Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

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

HI Dave,

NI R&D will attempt to reproduce this issue.  In addition to Jared's questions can you help us with the following?

1. Since reinstalling NI-DMM .NET Class Libraries have you attempted to run your code again to see if the same error as before is reproducible (-1074135030)?

2. Do you have a code snippet you can share with us?

 

Thanks!

Brandon G

National Instruments
Precision DC Hardware Engineer
0 Kudos
Message 11 of 20
(2,815 Views)

Hi Jared,

 

I unplugged all the other modules and the example program worked.  I tried to isolate which module was giving the trouble but ended up plugging them all back in and it continued working.  Perhaps plugging and unplugging was enough to solve a problem.

 

My modules are installed in the following order (all PXIs of course): 8360, 2575, 2569, 4072, 6259, and 6509.  Thet are in a 1042Q chassis.

 

I have a copy of the dll used in the old system niddd_32.dll.  Windows properties say that it is date 2/24/2007 and is version 2.7.0.49153.

 

Now that the example program is working, I intend to delve into what it is doing and how it differs from my old code.

 

I am trying to attach that c# module to this reply (it wouldn't work before, and this time I'm the.cs extension to .txt)

 

Please stay tuned,

 

Dave

0 Kudos
Message 12 of 20
(2,809 Views)

Hi Brandon,

 

I am grateful for your attention to this problem.  I did not see your question until after I posted a reply to Jared's last question.  You'll want to look at that.

 

Yes I tried my code after installing the libraries and it gives the same error.

 

Please stay tuned,

 

Dave

0 Kudos
Message 13 of 20
(2,808 Views)

Hi Brandon and Jared,

 

I started to compare the example to my old code.  Zowie! Big differences.  They call different classes altogether.  Do I have to change all my code to use the class in your example?  What can we do to get my old calls working?

 

I realized too that you should also have my "MuxMeasure.cs" file.  This combines the functionality of the mux to select input channel with the type of measurement which, in turn, decides whether to use the DAQ or the DMM (encapsulating all measurements in the one MuxMeasure object).  In particular you'll want to look at the function dmmMeasure().  You'll see comments to Elizabeth, the NI engineer who helped me get that going 5 yrs ago.

 

So, what do you suggest?

 

Dave

0 Kudos
Message 14 of 20
(2,806 Views)

Hey Dave,

We were able to build a simple DMM application today using the niDMM.cs class you attached to the forums.  We were able to successfully use this in VS 2010 as well as Visual C# Express 2012 without issue.  Please try running the attached code and let us know if any errors occurs.  Also, be sure to change the instrument descriptor either in the code or in MAX we're pointing to the right instrument.  

 

Can you tell us what errors you're seeing in your code set since you have reinstalled your hardware and eliminated the GUID error?  Are you still getting the same "PInvoke error -1074135030, "Failure loading driver module" with your code?

 

Generally, you do not want to copy over dlls manually because of the number of dependencies between the high level dll and the low level driver dlls.  It's very possible that one dll maybe misaligned in version to another, or missing altogether.  That being said, I'm wondering why the force reinstall did not fix this.  We should no more once we understand if the example we created works or not.

 

Thanks Dave,

 

Brandon G

National Instruments
Precision DC Hardware Engineer
0 Kudos
Message 15 of 20
(2,763 Views)

Hi Brandon,

 

Your sample prog with my dmm module worked fine on my system.  I ran my prog yet again on the same system and, yes, I got the same error "PInvoke error -1074135030".  I noticed that your program instantiated the dmm differently.  I did

 

dmm =newniDMM(dmmDeviceName, true, true, "");

 

but you did false, false.  But even when I changed mine to your false, false, I still got the same pesky -1074135030.

 

I confess that I did sprinkle that old dll around on this computer, but that was before installing niDMM and the libraries.

 

Thanks again for your quick replies.  Looking forward to your next,

 

Dave

 

 

 

0 Kudos
Message 16 of 20
(2,756 Views)

Hi Dave,

I was able to reproduce the error you're seeing by placing nidmm_32.dll from DMM 2.7.2 in the directory of my project. The project you are running will first check the local directory before looking in the system directory for the appropriate dll.  I suspect that you have an old copy of the nidmm_32.dll in a location that your program is trying to access before looking in the system directory.  I would remove any dmm dlls that are located in your project directory and see if you are then able to run your project.  Let us know what you find once you've had a chance to check this out.

 

Thanks!

Brandon G

National Instruments
Precision DC Hardware Engineer
0 Kudos
Message 17 of 20
(2,745 Views)

Bingo!

 

That gets me past that problem.   I think it''l be smooth sailing from here, but I'd prefer to leave this thread open for a little while in case I run into other bumps.  It may even be a few days before I can mate this up with the rest of the hardware to see if it really runs.

 

If you don't hear from me in two weeks then, please go ahead and close this and call it solved.

 

Thank you very much,

Dave

0 Kudos
Message 18 of 20
(2,740 Views)

Hey Dave,
Glad to hear we got you up and running.  This thread will remain open indefinitely, so if you have any issues even a year+ down the road you should still be able to reference this post.

 

Cheers!

Brandon G

 

National Instruments
Precision DC Hardware Engineer
0 Kudos
Message 19 of 20
(2,738 Views)

Hi Brandon,

We are setting up a simple test using the PXI-4071 and the PXI-2575 under C# for dotNET on Win7 with Measurement Studio and VS2010.  I have read this thread with interest,  as it has been very frustrating setting up such a simple test.  Are we missing a much simpler method?

 My coworker and I just implemented a 1000 channel system and a 400 channel system with these PXI modules, in LabView with apparent ease, so I was hoping it would also be straight forward in Measurement Studio/DAQmx.

Thank you for any insight you can provide -- in the mean time I will try your sample code.

Marvin

0 Kudos
Message 20 of 20
(2,680 Views)