LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Timer in a Sequence Structure

Hi Everyone,

I'm trying to setup a Sequence Structure with while loops in it. Here's the basic explanation of each sequence:
1st Sequence: Perform data aquisition and signal output for 5 mins
2nd Sequence: Perform Signal Output for 15 mins.
3rd Sequence: Perform Data Aquisition Signal Output for 5 Mins. Stop the Process and plot the data.

My questions are:
1) Can I put a while loop in a Sequence Structure?
2) Can I setup a timer in each sequence so that each sequence runs at its alloted time? Is so, how do I go about doing it??
3) Can I perform data aquisiton in a sequence structure?

I'm attaching my VI...please feel free to give me any comments/opinions/$0.02 on it!!

THANKS~! 🙂
0 Kudos
Message 1 of 6
(3,451 Views)
1) Yes
2) Not the way you're doing it.
3) Yes.

As to number 2, I've attached a simple VI that shows a different way.
Message 2 of 6
(3,450 Views)
Thanks for your help. However, the timer VI is used in the while loop instead. Do you think that I should implement the timer in the while loop and set the whole while structure in the sequence structure?? If so, how does the sequence structure realize times up for the next sequence??
0 Kudos
Message 3 of 6
(3,450 Views)
I don't think you need to use the sequence structure at all. In my example, I used dataflow to control the sequence of events. Putting the timer inside of the while loop means that each while loop will run for that time. Putting a wait function inside of the sequence but outside of the while loop means a time delay between each sequence and does nothing to control how long the acquisition will run which is what I thought you wanted.
0 Kudos
Message 4 of 6
(3,452 Views)
In a previous post you said you wanted to start, run for a time
period, stop for a time period, run....etc.

aderogba recommended a good VI to time a While Loop. Put the
functions inside that loop that you want to run for the specified
period of time

To get an OFF period place a For Loop around this VI and place a Wait
Until Next ms Multiple VI inside the For Loop, but Outside the While
Loop.

Each time the While Loop completes its run, the For Loop waits for the
number of miliseconds you specify and then runs the While Loop again.

Mike

June Kiat wrote in message news:<50650000000500000078AA0000-1031838699000@exchange.ni.com>...
> Thanks for your help. However, the timer VI is used in the while loop
> instead.
Do you think that I should implement the timer in the while
> loop and set the whole while structure in the sequence structure?? If
> so, how does the sequence structure realize times up for the next
> sequence??
0 Kudos
Message 5 of 6
(3,452 Views)
Hi Dennis,

how do I use dataflow then? The reason why I tried using sequence is that each process is different from each other. I tried putting a timer in each sequence but it does not move to the next sequence according to the time I had set. The data acquisition in my first sequence perform as required but it just won't move on to the next sequence.

Are you suggesting that I should just put a timer inside each while loop then??

Please help!
0 Kudos
Message 6 of 6
(3,450 Views)