The recommendation is to use the Reset MAX Database
option to remove any disconnected hardware from NI-MAX, this option is an executable accessible on the paths shown here
Once you've located the paths, you could use the Terminal/Consolve.vi
in your LabVIEW program to run the executable from there and reset NI-MAX. Once the reset process has completed, the disconnected/unused devices will be deleted from the database.
Take into consideration that this process will also delete other information such as DAQmx Tasks, Custom Scales, and DAQmx Global Virtual Channels, but there's always the possibility of create a backup
for all that information.