Added white space in send/receive value using Modbus strings

I am using an Opto 22 SNAP PAC system. I am trying to read and write an odd number of characters in a string to/from my SNAP PAC. However Ignition adds an additional piece of white space to the end of the string when the string is an odd number of characters. Has anyone come up with a work around or fix for this? If I send or read an even number of characters I have no issue. I know that Modbus in Ignition uses a 2 character storage system.

You can use a derived tag and the trim() function around the value read.

I am not using a 7.9 instance. I am using a 7.7 gateway that does not have derived tags

Hello,

I have what seems to be a similar problems with modbus strings. We are in the proccess of updating all SCADA from old citect to Ignition, and we do have 4 modbus LED displays.

Those display are configured to scroll text when it's bigger then the window, but show it fixed whenever the text fits the window.

This is the behaviour that everyone expects. However when we write a small string to the display, it assumes blank spaces and the text ALWAYS scrolls.

Any tip to solve this problem, or are we doing something wrong?

Thank you.

Interesting. The IA native driver is space-padding instead of null-padding, and your device obviously expects null-padding strings.

My alternate/expanded driver uses null-padding. You could try it, or, perhaps, try to null-pad your strings yourself before writing.

1 Like

Once again, a perfect pointer in the right direction. Problem solved by null-padding the string.

Thank you.

1 Like

Darn! You'll have to forgive me for hoping IA's driver choked on those.... :innocent:

2 Likes