General Category > Tips & Tricks

Modbus Addressing

(1/4) > >>

Archie:
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

Godra:
Here is a YouTube video which provides general information on Modbus:

https://www.youtube.com/watch?v=k993tAFRLSE

Intended for those, like myself, who would like to understand Modbus a bit better and most of the Archie's points stated above.

Archie:
That is actually a good video. I recommend anyone using Modbus to watch the video.

Godra:
For those who might be interested, here is a small program for ModbusRTU Slave simulation.

It is somewhat similar to MOD RSSim program but is far from being as functional (and definitely shouldn't be used as a replacement).

The program is using nModbus libraries, which were included as embedded resource so the program could be used as standalone. The slave DataStore can be used offline to set values (before making a connection).

The attached picture shows AHMI being used as master to poll this program (com0com was also used to create paired ports COM2 used by the program, and COM6 used by the AHMI).

See this topic for full solution:

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

DougLyons:
Godra,

On my Windows 7 64-bit laptop the program will not fully display.
See the attached picture for what I get. Also, I am not able to stretch the form to be able to see any more.

I am running the desktop with Medium Text if this might make a difference.
Also double-clicking brings us a Set Cell that and the value cannot be seen.

Doug Lyons

Navigation

[0] Message Index

[#] Next page

Go to full version