简体   繁体   English

C#NMODBUS寻址

[英]C# NMODBUS Addressing

I'm building a project that will be using a PC as a modbus master and a Click plc as a slave device. 我正在建立一个项目,该项目将使用PC作为Modbus主设备,并使用Click plc作为从设备。 The communication method is Serial RTU. 通信方法是串行RTU。 I'm having a bit of trouble with the addressing system to read and write to the registers in the plc. 我在寻址系统读取和写入plc中的寄存器时遇到了一些麻烦。 I've built some test code using the guide here: C# NModbus DLL with Wago Remote IO 我已使用此处的指南构建了一些测试代码: 带有Wago Remote IO的C#NModbus DLL

However, I can't get my head around the address system... I want to turn on output Y1 on my PLC, which has a modbus address of: 8193, but the modbus.dll doesn't seem to like it as iv the address is too high or incorrect? 但是,我无法解决地址系统问题……我想在我的PLC上打开输出Y1,它的Modbus地址为:8193,但modbus.dll似乎不像iv地址太高或不正确?

try adding leading zeroes to the address. 尝试在地址中添加前导零。 8193 should be 008193. 8193应该是008193。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM