Jump to content

Programmatically finding devices


Jim Kring

Recommended Posts

I am trying to programmatically generate a list of information about all NI hardware installed on a machine. I want to be able to read the model and serial number of these devices so that this info can be sent to a corporate database. I am dissapointed by the fact that the list of devices returned by the DAQmx System::Devices Names property is not complete.

post-17-1131765549.png?width=400

When I go to MAX, I see a list of about 7 DAQmx devices, but the DAQmx System::Devices Names property shows only two. Why would this be?

I did find a set of VIs under the NI-SCOPE palette called NI-ModInst that looks interesting.

post-17-1131765359.png?width=400

It looks like this set of VIs can programmatically obtain device info for NI-SCOPE, NI-FGEN, NI-DMM, NI-HSDIO, NI-SWITCH, and NI-RFSG instruments.

post-17-1131765490.png?width=400

This did find two of my high-speed digitizers as NI-SCOPE devices, but it failed to find my Arbitrary Waveform Generator (ARB) board as an NI-FGEN device and my digital multimeter (DMM) board as an NI-DMM device.

Any thoughts?

:headbang:

Link to comment
Any thoughts?

I don't have much insight but that sounds like a pretty practical idea to have an inventory system.

Have you talked w/ NI about this? I wonder what those ModInst VI's are actually for, because it doesn't make sense that they wouldn't find your hardware if that's what they were for. Obviously whatever MAX uses to enumerate the hardware devices would get you the info you're looking for and it's a question of whether or not those enumeration functions are available in LabVIEW through some interface.

I don't have the ModInst files handy at the moment but it might be interesting if they use some DLL's (from MAX or something)... to see if the DLL's have other functions that might do what you want.

Link to comment
I don't have much insight but that sounds like a pretty practical idea to have an inventory system.

Have you talked w/ NI about this? I wonder what those ModInst VI's are actually for, because it doesn't make sense that they wouldn't find your hardware if that's what they were for. Obviously whatever MAX uses to enumerate the hardware devices would get you the info you're looking for and it's a question of whether or not those enumeration functions are available in LabVIEW through some interface.

I don't have the ModInst files handy at the moment but it might be interesting if they use some DLL's (from MAX or something)... to see if the DLL's have other functions that might do what you want.

MAX uses a COM like infrastructure to enumerate those devices. Each type of hardware interface has a DLL implementing a resource enumerator and property manager of some sort. This DLL knows how to invoke the low level interface specifiek enumerator functions of the respective interface library, which are different for every interface.

The enumeration interface for the old NI-DAQ for instance was accessible through the DLL nicfq32.dll and its LabVIEW implementation was inside the NI-DAQ channel viewer support library in project/_res.llb in LabVIEW 6.1 and earlier. Of course password protected and as such almost useless.

Rolf Kalbermatter

Link to comment

Rumor has it that NI had a VI for the old NI-DAQ that did exactly this type of enumeration of all DAQ devices currently registered to the system. It was not a public VI. Can't say much more, but the functionality existed. Finding and sweet talking the right NI developer might help. Occasionally some of them have whipped up a custom VI for me (sometimes locked, sometimes not) that did stuff I requested that was not in the public view.

Good luck.

Link to comment
  • 4 weeks later...
This did find two of my high-speed digitizers as NI-SCOPE devices, but it failed to find my Arbitrary Waveform Generator (ARB) board as an NI-FGEN device and my digital multimeter (DMM) board as an NI-DMM device.

Hello,

NI-ModInst is what you should use to enumerate any of the Modular Instruments. The problem you're seeing may be due to the fact that it is fairly new, and depending on what versions of the drivers you have installed, the needed files weren't there. I believe NI-Scope was the first instrument driver to install NI-ModInst. I'm not sure when NI-FGEN added support but I know NI-DMM only added it in NI-DMM 2.4. 2.4 was released earlier this year so you'd need either NI-DMM 2.4 or NI-DMM 2.5 to be able to use NI-ModInst for DMM's. The latest NI-FGEN should work for your ARB.

Mark

NI DMM Software

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.