LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I determine the device number from the task ID

I'm using 'Port Config' to initialize my DIO port for a NI-DAQ 6052E. Port Config returns a task id and it would be very useful if I could determine what device number I have based on the task id.
0 Kudos
Message 1 of 3
(2,993 Views)
Hello,

Thank you for contacting National Instruments.

It is not possible to determine the device number programmatically from the task id. This would be slightly redundant since you must supply a device number when you Port Config executes. You could simply create a local variable of the Device Number control that is connected to the Port Config.vi if you need to use the device number elsewhere in your VI. Simply right-click on the Device number control and select Create >> Local Variable. Then right click on the local variable and select change to read. This will allow you to read the value of the device number you provided anywhere in your VI.

If you would rather determine the actual device that is being used rather than the device number, yo
u can use the Get DAQ Device Info.vi. I have attached a simple example program that demonstrates how to use the VI.

Regards,
Bill B
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(2,993 Views)
Thanks Bill.
0 Kudos
Message 3 of 3
(2,993 Views)