tokio-mc
tokio-mc is a pure Rust library for Mitsubishi Communication (MC) protocol, built on top of tokio.
Features
- Async & Sync communication with Mitsubishi and Keyence PLCs using the 3E frame protocol.
- Easy integration with the
tokioecosystem for async programming.
Installation
Add the following to your Cargo.toml to use tokio-mc with the desired features:
- Async Feature (3e-async): For asynchronous communication
- Sync Feature (3e-sync): For synchronous communication
Example Dependency
# For async usage
= { = "0.1.3", = ["3e-async"] }
# For sync usage
= { = "0.1.3", = ["3e-sync"] }
Async Example
Here's how to use the async features of tokio-mc:
use SocketAddr;
use Duration;
use ;
async
Sync Example
Here's how to use the sync features of tokio-mc:
use SocketAddr;
use ;
Disclaimer
When using this library for PLC communication, please first make sure that there is no abnormality in your connection. I used the 3E frame protocol, which has been tested with Keyence and Mitsubishi and used in actual projects. If you have any feedback or suggestions, please contact me via QQ email.
Some codes are referenced from tokio-modbus。