Sounds like you might not have all of the CVI support files for some reason. If you installed the NI-CAN drivers after installation of CVI, then the NI-CAN installer should have installed ansi-c driver files and examples in the CVI directory. These files include the nican.h header file, as well as a series of sample programs in the cvi/samples/nican directory. All of the examples are written in ansi-C for maximum compatability with all compilers. And if you drill into the LabVIEW ni-can VIs, you will see at the core an ansi-c style call to a DLL, which is the same way the driver works from a C program. For documentation on all of the functions, refer to the NI-CAN Programmer Reference Manual, which has both a C and LabVIEW section for every function.
The first thing to
check is to run the NI-CAN Diagnostic and make sure that it passes. The diagnostic will check for installation problems, resource conflicts, etc.
Next, the main test example that we use is the Obj2Obj example. To use this example, you need a 2-port CAN interface card, and you simply cable the two ports together and run the example. The example then communicates between the two ports to confirm that everything is working properly. The practical result of this is a check of the cabling. Personally, I have yet to see a case where the diagnostic passes and the Obj2Obj program fails, and the root-cause was not a cabling problem. For cabling information, refer to the "Cabling Requirements" Appendix of a "Getting Started with NI-CAN for Windows ... " reference manual.
As a final note, their is a CAN newsgroup, and quite a few more folks familiar with CAN check and post in that group much more than CVI. That is a better newsgroup for CAN specific questions.
Regards,
Greg Caesar