Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

how to encode data in CAN to transmit message

Hi all,

I have to encode two decimal no's  and has to transmit through the CAN,,so not getting how to code this in CAN data field,,,if anyone know please reply,,

thank you

0 Kudos
Message 1 of 4
(6,725 Views)

Hello Shoukat,

 

I have attached a VI that should help you make the conversion from a floating point number to an 8 byte array.  You can use less than 8 bytes depending on the precision of your float.  You can decode this by doing the inverse, using the index array and join numbers VIs.  

 

Depending on which hardware you are using, you can also use the channel API to easily make this conversion by creating a channel in MAX.

 

Let me know if this answers your question.  Have a great day.

 

 

O. Proulx
National Instruments
www.ni.com/support
0 Kudos
Message 2 of 4
(6,669 Views)

thanks for reply,,

 can you please send same  vi in labVIEW8

 

 

thank you

0 Kudos
Message 3 of 4
(6,663 Views)
This should work.
O. Proulx
National Instruments
www.ni.com/support
0 Kudos
Message 4 of 4
(6,648 Views)