Hi,
I have been working on Codesys V3.5 with PFC200 controller and Can Gateway 750-658. I want to convert the incoming CAN data from bytes into UINT and for outgoing data bytes to UINT. Does anyone has experience with this kind of data? I tried few different ways but it doesn't seem to be working.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for the reply. I got an error saying that
MEM.PackBytesToWord(GVL.Actual_Speed_DUT_high,GVL.Actual_Speed_DUT_low) = u; is not a valid statement. Am I missing some library?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for the reply. I got an error saying that
MEM.PackBytesToWord(GVL.Actual_Speed_DUT_high,GVL.Actual_Speed_DUT_low) = u; is not a valid statement. Am I missing some library?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have been working on Codesys V3.5 with PFC200 controller and Can Gateway 750-658. I want to convert the incoming CAN data from bytes into UINT and for outgoing data bytes to UINT. Does anyone has experience with this kind of data? I tried few different ways but it doesn't seem to be working.
There are some ways. One is to use SHR and SHL and it depends on your byte order in the data array. For Motorola byte order:
If it's Intel byte order just change 1 and 2 in the array indexes.
Related
Talk.ru: 1
Talk.ru: 2
Last edit: voffi 2023-12-07
https://content.helpme-codesys.com/en/libs/CAA%20Memory/Current/CAA_Memory/Packing/PackBytesToWord.html + optional TO_UINT
Last edit: kislov 2023-12-08
Thank you for the reply. I got an error saying that
MEM.PackBytesToWord(GVL.Actual_Speed_DUT_high,GVL.Actual_Speed_DUT_low) = u; is not a valid statement. Am I missing some library?
Thank you for the reply. I got an error saying that
MEM.PackBytesToWord(GVL.Actual_Speed_DUT_high,GVL.Actual_Speed_DUT_low) = u; is not a valid statement. Am I missing some library?