Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get N samples from a USB-6251?

Sorry for this real basic question:
 
I can't get N samples from our USB-6251.  I have tried all sorts of example VI's. eg Acq&Graph Voltage-Int Clk.vi.   I have set physical channel correctly.  The error message I keep getting is:
"Some or all of the samples  requested have not ye been aqcuired."
 
I am not successful even if I go into Measurement and Automation Explorer and create a new task getting N samples with either internal or external clocks. 
 
I can get 1 sample on demand OK. 
 
The USB-6251 is brand new. 
 
No doubt I am looking for some simple gotcha.  Any clues?
 
Thanks
0 Kudos
Message 1 of 11
(4,484 Views)
Hi,

The best way to make sure your DAQ device is working okay would be to use the test panels in Measurement and Automation Explorer (MAX).  If you click on your device in MAX, then above its properties you should see a tab that you can click on that will bring up the test panels.  You could set these for a contionous read on a single analog channel and then run them.  This should run and give you data from that single analog input channel. 

The main question to ask is did you have the device set for finite or continous sampling, and what values are you putting into the rate and samples to read parameters when you are getting the some or all samples have yet to be acquired error.  If it works in test panels, then just emulate the settings you made there in MAX, and from there we can do a code generation and you should have working LabVIEW code. Please let me know if you have further trouble with this issue.

Have a great day,

Michael D
Applications Engineer
National Instruments
0 Kudos
Message 2 of 11
(4,470 Views)
Thanks Michael.
 
You said: "The main question to ask is did you have the device set for finite or continous sampling, and what values are you putting into the rate and samples to read parameters when you are getting the some or all samples have yet to be acquired error."
 
I went into MAX and got the test panel up.  The only Mode that works on Analog input is "On Demand"  the other two, "finite" or "continuous" just get the CPU running to 100% and nothing comes up in the chart.
 
I have been trying the Cont Acq&Graph Voltage - Ext Clk - Dig Start.vi  (from the examples)  If I set up for my USB-6251 it doesn't work.  If I don't do the Trigger I get the Error -200284 error (Some or all of the samples requested have not yet been acquired).
 
If I do the trigger I instantly get the CPU use going to 100% and I get the error: -200361  "Possible reasons:  Onboard device memory overflow.  Because of system and/or bus bandwidth limitations, the driver could not read data from the device fast enough to keep up with the device throughput.  Reduce the sample rate or reduce the number of programs your computer is executing concurrently." 
 
I am only trying to get 100 samples sampling at 100Hz.  The problem lies elsewhere.
 
Any clues?   It's Friday here and I will be going home for the weekend in half an hour.
0 Kudos
Message 3 of 11
(4,468 Views)
Hi

Is there a reason you are using the Ext Clk example?  That error is not what I would expect, but I will test out one of the boards and see what behavior I get.  When you place the test panel to finite or continous did you change any other settings?.  Please get back to me and hopefully we can resolve this on monday.

Have a great week,

Michael D
Applications Engineer
National Instruments
0 Kudos
Message 4 of 11
(4,436 Views)
Thanks for the reply.
 
I am using the Ext Clk example because I am trying to learn all the DAQmx concepts.  I have not been using LabVIEW for a few years and I have inherited  a project from someone else which uses a DAQPad 6016 with external clocking and counters etc.  When I look at his code it's a mystery to me. 
 
I come from a electronics, microprocessor background so being isolated by all all this DAQmx stuff from what goes on in the DAQ pad is like peering through so much mud.
 
I am trying to answer a question I have about that system where I change cable length or even whether the conductors of a ribbon cable are together or pulled apart makes a difference between sensible data and some kind of aliasing caused by conversion on clock edges. 
 
Anyway, back to your second question:  When I placed the test panel to finite or continuous the only thing I changed was the Input Configuration from Differential to RSE.  I read in some posting somewhere that maybe it's not expected to work because the test panel is not set up to say where the clock is coming from.
 
However, if I go to create task and go through that I get to set up the timing and the triggering and the sources of clock and trigger.  I do that using PFI 0 for triggering and PFI 1 for the clock.  I set up 0-5V signals on those and click on test.  Do my triggering and the Windows task manager goes to 100%, so I know the USB-6251 has detected something but nothing gets completed. 
 
I will add that when I first did the LabVIEW DAQmx tutorial I used the DAQ assistant to set up the voltage an N samples but left the sample rate at 1k and it didn't work when I clicked test.  But then I went back and entered 1000 into the Rate and it worked.  It hasn't worked since.
 
Thanks for looking into this.
0 Kudos
Message 5 of 11
(4,422 Views)
Just some more information if anybody's reading this.
 
As I said I am using the Cont Acq&Graph Voltage-Ext Clk-Dig Start.vi example VI.
 
I decided to try using OnboardClock instead of one of the external lines.  Most of the time when I run it and do the trigger pulse I get a timeout error with the CPU going to 99% but sometimes it runs as expected.  My trigger consists of a push button switch connected between the PFI and   Digital ground and the PFI connected to +5V via a 10K resistor.
 
When the CPU goes to 99%, I can click on the abort button and the VI stops but CPU use stays high.  If I quit out of LabVIEW the CPU use still stays high until I shut down my machine and start again.
0 Kudos
Message 6 of 11
(4,385 Views)
Hi,

When it runs as expected you do not see any CPU usage spikes, such as when the task is completed?  What timeout do you have set for your read, and is it possible you are letting the task timeout, but your while loop is not setup to stop on error? If you remove the trigger from the example, or run the non triggered example do you see simialar behavior or does it always go to maxing out the CPU usage.

I am still wondering about your test panels behavior. If we can not take a continous measurement with your test panels then there is something incorrect with the way your device is working.  The device is listed in Measurement and Automation Explorer under NI DAQmx devices correct?  The test panel never returns an error.  The CPU usage just goes to 99% and your computer has to be restarted correct?

I will continue looking into this issue, but please get back to me about the behavior you see in test panels, because if those are not working nothing will consistently work.

Have a great morning,

Michael D
Applications Engineering
National Instruments
0 Kudos
Message 7 of 11
(4,372 Views)
Thanks Michael, I think you have hit the nail on the head.
 
I have followed your suggestion to ignore the VI's and concentrate on the test panel.
 
Starting from my machine turning on with the USB-6251 turned off I turned the USB-6251 on.  I chose configure and test this device.  The USB-6251 appears in the NI-DAQmx devices correctly (green).  I right clicked on that and chose test panels. 
Changed the mode to continuous and the Input Configuration to RSE. 
Clicked start and the CPU use went to 100%.  This is where I thought everything was frozen. 
 
In the past I have shut down the test panel and the CPU usage still was 100%.  I discovered that if I turn the USB-6251 off the CPU usage went back to low %use.
 
This time instead of pressing stop and shutting the test panels down,  I happened to wait for a long time and finaly a red ball with a cross in it came up indicating an error.
The error was: Error -200361 occured at Test Pane Possible Reason(s).  Onboard device memory overflow.  Because of system and/or bus-bandwidth limitations, the driver could not read data from the device fast enough to keep up with the device throughput.  Reduce the sample rate, or reduce the number of programs your computer is executing concurrently.
 
I've done the above things again just now and the test panel still hasn't come back with the error (at least 5 mins) but it is not reading and CPU is stuck on 100%.
 
Doing the above test and clicking stop and start again I have got it to work once or twice i.e.  a line actually appears in the chart and responds to changing input.  When it does work the CPU usage is roughly 5% with spike of up to 11%.  I notice that when I click on stop when it has been working the CPU% goes up to 100% and it will not run correctly after that until I turn it the USB-6251 off and start the test panel again.
 
If the device is flakey should I ring the local (across the Tasman Sea in Australia)  NI people to arrange a repair?
 
Thanks again for the reply. 
0 Kudos
Message 8 of 11
(4,368 Views)
Hi,

Thanks for all the info.  I have seen that error number a couple of times and it often had to do with the version of windows XP being run.  Do you know what service pack your XP OS is working with, because if the file usbehci.sys  is an older version then you will get incorrect behavior from your devices.  I would recommend updating to service pack 2 if you have not and that should give you better performance.  Please let me know if you already have SP2, or can't upgrade to it and we can find some instructions to update that file individually from the rest of windows.

Have a great day,

Michael D

0 Kudos
Message 9 of 11
(4,354 Views)
Thanks
 
Your hunch is correct. I am on XP service pack 1 here. There must be some reason for that known to our IT guys.  I've rung our help desk and she says she has Service Pack 2 so I'll see what I can do at this end first.
0 Kudos
Message 10 of 11
(4,347 Views)