Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

NI IVI DMM problems

I have an NI 4050 DMM card that I'm trying to use in VB.NET.

I've installed everything that appeared necessary from the CD provided with
the card, and created an IVI logical device, which when put into the ActiveX
property pages of a ComponentWorks IVI DMM control gives me a working DMM on
my form, on which I can use the built-in controls to take readings on the
differnt modes.

However, I'm completely unable to do anything with it through software. The
following transcript, done in a command window with the app at a breakpoint,
pretty much shows all. Note that these commands were executed in an app in
which the control was operating, and was firing the "ReadComplete" event
every time I pressed the "single read" button, so the object was there even
though .init complains that it isn't. Can anyone suggest anything?

ni_dmm.configure
Run-time exception thrown : System.Runtime.InteropServices.COMException -
Exception from HRESULT: 0x800A01A9.

debug.writeline(ni_dmm.autoconfigure)
Run-time exception thrown : System.Runtime.InteropServices.COMException -
Invalid property value

debug.writeline(ni_dmm.read)
Run-time exception thrown :
System.Reflection.TargetParameterCountException - Invalid number of
parameters.

debug.writeline(ni_dmm.read())
Run-time exception thrown :
System.Reflection.TargetParameterCountException - Invalid number of
parameters.

debug.writeline(ni_dmm.timeout)
1090781184

ni_dmm.timeout = 1090781183

debug.writeline(ni_dmm.timeout)
1090781184

debug.writeline(ni_dmm.range)
Run-time exception thrown : System.Runtime.InteropServices.COMException -
Invalid property value

ni_dmm.init
Run-time exception thrown : System.NullReferenceException - Object reference
not set to an instance of an object.

ni_dmm.initiate
Run-time exception thrown : System.Runtime.InteropServices.COMException -
Exception from HRESULT: 0x800A01A9.


--
Dr. Craig Graham, Software Engineer
Advanced Analysis and Integration Limited, UK. http://www.aail.co.uk/
0 Kudos
Message 1 of 2
(4,126 Views)
Hello,
The CW IVI controls are not supported in the .NET environment. To use an instrument driver DLL in a Visual Basic .NET or Visual C# project, you must use the DllImportAttribute class in the project. Refer to the Microsoft .NET Framework help for information about the DllImport attribute.
For information about the functions in each instrument driver, refer to the corresponding help file installed with each driver.

Please look at the following web page to learn how to use the IVI Specific Drivers in Visual Basic 6.0, Visual Basic .NET, or Visual C# .NET Applications:

http://zone.ni.com/devzone/conceptd.nsf/webmain/F8F4698C5D72B73686256B9D00516F24?opendocument

Regards

Russell B.
Applications Engineering
National Instruments
Director of Engineering
G Systems, www.gsystems.com
Certified LabVIEW Architect
Certified LabVIEW Embedded Systems Developer
Certified Professional Instructor
GCentral
0 Kudos
Message 2 of 2
(4,126 Views)