[?+]: Swap bytes in a word CAW/CAD?

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
Tcp
Posts: 21
Joined: Thu Jun 28, 2007 9:46 pm
Location: Australia

[?+]: Swap bytes in a word CAW/CAD?

Post by Tcp »

IS THERE AN EASIER WAY TO SWAP BYTES IN A WORD?
Dreamer76
Posts: 88
Joined: Sun Feb 18, 2007 10:47 am
Location: Europe

Post by Dreamer76 »

can you please tell me exactly what you want to do? :?:
then i can help you maybe
ciao
Dreamer76
ian
Posts: 9
Joined: Wed Apr 18, 2007 7:00 pm
Location: Netherlands

Post by ian »

in SCL

Code: Select all

INPUT     : WORD;
RESULT    : WORD;  

RESULT := ROL(IN:=INPUT, N:=8); // 8bits is 1byte

// INPUT  = 1111111100000000
// RESULT = 0000000011111111
Tcp
Posts: 21
Joined: Thu Jun 28, 2007 9:46 pm
Location: Australia

SWAP BYTES

Post by Tcp »

Someone elese helped me to do this.
See Help F1 for CAW (word) and CAD (dword)

L MW0
CAW
T MW1

Thanks everyone