MODBUS - Bad Value with Floating register

Hi,

I am experiencing a “Bad” Value when attempting to read two 16bit modbus register from a local device and cannot seem to troubleshoot the issue with Ignition OPC-UA.

I’ve done the same in KEPWARE and was successful, so I’m thinking I’m configuring the Ignition side wrongly somewhere and am looking for some advice or articles to help.

my address configuration:
10
V_ 0 10 TRUE 0 HoldingRegisterFloat 1

Device Manual mentions “These registers are 16 bits each and are organized as shown below. All of the values are reported as 32-bit IEEE standard 754 floating point format.
This uses 2 sequential registers, least significant 16 bits first.”

You might need to use the “Swap Word Order” setting in this device’s configuration.

I solved the issue.

I did try the “reverse word order”, but nothing really changed, although searching along “word order” for the device, I came by a forum post about the device.

Apparently I needed to assign the UNIT ID to a specific number that is configured on the device, which is not mentioned at all in the manual’s communication sections.

Thanks Kevin for responding so quickly.

That was going to be my next question! Glad you got it working.

Could someone elaborate a little more on this?
I am having the same issue using ns=1;s=[G1]21.HRF11380. I do not have the register in the gateway, just the tag browser although I have tried both.

When you say assign a unit id to a specific number, what do you mean? I already have the Unit ID in the address above.

Also, How does someone swap word order without the tag being in the gateway and selecting this from the advanced settings? (I don't believe this is my solution as I have tried it through a gateway tag where it did not yield any results)

You have a Unit ID, the original post was about using the address mapping configuration, which we don't recommend.

The advanced setting is how you swap word order. Whether the tag is defined in the address mapping or not is irrelevant.

Are you getting a value but it's wrong, or are you not getting a value at all? Do you have any other Modbus client that can read the value (modpoll, etc...)?

Tag quality is bad. I am able to see the value in modbus poll, yes.

Ok, should be easy to compare traffic with Wireshark then.

99% of the time this problem is one or more of the following:

  • wrong word order
  • off by one address (zero-based vs one-based)
  • Span Gaps setting needs to be turned off

Do note that 921 is not a valid Unit ID. It is a byte in the protocol, 0-255.

2 Likes

the 9 was a typo. should just be 21. I will make the edit on my post above.

1 Like

I was able to figure it out. I deselected the "allow read multiple registers request" and the tags started working.

I am very surprised to hear that you can read multi-word datatypes with that option disabled. Are you sure everything is working?

Going through the rest of my tags today but so far everything seems to be working as it should

Ah, nevermind, had this mixed up with WriteSingle/WriteMultiple.

1 Like