AdvancedHMI Software

General Category => Support Questions => Topic started by: EE_Kraig on March 14, 2017, 10:13:35 AM

Title: Writing a 32-bit integer ModbusTCP
Post by: EE_Kraig on March 14, 2017, 10:13:35 AM
Is there a way to set the PLCAddressKeypad to write a 32-bit integer or do I have to do it in code?
Code: [Select]
string[] data = new string[] { "13", "0" };
modbusTCPCom1.Write("40001", data);
Title: Re: Writing a 32-bit integer ModbusTCP
Post by: Godra on March 14, 2017, 10:20:57 AM
Check this topic for common Modbus addressing:

http://advancedhmi.com/forum/index.php?PHPSESSID=44140a34f41f03b586993fe235c95dd6&topic=765.0
Title: Re: Writing a 32-bit integer ModbusTCP
Post by: EE_Kraig on March 14, 2017, 01:33:39 PM
Thanks! IT was the SwapBytes/Words setting that was messing with me.
Title: Re: Writing a 32-bit integer ModbusTCP
Post by: Archie on March 14, 2017, 02:32:44 PM
if your SwapBytes and SwapWords are correct, it should just be:

modbusTCPCom1.Write("L40001", "13");

An important note is that version 3.99v has a bug in the Modbus drivers. You need to either upgrade or apply the driver patch.
Title: Re: Writing a 32-bit integer ModbusTCP
Post by: EE_Kraig on March 14, 2017, 02:39:50 PM
if your SwapBytes and SwapWords are correct, it should just be:

modbusTCPCom1.Write("L40001", "13");

An important note is that version 3.99v has a bug in the Modbus drivers. You need to either upgrade or apply the driver patch.

Yes, you got me the patch. In this case it was my fault.