Switch Hardware and Software

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get the logical name of a device from MAX 3.0 in my application?

I am developing a ATE application using VC++. I want to get the logical device name from MAX 3.0 in my program when it starts. How can I do?
0 Kudos
Message 1 of 8
(9,009 Views)
Do you know which type of device you are using? If you are referring to IVI logial names, you can use the IVI configuration store API to retrieve. If they are DAQmx based devices, the DAQmx API has ways to get the info you want. Give a little more info and I think someone will be able to help.
Message 2 of 8
(9,009 Views)
Which API?Could you give me some examples?Thanks!
0 Kudos
Message 3 of 8
(9,009 Views)
The simplest way to know would be to see where you've configured the devices in the Measurement and Automation Explorer (MAX):

- in the "IVI Drivers" section of the tree? You will use the IVI config store API to retrieve the names. This API is maintained by the IVI Foundation at ivifoundation.org.

- If you are using VISA names, they would be configured under the PXI System portion of the tree. You can use the NI VISA API (using their "find resource" functionality) to enumerate your devices.

- If you are using DAQmx-based devices, they would be configured under the DAQmx Devices portion of the tree in MAX. DAQmx supplies a function or set of functions for enumerating this information.

- If you are using traditional NI-DAQ devices
(again with traditional DAQ in the tree), there are also ways to enumerate the devices using the NI-DAQ API and GetDAQDeviceInfo.

If we have more information on what devices you are trying to enumerate and how they are configured we can potentially point you to an example program or more specific means of getting the information that you need.
0 Kudos
Message 4 of 8
(9,012 Views)
I am using DAQmx-based devices such as SCXI-1161 and SCXI-1166 modules.The default names of switch modules are given by MAX as "SC1Mod1","SC1Mod2","SC1Mod3",etc.I am using these names to control the modules in my application.For example,I initialize the first switch module in my application as niSwitch_InitWithOptions("SC1Mod1",...). But when I change any module name in MAX,the application doesn't work.
I want to know what DAQmx APIs have the function to get module name from MAX.Using these APIs,my application can get the changed name automatically.
0 Kudos
Message 5 of 8
(9,009 Views)
Assuming that you are using the C API, you can use DAQmxGetSysDevNames to return the list of all device names and then use the DAQmx_Dev_ProductType and/or the DAQmx_Dev_SerialNumber attribute to determine if it is the device that you are looking for. Those names can be passed directly to niSwitch_InitWithOptions.

Similar functionality is available wherever DAQmx is supported (for example, you can do this with LabVIEW, C++, CVI, Measurement Studio, etc)
0 Kudos
Message 6 of 8
(9,009 Views)
Thank you very much!
0 Kudos
Message 7 of 8
(9,009 Views)
Hi Zhang ShengWei,
 
I was going through the similar situation and I have created a LabVIEW vi to convert VISA Address (PXI0::10::INSTR at Slot 6) into Traditional Name (DAQ::6). According to NI the Slot # is used to assign Device number unless otherwise changes by the user. This VI will only work for default settings that is given by the MAX.
 
Iqbal Sihra
0 Kudos
Message 8 of 8
(8,734 Views)