01-12-2010 10:59 AM
Greetings. I tried to grasp an understanding of this when reading this post: http://forums.ni.com/ni/board/message?board.id=30&message.id=1353&query.id=1404883#M1353, however to no avail.
I wrote a VI using the PCI-CAN card (which supports use of CAN Objects). As an afterthought, my boss wants to start using the USB device (which does NOT support use of CAN Objects). Basically what this VI does is this: The user enters specific CAN 2.0B specifications (Priority, Parameter Group Number, and Source Address), which generates a NI-CAN Object that looks like CAN0::XTD0x######## (where the # depends on the user entered info). Now that I have the USB device, I can't use this configuration, so I turned my attention to the Extended Comparator and Mask functions of ncConfigCANNet.vi.
After reading the above link, I am still not comprehending how these functions are intended to work. Take, for instance, I have two Arbitration ID's present on the bus, 0x2CFDD6D0 and 0x2CFDD6D1 (the prefix "2" added by NI-CAN to indicate an extended 29-bit frame). Based on what the user selects as his specifications, I want to programatically filter all of the others out. I know it CAN'T be that difficult, I am just not familar with how this works. Assuming I should use the Extended Comparator and Extended Mask, what should I set them to in the above case?
Any help would be greatly appreciated.
Best regards,
controllersRus
01-13-2010 06:16 PM
Hello controllersRus,
You should be able to just AND your two values to use as your mask. This will find the common bits and return all Arbitration IDs that share those identical bits. If the IDs don't, then the driver ignores them.