Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ 9205 does not reconnect after reboot

Solved!
Go to solution

Using cDAQ-9184 with 9205 module

Set DAQ IP address to 192.168.1.20 and PC NIC to 192.168.1.11

 

REPRO STEPS

* Find 9205 via NI-MAX and set alias to DAQ1_Slot1

* Connect to it via C# code successfully and log data samples

* Reboot the PC leaving the 9184 and 9205 powered up

* Re run the same exact C# code

 

EXPECTED

* C# code connects to the device successfully as before

* Device shows up as connected in NI MAX

 

ACTUAL

* C# code fails to connect

* Device shows up as dis-connected in NI MAX

 

RECOVERY

* Manually remove and then re-add the device using NI-MAX

* Now the code works

 

PROBLEM

This is an unacceptable situation. The PC is a headless device that needs to be able to recover in the case of power failure or other reboot cause.

 

What is causing this problem and is there a way to reconnect programmatically? Either in my C# code or some other automated tool?

0 Kudos
Message 1 of 3
(2,542 Views)
Solution
Accepted by topic author cmz

Hi cmz,

would it be possible for you to post the initialize portions of your code so we can see how you're trying to add the device?

My first inclination would be to add the steps you've taken in MAX, to your C# code. I've included a link with instructions for performing a reset/self-test in C#. You could include this to the setup portion of your code and see if that helps.

How Can I Perform a Reset/Self-Test of My DAQmx Device Programmatically?
http://digital.ni.com/public.nsf/allkb/124D580AE300335E86256FDD006CE798

NickelsAndDimes
Product Support Engineer - sbRIO
National Instruments
Message 2 of 3
(2,516 Views)
Solution
Accepted by topic author cmz

Thank You Nick, this is what I needed.

Here is the code I am now using at start up to re-reserve the device (sorry for the formatting and some stuff specific to us, but you get the idea)

 

// The DAQ devce may have been left reserved.
// Re-reserve and do a self test.
Exception slotException = null;
using (Device dev = DaqSystem.Local.LoadDevice(this.daqDeviceName))
{
dev.ReserveNetworkDevice(true);
dev.Reset();
dev.SelfTest();

// Wait for attached module to connect
Device slotDevice = null;
for (int tries = 0; tries < 10; ++tries)
{
try
{
slotDevice = DaqSystem.Local.LoadDevice(this.daqSlotName);
break;
}
catch(Exception ex)
{
Thread.Sleep(10000);
slotException = ex;
}
}

if (slotDevice == null)
{
throw new VendorDriverExceptionException("Could not find DAQ Module: " + slotException.Message);
}
else
{
slotDevice.Dispose();
}
}

0 Kudos
Message 3 of 3
(2,513 Views)