03-25-2021 10:12 AM
So I looked through all the nodes I could find in the Advanced DAQmx menu. I can't find this most basic information, if a given device is currently physically attached to the computer.
I have an application on a laptop for various types of thermocouple boards. Other engineers use it for testing. They choose which board to use. I want my program to be easy for them and adapt to any of the boards they have now. They all have different characteristics I need to track. To do that I need to know which board they plugged in.
DAQmx has a record of every board of every type that was ever plugged into the computer. When I look at DAQmx Device -> ActiveDev class and get any information, it returns info for the complete list. Not just the boards that are connected now, but the entire history. There is not a Boolean for Device Present. The Boolean for DeviceIsSimulated is always false.
The software clearly knows this info, if you look at NIMax there are red flags for non-connected hardware. Is there any way I can get that programmatically?
I tried doing something to all the listed devices (create task, read data) to look for errors. The only error I got was -20077, unsupported measurement type. No "Device Not Present."
Thanks
Ed
Solved! Go to Solution.
03-25-2021 10:34 AM
Have you rummaged around the stuff in Measurement I/O -> System Configuration? You can access NI-MAX from there.
03-25-2021 10:46 AM
When I scan the instruments I do not see devices that are not plugged in. See below. Dev1, cDAQ3 is missing from the scan but shows in MAX. How are you scanning instruments?
mcduff
03-25-2021 11:07 AM
<sigh> as always the answer is to turn off the power and start again. I don't know what happened or what I was looking at, but now it works. I was scanning exactly that way and seeing wrong things. I unplugged everything cycled power and presto.
Once again, a helpful member has shown me the obvious answer. Thanks.
Ed
03-25-2021 11:17 AM
Note that method won't detect any PXI chassis. See here for another method.
Lastly, the method in that link is slower than the earlier solution and sometimes the System configuration VIs hang. Only use if absolutely needed for a PXI system.
mcduff
03-25-2021 12:07 PM
OK, it's the FieldDAQ. LV and MAX still show it in the system after pulling the Ethernet. I see you have one in your system, do you see the same behavior?
I just thought it did that with all instruments, sorry.
How to see if it's really there? I can open a TCP connection to port 80 and check for errors. That works. I don't want to shell out to Windows for a ping. Any other suggestions? Is there a way to force a refresh of DAQmx devices from LV?
03-25-2021 12:28 PM
I do not have a real FieldDAQ. I made a simulated one to test a general purpose program to see if it is general enough to apply to FieldDAQ. (It works for simulated devices.)
You can try the attached following; it uses System Configuration VIs. (I need to use both to get a complete list) Modify as needed I use it to do a complete scan so you can change type def etc as a lot of that stuff does not apply to your situation. (One of the Configuration filters is for Network Devices, see if the output changes when disconnected.) V2016 attached.
Let me know if there is a problem with it. The Main VI is called untitled 4 , I just copied and pasted into a new VI and saved for previous version. Sorry about the name.
mcduff
03-25-2021 12:52 PM
Ni Has something built to do this. It will show you everything connected to your computer
08-28-2024 11:47 AM
Revisiting this problem with real equipment this time.
I do not have a FieldDAQ but a networked cDAQ chassis. While testing what errors would occur if the chassis network cable became disconnected while using, I found the DAQSystem Device Names node was still listing the chassis even though it was disconnected.
Below and attached is one possible solution, but it seems a bit Rube Golberg. It works but maybe someone here can improve it. I assume it will work for other network devices also but have not tested.