I have an array of Bytes reading different messages from a COB-ID, one of them is a 16 bit signed INT, 2's compliment and other one is 16 bit unsigned INT, 2's compliment. What would be the best way to read them. Any function block for conversion? I assume I will have to take 2's compliment of the data read?
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have an array of Bytes reading different messages from a COB-ID, one of them is a 16 bit signed INT, 2's compliment and other one is 16 bit unsigned INT, 2's compliment. What would be the best way to read them. Any function block for conversion? I assume I will have to take 2's compliment of the data read?
Thanks
Hi, did you end up finding a way to take 2's compliment?
You could create a DUT of the Type Union and add an array of 2 bytes + an Int.
Then write the byte values in the array of the Union and read the Int.
Or