Author Topic: Modbus TCP 32-bit Input Registers  (Read 2615 times)

psullivan

  • Newbie
  • *
  • Posts: 6
    • View Profile
Modbus TCP 32-bit Input Registers
« on: March 18, 2016, 11:17:21 AM »
I am trying to read a 32-bit integer from a PLC and display it on a digital panel meter. I saw this thread about modbus addressing:

http://advancedhmi.com/forum/index.php?topic=765.0

The more significant word is in input register 7 and the less significant word is in input register 8, I tried setting the "PLCAddressValue" to L30007 but that didn't work so I tried setting it to L30008 and in both cases the digital panel meter only displayed a single register. Any ideas on where I am going wrong?

-Pat

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Modbus TCP 32-bit Input Registers
« Reply #1 on: March 18, 2016, 11:52:45 AM »
You may have to try different combinations of WordSwap and ByteSwap in the driver properties.

psullivan

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Modbus TCP 32-bit Input Registers
« Reply #2 on: March 18, 2016, 03:48:55 PM »
I gave that a try, but the problem isn't that I am getting the wrong value, the problem is that I am only getting the value from one of the registers at a time. If I force two consecutive modbus registers in my PLC to a value of 1, I should get 65537 when reading a 32 bit integer. However, I am always reading a value of 1.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Modbus TCP 32-bit Input Registers
« Reply #3 on: March 18, 2016, 05:06:21 PM »
Using version 3.99d along with a Modbus simulator I did a quick test

- Add 3 BasicLabels to the form with corresponding addresses in PLCAddressValue:

L40001
40001
40002

- Run the application
- In the simulator set 40001 to a value of 1
- I then see the first 2 BasicLabel go to 1
- In the simulator, set 40002 to a value of 1
- The first BasicLabel changes to 65537, the other two BasicLabels are both 1



What happens if you set both PLCAddressValue and PLCAddressKeypad to 40001, then run the app, click on the label and enter 65537 ?