John Gourlay
2008-02-06 15:10:11 UTC
Dirk, Attached is an NI Spy capture showing the problem. CAN0 is the USB board, and CAN1 is port 2 of a PCI board. They're connected to each other, and there is nothing else on the bus. The test configures and opens both ports identically and tries to send a frame from CAN1 to CAN0. The NI CAN library never calls the NC_ST_READ_AVAIL callback function for CAN0. In spite of the successful return codes, the USB board apparently never really goes on line, because CAN1 goes into error-passive state for lack of an acknowledgement. You can see the call to the callback for CAN1 to deliver the no-acknowledgement communciation error.It's impractical for me to send you the whole program I'm running. It's a big, programmable system for running end-of-line production tests of automotive components such as engines and transmissions. I am including the one C file that contains all of calls to the NI CAN library. The functions you'll be interested in are pc2_ds_open_port and receive_frames.John
Capture2.spy:
http://forums.ni.com/attachments/ni/30/3187/1/Capture2.spy
pc2_ds.c:
http://forums.ni.com/attachments/ni/30/3187/2/pc2_ds.c
Capture2.spy:
http://forums.ni.com/attachments/ni/30/3187/1/Capture2.spy
pc2_ds.c:
http://forums.ni.com/attachments/ni/30/3187/2/pc2_ds.c