Modbus RTU: method to get float value from main and least significant bytes in Ignition

Hello everyone,

I am using a probe for which I want to get a floating value that is stored as 4 bytes separated in two Modbus RTU registers with the main and least significant byte. Each register correspond to a tag in my Kepware server.

For now, I have written a short jython script that reads the two separate tags and do the conversion to a float value. Then the value is written into a memory tag.

I was wondering if there is a more elegant way to do it? Is that something achievable using an expression tag to avoid any script?

Thank you for your insights

Can Kepware not combine the registers for you? If you were using Ignition's native driver, there would be many built-in options for these kinds of multi-register conversions.

It can. This would be the elegant solution.

Ah well that's great, I am not familliar with kepware (my company use it that's the reason I am using it) and I haven't seen any obvious solution to do that, would you have a ressource on the internet which explain how to do that?

@pturmel @Kevin.Herron
Thank you both for your help. I finally found out. I initially got confused and used the script cause I wasn't getting the expected values: It appears kepware is weirdly made, and I had to decrement by one the Modbus register adress for floating values only.

Are you sure you're not just reading half the intended register now? If non-float values don't need the register address decremented it's more likely that you are combining the registers using the wrong byte or word order. This should be configurable in Kepware.