I'm using Codesys V3 ST language I'm writing a code to communicate motor controller unit which uses CANOpen protocol I want to use CAN raw messages to communicate
I put CAN bus messages bytes in an array -- myDataFF82 : ARRAY [0..7] OF BYTE; //(incoming message)
Then I put together first byte and second byte
raw := UserVarGlobal.myDataFF82[1] ;
raw1 := UserVarGlobal.myDataFF82[0] ;
raw2 := MEM.PackBytesToWord(byHighByte:=raw1 , byLowByte:=raw); //real message is '01F4' which is Hex
At this point I want to convert '01F4' into Decimal value ('01F4' Hex is '500' in Dec)
I don't see any function to do that in Codesys Can you help?
Thank you in advance