Author Topic: Writing a 32-bit integer ModbusTCP  (Read 916 times)

EE_Kraig

  • Newbie
  • *
  • Posts: 37
    • View Profile
Writing a 32-bit integer ModbusTCP
« 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);

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Writing a 32-bit integer ModbusTCP
« Reply #1 on: March 14, 2017, 10:20:57 AM »

EE_Kraig

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Writing a 32-bit integer ModbusTCP
« Reply #2 on: March 14, 2017, 01:33:39 PM »
Thanks! IT was the SwapBytes/Words setting that was messing with me.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Writing a 32-bit integer ModbusTCP
« Reply #3 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.

EE_Kraig

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Writing a 32-bit integer ModbusTCP
« Reply #4 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.