LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pcan_usb.dll blocked

Hello,

 

I use the PEAK USB CAN Dongle within Labview and recently found out, that the dongle is blocked as soon as a VI is loaded that uses it somewhere during run. I wrote VIs that open and close connections to CAN only when needed. Now I wanted to run an external program from Labview that also uses CAN for communication and was astonished that the CAN interface was already in use although nothing is sent or received.

 

Is it possible to unload the DLL when it is not used and load it again later?

0 Kudos
Message 1 of 5
(3,180 Views)

LabVIEW does not provide a method for unloading a DLL. Once it is loaded into memory, it stays in memory until LabVIEW is closed.

 

That said, your USB dongle should provide a disconnect or close function that when called will disconnect from the dongle. Your external program should then be able to connect to it. If it does not provide such a functionality, then a possible solution would be to develop your CAN driver as a stand alone application. Then start the application from your main routine and communicate with it via TCPIP and close the app when you are done talking. This would force the DLL out of memory.

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 2 of 5
(3,166 Views)

If you use a path to specify the DLL you can load the library by calling the CLFN with the DLL path and later unload it by calling the same CLFN with an empty path.

Message 3 of 5
(3,163 Views)

The VIs provided by PEAK Systems include Init and Close functions.

Everytime I want to read or write to/from CAN I use these VIs, that's the reason why I'm confused. The main VI does not use the init and close VIs directly and despite that the dongle is blocked even if the main VI is not running but just loaded.

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

PEAK System provides VIs to use their DLLs

0 Kudos
Message 5 of 5
(3,122 Views)