04-23-2013 11:41 AM
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
Solved! Go to Solution.
04-24-2013 02:51 AM
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
Best Regards
Anders Rohde
Applications Engineer
National Instruments Denmark
05-01-2013 02:36 AM
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
05-01-2013 03:20 AM
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
05-01-2013 04:20 AM
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
05-01-2013 07:06 AM - edited 05-01-2013 07:15 AM
Hi cpede
I still need you to do a little bit more explanation of what you do. I tried this,
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?
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
05-01-2013 07:51 AM
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.
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
05-01-2013 07:57 AM
Hmm.. interesting.
Ok I will try this, but:
-cpede
05-01-2013 08:34 AM
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