From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to check if DAQmx device is connected ?

Solved!
Go to solution

Hello,

 

I want to measure 2 channels of Daqmx USB-6211 continously.

If I want to write USB-6211, I make anywhere in the project global variable "Permission for using usb-6211" false and don't measure anything, just write (value of magnetic field for example).

 

Question: I want to know if the device is connected. If not - no measurement, no writing. How to easily check if device is connected? 

 

Previously I made as in example plus didn't clear task if device is disconnected.

In several boots of Labview it resulted in:

a) the error before Labview booting: "The last time you ran LabVIEW, internal warning 0x30EA5E5C occurred in fpinval.cpp."

b) total freezing at each using of DAQmx Create Task

 

Each time I must reinstall NI-DAQmx to make its functions work.

 

Please help.

 

Thanks, Gregory.

0 Kudos
Message 1 of 11
(10,045 Views)
Solution
Accepted by topic author dimitriev.g

Hi dimitriev,

 

you can check available DAQmx devices using DAQmx property nodes. When you use two USB6211 you can even check their serial numbers:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 11
(10,001 Views)

Thanks! You are magician Smiley Happy

 

One more question - is there any way to check if device is reserved with other program on PC?

0 Kudos
Message 3 of 11
(9,983 Views)

Hi dimitriev,

 

never had to do that…

 

Idea: Try to create and start a task. When the device is reserved you should get an error message from DAQmx…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 11
(9,961 Views)

Yup make a task and see if there is an error.  If it is a remote device like an ethernet cDAQ you can reserve it, and it will return an error if it is already reserved, but the more universal solution is to try to make a task.

 

Also the method to finding DAQmx devices mentioned earlier is a good one.  But for finding more than just DAQmx devices you can use the System Configuration VIs.  Here you can also setup filters for returning devices in the system that match what you want.  These are more flexible but for simple things DAQ device query it might be overkill.

0 Kudos
Message 5 of 11
(9,939 Views)

Hi,

I am using NI DAQ6003, and i am connecting my temperature sensor circuit with this to aquire data in my computer.

can you plz upload labview code to check weather DAQ is connected with computer or not, i mean to just check that hardware is connected or not.

i want to use that code for my every hardware which is going to b used for data aquisition...

 

Thanks in advance!!!

0 Kudos
Message 6 of 11
(9,527 Views)

Hi pooja,

 

did you see my message #2, which is marked as solution?

 

What else do you need?

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 11
(9,518 Views)

Hi,

Thanks for ur immediate reply....

can i use that for every hardware...which is not NI hardware...?

i m new for Labview...so may be my Q will seem like stupid...but plz bear with me  Smiley Tongue

can u plz upload the VI file for the same...which i can open in my comuter...and can explore that...

 

thanks

0 Kudos
Message 8 of 11
(9,504 Views)

Hi pooja,

 

can i use that for every hardware...which is not NI hardware...?

The last time you asked for DAQmx hardware and the solution is shown above.

Sorry, I don't have this VI anymore - but all you need are two DAQmx property nodes. I guess it's easy to recreate this snippet, even for you!

 

When you want to check for non-NI hardware you need to know how to detect that hardware. Once you know that you can create a test routine to check for presence of that hardware!

Sorry for being so unspecific, but your question is also very generic…

 

my Q  … but plz … u plz

Please read this!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 11
(9,498 Views)

thanks!!!

0 Kudos
Message 10 of 11
(9,493 Views)