LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to release CAN handles even after closing driver

hello,
 
I am using labview user interface to run a sequence in teststand. The Teststand sequence uses CAN drivers, which I use to read and write off the CAN card. I do close the cards at the end of the sequence in the cleanup section. If I run the sequence again, I get an error when the program is trying to configure the CAN cards again. It will only allow me to run it again if I completely exit out of labview. It seems that teststand or Labview keeps holding the driver for some reason.
 
Any ideas on what may cause this problem.
 
Thanks,
Ayman
0 Kudos
Message 1 of 5
(3,022 Views)

Hi Ayman,

It sounds like it's not properly closing the session. By exiting LabVIEW, you are forcing LabVIEW to close down all open handles that were left open in memory. Obviously, we need to close them properly in your sequence to avoid having to close LabVIEW. I have some questions for you to help troubleshoot this issue.

How are you passing the CAN handles through your sequence? If you place a breakpoint at the step that calls the CAN close call, do you see that it performs this step? Which API are you using in CAN, the frame or channel API? How many ports or CAN objects do you open?

Regards,

Missy S.
Project Engineer
RoviSys
0 Kudos
Message 2 of 5
(2,996 Views)

Hello,

Thanks for your reply.

I am passing the CAN handles using FileGlobas variables

I have 3 CAN ports open and Yes it does execute the close operation which I placed in the cleanup step. I use frame API to close the channels with the VI called ncClose

Note: When i execute the sequence file on its own, not through the Labview interface, I get no errors no matter how many times it closes, which made is more confusing to pin point the problem.

Hopefully this rings a bell

 

Thanks,

Ayman

0 Kudos
Message 3 of 5
(2,986 Views)
 
Hi Ayman,
What versions of NI-CAN and TestStand are you using? Here is a link to the latest version of NI-CAN, version 2.4
 
When you say you are running the sequence from the LabVIEW operator interface (OI), are you running the OI as a compiled executable or are you running the OI code in LabVIEW and then executing your sequence in that manner? Also, are you using a customized LabVIEW OI or are you using the OI that we ship with TestStand? Finally, when you say that you are running this outside of the LabVIEW OI, do you mean that you are running this in the TestStand Sequence Editor?
 
Regards,
Missy S.
Project Engineer
RoviSys
0 Kudos
Message 4 of 5
(2,968 Views)

Hi Ayman,

Also, when you say you "use frame API to close the channels with the VI called ncClose", do you mean that you use the Frame API throughout your code for this port? You are not mixing the Channel and Frame API for this port, correct?

I assume you are just using the Frame API here, but I wanted to make sure.

Regards,

Missy S.
Project Engineer
RoviSys
0 Kudos
Message 5 of 5
(2,959 Views)