Studio 5000: Swap Byte in structure

taylor1982

Member
Join Date
Aug 2011
Location
Bavaria
Posts
78
Hello everybody,

I have a communication to a Linux-PC via sockets. So I created a quite large UDT with all the content.
Unfortunately we have to swap the low and highbyte. Of course there is the SWPB instruction. But it seems to me that this is not applicable for structures (?)

Can you give me some advices how to solve this?

Thanks a lot!
 
There is no easy way to solve your problem. You could store 2 copies of the UDT. One your store in the normal way and the other one swapped. This means two writes must be done when updating the UDT but then the swapped UDT doesn't have to have every word swap byte before sending. The swapped byte UDT can just be sent.
 

Similar Topics

I want to know how to make a flip flop rung that will change states every scan. This is for a fast sequencer. Is there a special bit similar to a...
Replies
8
Views
2,183
Hi, how do I convert 2x Integer registers to a Real? The two integers are from Modbus registers that contain a floating point value, I need to...
Replies
2
Views
104
What is the best way to extract the hour and minute from the register that comes from Yaskawa VFD. In studio 5000 I have a register saved as INT...
Replies
3
Views
102
I have an Allen Bradley temperature switch that I am trying to use in studio 5000. I am getting the message "Unable to interpret the IODD file"...
Replies
0
Views
64
Hi all. I want to ask what may seem a stupid question, as I have a project to send live data to a Yeacode line printer which will print meterage...
Replies
10
Views
189
Back
Top Bottom