To find 1 device name, use the following flow:
- A DAQmx System property node can be used to find the device name.
- A DAQmx Device property node can be used to determine the product type, which can be matched against a string containing the desired device model name.
- A For Loop with Conditional Terminal checked is used to iterate through all the device names in the system and stops when the first device name match is found.
- When the loop stops, the device name is passed out of the loop and the channel is appended to the end of the string through Concatenate Strings.
- The resulting string can be used as the physical channel input for DAQmx Create Channel VI
Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram. If multiple devices of the same model are installed, modify the code to use a
Conditional Indexing Tunnel on the
For Loop.
Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.
Additional Information
These snippets will only only work with NI DAQmx devices. If you need to find other devices you should consider using the NI System Configuration API.
If you are distinguishing between more than one of the same device, you can use a hardware property node to compare the device's serial number to select the correct device. If only one device is present but several are listed in NI MAX, you can use the "Is Present" method from a hardware property node or error validation.