From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Industrial Communications

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus RTU 32-bit registers

I am having trouble communicationg with a Control Techniques Unidrive M using Modbus RTU over serial for 32-bit registers.

 

What are people using? The LabVIEW Modbus API from NI Labs website seems to only be able to accept addresses that are 16 bit.

 

Depending on what people respond with, I've got a bunch more questions related to what I've tried.

0 Kudos
Message 1 of 8
(5,682 Views)

Hi,

 

What I have seen ModBus addresses are always 16 bits. Also registers are 16 bit.

 

Kees

0 Kudos
Message 2 of 8
(5,636 Views)

Hi,

 

The register size (the data itself) might be 32 bits. The register address (where the data is located) might be 16 bits. I don't believe these are conflicting numbers.

 

Andrew T.
"His job is to shed light, and not to master" - Robert Hunter
0 Kudos
Message 3 of 8
(5,611 Views)

I figured it out on my own.

 

I guess the confusion was with how registers are described. When talking about holding registers, seems most resources reference them as being 40000-49999, for 16-bit registers. and to go to 32-bit registers, they have to be 4xxxxx. 400,000 is well above what you can fit into a 16-bit number.

 

With what I'm working with doesn't want 4xxxx numbers as registers, its was the xxxx only. no leading 4. And to go from 16-bit to 32-bit register, you had to add 16384 to the numbers.

0 Kudos
Message 4 of 8
(5,608 Views)

Hi, 

That is the way how ModBus address are presented.

If it says data at 40000. It actually tells you that you must use ModBus function 4 (read register) to read address 0000.

Hope this helps.

 

Kees

 

0 Kudos
Message 5 of 8
(5,604 Views)

I make use of function 3 to read and function 6 to write. So to put a 'silent' 4 infront of a register address just made things confusing. As no one I asked for help mentioned the fact that its just a nomenclaure, and that the actual syntax in the serial string, does not include this leading 4.

0 Kudos
Message 6 of 8
(5,598 Views)

You also have to know that ModBus is an old protocol with some inherited 'features'

For a lot of devices function code 3 and 4 are the same.

That also applies for function code 1 and 2.

 

Also in some worlds they say register 40001. Which is translated on ModBus level to function code 4 and address 0000

So I can understand that it is really confusing to a lot of people.

0 Kudos
Message 7 of 8
(5,596 Views)

If only someone had been able to simply say that 11 days ago, I'd have more hair on my head Smiley Very Happy


Before I'd even started asking questions, I knew registers in the format xxxx worked... but all the talk of 4xxxx drove me to question whether it worked for the right reason, and had me believing it was being done wrong. And that to make the conversion from 16-bit to 32-bit registers, I had to first figure out how to get 4xxxx registers to work. After nothing worked, and had literally given up on 32 bit... I went with the theory that the leading 4 was meaningless, and figured out that the +16384 offset was all that was needed. Part of which involved attempting to read every address from 0 to 65500 in a for loop, and making a list of all that didn't error.

0 Kudos
Message 8 of 8
(5,592 Views)