06-09-2009 10:05 PM
Hy,
I am in trouble with labview...
I have to stop the acquisition and the generation when an acquired data is below a reference value. That value is calculating by using the first 200 hundreds points. So, if for a voltage of 5V, the recorded data is below the reference value, the software must stop and generate a DC voltage of 5V. To achieve such a goal, I decided to compare the input data to the reference value. I will have 2 results true or right. Then I wired it to the stop buttons of the while loop. My idea is : "keep running until the case True occurs then Stop". It seems that I can't compare each point in real time. I mean point by point. But only all the datas acquired during an iteration. That's why I have an array of boolean result which can wired to a stop button or a case structure. I don't know if I should use the "Waveform tools" or working with DBL datas.
Thank you for having a look on my computation
06-10-2009 09:00 AM
06-10-2009 06:52 PM
Thanks for the answer. I tried to "And" the array with a true constant but nothing changed. Is it what you told me to do?
There are 3 steps in my computation:
step1: synchronisation of the AO and AI.
step2: calculation of the threshold by analysing the first 100points.
step3: stop the computation when a value is below this threshold.
I am introuble with the step3. It seems that the software must finish the acquisition of all the samples. And then, the step 3 occurs. Unfortunately, I will have other points below the threshold and I can't stop the experiment because I haven't one "True value" but an array of boulean value.
My aim is to "stop" when the first true case appears.
06-10-2009 08:12 PM
No, I wasn't exact enough in my description. On the Boolean palette is the function 'AND Array Elements'.
Yes, of course your computation must wait until you've acquired the samples you've requested. You have set the sample rate for 10000 Samples/sec and the number of samples requested is 10000. That means you get 10000 samples each second. It's simple arithmetic. All of those samples are transferred from the DAQmx Read as a single array - not one point at a time. If you don't want to wait for one second, request fewer samples at a time. Request 1000 samples and you will get that number every .1 sec. Request 100 samples and you will get that number every .01 sec.
06-11-2009 09:42 PM
Ok. But I need my 10Kpoints per experiments. How can I collect it if I fixed the number of samples to 10?
I tried a "for loop" with a 1000 iterations but it doesn't work with the daqmx "read" inside the while loop.
Thanks in advance.
06-11-2009 10:33 PM
06-15-2009 01:03 AM
Yes, I am using the "append wfm" vi tool.
Thanks for your advice. So now I can acquire the data as fast as I want.
But now, I don't know how to define my threshold. My first idea is to use a "events" structure.
I am oscillating between a "flat sequence" structure or a "events" structure?
06-15-2009 06:25 AM
06-15-2009 05:33 PM
Thank you for your quick reply to my post. It's very helpful.
A case structure is appropriate to stop the computation. But how can I calculate the threshold (based on the first 100 points) without stopping the "for" loop?
06-16-2009 01:22 AM
So finally, I used a flat sequence structure. But I still have 2 problems. I am very much near to my purpose now.
The first frame calculates the threshold. The second one compares every data point to the threshold and stop the computation when a true case occurs.
1--It seems working but I am losing the data because I stopped the "for loop" before the N iteration required. So how can I get back the data acquired before the stop?
2--If my true case occurs for a generated voltage of -6V, I expected that this voltage would stop at -6V. But there is a delay and my software keep running few points below up to 7V. How can I be more accurate and minimize this delay?
You can see my computation in enclosed files.
Cheers