02-16-2009 12:30 PM
I'm writing a Labview code using NISWITCH 3.8 drivers. When I try to open any vi from niSwitch.LLB I get an error message "Error loading niswitch_32.dll. A DLL initialization routine failed".
I've tried to repair the drivers, even uninstalled them and deleted niswitch_32.dll from the location it was residing (C:\Program Files\IVI Foundation\IVI\Bin), installed the NISWITCH 3.8 drivers anew, but that did not help.
Please, suggest what else could be done to solev the problem.
Regrads,
E Stoykova
02-16-2009 02:24 PM
Hi E Stoykova,
To better assist you in discovering why niswitch_32.dll is failing to initialize, can you run Dependency Walker and save the file? I've attached an example .dwi file. Create a zip file to attach the .dwi file to a forum post.
1. Download Dependency Walker from: http://dependencywalker.com/
2. Run Depends.exe and select File->Open...
3. Browse to C:\Program Files\IVI\Bin\niswitch_32.dll
4. Save niswitch_32.dwi, zip, and post niswitch_32.zip
Thanks!
Chad Erickson
Switch Product Support Engineer
NI - USA
02-16-2009 02:37 PM
Hi Chad,
Here is the zipped dwi file.
Thanks,
E stoykova
02-16-2009 03:25 PM
Hi E stoykova,
From what I can see, your installation went okay. Let's see if we can find out the reason why you're getting the error when loading the DLL.
Next Step
1. From Dependency Walker, select File -> Open... C:\Program Files\National Instruments\LabVIEW x.x\LabVIEW.exe.
2. Select Profile -> Start Profiling...
3. Click OK. When LabVIEW finishes opening, click Blank VI.
4. In LabVIEW, select an NI-Switch VI and drop it on the block diagram. I'm expecting you'll get "Error loading niswitch_32.dll. A DLL initialization routine failed".
5. In Dependency Walker, select Profile -> Stop Profiling
6. Save LabVIEW.dwi, zip, and post LabVIEW.zip
Thanks!
Chad Erickson
Switch Product Support Engineer
NI - USA
02-16-2009 03:46 PM
Hi Chad,
Here is the LabVIEW.zip file.
Thanks,
Eli Stoykova
02-16-2009 04:48 PM - edited 02-16-2009 04:51 PM
Hi Eli,
Thank you for your continued assistance troubleshooting this issue.
It is possible that this issue is not niswitch_32.dll-specific. Other Modular Instrument drivers could also be affected. It will be easier to find the cause of the problem if we can determine the issue is niswitch_32.dll-specific. To verify this, can you see if you get an error when dropping a VI from one of the following MI driver versions (listed below) on the LabVIEW block diagram?
NI-DCPower 1.3 (http://joule.ni.com/nidu/cds/view/p/id/1206/lang/en)
NI-DMM 2.9 (http://joule.ni.com/nidu/cds/view/p/id/1094/lang/en)
NI-SCOPE 3.5 (http://joule.ni.com/nidu/cds/view/p/id/1096/lang/en)
If you do not have these versions installed, you can install them from the links above.
For reference, can you note what driver versions you have installed now? You can simply create and attach a MAX report (File->Create Report...).
Thanks again and best regards!
Chad Erickson
Switch Product Support Engineer
NI - USA
02-16-2009 05:39 PM
Hi Chad,
Please, find the attached files - LabVIEW DMM. zip and max_report.html.
The application I'm working with uses both niswitch 3.8 and nidmm 2.9 drivers. I do not have any problems with the DMM drivers, only with the Switch drivers and only recently (I was working with them for about 2 months without any problems).
Please, let me know if I can give you any additional information that will help.
Thanks,
Eli
02-17-2009 11:21 AM
Hi Eli,
It's interesting you were working with the drivers for 2 months with no issues. Has anything changed on your system recently?
I want to provide you a special version of the niswitch_32.dll that we can use for troubleshooting purposes. Would you be willing to use this and send us a resultant log file?
Thanks!
Chad Erickson
Switch Product Support Engineer
NI - USA
02-17-2009 11:53 AM
Hi Chad,
Yes, two things happened on the day that this problem occured. First, there was some remote patching and reboot done by the IT department on the computer that I'm working with. I'm not aware what exactly have changed, but this is a procedure which happens fairly often and never had caused any problems up to now. Second, immediately after the patching I tried to open an older version of the application I'm working on - this older version was written on LabVIEW 7 and uses older versions of both DMM and SWITCH drivers. At that point I got the error message "Error loading niswitch_32.dll. A DLL initialization routine failed" for the first time. Then I started to get the same message even when I tried to use the most recent version of my application.
Sure, please send me this specilal version of the niswitch_32.dll that we can use for troubleshooting. I'm willing to give it a try since I do not know what else could be done (besides uninstall/install LabVIEW again).
Oh, and one more thing, the file niswitch_32.dll resides on my computer on C:\Program Files\IVI Foundation\IVI\Bin, not on C:\Program Files\\IVI\Bin.
Thanks,
Eli
02-17-2009 02:03 PM
Eli,
have you established where the problem is: is it niSwitch_32.dll that cannot be loaded, or is it LabVIEW that can't load it for some reason?
Can you run any other application that uses niSwitch? What happens if you run the NI SWITCH soft front panel? (Granted, it is developed in LabVIEW but it may shed some light on the problem if it works/does not work.) What happens when you try to self-test or reset the switch device from MAX? All these exercise the driver at different levels, and may help in troubleshooting.
Also, the location of your DLL (IviFoundation or no IviFoundation) only depends on the IVI version first used on that system, and is irrelevant. You should be fine with the one you have, as long as you do not change it.
best regards,