Configure an NI device
Connect National Instruments DAQ hardware to the Driver and configure it for tasks.
The Driver connects to National Instruments hardware that works with NI-DAQmx: CompactDAQ chassis and modules, USB and PCIe DAQ devices, and PXI. It finds them through NI-DAQmx. Before a task can use a device, you configure it.
Prerequisites
- Supported
- WindowsLinuxNI Linux RT
- Not supported
- macOSDocker
- Install NI-DAQmx on the computer that runs the Driver. If the Driver says that System Configuration is missing, install NI System Configuration.
- After you install, restart the Driver.
How the Driver finds devices
The Driver looks for NI devices every few seconds. A device shows in the devices toolbar with:
- Name ->
NIand the model, such asNI 9205orNI USB-6343. - Location -> the name of the device in NI-DAQmx, such as
Dev1orcDAQ1Mod1. The Driver uses it to address the ports of the device, such asDev1/ai0.
The key of an NI device is its serial number. Modules show under their chassis. The Driver skips CompactRIO controllers, but it finds the modules in them.
To stop the search, right-click the Driver in the devices toolbar and select Toggle NI device scanner.
Configure a device
Console
Python
TypeScript
- In the devices toolbar, right-click the device and select Configure. You can also click Configure in the “New … connected” notification. To list each device that the Driver found, click and select NI hardware.
- Enter a Name and an Identifier, or click one of the identifiers that the Console suggests.
- Click Save. To also open a read task for the device, click Save and create read task.
Configure each module that a task uses.
Find the NI devices that the Driver found:
for dev in client.devices.retrieve(makes=["NI"]):
print(dev.key, dev.name, dev.model, dev.location)Configure devices in the Console.
Find the NI devices that the Driver found:
for (const dev of await client.devices.retrieve({ makes: ["NI"] }))
console.log(dev.key, dev.name, dev.model, dev.location);Configure devices in the Console.
Do not create NI devices in code. A device that you create has a different key than the device that the Driver finds, and the Console cannot use it.
Troubleshooting
- The device does not show in the devices toolbar.
- Cause
The Driver cannot load NI-DAQmx, or it skips the device.
- Fix
- NI-DAQmx is not installed -> install NI-DAQmx and restart the Driver.
- The device has no name -> check that NI MAX shows the device with a name. The Driver skips a device that has no name.
For more causes, see Troubleshoot hardware.
- Cause
The Driver cannot load the libraries. The task shows “Failed to create task”, with this text in the description.
- Fix
- Install the software in the prerequisites.
- Restart the Driver.
- Cause
The Driver lost the connection to the device. The task shows “Failed to read data” or “Failed to write commands”, with this text in the description.
- Fix
Check the cable and the power. The task continues when the device comes back.
For other problems, see Troubleshoot hardware.