From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx not finding PXI-4071 DMM

MAX correctly shows my 2 devices, a PXI-2584 switch and a PXI-4071 DMM. However, when I call DAQmx.DaqSystem.Local.Devices(), only one name is returned, "Dev1" which is the name corresponding to the switch. I need to be able to get the device addresses programmatically since I'm delivering multiple systems and hard-coding the names is not practical. This error appears on two different units, so I don't believe it's a hardware or driver problem. Can anyone help me solve this?
 
James
 
Configuration info:
  • NI-DAQmx version 8.7.1f2
  • NI-DMM version 2.72 (Soft front panel recognizes DMM)
  • NI-MAX version 4.1.1.49152
  • Windows XP Pro
  • NI-PAL Service Manager (Device Loader service) version 2.1.1.49152 is running
0 Kudos
Message 1 of 8
(5,615 Views)
Hi James,

I was unable to find that function in either the DAQmx C Reference Help, or the Measurement Studio Help.  You posted in the Measurement Studio for .NET Languages, but what programming language are you using?  I found these functions in the Measurement Studio and DAQmx C Reference help files respectively.

Measurement Studio

Device.DeviceID Property
which gets the name of the device, as configured in Measurement & Automation Explorer (MAX), to which this operation applies.
[Visual Basic]
Public Property ReadOnly DeviceID As String
[C#]
public string DeviceID {get;}
 
DAQmx C Reference
 
DAQmxGetSysDevNames

See if you can use any of these functions to recognize the 4071.

Rod T.
0 Kudos
Message 2 of 8
(5,597 Views)

Rod,

I'm using Visual Basic in Visual Studio 2005 with .NET Framework 2.0.

It appears from NI's documentation that the C function "DAQmxGetSysDevNames" provides the same functionality as the Visual Basic method "DAQSystem.Local.Devices". Both obtain a string array of MAX-recognized device names.

NI provides a sample VB solution, ListDevices.2005.sln, which uses DAQSystem.Local.Devices. When I ran this sample, I got the erroneous results. Unfortunately, I couldn't find a matching sample using the C library, so I recruited my C++ counterpart here to create and run a test using DAQmxGetSysDevNames. The results are the same.

At this point I'm getting the same results on 4 different units using two different languages. The PXI-4071 never appears! Could this be a bug in the latest NI-DAQmx or NI-DMM software?

James

0 Kudos
Message 3 of 8
(5,579 Views)
Hey James,

Try upgrading to NI-DMM 2.8.  You can download the latest driver here.  I need to track down a PXI 4071 to try it out myself, but I do have version 2.8.  Let me know if you still do not get the device name after upgrading. 
Rod T.
0 Kudos
Message 4 of 8
(5,567 Views)
Rod,
 
Unfortunately upgrading to NI-DMM 2.8 did not solve the problem.
 
As an interesting aside, the hardware came with version 2.5 -- shouldn't the PXI-4071 have been compatible with every version since then? Also, my latest Developer's Suite quarterly release (2nd quarter 2008) has version 2.7.1, but the 2.8 download is dated Jan 2008. Very curious??
 
At any rate, I hope you can  continue to work with me on this.
 
James
0 Kudos
Message 5 of 8
(5,556 Views)
Howdy James,

Since DMM drivers act more like instruments than DAQ devices, you will need to make a call to the NI-ModInst API to retrieve the device models and corresponding device names for your modular instruments (DMM's, FGen's, Scopes, etc). In LabVIEW the niModInst Get Installed Device Attribute.vi can accomplish this; the equivalent function in C is niModInst_GetInstalledDeviceAttributeViString().

References:
KB 3KK599LE: Using NI-ModInst to Query Device Specific Information
NI-ModInst Help (located at \labview\help\niModInst.chm)


Message Edited by pBerg on 07-31-2008 03:00 PM
Warm regards,

pBerg
Message 6 of 8
(5,531 Views)

pBerg,

Thanks a million for pointing me in the direction of NIModInst (instead of NI-DAQ). It works and my problem is solved.

The sample VI's are in LabVIEW and I use Visual Basic, so I had to dig a little to find the DLL calls I needed. (The sample VIs' block diagrams are password protected - usually I just look at the parameters of a DLL call node.) It didn't take long to find the info I needed on the NI web site. The DLL is NIModInst.dll in the IVI\bin folder.

niModInst_OpenInstalledDevicesSession opens a session.

niModInst_GetInstalledDeviceAttributeViString gets the name, model and S/N of a device.

niModInst_CloseInstalledDevicesSession closes the session.

There's more, but that's all I need for now. I'm a happy camper - although I still wonder how this gets to be problematic when it's supposed to be easy?

James

0 Kudos
Message 7 of 8
(5,525 Views)
Hi James,
 
I'm glad that your problem is solved and you are happy.
 
If you are working with Visual Studio 2005/.NET 2.0, I suggest that you take a look at the .NET API that we provide for the NI-ModInst library. This can be installed as part of the .NET API for NI-SCOPE, which you can download from here . You can specifically take a look at the NI-ModInst example called ListDevicesConnectedToSystem that shows how to programmatically see all the Modular Instrument devices (all or of a particular type, which in your case is NI-DMM) conencted to the system. You can use the classes and methods in NationalInstruments.ModularInstruments.SystemServices.DeviceServices namespace from the NationalInstruments.ModularInstruments.ModularInstrumentsSystem.dll assembly.
 
If you are using NI-DMM in .NET, then I suggest that you take a look at the .NET wrappers for NI-DMM that we provide here. Though, this is not a .NET API like the one for NI-ModInst mentioed above, it will at least save the trouble of finding out the C API, function names, parameter types etc for you.
-Mahesh
National Instruments
0 Kudos
Message 8 of 8
(5,511 Views)