From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

using nican.dll and NI CAN softare

Hello,
I'm using CAN software to communicate via CAN. I comunicate without problems in a laptop with a PCMCIA CAN.

My problem is:
I need to use in a separate computer
without CAN card the NI-CAN software, specially VIs
CAN Get Names.vi
CAN Get Property.vi to configure the test and to know in LabVIEW the CAN Channel paramenters, but the vi CAN Get Propoerty.vi needs a task input.

I'm using CAN Initialize.vi to generate a task but the VI generates an error because this computer hasn't CAN-Card.

How can I acces from LabVIEW to the channel properties of differents channels or messages imported in MAX?

Can I do this without NI-CAN software?

or if I need NI-CAN for to do it, how I can create a task without CAN I
nterface?

Thank you in advanced.
0 Kudos
Message 1 of 6
(6,278 Views)
It sounds like you want to use other parts of the application on the computer without the CAN Card. Am I correct?

There really isn't an easy way to use the CAN VI's and not have them available on another computer. If they are on the diagram, they need to be there. And not only the VI's, but all the .dll's that they access.

You could build some kind of check that would look to see if there is a CAN card or not, then load one of two main VI�s that is actually the application. One would have the CAN stuff, the other wouldn�t. Or you call all the CAN VI�s by reference, but put the reference call inside a case structure so it wouldn�t get called if there is no CAN card.

I�ve done this by actually installing the CAN driver even if there is no CAN card (
it will install) and building my own NI-CAN VI�s that have a �No CAN� option. If the CAN Config VI generates an error, none of the CAN VI�s run. You could modify the CAN Interface control to include a �None� selection that would just run an empty case for the VI.

As far as I know, you can�t configure a CAN channel unless you have the NI-CAN driver installed. That�s what puts the CAN Channel config in MAX.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 2 of 6
(6,279 Views)
Good answer Ed.

Joaquin, in case your use case is not the same as Ed's, here are the answers to your specific qustions:

Q: How can I access from LabVIEW to the channel properties of differents channels or messages imported in MAX? Can I do this without NI-CAN software?
A: No. Without NI-CAN installed, you can't import an ncd file (or dbc file) into MAX. The closest thing you can do is open and parse an .ncd file to extract the channel information.


Q: if I need NI-CAN for to do it, how I can create a task without CAN Interface?
A: You cannot create a task without a CAN Interface.

The real question is why do want to do this and what is your end goal. There may be another way of achieving your end goal.
0 Kudos
Message 3 of 6
(6,277 Views)

Ed,

Did you say that you can access the NI-CAN channel properties without a CAN card present? If so, how? My app needs to do that and I can't figure it out. nctGetProperty wants a TaskRef which comes from nctInitialize which wants an Interface which requires hardware, no?

Thanks.

0 Kudos
Message 4 of 6
(6,006 Views)
Hi ClausB,

NI-CAN 2.3 introduced the ‘virtual CAN interface’ (aliases CAN256 and CAN257). Thus, if you use NI-CAN 2.3 (or higher) you can just initialize one of those aliases and use the generated TaskRef as an input for the nctGetProperty function.
Download the latest NI-CAN version here.

-B2k
0 Kudos
Message 5 of 6
(6,003 Views)

Thanks!

When in doubt, update!

0 Kudos
Message 6 of 6
(5,997 Views)