Modbus ASII Read to String value

I have looked around the forum but can’t find my exact problem.

I need to read a ASCII string from a device (It is not a PLC) It is a standalone machine with control boards on it that does have Modbus TCP. I can read integer values and floating point just having issues with the ASCII part of it.

All the company gave me is the register for the string.

Address=31050 - Size=50 Type=String - Range=ASCII

How would I read this using the Ignition Modbus driver?

I have used WW to read from the same type of machine at another facility using
31050-31075 M
in WW MBTCP driver. So I know the value is there.

If the ‘3’ prefix indicates Input Registers, you might be stuck. For Holding Registers, it would be HRS1050:50. For other variants, HR can be replaced with IR to get the corresponding Input Registers, but that’s not documented to work. Worth a try, I would think: IRS1050:50.

@Kevin.Herron ?

They are def Input Registers - I did try the I am kinda confused on how I should do the modbus mapping for it in the device settings before I could even apply the IRS or HFS(Which I tried even knowing it is not a holding register)

Do I set it up as Input Register INT32 for 25 words?

No. Modbus Input Registers and Holding Registers are 16-bits each at the device. They can be used in pairs for 32-bit data types. Multiple sequential registers can be treated as two 8-bit ASCII characters each. But it looks like that usage for Input Registers may not exist in the IA driver.

Thanks! The IRS1050:50 worked… Though the string is coming in backward I think I need to change one of the Modbus settings to swap bytes.

There are 7 strings - 5 50 in length and 2 7 and they all come in. Just got to figure out the byte swapping.

Thanks @pturmel

edit. ModbusTcpDriverSettings.ReverseStringByteOrder.Name? Turning that on fixed the strings - Thanks again.

1 Like

In the device settings in the Gateway, under show advanced properties, there is both reverse word order and reverse string byte order, try those they may help…

2 Likes