NI Home > Community > NI Discussion Forums

Measurement Studio for VC++

Showing results for 
Search instead for 
Do you mean 
Reply
Member
Mitch7
Posts: 28
0 Kudos

USB6008 - Errors from DAQmxResetDevice and DAQmxReadAnalogF64

When my app starts, I occasionally get errors from a USB-6008 IO card. I'm at a loss to see any pattern which is correlated with the errors. Maybe you can help.

 

Here's what happens:

 

1) App starts (console app)

2) Main thread calls DAQmxResetDevice. error = -50405

3) Main thread calls DAQmxCreateTask, DAQmxCreateAIVoltageChan, DAQmxStartTask ** no errors **

about 2 sec later

3) Main thread starts a worker thread.

about 3 sec later

4) worker thread calls DAQmxReadAnalogF64 - error = -88708

 

On some of our products, this happens much more frequentlty than on others (were building up inventory to sell). At this point in time we have a low confidence in using NI cards in our products.

 

One other point is that the NI card is connected to the PC via a hub. And that that hub has a second IO card (not an NI card). 

 

We've seen problems on Win7 32 bit and Win XP. Anyideas or suggestions are welcomed.

 

Thanks,

 

Mitch

 

 

 

 

 

 

Member
Samuel_S
Posts: 143
0 Kudos

Re: USB6008 - Errors from DAQmxResetDevice and DAQmxReadAnalogF64

This appears to be a USB communication error. You may want to try updating the drivers and switching the USB port.

 

The 88708 error is a resource allocation error it appears that you are trying to call into a device which is already being called into.

 

http://zone.ni.com/devzone/cda/tut/p/id/4638#1 You can test your device in MAX and see how it is operating and then in LABVIEW see if it is not being closed correctly.

 

I believe this will be the most helpfull link:

 

http://digital.ni.com/public.nsf/allkb/3EA2432762C45B298625734D0061D527?OpenDocument

 

:smileyhappy:

Sam S
Applications Engineer
National Instruments
Member
HelenC
Posts: 30
0 Kudos

Re: USB6008 - Errors from DAQmxResetDevice and DAQmxReadAnalogF64

Hi Mitch,

 

I had exactly the same problem the cause being that I had omitted DAQmx Create Task.vi from the code - restarting the PC and correcting the mistake remedied the problem.

 

Other point to note is that you definitely do need to use a mains powered hub with an USB6008/6009 if you don't want to suffer from the -200361 (onboard device memory overflow) / -200284 (some or all of the samples requested have not yet been acquired) errors.

Also ensure you have updated the drivers.

 

My PC is a DELL, Windows7.

 

Regards,

 

Helen

CLD, CTD
Active Participant
Dave_Thomson
Posts: 349
0 Kudos

Re: USB6008 - Errors from DAQmxResetDevice and DAQmxReadAnalogF64

We are having a similar problem with a 6008 on a Dell laptop.  We have a simple daq task that runs fine.  However, when we stop the task, clear it, and then later reinitialize it, the daq doesn't work.  We find that if we stop the program, unplug the 6008 usb cable, plug it back in, and restart the program, it will work again.  This doesn't happen on a desktop machine, so I believe that our sequence of Daq calls is correct.  It also doesn't happen if we use a powered USB hub, which, along with working on desktop machines, seems to indicate the Dell USB ports are in some subtle way, insufficient.  Oddly, we found that we don't get the error when we use an optionally-powered USB hub but without the AC wall power connected.  E.g. the hub is only getting power from the Dell USB port, but the error is gone!

Can someone from inside NI enlighten us about the technical reason why this is happening?  We have a strong desire not to send a USB hub with every system, but without more info, it is unlikely that Dell will be very helpful.  We need to know what is happening at the hardware level so that we can identify a laptop that won't suffer from this issue.

 

Regards,

   DaveT

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
Member
HelenC
Posts: 30
0 Kudos

Re: USB6008 - Errors from DAQmxResetDevice and DAQmxReadAnalogF64

Hi Dave,

 

we also use a 6009 DAQ at work with a hub but also with no power connected to it and have not had an errors from it - strange isn't it!

 

For my 6009 DAQ at home I will only use it with a mains powered hub.

 

Regards,

 

Helen

CLD, CTD
Member
Mitch7
Posts: 28
0 Kudos

Re: USB6008 - Errors from DAQmxResetDevice and DAQmxReadAnalogF64

> Can someone from inside NI enlighten us about the technical reason why this is happening?

 

The NI toolkit is a complex mulit-layered concoction of services and dlls. I counted 14 services running after a "minimal" install of the DAQmx drivers.

 

NI hardware may be great, but when there are difficult software problems, itis almost impossible to figure which dll or service is causing the problem. We chose the NI card for use in an instrument we recently introduced. The next instrument will not use NI because of this complexity. We can't afford to have problems which we cannot solve.

 

Dave, I know this doesn't help you, and I can see from your website, you're no stranger to NI. So I presume I'm not telling you anything new.

 

Mitch

Member
PeterGC
Posts: 73
0 Kudos

Re: USB6008 - Errors from DAQmxResetDevice and DAQmxReadAnalogF64

[ Edited ]

Hey Mitch,

 

I'm sorry you are experiencing so much difficulty.   I saw your initial post that made references to your application sequence and the errors you are seeing.   The DAQmx driver package is a fairly large install because it includes the drivers for most all of our multifunction DAQ and many services that are used to detect/monitor these devices.    Are you using LabVIEW to interact with the 6008? 

 

Regardless,

 

Both of those errors are seem to deal with the device not communicating properly with other hardware.  The link below describes one possible solution to error  -50405

 

 

http://digital.ni.com/public.nsf/allkb/3EA2432762C45B298625734D0061D527?OpenDocument

 

 

Error 88708 can occur if the the device is in use by another program/VI, or a previous DAQ task did not release the device resources. So, if you start a DAQmx task, but do not stop it properly (via the DAQmx clear task and DAQmx stop task VI's), the DAQ card may still be reserved. I would recommend testing the DAQ card in "Measurement and Automation Explorer" which is a software program that allows you to test your DAQ card without any code possibly causing errors. There is also an ability to reset the device in MAX to deallocate the resource if it is still reserved. A good knowledge base article about "Measurement and Automation Explorer" is available at:

http://zone.ni.com/devzone/cda/tut/p/id/4638#1

 

 

Also, make sure you are using the latest version of DAQmx drivers.  (9.4)  These can be found at www.ni.com/downloads  .

 

 

I hope this information proves useful.  Let me know if you have any other questions.

 

 

Best,

 

Peter Connolly

Applications Engineer

National Instruments

Peter C.
Applications Engineer
National Instruments