Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

DMM PInvoke error -1074135030 in C#, worked before migration

I get a DMM PInvoke error -1074135030, "Failure loading driver module"

 

The error occurs with the following call:


pInvokeResult = PInvoke.InitWithOptions("Dev5", System.Convert.ToUInt16(ID__Query), System.Convert.ToUInt16(Reset_Device), Option_String, out this._handle);

 

The call occurs  when calling new dmm in namespace InstrumentDriverInterop.Ivi.  I had trouble attaching my dmm C# module itself.  It is almost entirely from a very helpful Elizabeth at ni 5 yrs ago with very few changes from me.

 

This is with a PXI-4072 DMM in a Visual C# Express 2012 with .NET calls to drivers from NiDAQmx V9.5.1 and niDMM V3.0.6 running on Windows7.

 

The same code is still working on another laptop with Visual C# Express 2005, niDAQmx V8.5(I think) and an older version of niDMM running on WindowsXP. 


I am migrating the code to the newer OS, uSoft, and ni software.  I started with a clean install of Windows7 on a Dell laptop a few years old.  The previous dlls for niCommon, niCommonNative, and niDAQmx gave errors on the first build.  Installing V9.5.1 of niDAQmx didn't give me any new dlls.  I modified the install adding NET language extensions, and though the install said that it would not add the new stuff without Measurement Studio installed, it proceeded with the install anyway, installed the dlls, and I could add them as references to my C# project.  At this point niMAX was able to recognize 4 of the 5 PXI modules in my chassis for the first time omitting only the 4072 DMM.  Running my C# project caused an error saying it could not locate nidmm_32.dll.  I had the version of that dll from 2007 and I sprinkled it in every rational directory I could think of to no avail; it still could not find the d**m thing.  So I installed niDMM V3.0.6.  niMAX now recognized the 4072.  At first, it could not run the test panel but a reset solved that problem.  Running my C# project now gets past the nidmm_32 error but throws the exception detailed above.

So far online, the only useful suggestion I found was to delete and add the references again.  I did that, but am still stuck at the same spot.

 

Oddly, doing a "Simulated4072" instead of the "Dev5" doesn't work either and gives a different error.  Pretty sure that worked 5 years ago.

 

My bridge is a PXI-8360 with an ExpressCard.

 

I've worked with ni stuff for 15 yrs, most of it with CVI ( a text based programmer thru and thru, I hate Labview with a purple passion, but ni hardware is the best, hands down).  When we developed this system 5 years ago, we wanted the advantage of OOP and the far superior IDE of Visual Studio Express (boy oh boy, is it better than CVI: refactoring, intellisence, ...).  The Task and Channel business that came with niDAQmx was a big nuisance  ("Please just let me read the analog input...What the heck is a Task and why do I HAVE to have one?!"), but integrating niDAQmx with C# thru .NET was a breeze.  I recall that integrating the DMM was an entirely different animal, but with help from Elizabeth at ni (the code still has some comments for her around the PInvoke stuff), it came together and has worked like a champ for 5 yrs.

0 Kudos
Message 1 of 20
(6,406 Views)

Hi AnyDryRedPlease,

 

It is likely that your problem is a result of a corrupt installation of your NI-DMM driver.  I recommend that you perform a force reinstall of NI-DMM 3.0.6.  The article below describes the process:

 

Force Reinstall NI Software from Command Line (for Windows)
http://digital.ni.com/public.nsf/allkb/ADD22E807D5A12AD862579EC00760F79?OpenDocument

Below is the download page for NI-DMM 3.0.6 in case the setup file is no longer on your system:

NI-DMM 3.0.6

http://joule.ni.com/nidu/cds/view/p/id/3193/lang/en

Regards,

Jared R.
Precision DC Product Support Engineer
National Instruments
0 Kudos
Message 2 of 20
(6,384 Views)

Jared,

 

Thank you for your quick reply.

 

I did exactly as you instructed with no change in behavior.

 

What next?

 

Dave (AnyDryRed)

0 Kudos
Message 3 of 20
(6,371 Views)

Hi Dave,

 

I would like to see if you can successfully run a text-based shipping example.  These are installed with your NI-DMM driver under Start > Program Files > National Instruments > NI-DMM > Examples.  

Are you able to simulate the device in MAX? The link below describes the process:

NI-DAQmx Simulated Devices
http://www.ni.com/white-paper/3698/en

 

 

Regards,

Jared R.
Precision DC Product Support Engineer
National Instruments
0 Kudos
Message 4 of 20
(6,346 Views)

Hi Jared,

 

Thanks again for your quick reply. 

 

I created simulated devices for every module in my chassis (4 good, nice modules: a DIO, 2 switches, and a DAQ; and our bad boy DMM).  My C# app loads the 4 good ones fine, but gives the same error on the simulated DMM as it does on the real one.

 

Both the real DMM and the simulated one play perfectly well in MAX.  They, reset, test, and run test panels without a hitch.

 

I did not find any examples in the place you said, nor in any similar location under Program Files\NI\etc.  I did find plenty Labview(ugh) examples.  So, I'm no dummy, and I go to modify the install of Ni-DMM.  No dice there either.  The only things left uninstalled were more Labview support items.

 

Perhaps you could attach a few examples, or... maybe the lack of them points to something amiss in my Ni-DMM install, though there were no errors when I did the install.  If I remember correctly, I did not follow all the defaults, but instead chose to install a few items that were not included in the default settings.

 

Thanks again for your prompt responses.  Looking forward to your next one,

 

Dave

0 Kudos
Message 5 of 20
(6,333 Views)

Dave,

 

The CS examples actually are included with the following software package:

NI-DMM .NET Class Libraries 1.0.1
http://joule.ni.com/nidu/cds/view/p/id/2913/lang/en

Install this and try running a C# example.

Regards,

Jared R.
Precision DC Product Support Engineer
National Instruments
0 Kudos
Message 6 of 20
(6,315 Views)

Hi Jared,

 

I ran the voltage measurement C# project.  It works fine with the simulated DMM that I have - that's more than I could do before.  However, it does not work with the real DMM.  I get the following message:

 

ModularInstruments.NIDmm: Driver Device GUID not found error!  Please verify that the device driver is installed and started correctly.
Error Code : -1074118636

 

I get the same behavior with the Continuous Acquisition project.

 

Thanks agan for your prompt replies. 

 

What next?

Dave

0 Kudos
Message 7 of 20
(6,307 Views)

Dave,

 

Are you using the same PXI-4072 on the older machine with the working code or do you have multiple sets of hardware?  I would like you to perform a continuity test on fuse F1 on the PXI-4072 to see if it has been damaged.  The image below shows the location of the F1 fuse:

407x.jpg

Because the hardware works in a Test Panel, the problem seems to be software-related.  However, issues with F1 have caused this error in the past, so I just wanted to double-check.


Regards,

Jared R.
Precision DC Product Support Engineer
National Instruments
0 Kudos
Message 8 of 20
(6,300 Views)

Hi Jared,

 

Thx for the pic.  By golly, that's a tiny fuse.  On my board it is good.

 

This system worked before being mothballed 5 yrs ago.  The original Dell laptop has vanished thus forcing me to migrate the system.  A duplicate system in Asia was put into heavy use 5 yrs ago and is still chugging away - a testament to NI robustness.

 

I could perhaps rebuild the new laptop with WinXP and use my old software with old NI code and dlls, but I'd rather not take that big step backwards.  Migration should not be this difficult (sadly, a mark against NI on this one).

 

Good thing your turnaround time is quick.  This is our 4th(?) iteration.

 

Looking forward to hearing from you soon,

Dave

0 Kudos
Message 9 of 20
(6,290 Views)

Dave,

 

I am currently working with others within the company to determine the cause of your issue.  Could I possibly get a few additional details from you so I have a complete understanding of your system?

  • What PXI chassis are you using?
  • Can you provide the model numbers for the other PXI cards in your system?
  • Is it possible to find out which version of NI-DMM was installed on the XP machine?

I will let you know as soon as I have further suggestions for you.

Regards,

Jared R.
Precision DC Product Support Engineer
National Instruments
0 Kudos
Message 10 of 20
(6,281 Views)