LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unloading dll freezes labview

Hi guys,

 

I am trying to unload a dll file and it seems to freeze labview. It sways happens at the last CLFN. If I disable the last CLFN node than the new CLFN freezes. I have watched it go through with the lightbulb thing and everything works fine until the last time I try to write an invalid path to a CLFN. Any Ideas?

 

Any help would be greatly appreciated.

Adam

 

Unload dll error.png

 

0 Kudos
Message 1 of 13
(4,513 Views)

Hi Adam,

 

I have found what should hopefully be a solution for you but it will take me some time to write it up in a coherent message so you will have to grin and bare it for a little bit. I'll try and have it written up in a day or so.

 

Regards,

 

Chris

National Instruments - Tech Support
0 Kudos
Message 2 of 13
(4,473 Views)
ok thank you very much.
0 Kudos
Message 3 of 13
(4,466 Views)

Hi Chris,

 

Just wondering how you are getting on?

 

Adam

0 Kudos
Message 4 of 13
(4,443 Views)

Hi Adam,

 

Sorry I'm taking so long. I have found a record of this problem before but it is very difficult to track down the solution. As soon as I have a clear idea of what you need to do I will post back for you.

 

Best Regards,

 

Chris

National Instruments - Tech Support
0 Kudos
Message 5 of 13
(4,437 Views)

Hi Adam,

 

I believe you are seeing this problem as you are calling the Call Library Function Node within the for loop. This means you will need to use another method to unload the dll.

 

There are a couple of methods you could use:

1. Whenever you specify the path to a dll on the blck diagram, LabVIEW will automaticaly unload the current dll and load the new one. As long as you are not trying to use an identical name while the VI is running, LabVIEW should automatically do the unloading for you

 

2. If you still need to unload the DLL every single time you can bundle the Call Library Function Node into a subVI that you can call dynamically from your main VI. You can do this using a Call by Reference Node. Once the subVI has finished executing it will automatically unload the DLL for you.

 

I can imagine I haven't explained this very well so if you have questions please feel free to post them. It may take me some time to get back with a coherent answer though.

 

Best Regards,

 

Chris

National Instruments - Tech Support
0 Kudos
Message 6 of 13
(4,397 Views)

Thanks for the reply but im still not sure what you mean.

 

For point 1.

I though to unload a DLL in LabVIEW that a new path had to be wired into every CLFN that had been used in the VI, and the same node not a copy of it. If I call another path or DLL surely I still have to wire it to all the CLFN like I have tried to do above?

 

For point 2.

If I put all my CLFNs in a SubVI then they will be copies of the actual CLFN that I have used in the main VI. Doesn't this mean that it will not be unloaded? Or do you mean Use the subVI every time I use the CFLN so that it is the same one? IIf this si the case I still dont see how this will be any different from what I have?

 

Adam

0 Kudos
Message 7 of 13
(4,391 Views)

Hi Adam,

 

The information I gave you was from one of the people who develop LabVIEW in the US. I'm afraid I don't fully understand the inner workings. For point 1 I am quoting what I have read. Have you given it a try to see if it works?

 

For point 2 I can imagine that this would work as LabVIEW unloads the resources called by a subVI when it has finished executing. Any DLLs called should be unloaded automatically so you could try using the subVI for every time you use the CFLN.

 

I can understand that I'm not being very clear so it may be best to give the methods a try and see if they work. They were recorded to have worked with a previous customer.

 

Regards,

 

Chris

National Instruments - Tech Support
0 Kudos
Message 8 of 13
(4,383 Views)

Ok,

 

I tried your first suggestion to call another dll path to unload it. It does not freeze my program but it doesnt unload it. my client stays connectected. it should disconnect because if i shut labview down it does disconnect.

 

load empty dll path

 

My code already has the CLFNs in subVIs. The problem is that it never gets out of the last subVI. However with teh new code attached it does get out of this subVI and the dll is not closed.

 

Adam

0 Kudos
Message 9 of 13
(4,369 Views)

Hi Adam,

 

I'll look into this a little more. I'll see if I can get in contact with the guy who solved the problem last time.

 

Regards,

 

Chris

National Instruments - Tech Support
0 Kudos
Message 10 of 13
(4,366 Views)