Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use CAN256 and CAN257 in Labwindows CVI?

I am trying to learn about CAN programming in LabWindows CVI. None of the samples do anything other than generate cryptic error messages. I do not have a card or interface device yet, but reading in the help files I found this:
 
"NI-CAN provides a virtual CAN card with two interfaces, CAN256 and CAN257. The two virtual interfaces are connected by a virtual bus. When you write CAN frames to one virtual interface, those frames are received by the other virtual interface, and can be read as channels. This feature allows you to read and write CAN data in the same manner as two real CAN interfaces connected by a real CAN cable. The conversion does not require real NI CAN hardware, and your application is not required to check for specific CAN IDs."
 
I modified the Waveform ouput project and add CAN256 to the dropdown in the uir file. However when I run it, I get the same error message as always, error -1074388725.
 
Is there an example CVI code someplace to demonstrate the use of these virtual channels?
0 Kudos
Message 1 of 5
(4,926 Views)

Hi

You can use the virtual ports 256 and 257 to set up the attached  input and output example to work virtualy. But you have to install the NI CAN driver 2.3 or later.

You can download the driver here:  Current NI-CAN Version

DirkW

0 Kudos
Message 2 of 5
(4,914 Views)

Can you use the virtual CAN channels with the Frame API?

If so, how?

 

Thanks,

Don

0 Kudos
Message 3 of 5
(4,090 Views)

Don,

 

I am sorry it took so long to get in touch with you.  Yes it is possible to use CAN256 and CAN257 with the Frame API.  They are used just like normal interfaces.  

 

However, there are certain limitations, which are described in Table 6-1 and 6-2 of the NI-CAN Hardware and Software Manual, which should be under Start » Program Files » National Instruments » NI-CAN.  For example, CAN objects are not supported, as virtual interfaces are limited to the Network Interface. 

Drew T.
Camber Ridge, LLC.
0 Kudos
Message 4 of 5
(4,057 Views)

Thanks Drew.

 

Ultimately, my customer provided me with a WriteCAN256.vi and ReadCAN257.vi that were perfect for my needs. The WriteCAN256.vi along with my NI USB 8473s allowed me to provide data collection on multiple CAN devices and to verify that my Software can handle all data types from CAN devices.

 

Note: My customer allowed me to share his .vi's. They are enclosed ...

 

Best Regards,
Don W

Download All
0 Kudos
Message 5 of 5
(4,018 Views)