Hi everybody, I'm trying to obtain a fixed number of samples in different acquisitions, i have the next block diagram in which task is configured ON DEMAND, that's the main reason for what I'm obtaining a different number of samples after acquisitions. I just want to use N SAMPLES but I get an error (-200479) when I introduce the Start Task.vi inside the while loop.
If I use the Start Task as you see it in the block diagram below and with a N SAMPLES configured task, I just get one time the number of samples defined (e.g. 1000 samples), and I need that the acquisition of the N_SAMPLES runs along the execution of the acquisition.
I hope you have understood me and you could give me a tip. Any help will be appreciated. Thank you so much.
I have been searching about your issue, and this is the only thing I´ve found until now: http://digital.ni.com/public.nsf/allkb/53EA57DD114C85CE8625755900765A76?OpenDocument
However, that kind of error usually happens when you ask your board for N Samples in DIGITAL I/O, because if your NI board does not have correlated I/O you are not going to be able to do so.
If you want you can tell me your model and I can tell you if yours supports that aplication or not.
Thanks Luis, of course, my model is a NI USB 9162 and a NI 9215 with BNC, i use Analog input 2D DLB NChan NSamp in the DAQmx Read.vi. In fact, i have had a small advance, I can obtain a fixed number of samples, but when I run again my application without stop the execution of the vi, the number of samples is being concatened.
I run a Newport linear stage to displace materials on it, so I need to execute the acquisition from the acquisition board at the same time than the motor of the linear stage and force to the acquisition board to obtain the same number of samples in every displacement. I can do this, but as I use N_Samples I need to concatenate the data of every acquisition while the displacement is finished. The concatenation is only to watch the data in a waveform graph. And this concatenation is the problem because I obtain a different number of samples. If i have in the end of acquisition 100 samples, the next displacement of the linear stage is 200, and the next 300, and so, but I need to have 100 samples in every acquisition. As I tell you I need the concatenation because I would obtain different lines of data in the same waveform graph, and with the concatenation I obtain 10 times (bucles needed to finish the total displacement) 10 samples (those are the N Samples) and concatenated it gives a total of 100 samples.
I send you an image of my code, the only thing I need is to obtain the same number of samples in the TOTAL SAMPLES indicator as shown below:
Or how can i delete from the buffer or the memory the data that remains in the all vi and so can realize a new displacement with everything in zero.
As a note, I can obtain the same number of samples in every displacement of the linear stages, but just stopping my application and running it again, but this is not what I want. Stop and start again the vi to obtain the same number of samples for every displacement is much time lost. How do I proceed? Should I delete all the information in buffer or something like that? or should I modify entirely the vi?
really, this is a known bug in DAQmx. The solution is to install the updated DAQmx 9.2.2 driver.
a workaround is to use the Stop Task.vi after your read.
Oh, ok Jeff, thank you so much, I'll try to install it if the school have that version. Thank you so much.
I use Stop Task.vi and Clear task.vi after the while loop, but looks that something's wrong there.
yep- "clear task" requires you to re-"create" the task before it can be used. just a stop task, after the read, inside the loop, may get around the issue.
DAQmx 9.2.2 is available at this link
Glad to have helped