Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

CAN Interface Open/Close Question

I have a program I'm writing where I need to monitor a master CAN0 node for frame packets, but also transmit frames to that node. My question is, do I need to start my VI by first opening a slave CAN1 Node Port and leave it open to poll and transmit frames to the master node through out the rest of my VI test execution or can I just open the slave CAN1 node port, poll for new messages or transmit a frame then close it again. I'm assuming if I close the port each time I will lose any frames sent by the master CAN0 node, is that true or will the frames still be queued up to be retrieved when I open the slave CAN1 port again?

 

Thanks in advance.

0 Kudos
Message 1 of 4
(6,043 Views)

I guess no one knows the answer to this.

0 Kudos
Message 2 of 4
(6,024 Views)

Hello QRP,

 

Using a close VI such the NI-CAN ncClose.vi for the the frame API will close out the object you are using. When an object is closed NI-CAN stops all the current operations and also clears all the current configurations for the object. In your case specifically any queued frames would be cleared. I have included a link to the NI-CAN Hardware and Software Manual for your reference, this manual contains all the reference information for each NI-CAN function and VIs. Please look over this documentation for more detailed information on any VIs you have questions about, I would also recommend taking a look at some of the shipping examples for NI-CAN under Help>>Find Examples in LabVIEW. Hope this helps!

 

Paul-B

Applications Engineer
National Instruments
0 Kudos
Message 3 of 4
(6,017 Views)

Thanks Paul!

0 Kudos
Message 4 of 4
(6,007 Views)