09-17-2008 11:44 AM
I have a labview application that control multiple hardware devices ( DMM, scope, switch). I'm using an IVI instrument specific driver to control the DMM (Keithley 2015 THD). I can talk to and control the DMM from the development environment but when I create an executable it doesn't work. I can talk to the DMM but it's like it's ignoring the commands I'm sending to control it. I've never used an IVI driver before but I think I have everything I'm supposed to have. Plus the weird thing is that the exe doesn't work in the SAME development PC. I can't really understand what's going on. Is the exe looking for the IVI drivers somewhere different than the development environment? If so, how do I find out what's missing and where it is?
Any help is greatly appreciated.
09-17-2008 12:15 PM
Are you using "Current Vi's path"? If you are running in an exe, the path of the exe forms the beginning of the result, so you get a different answer in the exe as compared with running in the development environment.
You can read more in this thread
Rod.
09-17-2008 02:37 PM
09-17-2008 03:05 PM
Have you tried the executable on a different PC, or only on your development PC? If only on the development PC, do you still have LabVIEW running when you launch the executable? If so, is it possible LabVIEW has already opened the port or device, preventing your executable from accessing it?
I know, really basic questions... but I make this sort of error all the time.
Also, have you added error handling to your executable so you can see if anything is going obviously wrong? You can debug an executable by setting the appropriate key in your .INI file; instructions on how to set this up are in the LabVIEW help.
09-17-2008 04:03 PM
Hi nathan,
Thanks for your response. Yes, I have tried running my exe in both my development PC and on a clean PC by using the installer. It behaves the same in both places. I've also ran the exe with Labview environment close but it makes no difference. I guess I should start by aksing what are you supposed to do when using IVI drivers. I just basically treat it this driver as a normal VXI driver except that I included the .dll file in my project so I can later on included in my exe and my installer. But I've been reading around and it seems that I'm supposed to "import" the driver so Labview can create wrappers around it?? I'm not sure how to do this. Maybe someone can help me with that and by doing the whole process properly from the beginning I might fix what's broken.
09-17-2008 04:46 PM
In the development environment, where is the application looking for the dll? It has been a while since I've used IVI but in the past, I did not place the dll in a project or have an installer place it a data folder. When I distributed an app that used an IVI driver, I ran the original installer for the driver so that it would place it in the correct location. This used to be in the VXIpnp folder but I think this may have changed.
If you have a data folder with the dll in it, try removing it. On the other hand, if you don't have a data folder with it in it, try creating the folder in the same folder that the exe is in.
09-17-2008 05:09 PM
Hi Dennis,
The driver that I'm using I downloaded from the Keithley website and is for the DMM 2015 THD Model. I installed the drivers which puts the appropriate files under the C:\VXIpnp\ folder and the ke2015.llb file under C:\Program Files\National Instruments\Labview 8.5\instr.lib\. I always copy my library files(.llb) into my application directory so I can bring them in with the executable when I'm building and packaging the application (should I not do this?). In my previous post I stated that I had the .dll file from the C:\VXIpnp directoy in my application directory. I did this cause I thought I needed to include the DLL with the executable but apparently that is not the case. So right now all the files are on their appropriate directories:
.fp, .dll, .h files are in C:\VXIpnp
But I still have the issue of the exe not working. I should mentioned that I'm controlling other devices using regular VXI drivers and they work fine in the exe. Only the IVI driver device is giving me issues.
09-17-2008 05:14 PM
09-18-2008 09:23 AM
09-19-2008 10:54 AM
So I got additional info on what's happening in my program. I used NI-SPY (never used it before... don't know why cause is a pretty good tool) and I found out that the VI that is configuring my device using the IVI driver is closing the reference to my device when it gets unloaded. This is not desired in my program. Let me explain a bit more what I'm doing...
I have a custom test manager. It comes up and it opens sessions for all HW devices connected. I do this by calling a set of configuration VI's by reference (passing in their name) for each instrument. When I'm done initializing I close the reference to the configuration VI. With a normal driver this leaves the open reference to the HW in memory and I use it later to do my measurements without any problem. However, this doesn't work with the device using the IVI driver. As soon as the configuration VI leaves memory so does the HW reference created. I can even see a viClose being executed in NI-SPY.
I also discover another interesting behaviour. In the development environment if I open the reference to the IVI driver let say for GPIB0::16::INSTR then it returns GPIB0::16::INSTR(1) as a refnum. If I go back and manually select the refnum name from the resource name list on my measurement VI then the VI works properly even if the original configuration VI is closed. Apparently this IVI driver device needs the refnum NOT the resource name to be passed into it in order to work. Does anyone know how to pass in the refnum vs. the canonical visa resource name??
I hope I explain myself properly... cause it's kind of complicated.