Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Outputting information from CAN data array to a gauge

Solved!
Go to solution

Hi,

I am new to Labview and just know the very basics. I am using some sample code to send and receive CAN messages. I need to output the data from the recieved messages (just the first two bytes) on to two gauges, i.e. the first two values of the data array. Is there any way of doing this? Also it would be handy if i could control the value of the first data byte using a knob or dial. Any help would be much appreciated.

 

Thanks

Brian 

0 Kudos
Message 1 of 3
(6,735 Views)
Solution
Accepted by topic author brian_s1

Hello Brian,

 

You can use the "Array Subset" function in your Arrays pallette of your block diagram and choose zero index and size of two (2 elements off the array) in order to extract the first two values.

Here is a link to the help document of the function:

http://zone.ni.com/reference/en-XX/help/371361E-01/glang/array_subset/

 

You can have the whole of your input as a control and set default values for the elements that you want unchanged. You can access this property by setting the value on the control and then right-clicking on it to go to "Data Operations" and "Make this value default". Then, you can right-click on the control that you want changed and replace it with a dial. Make sure you select its representation correctly. For example for a byte you would probably select U8.

 

Attached is an example, please have a look and let me know if it helps.

 

Kind Regards,

Michael S.
Applications Engineer
NI UK & Ireland

Download All
0 Kudos
Message 2 of 3
(6,709 Views)
Got it sorted, thanks for that.
0 Kudos
Message 3 of 3
(6,688 Views)