KV Host Link Protocol for Rust
Async Rust implementation of the KEYENCE KV Host Link protocol, aligned with
plc-comm-hostlink-dotnet and the shared plc-comm-hostlink-cross-verify
harness.
Scope
- TCP and UDP Host Link transport
- full low-level Host Link command surface from the
.NETreference - queued high-level helper API for typed reads/writes, comment reads, named snapshots, and polling
hostlink_verify_clientwrapper binary for cross-language verification
Installation
The package name is plc-comm-hostlink-rust and the library import path is
plc_comm_hostlink.
Examples and the verification wrapper require --features cli.
Quick Start
use ;
async
High-Level API
HostLinkConnectionOptionsopen_and_connectread_typed/write_typedread_commentsdevice_range_catalog_for_modelwrite_bit_in_wordread_namedpollread_words_single_request/read_dwords_single_requestread_words_chunked/read_dwords_chunkedwrite_words_single_request/write_dwords_single_requestwrite_words_chunked/write_dwords_chunked
Comment reads also accept XYM aliases such as D10, E20, F30, M100, L200, X100, and Y100.
Device-range catalogs are also available for UI use cases such as device monitors:
use ;
let catalog = device_range_catalog_for_model?;
let dm = catalog.entry.unwrap;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
The full static range specification is documented in
docs/DEVICE_RANGES.md.
Verification
Run formatting, static analysis, and tests:
Run the shared cross-verify harness after building the Rust wrapper: