Hello All,
I have just joined this forum and I would to say hello to all the members. I hope I will get lot of information here.
I am using ABB AC500 PLC and Vekio Citec 7.1 for my application. The software platform is obviously CodeSys 2.3. Whenever I am transferring a word to the HMI,it is swapped i.e. Hi word comes as Lo word and vice versa. I guess I need to write a code into CodeSys to swap the word before sending it to the HMI. Can anyone help me out as to how to write the swapping code in codesys ?
Thanks in advance
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello All,
I have just joined this forum and I would to say hello to all the members. I hope I will get lot of information here.
I am using ABB AC500 PLC and Vekio Citec 7.1 for my application. The software platform is obviously CodeSys 2.3. Whenever I am transferring a word to the HMI,it is swapped i.e. Hi word comes as Lo word and vice versa. I guess I need to write a code into CodeSys to swap the word before sending it to the HMI. Can anyone help me out as to how to write the swapping code in codesys ?
Thanks in advance
got it from oscat.de
swap_byte :=ROL(inword,8);
it is rolling over 8 bits just what you want.
Originally created by: Mikhail Shvetsov
it'snot necessary to use oscat for this function. it's usual function from CoDeSys
yes i do know but i like to advertise with oscat.
just because i like it.
Originally created by: Mikhail Shvetsov
Otherwise it seems like CoDeSys can nothing without Oscat )
VAR
Test1:WORD;
Test2:Word;
END_VAR
Test2:=MEM.ReverseBYTEsInWORD(Test1);
VAR
Test1:WORD;
Test2:Word;
END_VAR
Test2:=MEM.ReverseBYTEsInWORD(Test1);
Last edit: DreamWorks 2023-06-21