Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Maximum number of samples with PCI-6123

Solved!
Go to solution

I'm facing a strange problem. I cannot start a task with more than 1 mill (1000000) samples with my PCI-6123?

If I just get under, then it works, no matter how many channels or sample frequency set.

I'm using DAQmx which should handle up to 16 mill.

 

-cpede

0 Kudos
Message 1 of 9
(3,952 Views)

Hi cpede

 

Could you send me a little more info on this problem (DAQmx version and VI)?

 

I just tried to run an example on my PC (only simulated though) and here it seems to work. Could you please try out if you have any luck in doing it in simulation with your VI as well?

 

I ran the following VI - In LabVIEW 2012 SP1 - Using DAQmx 9.6 - On a Simulated PCI-6123

DAQmx high speed.PNG

 

Best Regards

Anders Rohde

Applications Engineer

National Instruments Denmark

0 Kudos
Message 2 of 9
(3,935 Views)

Hi

 

This problem is very reproducible. I'm using C++ and the code is verified and proven for many years, please see below. Polling the DAQmxIsTaskDone never return true if the number of samples is higher than 1000000.

 

DAQmxErrChk( DAQmxCfgSampClkTiming,s_hTask,"OnboardClock",100000,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,1200000) );

DAQmxErrChk( DAQmxStartTask(s_hTask) );

bool32 bTaskDone = false;
DAQmxErrChk( DAQmxIsTaskDone(s_hTask,&bTaskDone) );

  

- cpede

0 Kudos
Message 3 of 9
(3,893 Views)

Hi Cpede.

 

Just to be sure. In your first post you said you got an error on the DAQmx Start, but in this post it sounds like the problem is that the DAQmx Is Task Done is never raised. Which of the problems is it you are having?

 

Could you send me the hole C++ file that replicates this problem? Have you tested if you get the same behavior on a simulated device (that would make it easier for me to test it out).

 

 

Best Regards

Anders Rohde

Applications Engineer

National Instruments Denmark

0 Kudos
Message 4 of 9
(3,890 Views)

Hi

 

Sorry about being so unclear. None of the DAQmx methods are returning any errors. The problem is, that the DAQmxIsTaskDone method never returns true, when the number of samples is higher than 1000000.

 

The code is complex, but the problem is seen both with a real device and on a simulated device.

 

If necessary, I can write a small console program, but please test with a simulated device first.

 

-cpede

0 Kudos
Message 5 of 9
(3,885 Views)

Hi cpede

 

I still need you to do a little bit more explanation of what you do. I tried this,

 

daqmx done.PNG

 

And here the DAQmx Is Task Done flag is raised still when I have samples per channel more than 1M. But I'm still not 100% sure if this is the setup you are using.

 

 

EDIT: Ahh I think I know what you are trying to do.....

 

Are you starting the task and then waiting for the done flag and then when you are done you want to read what is in the buffer?

 

Like this?

daqmx done2.PNG

 

Here I see a behavior like what your are explaining.

 

Please if you can confirm that it is this setup then I will investigate why this happens more in deep.

 

 

Br, Anders

0 Kudos
Message 6 of 9
(3,874 Views)

Hi cpede

 

I tried to look into it and what happens is that the read input buffer (DAQmx Property Node) never gets above 1M so the Is Task Done which is evaluating upon this value never gets up to more than 1M and thereby never stops. 

 

The solution is to call the function DAQmx Configure Input Buffer which will increase the size of the buffer. So it can be done like this.

 

DAQmx Done 3.PNG

 

Normally DAQmx will allocate the right buffer when you run finite samples. But when it is more than 1M samples we need to configure it manually. You can read about how to manually change the buffer size in this post: 

 

How Is the DAQmx Buffer Size Allocated for a Finite or Continuous Acquisition?

http://digital.ni.com/public.nsf/allkb/E1E67695E76BA75B86256DB1004E9B07

 

 

So to solve it in your application you would do this:

 

DAQmxErrChk( DAQmxCfgSampClkTiming,s_hTask,"OnboardClock",100000,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,1200000) );
DAQmxErrChk( DAQmxCfgInputBuffer(s_hTask, 1200000);
DAQmxErrChk( DAQmxStartTask(s_hTask) );

bool32 bTaskDone = false;
DAQmxErrChk( DAQmxIsTaskDone(s_hTask,&bTaskDone) );

 

Best Regards

Anders Rohde

Applications Engineer

National Instruments Denmark

0 Kudos
Message 7 of 9
(3,865 Views)

Hmm.. interesting.

 

Ok I will try this, but:

 

  • Why did your sample work then?
  • Why does it work for other devices e.g. NI USB-9215A?
  • Why this limit for the automatic buffer size?

 

-cpede

0 Kudos
Message 8 of 9
(3,861 Views)
Solution
Accepted by cpede

Hi Cpede

 

I agree with you that it should just work out of the box for this device as well and I will offcourse report this issue to our R&D department. 

 

But I'm confinced that the above should be a usable work around in your case.

 

 

Best Regards

Anders Rohde

Applications Engineer

National Instruments Denmark

0 Kudos
Message 9 of 9
(3,853 Views)