SWPB command

taylor1982

Member
Join Date
Aug 2011
Location
Bavaria
Posts
78
I was using the swap byte command (SWPB) for a long time for swapping REAL values.
Now I have updated an older projekt to Studio5000 V31 and I get a errors prompted at this SWPB command.
For me it seems that they have removed REAL values from the SWPB command.


Is there a way around it?


Thanks
Stefan
 
Thanks but with this I will lose the data after the decimal point right?
I need this to communicate to a PC.

No you will not loose any data with COP, it's actually ignoring the value, instead takes a 32-bit pattern from the REAL and puts into the DINT. This is very common when you do comms like Modbus that require a different bit order.
 
Just a feedback from my side.
The solution


COP REAL TO DINT
SWPB DINT
COP DINT TO REAL


worked very well. Thanks for your help.


Have a great day!


Stefan
 
is Contr_Conn correct that you are doing modbus comms and changing endian ?


I communicate to a LinuxPC. The LinuxPC has an EthernetIP card installed but interpretes the data in a wrong byte order. Thats why I swaped the bytes on the PLC side.


Till now we used Studio5000 V24 and with this version ist was possible to swap REAL values.

Due to a CPU change it was required to upgrade to V31 and here unfortunately it´s not possible to swap REAL any more.


That´s why I was looking for a work around.


Stefan
 

Similar Topics

Howdy, I am currently struggling with an array of values that I want to re-arrange in a programmatic way. My program is a mix of ladder and STX...
Replies
6
Views
393
I understand the stated meaning of both and I see them being used in the project... can't quite figure out why they're being used. Can anybody...
Replies
5
Views
3,240
Hey guys. As the title suggests, I need to configure a Danfoss Aquadrive FC202 inverter, so that its logic inhibits the local command when the...
Replies
2
Views
43
Kindly, we have the following configuration fault on a Kinetix 5700 axis. It only appears when we go online on the Plc. We are just starting the...
Replies
2
Views
86
Sigh, DeviceNet noob... I have a 1756-L55, with a DeviceNet module, and 10 PF700 all commanded with DeviceNet. One of the PF700's blew up...
Replies
3
Views
131
Back
Top Bottom