Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Channel API

We are using Channel API and we want to be able to see which message that is read. How to do this? We don´t want to use MAX.
0 Kudos
Message 1 of 6
(4,474 Views)
Down in the advanced CAN channel pallette, there are some VI's that let you create a CAN task, and set properties. You would use those VI's to configure a CAN read task similar to one setup in MAX.
0 Kudos
Message 2 of 6
(4,465 Views)


@dhuff wrote:
Down in the advanced CAN channel pallette, there are some VI's that let you create a CAN task, and set properties. You would use those VI's to configure a CAN read task similar to one setup in MAX.


Hello!

Thank you for your answer. We want to have many channels and create them dynamically. Then we want to get a measurement value and want to kknow from which channel that value come from. If we use the VI-s that create a task isn´t that only for one channel then? Best regards!
0 Kudos
Message 3 of 6
(4,461 Views)
The term CAN channel is a bit misleading, each CAN channel in MAX is really a signal or message. You can have multiple CAN channels active at the same time sharing the same CAN bus, because the CAN port is a shared resource. If you do it correctly, you can also use the advanced CAN channel API's to share the CAN port among many CAN Channel signals.
0 Kudos
Message 4 of 6
(4,451 Views)
Hi!

Thank you for your answer. We have now another problem that we hope anyone could help us with. We want to filter out a certain message with a certain ID number. We are using config-VI. We guess that we have to put some numbers in the standard mask and standard comparator field but we might be wrong to :-). Can anyone help?

Best regards
0 Kudos
Message 5 of 6
(4,441 Views)
First of all, make sure what type of CAN hardware you are using. If you have 'Series 2' NI CAN hardware, you should leave the fields in the configuration cluster empty and use the Series 2 Filter attributes instead:

ncConfigCanNet (StartOnOpen = False)
ncOpen
ncSetAttr (Series 2 Filter Mode)
ncSetAttr (Series 2 Mask)
ncSetAttr (Series 2 Comparator)
ncAction (Start)
...
...
ncClose

Of course, the fields of the configuration cluster do work with the Series 2 NI CAN hardware, however they are processed in software on Series 2 NI CAN hardware, whereas the above mentioned attributes work in hardware directly on the CAN controller (more efficient).

Another good start would be the 'Series2 Filter Mode' example VI:
NI Example Finder » Hardware Input and Output » CAN » Frame API » General

Check out this knowledge base article:
http://digital.ni.com/public.nsf/websearch/E834440265FD497986256968005DF85F?OpenDocument

Regards,
-B2k
0 Kudos
Message 6 of 6
(4,428 Views)