Jump to content

Conditional DLL call


Recommended Posts

I'm new to using external code in LabView so I might be missing something obvious.

Is there a way to check for the presence of a DLL before making the call? How can you avoid an error (or catch the error) when a DLL is missing? The "Call Library Function Node" doesn't seem to have any way of handling the error. I'm using LV7.0

Link to comment

I'm new to using external code in LabView so I might be missing something obvious.

Is there a way to check for the presence of a DLL before making the call? How can you avoid an error (or catch the error) when a DLL is missing? The "Call Library Function Node" doesn't seem to have any way of handling the error. I'm using LV7.0

Link to comment

QUOTE (Dan DeFriese @ Jan 14 2009, 03:02 PM)

Finding the *.dll is not a problem (you can search for it with file I/O).

However, if the file can't be found when the VI is loaded, it will break whether or not you ever call the interface node. I've never tried it, but perhaps using dynamic VIs could allow you to get around this.

In LabVIEW 8.5 you can configure the Call Library node to get a path that receives the DLL to call at runtime. Before LabVIEW 8.5 you have indeed to encapsulate all calls to DLLs that might be not available into VIs that get called dynamically through VI server. You can load the VI with an Open Instrument Node and either check its execution state or directly try to call it through the Call By Reference Node. Call by Reference will return an error if the VI was not executable (which it will not be if it could not resolve a DLL call).

Rolf Kalbermatter

Link to comment

QUOTE (Dan DeFriese @ Jan 14 2009, 03:02 PM)

Finding the *.dll is not a problem (you can search for it with file I/O).

However, if the file can't be found when the VI is loaded, it will break whether or not you ever call the interface node. I've never tried it, but perhaps using dynamic VIs could allow you to get around this.

In LabVIEW 8.5 you can configure the Call Library node to get a path that receives the DLL to call at runtime. Before LabVIEW 8.5 you have indeed to encapsulate all calls to DLLs that might be not available into VIs that get called dynamically through VI server. You can load the VI with an Open Instrument Node and either check its execution state or directly try to call it through the Call By Reference Node. Call by Reference will return an error if the VI was not executable (which it will not be if it could not resolve a DLL call).

Rolf Kalbermatter

Link to comment

I made a small toolkit called LVDynaCall. That allow you call DLL dynamic in LabVIEW, you may want have a try on this.

http://code.google.com/p/lvdynacall/

QUOTE (cosborne @ Jan 15 2009, 01:04 AM)

I'm new to using external code in LabView so I might be missing something obvious.

Is there a way to check for the presence of a DLL before making the call? How can you avoid an error (or catch the error) when a DLL is missing? The "Call Library Function Node" doesn't seem to have any way of handling the error. I'm using LV7.0

Link to comment

I made a small toolkit called LVDynaCall. That allow you call DLL dynamic in LabVIEW, you may want have a try on this.

http://code.google.com/p/lvdynacall/

QUOTE (cosborne @ Jan 15 2009, 01:04 AM)

I'm new to using external code in LabView so I might be missing something obvious.

Is there a way to check for the presence of a DLL before making the call? How can you avoid an error (or catch the error) when a DLL is missing? The "Call Library Function Node" doesn't seem to have any way of handling the error. I'm using LV7.0

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.