To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This VI utilises the System Configuration API to search a local machine's resources to find the DAQmx Device alias based upon the product name.
Description
This is useful as a NI USB-6212 may appear as 'Dev1' on your machine, but have the name 'Dev2' auto-assigned on another.
Requirements
Software
Hardware
Steps to Implement or Execute Code
Additional Information or References
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
How could I change the Device Alias like this: "Dev1/ai2" ?
It sounds like you're describing a Physical Channel rather than a device, you can do it a number of ways. If you want to extract all of the physical channels available to the device, you can use a DAQmx Device property node. Otherwise just treat the device name like a string and typecast to the correct datatype (you can also wire a string to DAQmx Create Virtual Channel, so don't necessarily need to convert back).
I, too, would like to use the results of the Find Hardware routine to create a channel for a DAQmx task. I am using LV2018, and when I run the Show All Hardware.vi from the examples, I get back aliases that are strings that look like 8 digit hexadecimal numbers. If I concatenate such a string with a port0/line0:7 and send to DAQmx Create Channel.vi, I get a -200220 error, "Device identifier is invalid". I have also tried typecasting the alias to a physical channel, concatenate it with port0/line0:7, and typecast it again, to more closely follow the example above, but with the same result. Any ideas why it's not working?