twincat_derive 0.1.0

TwinCAT ADS macro derivations
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 5.33 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 277.38 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • becky112358/twincat
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • becky112358

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,
    )
}