[S5-155U CPU948]HEX convert to Integer ??

apple

Member
Join Date
Jun 2006
Location
Taipei
Posts
24
This code's comment say it can convert Hex number to Integer number, but I don't understand how it work, wish you can explain it. Thanks!!! Thanks!!!

Input in FW250 with Hex number and Integer number in FW248

Here the code:
-----------------------------------------------
L FW250 inhalt der adresse IN [KH]
SLW 8
L FW250
SRW 8
OW
T FW248 inhalt der adresse IN [KF]
------------------------------------------------
 
The code is swapping bytes, changing High Byte > Low Byte and Low Byte > High Byte.

I presume FW250 holds a KF format number thats been read in with the bytes swapped. This sometimes happens.
 
Apple,

I don't think you are "converting"...word 250 and 248 can be view in hex or as a integer that is where the [KF] and [KH] come in, you are just viewing them different, as Peter has said SL Shift Left and SR Shift Right

inhalt der adresse IN [KH]//contents of the address IN [KH] HEX
inhalt der adresse IN [KF]// contents of the address IN [KF] (K)constant integer

Peter am I correct in this assumption?

Also look at this CPU 948 it may have some info that will help..
 
I was going to say the same but noticed it was just byte swapping.

I know that some SCADA/HMI systems sometimes require byte swapping, had to do it recently with data received over serial comms from an X-Ray machine.
 

Similar Topics

i have an old PLC : S5 155U (CPU 948) i need to connect it to ABB PLC using Profibus-DP, ABB will act as Master and S5 as slave. I need to...
Replies
3
Views
3,007
Iam new to siemens systems and trying to install S5-155U CC with a CPU 948 in a very old plant.The CPU is OK and RUN LED is Green and iam able to...
Replies
2
Views
1,441
Hi! Everyone~ I want to know is there some way can copy program code from one cpu to another cpu, and append it? My system has two cpu948, A and...
Replies
5
Views
2,208
Hi~ I have a question about Intouch. this is,could Intouch directly read/write date(DD,DW,I,F...etc) from/to PLC via H1Server? assume all setup...
Replies
3
Views
2,384
Hi~Everyone,I don't understand what mean this code, need your guys help, Thanks!! I have two FX block(FX131 and FX132) ,they call the same...
Replies
8
Views
2,670
Back
Top Bottom