Contr_Conn
Member
Need a little help. All below is for Logix PLC.
I have an array of integers named INT[20], size may be different using 20 as an example.
I need to put these integers sequentially in the string named STR
Looks simple right?
COP INT[0] STR.DATA[0] 40
MOV 40 STR.LEN
Now the tricky part: the operation above will pack String in “Little-Endian” byte format:
Lo[0], Hi[0], Lo[1], Hi[1]…
The string I need is “Big-Endian” byte format:
Hi[0], Lo[0], Hi[1], Lo[1]…
The only way I found is a loop something like this:
Small correction - Source B in LES should be 19
Any ideas for a simple solution?
Thanks.
I have an array of integers named INT[20], size may be different using 20 as an example.
I need to put these integers sequentially in the string named STR
Looks simple right?
COP INT[0] STR.DATA[0] 40
MOV 40 STR.LEN
Now the tricky part: the operation above will pack String in “Little-Endian” byte format:
Lo[0], Hi[0], Lo[1], Hi[1]…
The string I need is “Big-Endian” byte format:
Hi[0], Lo[0], Hi[1], Lo[1]…
The only way I found is a loop something like this:
Small correction - Source B in LES should be 19
Any ideas for a simple solution?
Thanks.
Last edited: