Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Comparing CAN messages

Solved!
Go to solution
I am sending a voltage to a node that we build, and looking to monitor the CAN message that the node spits back out, which is converted to an actual PSI number by one of our consoles.  How can I just wait for a single CAN message, and have it compaired toanother so that I may verify in a test that the message is the correct one?  I have tried using search 1D array, and have had no luck.  I watch the messages that are being spit back out and I know that the correct message is comming out but the search 1d arrray always comes back out with the same message.  Any help would be great. Fred
0 Kudos
Message 1 of 4
(7,141 Views)
Solution
Accepted by wana be prog

Are you using the Channel API or Frame API? If you are using the Frame API, have you seen the Filter example provided by the NI-CAN driver? If you have LabVIEW and the NI-CAN driver installed, NI-CAN installs example VIs in your Example Finder. I think one of them performs the functionality that you are after.

To locate the Series 2 Filter Mode.vi example:
Open LabVIEW. Open the Example Finder (Help » Find Examples). Browse to Hardware Input and Output » CAN » Frame API » Basic » Series 2 Filter Mode.vi


Description of the VI:
Demonstrates how to use the Series2 filter attributes.

This example is similar to the CAN Receive.vi example, but allows you to set the Series 2 attributes that filter incoming CAN frames. To learn more about the filter attributes, refer to the description of ncSetAttr.vi in your NI-CAN Hardware and Software Manual (http://www.ni.com/pdf/manuals/370289k.pdf).

VI Instructions:
Start this VI on a Series 2 NI-CAN card. Transmit frames with different IDs from another CAN device to this card. Frames that pass the filter will be displayed on the front panel. Every time you change the filter settings, press the 'Change Filter Settings' button to use the new values.
Click on the 'Configure' button, to see how the resulting filter is created from the Series 2 Comparator, Mask and Filter Mode values. You can also configure new filter settings in that dialog box.

Press STOP to end this VI.

I think this would be a great starting point. If you have any questions about this, please let me know. 

 

Regards,

Mark E.

Applications Engineer

National Instruments


Mark E.
National Instruments

0 Kudos
Message 2 of 4
(7,132 Views)

This is worked out great.  But I still have one issue...  I can get it down to a set of messages that use the same arbitration ID.  But I need to look at one message in particular, to know if that message is displaying the right value.  What I have done is taken the data out using a FOR loop, and I need just to compare to see if this message that is shown in my picture happens to come down the message line.  Is there a  way to get even farther down?  A screen shot will be attached.  Thanks

Fred

0 Kudos
Message 3 of 4
(7,109 Views)

You declared the original issue to be solved.  If you have another issue, please create a new thread on the discussion forums.

 

Regards,

Mark E. 

Applications Engineer

National Instruments


Mark E.
National Instruments

0 Kudos
Message 4 of 4
(7,081 Views)