VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

using a CAN stream and CAN card in Veristand

Hi all,

 

i'm currently creating my first custom device and I'm facing problems with it. I have a channel (will be used as boolean) which I want to set. This channel needs to be an input of a VI that sends CAN Frames as stream that I created dynamically in a memory database. The CAN VI is finished, I tried it on the RT target alone and it worked. Using it with Veristand creates problems.

1) Must I use System Mappings within the system definition file to connect my channel to the VI (and make my VI a simulation model) or is there an other way to do this directly in the custom device project?

2) I have a CAN card in the PXI chassis. In the system definition file it is shown independant from my custom device. How can I include the CAN card in my VI/custom device project to select the CAN interface/port there programatically? As for now, I enter baud rate and CAN port name in the main page.vi to global variables.

 

Greets

ManuKlause

Greets
ManuKlause


LabVIEW 2018
Veristand 2018
Teststand 2017
0 Kudos
Message 1 of 7
(2,608 Views)

Hi, where is your channel? In System Definition File? Or just in the VI in CD?

Please give me more detailed system structure.

 

For second question, how about using VI below in CD?

http://zone.ni.com/reference/en-XX/help/373107H-01/nisyscfg/find_hardware/

Certified LabVIEW Developer
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

GCentral
0 Kudos
Message 2 of 7
(2,573 Views)

I use the PXI 8840 Controller and the PXI 8512 CAN card.

 

I have a cluster containing the input elements and for each element a channel is created. When a channel value changes from 0 to 1 I want to start my VI that sends the CAN data. Now I have noticed that I can use the cluster elements in the RT Driver VI and use the FIFO structure and parallel while loops to control the call of the VI.

In the Main Page VI I can enter the name of the CAN port (here CAN1). Does the CD itself "see" the CAN card, so that I can include it in my VI (get the property of the CAN port(CAN1) and use it to create my memroy database for the CAN messages?

The VI Find Hardware needs a session as input. But the XNET Create Session VI needs a XNET interface. Here, I must use the Get Item Property VI wit the CAN port of the Main Page?

 

Greets

ManuKlause

Greets
ManuKlause


LabVIEW 2018
Veristand 2018
Teststand 2017
0 Kudos
Message 3 of 7
(2,559 Views)

Ah I just saw, that the VI Get Item Property needs the Item Ref an input. The items are sections or channels, not the CAN port configured on the VI Main Page... This wont work.

Greets
ManuKlause


LabVIEW 2018
Veristand 2018
Teststand 2017
0 Kudos
Message 4 of 7
(2,552 Views)

For 2nd question, how about using an example blow.

Programmatic Discovery of CompactRIO XNET C Series Modules in LabVIEW

 

This example make it possible to search the CAN interface/port programmatically.

Certified LabVIEW Developer
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

GCentral
0 Kudos
Message 5 of 7
(2,540 Views)

I tried your example, but I run the code only on the custom device. An additonal "target or devices" is not included, although I have done that before to test my programm (here, the CAN port was detected). Doing so would require a driver for labview on my PXI system and deployment with veristand would not be possible.

Greets
ManuKlause


LabVIEW 2018
Veristand 2018
Teststand 2017
0 Kudos
Message 6 of 7
(2,535 Views)

Hi ManuKlause,

 If I understand you correctly, you'd need to discover ports in the Configuration part of the Custom Device, then pass the discovered value to the RT part. I suppose that you'll have to call System Configuration API (on the PC) to get information about the connected PXI and its configuration, parse it and extract CAN port information (like NI XNET part of Veristand does).

Piotr F.
Hardware Engineer @ ZF
0 Kudos
Message 7 of 7
(2,511 Views)