Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I filter J1939 CAN messages by Command Byte. (NI-CAN)

We have customers who use the first byte of data as an additional header byte. They have the usual J1939 extended header along with the first byte. Does anyone know of a way to filter on this in "Measurement & Automation Manager" (NI-CAN). We then bring this data into our VB6 application using the NI-CAN API. But I always need to write extra software to filter on the Command Byte (first byte of data).
0 Kudos
Message 1 of 5
(5,329 Views)
The newest NI-CAN driver (2.2) supports using a command byte or bytes. Your best would be to download it so all of the filtering can be done on board the CAN card instead of doing it in software.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 2 of 5
(5,328 Views)
You can do that in MAX by doing the following steps:
1. Create the CAN channel by clicking on CAN channels and Create New.. (the common PGN)
2. Right click on the channel you just made in the Max explorer, and click on Create Multiplexer
The multiplexer tells Max that this is a mode dependent channel (it will switch the message based on the defined data byte, not just the PGN)
3. Define the way the data byte switches messages (1 bit, 4bits... etc.)
4. Create the seperate message definitions bleow that message indicating the different messages.
5. Read the CAN message. Your are on your own with VB, I have never used it to read a MAX/CAN channel. I am betting it uses the nctRead()
0 Kudos
Message 3 of 5
(5,328 Views)
Thanks all I am downloading 2.2 now. I noticed that this is not listed to work on Windows 9x. We have an old system I am updating that is running Windows 95. Any ideas if this will work on that machine??
0 Kudos
Message 4 of 5
(5,328 Views)
You have to have at least LabVIEW 6.1 to use the NI-CAN 2.2 driver. So you might be OK running it on a Win95 machine.

I didn't find anything saying that it won't work on Wi95, it may not be supported, which just means that if you run into problems, NI support probably will not help you. On the download page for the driver, it says it supports Windows 2000; Windows 98; Windows ME; Windows NT and Windows XP. They may have indeed dropped support for Win95. LabVIEW 7.1 will not even install on a Win98 or 95 machine, so they may have done the same for the new CAN driver. Only way to know for sure is to try it.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 5 of 5
(5,329 Views)