Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How to safely handle restarted NI-DAQ device.

Hi,

I have NI-DAQmx device used to measure voltatages on 3 different channels. I run my application from start it works fine. But when I power off my NI device and switch it back on I create STOP() current acquistion task and create new one (using a refresh button), so the code looks like in attached document. But I receive following error code

-201250 when I start again.

 

"Connection to the network device has timed out. The network device did not respond properly for a period of time. If timeouts persist, contact your system administrator.

Status Code: -201250"

 

Is there any example code which can safely handle restarting of NI-DAQ Device without restarting the application.???

0 Kudos
Message 1 of 4
(5,374 Views)

Greetings prabhushrikant

 

Have you tried using this function?

 

Let us know if that solved the problem, or if you require further assistance with this case. We are here to help!

 

Warm Regards, 

Luis J.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(5,346 Views)

Also, in case you are using C#, this might prove useful as well.

 

Warm Regards, 

 

 

Luis J.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 4
(5,342 Views)

Well I am doing device.Reset() this but no use. Still gives me same error.

I checked in NI sample program what happens. And it gives me same error even on sample program supplied. (Program name : ContAcqVoltSmpls_EveryNSamplesEvent.2008). It looks like DaqSystem.Local keeps the last connection and I couldn't clean that programmatically but only by restarting the program.

 

 

Also, I would like to know how to easy way check status of NI device connection. I didn't find any simple way for the same. Can we do it using device object or task object? I only have one device and one task running so either way if I could check status of my connection it will be fine and that way can stop my graph plotter and notify user of the same.

 

Thanks,

Shrikant.

 

 

0 Kudos
Message 4 of 4
(5,160 Views)