ControlLogix: Simple way to swap bytes of all words in an array?

File Fill
FLL

Source - the new value you want to insert
Dest - location of the first word ie. test[0]
Length - how many words
 
File Fill
FLL

Source - the new value you want to insert
Dest - location of the first word ie. test[0]
Length - how many words

He wants to swap the bytes, with the data that is already there, not fill the data with something else.

I believe the instruction is only for one word at a time. Might be able to index through an array with a pointer. Never had a need to do because most of the time the issue is due to an HMI, and most HMI's have the ability to swap on their end.

James
 
Make a for/next loop with JMP/LBL pairs.

I was trying to think of a way to make FAL work. If you copied it to a SINT array with a file COPy, and then used the expression A XOR (B XOR(A XOR B)) (bit hack for a byte swap) and then copied it back to the DINT array so you had whole words you could probably get it to work. But with all the copying I think a for/next loop is the way to go for a large array. For a small array just brute force it, its simpler.
 
what the different on this example with the OP request ?


RSLogix 5000\Projects\Samples folder, Swap_Bytes_in_Array.ACD file.
 

Similar Topics

Hi everyone, Suppose I have a periodic task to trigger some communications, and in this task I have a pointer that iterates for each...
Replies
3
Views
1,315
I know I posted a question about communicating with a Zebra printer with ControlLogix or CompactLogix. I did see some conversations concerning...
Replies
7
Views
5,179
Why does the controllogix redundancy modules use a single mode fiber vs multimode fiber?
Replies
1
Views
78
Hello, I have two 16 point input cards and 1 16 point output card showing module faulted on my IO tree in Logix Designer. The fault code is...
Replies
7
Views
214
Hello, My associate and I are trying to sync up two ControlLogix racks (7-slot chassis) with identical modules. We are able to see the secondary...
Replies
4
Views
190
Back
Top Bottom