11-21-2008 08:53 AM
Hi,
I am using the Frame API and want to send a message that contains the following information
Payload length - 8 bytes (most likely)
byte 0 - cmd ID
byte 1 + 2 - unit ID
byte 3 - selection
byte 4-7 - coefficient
I have the first 4 bytes working because I take a string, convert it to byte array and insert each byte in the U8 array. The problem that I am trying to solve is to be able to have the first 4 bytes be U8 and the next 4 bytes hold the coefficient which is stored in a single precision floating point number. How do I setup the write message starting from position 4 in the payload to properly send the SGL coefficient? Can a SGL be packed into the 4 byte payload? I figured it could because 4 bytes =32 bits and a SGL is a 32 bit number. I am confused because the Write block takes in a U8 array as the data input.
Thanks,
Gary
Solved! Go to Solution.
11-21-2008 10:13 AM
I realized that all I need to do is cast the byte array as a single precision floating point number.