Reverse Word Order Issue

Hello,
I read Holding registers (UInt 32) and Holding registers (Float) from Unitronics PLC SM35, using Modbus TCP driver. The problem is that if I change Reverse Word Order to True, the readings are correct for floating values, but wrong for 32 bits values, and on the contrary, set Reverse Word Order to False, correct 32 bits values, wrong floating values. Any ideas how to solve the issue?

You’ll need to make 2 separate device connections. The setting applies to all multi-word datatypes.

Thank you!

Finally it did not work. Two separate device connection with Modbus TCP driver (same IP adress) seems not possible, the second connection does not connect. Other ideas?

Kepware, perhaps?

You could also leave the driver set up so the floats are correct and then bring the UInt32 values in as the original two 16-bit registers and then make an expression tag that ORs it all together in the correct byte/word order.

Kepware will encounter the same connection issue. If the device accept only one client there will be only one connection.
Keeping one type of connection good for float and reversing with expression/script the int is the sensible approach.
I have access to some unitronics plc’s and see if I can replicate the issue.
It could be a case for unitronics to change their mapping as such behaviour is really abnormal.

alnet is right, KEPWARE encounters the same issue.
Regarding the expression tag, I cant still figure out how to right it, since scripting is not my strength. But definitely I will try and revert, thanks, guys!

After trying to get access and test this issue ( really curious to see if unitronics resorted to such dirty trick) , think I can help with the reversing. Not a script expert either but does not seem to be so hard. We have lots of examples.

Hello, allnet, if you have examples that may help, please share, I will save precious time.

Found the way, though not as planned initially.
Expression tag is shown on the snip attached. No word reversing.


Counter expression tag: 65535*{[~]L10}+{[~]L9}+{[~]L10}
In any case, I am curious to see how a script with word reversing will look like. Any ideas?

Sorry, been very busy yesterday, out of office.

When I said “we”, I meant me and you and all other from Ignition community.
We all have access to forum and docs which are full of examples.

As I see you already figured out the expression tag.

For scripting you have to decide where and when the script will run.
In this case I would use the tag change event for L9 and L10

Create a new memory tag, long named ReverseVal

On both L9 and L10 go to EditTag->Tag Event Scripts, click edit ->Value Changed
Now you can add the following code :

lowInt = system.tag.read("[default]L9")
highInt = system.tag.read("[default]L10")
ReverseVal = 65535 * highInt.value + lowInt.value + highInt.value
system.tag.write("[default]ReverseVal", ReverseVal)

If you have different path just change it. From your image I cannot see full path.

Example is taken from Inductive University , Tag Event Script lesson.

Feel free to add protection as script to fire only when you need it to.
Now it will fire at any change, no matter quality, connection and so on.

Thank you, allnet, much appreciated!