10-14-2010 04:36 PM
Why does viFindRsrc fail to return if I call it from a dll that is dynamically linked to an application? The expression that I am using is "?*VXI[0-9]*::?*INSTR". If I use the expression "VXI?*INSTR" everything is fine. I am just concerned about legacy dlls that I have to support with expression that seems not to work. The expression works though when the dll is statically linked to the application. I have an application that is dynamically linked to a dll which calls viFindRsrc. When I use the expression "?*VXI[0-9]*::?*INSTR" viFindRsrc fails to return, it does not do anything it just seems to sit in viFindRsrc. If I use the the expression "VXI?*INSTR" everything works fine. My problem is that I am writing a wrapper that will dynamically link to a legacy dll for one version of the instrument or a newer dll for the new instrument. The wrapper determines which instrument is being used and dynamically links the dll for the correct version of the instrument.
10-15-2010 04:11 PM
I assume you are calling the function in LabVIEW, what version are you using? Is it possible jsut to call the DLL static in the application? Do the calls that do not work in the application work on the development machine in the exe and/or the development environment? Can you post a small representation of the code that can reproduce the behavior?
10-18-2010 07:21 AM
Actually I am using VC++ 6.0 to call the function. The DLL can not be called statically becaause the dll calling the function determines whether to load a legacy dll to control a legacy instrument or a newer dll to control a newer instrument. When the call is made from an exe directly to the legacy dll or new dll everything works fine. The problem is when the extraa dll is added it does not work.
the line of code is
status = viFindRsrc(defaultRM, "?*VXI[0-9]*::?*INSTR", &fList, &numInstrs, desc);
Thanks for your help
10-19-2010 10:46 AM
Thank you for the post, and I am glad you have it working. Can you please post the problem in case another user runs into the same issue?
04-21-2012 03:02 AM
I am seeing viFindRsrc failing to return on Lion
This happens when there isn't a GPIB connected in the system. (Some systems have, some do not)...
I could use an answer to this...
04-23-2012 06:13 PM
When you say "Lion" do you mean you are using Mac OS X Lion? Also, are you seeing the same behavior as described in the original post? Are you using a VXI system, or is this occuring while trying to communicate to a different instrument via GPIB? Are you calling the command from a statically or dynamically linked DLL?
You say it only happens when there isn't a GPIB connected - is there a reason you are trying to communicate with a GPIB resource that isn't present in the system? Sorry, maybe I'm understanding you incorrectly. Additional information as to the overall problem may be helpful.