There are only two ways to tell somebody thanks: Kudos and Marked Solutions Unofficial Forum Rules and Guidelines "Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
For a given channel with multiple samples per channel (diagram above shows 20 samples per channel) and with the DAQmx Read function set to "1Samp", which sample in that channel is read by the function? First? Last?
When the DAQmx task is ran (at the DAQmx Run), a buffer starts to be filled with data. When you perform a DAQmx Read, you are taking the oldest data out of that buffer.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions Unofficial Forum Rules and Guidelines "Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
As per my understanding, the upper loop with 10,000 samples read takes one second and lower loop with 2000 samples read takes 2 second to complete one iteration (time = number of samples/channel divided by sample rate).
As the emergency button local variable keeps updating at the start of each iteration so when you press stop it update after one iteration so it takes 2 full second of 2nd iteration and <=2sec of first iteration (when you pressed the button). I think that how it works
I agree with PakAsia, the top loop takes 1 second to complete and the bottom loop takes 2 seconds. The state of the Emergency Stop button is read every 1 second, so you would expect the top loop to stop in less than 2 seconds (1 second for the data acquisition + some additional time for other processing). Using the same rationale you would expect the bottom loop to stop in less than four seconds (2 seconds for the data acquisition + some additional time for other processing).
The time for other processing is very small (for LabVIEW to evaluate the While Loop Stop Condition) but is enough when added to the data acquisition time to push the total time over the time boundaries in the answer. For this question VI stop time would be in the order of 2.01 seconds.
Steve can you please post some questions from this style "" which of the VI will generate a human readble text?"" they are questions based on text file functions i think?
If the above question, the daqmx read is changed to 1channel Nsamples then the numeric value out will be 40, ans d because counting terminal N=2 (20 samples per channel) which means the output values are concatenated. Is that right?
There are only two ways to tell somebody thanks: Kudos and Marked Solutions Unofficial Forum Rules and Guidelines "Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
DAQmx Read is configured to Read 1Chan 1Samp, so each call within the FOR Loop returns a single data sample. The individual data points are auto indexed on the output of the FOR Loop, so after the two iterations of the FOR Loop the samples have been built into a 1D array containing 2 elements.
Refering to this quiz by SercoSteveB, I am wondering how Labview handles following case:
The SampleClock.vi is configured to 20 samples per channel, however the Read.vi is set to read 15. Now, does the last setting of 15 overwrite the first of 20?
The DAQmx Read will attempt to get 15 samples from the buffer. If the task is not closed out, another 5 samples will be put into the buffer that you can read with a later DAQmx Read. If you set the number of samples per channel to be less than the number you told DAQmx Read to read, you will get an error of some sort (at least a timeout error, not sure if there is an error for requesting more data than the buffer holds).
There are only two ways to tell somebody thanks: Kudos and Marked Solutions Unofficial Forum Rules and Guidelines "Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
That is off topic for this blog. But I see you did ask in the proper place here.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions Unofficial Forum Rules and Guidelines "Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5