Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Change the condition in event structures

Solved!
Go to solution

Hi all,

 

I am a student, currently doing a project. I'm very new to labview and I don't really know much of the function in labview. Anyway, I have this timer made using event structure if I'm not mistaken (I downloaded this timer from one of the post in this forum). This timer will start at 0s, count to 20s, then stop. So what can I do to change the end time of this timer?? Let's say stop at 50s??

 

Attached is the program. Kindly please explain to me or modify the program and attached back as a reply. I've been trying to figure it out from the help function, but still don't understand.

 

Thank you very much in advance!!!

0 Kudos
Message 1 of 3
(5,637 Views)
Solution
Accepted by topic author woohooo098

Hi,

 

Thanks for your inquiry. The VI attached uses a couple of programming structures: While loop, Event structure and Case structure. What you would have to change is actually the case structure. Before we go to that, let us go through the different structures. Open up the block diagram by going to the Menu bar of the front panel and navigate to Window->Open block diagram.

 

 support 1.png

The While loop is like a Do Loop in text based programming. It will execute until a condition is met. From the attached VI, it stops running when you click the exit button.

 

The Event structure is a structure which consists of subdiagrams. The structure responds to interactions with front panel objects. For example, if you click the start or stop button in the front panel, the event structure will switch to a case which corresponds to this interation. In the attached VI, the case, which corresponds to intreaction with the start or stop button, is called  "Start", "Stop": Value Change. Each case will contain an event-handling routine.

 

Case structures are like switch statements in text programming. Take a look at the "Start", "Stop": Value Change event. It contains a routine which consists of a case structure. The case structure responds to the input terminal called Start (which is actually the start button on the front panel). The case structure switches between cases according to this input. To view the different cases just cycle through the case structure by clicking the left and right buttons. There are only two cases: True or False as the input is a boolean.

 

Now lets take a look at the VI. Take a look at the "Timeout" case of the event structure. This is where the modification needs to be made. Modify the case structure by editing the cases. Change the numbers in case structures: ..20000 to ..50000  and 20001.. to 50001.. This should do the trick.

 

Regards,

Alan Bong

 

Message 2 of 3
(5,615 Views)

Thank you so much Alan...

0 Kudos
Message 3 of 3
(5,611 Views)