LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continual measurement-stabilized state

Solved!
Go to solution

Hi everyone,

i am seeking for something that i haven't found here as an already soluted question (maybe because i did not use proper keywords).

I am trying to make a programme-measuring of a voltage. The voltage is caused by a change of concentration of gas in liquid, i use some probes for it. One part of a programme is measuring of the voltage and waiting for a stabilized state in order to have proper results. 

Let's say, that I measure 540 points (3 minutes, 3 Hz). The condition, that has to occur, is following: A1<A2>A3 or A1>A2<A3, A1 is average of the 180 values of the first minute, A2 is average of the 180 values of the second minute and so on. If one of those conditions occurs, then i can continue with another part of programme. But if not, I need to add another minute of measurement and try, if the conditions have already occured. The next conditions should look following: A2<A3>A4 or A2>A3<A4. This means that I need to delete or replace A1 and  generally make this: A(n+1) new=A(n) old.

I am looking for a function called "Add another frame if condition occurs" or something like that. Could someone please help me or give some advices?
Regards

Jan

0 Kudos
Message 1 of 6
(3,569 Views)

Those conditions actually look a bit like peak detections. There's some canned VIs you can use if you search for peak that may or may not be usefull.

Regarding what I think is your general concern, you can use shift registers to change the conditions.

Bring in new conditions.png

You will need to replace my logic test placeholder and maybe some code (another shift register?) to collect samples before the logic test.

0 Kudos
Message 2 of 6
(3,555 Views)

Thank you very much for your help, I will try it. If I have any trouble, i will write it here. Happy New Year 🙂

0 Kudos
Message 3 of 6
(3,519 Views)

Well, I found another problem, as I expected :D..

First of all, I need to generate Ai-2, then Ai-1 and then we are coming to the last frame of of sequence. For the first time everything is alright (Ai is different from Ai-1 and Ai-2), but after the shift register starts working, Ai and Ai-1 are the same values and that is not what I need. I need Ai to be different value from Ai-1 (Ai-1 and Ai-2 shifts properly). I need all the numbers to change and shift. This time I am only trying to make the simplified programme without any case structures. Wouldn't you know, how to solve this? Maybe there is a very simple solution, but as I am a beginner, I don't have much experience.

0 Kudos
Message 4 of 6
(3,486 Views)
Solution
Accepted by topic author Pinca

It sounds like you need the current value (X), the previous value (X-1), and the one before that (X-2).  You can do that with a shift register by adding another stage on the left edge, like the example.  Note that you have X, X-1, and X-2 available inside the While loop, so only need to add the "stopping logic" (which I left out) to wire to the Stop terminal.

Last three values.png

Bob Schor

0 Kudos
Message 5 of 6
(3,438 Views)
Solution
Accepted by topic author Pinca

Well, that's it. Thank you very much for your help.

Pinca

0 Kudos
Message 6 of 6
(3,413 Views)