Author Topic: Modbus Addressing  (Read 30162 times)

muratguenduez

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Modbus Addressing
« Reply #15 on: October 09, 2017, 10:30:09 AM »
Some hints when using Modbus with AdvancedHMI.....

The most common addressing is supported such as:

40001
00001
10001

The default are signed integers, but you can force it to use unsigned by preceding the address by a "U". For example:

U40001

32 bit integers and 32 bit floating point are also supported by using the following prefixes:

F40001
L40001

Keep in mind that you are using 4 bytes, so L40001 may overlap L40002. Based on the device you are using. The consecutive 32 bit values may be L40001 and L40003

If you want to force a particular function number, then specify the function followed by a ":". for example:

3:0001


As of version 3.99b, a new prefix is supported for BCD. For example:

B40001

hi,
understand that, u is uword, L is long, F is float.
i saw a table that is a modbus register of a device included "ULONG", at this point what should i do to read that register. i can get that and convert with c# its ok but i wonder that is there any other type of decleration in plcadressvalue section ?

thnks
if i need to read an unsigned long, what decleration should i use in PlcAddressValue? UL or LU is not working. eg. UL30001 or LU30001.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Modbus Addressing
« Reply #16 on: October 09, 2017, 02:29:08 PM »
The current Modbus driver does not support more than one modifier prefix, so it will not directly return an unsigned long. This would have to be done in code. You could use a DataSubscriber to read 2 consecutive unsigned words, then combine then into a single long in the DataReturned event handler.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Modbus Addressing
« Reply #17 on: June 05, 2018, 10:16:05 PM »
The latest beta driver supports LU format, ex. 40001@LU:

https://www.advancedhmi.com/forum/index.php?topic=2058.0

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Modbus Addressing
« Reply #18 on: September 21, 2019, 01:56:09 AM »
There is a new version of the Modbus Slave Simulator, previously discussed in this topic, as well as the Modbus Master:

https://www.advancedhmi.com/forum/index.php?topic=2567.0
« Last Edit: November 30, 2019, 09:28:29 PM by Godra »

AnaKalafadzic

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Modbus Addressing
« Reply #19 on: March 15, 2022, 09:54:21 AM »
Some hints when using Modbus with AdvancedHMI.....

The most common addressing is supported such as:

40001
00001
10001

The default are signed integers, but you can force it to use unsigned by preceding the address by a "U". For example:

U40001

32 bit integers and 32 bit floating point are also supported by using the following prefixes:

F40001
L40001

Keep in mind that you are using 4 bytes, so L40001 may overlap L40002. Based on the device you are using. The consecutive 32 bit values may be L40001 and L40003

If you want to force a particular function number, then specify the function followed by a ":". for example:

3:0001


As of version 3.99b, a new prefix is supported for BCD. For example:

B40001

I have problem with addressing my modbus to communicate to Arduino, but only with 32 bit adrresses. "Normal" 16 bit work great, but when I write i.e. L40020 I can write 32 number but it is not send to a Arduino, on any address (40020,40021 or 40022).

I am new to AdvanecedHMI, what am I doing wrong?

I use Modbus RTU that communicate normal with other 16 bit addresses.