Author Topic: Non-standard Modbus registers  (Read 1482 times)

dsjstc

  • Newbie
  • *
  • Posts: 2
    • View Profile
Non-standard Modbus registers
« on: January 10, 2017, 01:37:52 PM »
So I bought a house that's controlled by some remarkably cheap xLogic PLCs which speak a slightly off variant of Modbus RTU and TCP, and I can't seem to get AdvancedHMI to communicate with them.

The xLogic devices don't perfectly follow the modbus standard.  According to the awesome introductory video on Modbus referenced below, input registers should be accessed with command 0x4 and live in the 30,000 range.  They seem to have invented their own addressing scheme, though.  The PLC has 8 analog input registers, which are accessed with command 0x3 at addresses 1024-1031, and I've had good luck communicating with them with qModMaster through a Prolific USB-RS485 adapter.

But not with AdvancedHMI.  I've tried hooking up a DigitalPanelMeter to addresses "1024", "3:1024", "31024", "031024", as well as  "41024" and "041024".  No luck.  I just variously get zero, -999, or "invalid response".

I've been trying the above with a ModbusTCPCom1 with a UnitID of CType(1, Byte) (because I have a TCP device at modbus address 1.    I've also tried the above with a ModbusRTUCom1 with a StationAddress of CType(2, Byte) (because I have an RTU device at modbus address 2).  I've tried various combinations of SwapBytes and SwapWords, and reduced the MaxReadGroupSize to 1.

Am I overlooking something?  Is AdvancedHMI just refusing to talk to the non-standard addresses?

References:
xLogic PLC: https://www.aliexpress.com/item/xLogic-Alternative-of-Siemens-LOGO-programmable-logic-controller-mini-PLC/490250595.html
qModMaster: https://sourceforge.net/projects/qmodmaster/
xLogic's RTU addressing: http://www.xlogic-plc.com/Modbus%20RTU%20PROTOCOL.pdf
Awesome modbus video: https://www.youtube.com/watch?v=k993tAFRLSE

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5317
    • View Profile
    • AdvancedHMI
Re: Non-standard Modbus registers
« Reply #1 on: January 10, 2017, 01:49:25 PM »
Function code 3 would use an address starting with 4. The 1024 may be an offset based on 0, but Modbus addresses use base 1. So I would try 41023 or 41025

dsjstc

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Non-standard Modbus registers
« Reply #2 on: January 10, 2017, 01:59:25 PM »
You're right, it works perfectly as 41025.

And I didn't know about the Modbus being based at 1, either, so learned something today!  Thanks for the help, Archie.