twincat_derive

Crates.iotwincat_derive
lib.rstwincat_derive
version0.1.0
sourcesrc
created_at2024-10-01 16:31:56.796498
updated_at2024-10-01 16:31:56.796498
descriptionTwinCAT ADS macro derivations
homepage
repositoryhttps://github.com/becky112358/twincat
max_upload_size
id1393108
size4,698
(becky112358)

documentation

README

Usage

Apply this macro to all functions which access a PLC variable through ADS. Give as arguments the client definition, followed by the full range of each function argument. This macro writes a test which verifies that the PLC variable path is valid.

Example

#[ads_path_verify(crate::client::connect().unwrap(); 0..MAX; ALL_MODES)]
fn function_which_accesses_plc_variable(client: &mut Client, var0: usize, var1: Mode) -> Result<()> {
    client.set_value(
        &format!("Main.some_thing[{var0}].another_thing"),
        var1,
    )
}
Commit count: 26

cargo fmt