LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Has anyone got a NiCan demo?

Am having problems setting up an application using NiCan. The C demo program doesn't work, and the driver seems to be mainly geared to LabView 😞 or C++. A sign of things to come?

My own program can get the UUT sending the right data out, but I keep getting comms errors trying to read it.

Anyhow if anyone out there's got a small working Nican test prog I'd appreciate it if you could email it across.

Thanks - mailto:stever@serco.com
0 Kudos
Message 1 of 4
(3,308 Views)
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
0 Kudos
Message 2 of 4
(3,308 Views)
Thanks for your reply. Obj2Obj works as advertised. Unfortunately, I'm using the Network Interface Object type, rather than the CAN Object type, since our UUT's don't have fixed addresses and the arbitration ID is changing constantly (it contains a combination of node ID and message type arranged as a 7-bit and 4-bit bitfield in our case). I think my problem might be that I'm not entirely sure what ID the nican board is expecting back from the UUT, although it strikes me that if filtering is off, anything should do.

I have just downloaded and installed Nican 1.4.2 ( the board came with 1.4.0). The .fp STILL doesn't have on-line help attached.

Someone in the CAN group mentioned that V1.5 will have a bus diagnostic included along with the board check. Any
truth in the rumor, and could I get a beta?
0 Kudos
Message 3 of 4
(3,308 Views)
The readmult.c example found in C:\program files\national instruments\ni-can\examples is an example of how to do what you have asked. Here's the starting comments:

This example reads a specified data buffer size from the Network Interface and
returns the time-stamped data and the actual number of frames read.
Transmision is done via three CAN objects on CAN0 with different CAN Arbritration
IDs, and the Network Interface object, CAN1 receives all the frames.

-----------

I'll look into getting some commentation for the .fp in CVI.
0 Kudos
Message 4 of 4
(3,308 Views)