Anyone knows how to swap 2 words in a doubleword varible in SCL or ST ?
This is what I have:
Set_Pos:= REAL_TO_DINT(GRAPH_POS_SET * Scale)
Set_Pos is a DINT, the 2 words/integers in this doubleword should be swapped.
In STL it's possible by using a ROL_DW function and this for a shift of 16 places.
In ST or SCL, I have no idea...
I also need the CAW function in SCL: Swapping 2 byte's in a word
This is what I have:
Set_Pos:= REAL_TO_DINT(GRAPH_POS_SET * Scale)
Set_Pos is a DINT, the 2 words/integers in this doubleword should be swapped.
In STL it's possible by using a ROL_DW function and this for a shift of 16 places.
In ST or SCL, I have no idea...
I also need the CAW function in SCL: Swapping 2 byte's in a word
Last edited: