LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Execute when case is true and stop when time is up

Hi,

 

I made program for particle measurement with LabView.

So far, the programm is live-grabbing in a timeout event of an event structure all the time, and starts writing the measurements to a file and graph, if the area of the particle has reached a certain value. (the writing scenario is another case structure in my timeout loop)

 

Now, what I want the program to do, is stopping this case structure, after a certain time, which should be controlled by the user.

 

Can anyone please give me a hint?
So far, I can't figure out how to do that.

 

Greetings,

Rouven

0 Kudos
Message 1 of 19
(2,977 Views)
Use the "tick count (ms)" function under timing. You need to take the tick count outside your loop and read it inside your loop. The diference is your time in msec. Or you can insert a wait (ms) in your loop, and count the number the while loop execute. If you set the wait (ms) vaulue to 100 and your loop has executed 10 times, it has run for 1 second. Do not expect better precision than say +/- .5 second at the best


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 19
(2,971 Views)
0 Kudos
Message 3 of 19
(2,970 Views)

thanks for your replies!
But there's something different in my program structure.

I'm having a case structure inside the timeout which, if true, writes the measurement file. (true=particle size has reached a certain value)

 I just want this case-structure to stop after a certain time.

How exactly does that work?

0 Kudos
Message 4 of 19
(2,930 Views)
Please post your code.
0 Kudos
Message 5 of 19
(2,922 Views)

Just connect the output of the comparison function to the case structure.

Use highlight execution to see how it works

0 Kudos
Message 6 of 19
(2,921 Views)

okay. so here's a screenshot of a part of the block diagram attached.

I know, that the structure of my code isn't that good. But I hope the problem can be solved.

 

To give you an idea of what's happening in the program:
A picture is being acquired continuously (outer while loop), processed (particle analysis) and displayed (inner event structure "timeout").

Now, what I want to do now is to only save the measured data, when the particle has reached a certain area, but also control how long it's been measured.

I hope, you can help me.

0 Kudos
Message 7 of 19
(2,909 Views)
0 Kudos
Message 8 of 19
(2,886 Views)

thanks.

Maybe I forgot to mention it, but I'd like to start the counter with the case-structure.

 

The way I understand your code is, that the case-strucutre will be executed if my particle size is big enough AND the time is up?!

Or am I wrong?

0 Kudos
Message 9 of 19
(2,877 Views)

I changed the comparison to the second picture, so it will be executed as long as the time has not passed out.

 

0 Kudos
Message 10 of 19
(2,864 Views)