Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
1 ratings:
 3 out of 5   

Find DAQmx Resource Name of a Modular Instrument from VISA Alias

Primary Software:
Primary Software Version: 3.8
Primary Software Fixed Version: N/A
Secondary Software: Utility Software>>Measurement & Automation Explorer
Hardware: Switches>>Multiplexer/Matrix>>PXI-2532

I am using the NI-SWITCH and the Init with to open up a driver session to my PXI-2532. I would like to use the string “PXI1::5” to open a session to my switch in chassis 1 slot 5. However, the driver throws Error -1074118644 "Insufficient location information [...]" every time I use that string. If I use the NI-DAQmx device name "Dev1," the switch session opens without errors.

According to Knowledge Base 4MJEIND4, VISA aliases such as "PXI::5" are only supported for switches that are programmed with Traditional NI-DAQ.  In this case, my switch uses the DAQmx driver and requires the Resource Name of the device.  In this case, I am writing code to be distributed to customers who would prefer to use the chassis and slot number to identify their devices.

Is there a way that NI-SWITCH functions will accept the “PXI1::5” string?

There is no direct way for the NI-SWITCH driver to accept the address string if you are working with switch hardware addressed by the DAQmx resource name. However, if you are not interested in using the DAQmx resource name, you can programmatically use the chassis and slot number along the with ModInst driver functions to find the DAQmx resource name, as seen in the LabVIEW 2016 VI attached below.

NI-ModInst is a component that you can use to query information about National Instruments modular instruments installed in your system. NI-ModInst provides a programmatic way to determine the number, names, models, and other attributes of devices in your system that are supported by a specified driver. You can use the NI-ModInst API in applications you develop using LabVIEW, LabWindows™/CVI™, Measurement Studio, or ANSI C.

In general, you provide the name of a National Instruments instrument driver to NI-ModInst. Examples of instrument drivers include NI-SWITCH, NI-SCOPE, NI-FGEN, and NI-DMM. NI-ModInst searches the system and finds all the devices that are supported by that driver. You can query NI-ModInst for the number of installed devices, the device names, product models, serial numbers, chassis numbers, slot numbers, bus numbers, and socket numbers. The ModInst functions can be found on the block diagram by navigating to the NI-ModInst VI palette: Functions»Instrument I/O»Instrument Drivers»NI-ModInst

The basic process for determining the DAQmx resource name for your MI devices is:
  1. Use a string control on the front panel, in which the user will enter a string with the "PXIa::b::INSTR" or "PXIa::b" address.
  2. Parse the string to determine the instrument's chassis and slot number.
  3. Programmatically compare these values to the chassis and slot numbers of every switch device in the system, as reported by the ModInst functions. 
  4. When a match is made, the index number for the device can be wired to the ModInst Get Attribute function and return the DAQmx device name. 
  5. The device name will be the "Devx" or "PXIxSlotx" logical name provided by MAX. That string can then be wired to the resource name input of an NI-SWITCH Initialize function, for example.
**Additional Note:  In the example VI, there is also error handling to allow for a mismatch of the VISA alias string with the physical location of the Modular Instrument type.  So in the case of searching for DMM's in "PXI2::3" when the actual location is Chassis 2, Slot 4, the VI will report that 1 device is found, but the location is incorrect.

Related Links:
Knowledge Base 4MJEIND4: Error -1074118644 (0xBFFA400C) Using an NI Switch
Knowledge Base 3KK599LE: How Can I Programmatically Get Information from Modular Instruments?


Report Date: 11/07/2008
Last Updated: 07/05/2017
Document ID: 4R6ES99G

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit