Solution
You can remove disconnected devices from NI-MAX using one of the following methods:
Option 1 – Use the NI System Configuration API
Use the NI System Configuration API to programmatically identify and remove disconnected hardware from the NI-MAX database.
- Use the API to query all system hardware resources.
- Use the Device & Chassis >> Is Present property from the System Hardware Property Node to determine whether each device is currently present.
- Identify devices that return False for Is Present.
- Use Delete Resource.vi to remove those devices from the NI-MAX database.
The attached VI Find and Delete Missing Hardware.vi demonstrates this workflow. This VI is based on a modified shipping example and illustrates how to:
- Enumerate hardware resources
- Check device presence
- Delete missing devices
Select the appropriate delete mode in Delete Resource.vi based on your application requirements.
Option 2 – Reset the NI-MAX Database
Use the NI-MAX database reset utility to remove all disconnected hardware entries.
- Locate the NI-MAX reset executable on your system.
- Call the executable from LabVIEW using System Exec.vi.
- Allow the reset process to complete.
After the reset, NI-MAX will no longer display disconnected or unused devices.
Note: Resetting the NI-MAX database removes additional configuration data, including:
- NI-DAQmx Tasks
- Custom Scales
- NI-DAQmx Global Virtual Channels
To preserve this information, create a backup before performing the reset.