LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

To capture the value of a channel on CAN bus using Channel API.

Hi,
I've 2 ports, one of them configured for frame API and the other for Channel API.
 
Requirement: I want to extract the value of the channel of a message using channel API only. The message is on the CAN bus.
I can observe the channel on the MAX and the value aswell. Its an hexadecimal value and this has to be captured on the VI.
 
In the VI  I've attached, the indicator 'Channel_Value' is an arary which shows a value. At the indicator 'Captured_Value', the value of the 5th channel is extracted. I'm not sure about the nature of the value at both the indicators.
 
I'm not sure if this is the correct approach towards my requirement. I'm not sure about the output I'm getting now. Its just a logically correct code.
 
Please suggest the methods to meet my requirement.
 
-Arun
0 Kudos
Message 1 of 4
(2,855 Views)
Hi Arun,

Does the samples from the message in your code match up with MAX?  Are you uncertain that the value is actually matching up with the fifth channel?  You can try selecting a different data type on the CAN Read (right click > Select Type) to try with multiple samples or a single channel.  Also, you may want to take a look at one of the CAN Example programs.  If you go to Help > Find Examples you can search the NI Example Finder for a Channel API example.  Just Browse to Hardware Input and Output > CAN > Channel API > Basic.  There's a VI called Get Names with Waveform input.vi that is similar to what you are doing, and may be worth a look.  The code is well documented, and explains what is happening at each stage. 

Hope this helps!

Adam W
Applications Engineering
National Instruments

0 Kudos
Message 2 of 4
(2,838 Views)

Hello,

I have the same problem as Arun,

and if I start the channel API example "Waveform input"  and write my cannal name ( laying on the MAX) in it and start the VI. the Waveform is started, but nothing I see on it.

Why I get no value out of the read output???

can someone help me please???

 

 

Message Edited by thitob on 08-10-2007 09:07 AM

0 Kudos
Message 3 of 4
(2,778 Views)
Hey guys,
 
Something I was curious about is could you try Waveform output, and Waveform input? From the examples window? If you're able to get that to work, then you should be able to compare a working program vs. a non-working program with NI-SPY. NI-SPY is a utility that monitors driver level calls, and you can find it at Start->Programs->National Instruments->NI-SPY.
 
Can you let me know how that goes?
 
Regards,
 
Nick D.
0 Kudos
Message 4 of 4
(2,754 Views)