LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx cDAQ Odd Behaviour, Unknown Return Value

CVI 2012, DAQmx latest, cDAQ-9188 with NI-9425 32-Ch DIN in slot1, NI-9481 4-Ch Relay in Slot 2.  Dev computer Windows XP.

 

This arrangement works very well, under normal conditions -- power the equipment up, launch the test application I wrote.  The test application issues DAQmxAddNetworkDevice(), then DAQmxReserveNetworkDevice(), then DAQmxResetDevice().  After than, if there were no errors, the DIN and Relay tasks are created, and a thread is launched to read the DIN UNIT every 100 ms.  Works fine.

 

But my application must recover from problems out on the network wheret the cDAQ unit is located -- a power failure and a network drop.

 

So my test program uses a separate thread with that initialization code listed above, in a while loop with a conditional.  If communications is good, the loop waits 1 second and checks again. If communication has failed, it goes through the initialization steps again.

 

For power failures it works fine.  I unplug the cDAQ, let all the tasks fail, be stopped and cleared, then plug it in again.  The cDAQ is initialized, and readings and relay control resume properly.  I unplug the cDAQ, let all the tasks fail, be stopped and cleared, then plug it in again.  The cDAQ is initialized, and readings and relay control resume properly.  It has taken a while to figure this out, since if one task fails and is cleared, another task is still registered, and messes up reinitialization.  So far so good. 

 

I have a couple questions:

 

I have noted that there seems to be an inherent 10 second timeout that is not selectable.  When comm fails, a call such as this, takes 10 seconds to return an error, even though it should make a single reading and return an error:

  DAQmxError = DAQmxReadDigitalScalarU32 (DinTaskHandle, 0.0, &dinData, 0);

This timeout means that it takes a long time to detect a failure and reinitialize the system.

 

Q1:  Why the long timeout? Why is it not selectable?

 

One of my applications for the cDAQ is in a critical location.  I need to detect a communications failure much, MUCH faster than 10 seconds. 

 

Q2:  Is there a suggested way to test this?  Would a Ping work in parallel with the tasks?

 

I have seen an odd return value from DAQmxResetDevice().  When recovering from a power drop I have seen this return the warning 88708.  88708 is not listed in nidaqmx.h.

 

Q3:  What is warning 88708, and should I be concerned?

 

0 Kudos
Message 1 of 5
(3,435 Views)

I looked for this warning and I found the error 88708, but not a warning. So I could not understand why you are getting this return value. (No documentation found around this).

0 Kudos
Message 2 of 5
(3,392 Views)

Since the number is positive, it should be a warning.  Only negative numbers are "errors", at least according to the documentation.  Did you find a meaning for the number, even if it does not make sense? I'm really curious.

 

And I'd still like answers to the long timeout questions.  Hey, NI Tech Folks, how about chiming in here?

0 Kudos
Message 3 of 5
(3,386 Views)

yeah, with error 88708 I mean I found the code "-88708"

      #define DAQmxErrorResourceNotInPool_Routing                                              (-88708)

 

About the long timeout, let me look into a little more..

0 Kudos
Message 4 of 5
(3,382 Views)

Sorry, I misunderstood.  I also found the -88708 and it was not even related to cDAQ.  But something buried down deep in DAQmx returns 88708, quite regularly. In fact, I test for it, and if found, reissue the function call, just in case.  It does not occur twice in a row.

0 Kudos
Message 5 of 5
(3,379 Views)