cosborne Posted January 15, 2009 Author Report Share Posted January 15, 2009 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 Quote Link to comment
cosborne Posted January 15, 2009 Report Share Posted January 15, 2009 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 Quote Link to comment
Dan DeFriese Posted January 15, 2009 Report Share Posted January 15, 2009 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. Quote Link to comment
Dan DeFriese Posted January 15, 2009 Report Share Posted January 15, 2009 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. Quote Link to comment
Rolf Kalbermatter Posted January 15, 2009 Report Share Posted January 15, 2009 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 Quote Link to comment
Rolf Kalbermatter Posted January 15, 2009 Report Share Posted January 15, 2009 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 Quote Link to comment
TomLu Posted January 15, 2009 Report Share Posted January 15, 2009 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 Quote Link to comment
TomLu Posted January 15, 2009 Report Share Posted January 15, 2009 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 Quote Link to comment
Dan DeFriese Posted January 16, 2009 Report Share Posted January 16, 2009 QUOTE (rolfk @ Jan 14 2009, 05:00 PM) In LabVIEW 8.5 you can configure the Call Library node to get a path that receives the DLL to call at runtime. Thanks for pointing this out! Quote Link to comment
Dan DeFriese Posted January 16, 2009 Report Share Posted January 16, 2009 QUOTE (rolfk @ Jan 14 2009, 05:00 PM) In LabVIEW 8.5 you can configure the Call Library node to get a path that receives the DLL to call at runtime. Thanks for pointing this out! Quote Link to comment
crelf Posted January 16, 2009 Report Share Posted January 16, 2009 QUOTE (TomLu @ Jan 14 2009, 07:56 PM) I made a small toolkit called LVDynaCall. That allow you call DLL dynamic in LabVIEW, you may want have a try on this. Note: this toolkit is currently under consideration in the http://forums.lavag.org/downloads.html' target="_blank">LAVA Code Repository queue. Quote Link to comment
crelf Posted January 16, 2009 Report Share Posted January 16, 2009 QUOTE (TomLu @ Jan 14 2009, 07:56 PM) I made a small toolkit called LVDynaCall. That allow you call DLL dynamic in LabVIEW, you may want have a try on this. Note: this toolkit is currently under consideration in the http://forums.lavag.org/downloads.html' target="_blank">LAVA Code Repository queue. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.