Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

devicenet and can together

Hi.
 
I need to test devices using CAN or Devicenet for different variants.
 
The ideal solution for me would be to use one CAN card to test either a connected CAN or DNET device, merely by using a different API.
 
I read in an older post that the NI-CAN and NI-DNET drivers are not installable on the same PC, is this still the case?
 
So I cannot install a CAN and DNET card in the same PC?
 
The second best option is both a CAN and DNET  card installed on the same PC, and accessed via seperate API's.
 
Is this actually possible with the NI cards? (bearing in mind that NI-CAN and NI-DNET would have to be installed together, see above).
 
Thanks for your time.
 
Si.
 
I am using Windows XP and C#.
 
 
 
0 Kudos
Message 1 of 7
(5,684 Views)
Hi Si,
 
I have both NI-CAN 2.3.3 and NI-DNET 1.5.1 (latest versions) installed on my Win XP machine, so you should be able to do this. Programming using one card should be possible, check the readme for the supported CAN interfaces under NI-DNET, as long as you only try and work with one API at a time, and close off the references correctly, etc.  
 
You can download these drivers at the following links:
 
However, NI doesn't provide direct .NET support for these drivers, so there is no C# API, but there is a C API which you should be able to use.
 
I hope this helps, let me know if you have any questions.
 
Hannah
NIUK & Ireland
0 Kudos
Message 2 of 7
(5,674 Views)
OK, that's cool.
 
I'll install the card and give it a go as soon as I get a chance.
 
loading and wrapping c/c++ dll's in is pretty easy in c#.net, so the API should be OK.
 
Thanks again.
 
Si.
0 Kudos
Message 3 of 7
(5,669 Views)
You should order PCI-DNET/PCMCIA-DNET/PXI-8461 card to use both CAN and DeviceNet API.
If you order the PCI-CAN/PCMCIA-CAN/... card, you can't use DeviceNet API.
0 Kudos
Message 4 of 7
(5,613 Views)

Hello again.

Right, I've now started working on this, and have successfully got DNET working through c# .net by wrapping the NICAN dll. (On a PCI-DNET card).

The only functionality I need is the abilty to enumerate a device on the network, and read a piece of test data (for devicenet I'm just reading the object name, as per the Get Device List example).

What I now need to do is to implement a similar test using CANOpen (which is the other CAN variant I need to test).

Q1. Are there any examples/support for implementing (simple) CANOpen using NI-CAN? (I have found a few labview examples but no C++).

Q2. If not, what would be the general procedure for implementing a CANOpen 'who's connected' function using NI-CAN commands (Maybe I can get it working with a few hints).

If all else fails, I have an old softing card somewhere which comes with a CANOpen driver, so I could install that If necessary for the CANOpen, but I'd rather just use one card if possible.

Thanks for your time.

0 Kudos
Message 5 of 7
(5,512 Views)
If you want to do all the things by yourself, you need implement the basic SDO read service in CANopen.
If you'd like to pay $100, then you can purchase the CANopen library from NI. It works on the same NI CAN board you got.
0 Kudos
Message 6 of 7
(5,499 Views)

Thanks, but that library is Labview only, not  C++.

Implementing the SDO and NMT protocols from scratch will be too much work for what I need to do.

Looks like I'll have to use two cards after all.

0 Kudos
Message 7 of 7
(5,492 Views)