Finding the Message a CAN Channel Belongs to Using GetNames.vi
Primary Software: Driver Software>>NI-CAN
Primary Software Version: 2.3.2
Primary Software Fixed Version: N/A
Secondary Software: N/A
Hardware: Industrial Communications>>CAN
Problem: How Do I Find Out What Message my CAN Channel Belongs to When I use the GetNames VI in LabVIEW?
Solution: To find out what message a CAN channel belongs to, you will need to use two instances of the "Get Names" VI with the first one set up to return message names, and the second one set up to return channel names. Follow the steps below to configure the VIs:
- Place two "Get Names" VIs from the CAN Channel API palette onto the block diagram.
- Right-click on the mode input of each VI and select Create » Constant.
- Select "messages" as the mode for the first "Get Names" VI, and "channels" for the second "Get Names" VI.
- The first "Get Names" VI returns an array of messages in the channel list output, and you can index this array (using an "Index Array" function or a "for loop") to get the individual messages.
- Connect a message to the "message name" input of the second "Get Names" VI; the channel list output returns all the channels that belong to the message in the "message name" input.
See the attached VI (can be opened in LabVIEW 7.0 or later) for an example that demonstrates the steps above.
Related Links:
Attachments:
Report Date: 06/10/2006
Last Updated: 06/22/2006
Document ID: 3Y9G955N