LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I search SIMPLE tutorials for events structure Labview 8.06

Hello

 

I search a little tutorial, to explain the event structure.

I saw the examples in the help of Labview but they are too hard to understand for a novice.

 

I would like to create a simple structure where a event like a "clic" will generate an event and this event will start a timer for example.

 

 

Thanks for your help.

 

bye

0 Kudos
Message 1 of 11
(4,658 Views)

The event structure will respond to user events either on the entire Front Panel or on a single control.

For example, if you have a button, you can register the 'mouse click down' or 'mouse click up' or whenever the mouse moves over the button.

 

I attached a very simple example of how the event structure works.

In my example, there is a boolean indicator on the front panel.

When the user moves their mouse over the boolean, it turns on.

In the block diagram, you can right click on the event structure and click 'add event case'.

See what you can come up with.

 

Cory K
0 Kudos
Message 2 of 11
(4,652 Views)

Here is the example you requested:

Run the VI.
When you click anywhere on the front panel, a timer will start.

I had the loop stop after 5 seconds.

Message Edited by Cory K on 06-23-2009 09:35 AM
Cory K
0 Kudos
Message 3 of 11
(4,648 Views)

Thanks for your help but I have Labview 8.5 and not 8.6, apologise...

 

I can not open the files, do you know a method to open labview 8.6 files with the 8.5 version, or it's impossible ?

 

 

0 Kudos
Message 4 of 11
(4,639 Views)
Hi leo, here is the example you requested, saved down to 8.5
Cory K
0 Kudos
Message 5 of 11
(4,632 Views)

I really don't like Cory's example for various reasons:

 

  • You should NEVER place while loops inside event strctures, because they prevent the event structure from servicing new events.
  • If the timeout case is not used, it should not be there.
  • An event structure typically belongs inside a while loop.

 

 

Here's a simple event example that manipulates the timeout to achieve a conditional timer. see if it makes sense. Modify as needed.

 

 

(see also this post for a more complicated example with four timers)

Message 6 of 11
(4,622 Views)

Ouch.....

Hehe thanks Altenbach

Cory K
0 Kudos
Message 7 of 11
(4,614 Views)

Thank you for your help, I have two questions:

 

- I haven't understand why do you use a selector with (100) for the configuration of the time for the event structure, and the aim of the decalage register.

 

 

- Do you know how to select dynamics events  when you edit the structure, because there is some examples where you can choose a dynamic event but when I create my own structure, and when I edit it "dynamic" is in grey and I can't use it.

0 Kudos
Message 8 of 11
(4,595 Views)

leo2b wrote:

- I haven't understand why do you use a selector with (100) for the configuration of the time for the event structure, and the aim of the decalage register.


The 100 is an arbitrary timeout value, in this case the timeout case will execute every 100 ms if we are running the timer and never (-1) if we are not counting. You could set it also to 1000, since we are only displaying full seconds. This is how we dynamically change the timeout value as a function of program state.


leo2b wrote:

- Do you know how to select dynamics events  when you edit the structure, because there is some examples where you can choose a dynamic event but when I create my own structure, and when I edit it "dynamic" is in grey and I can't use it.


It is not clear what you are doing. Can you show us a screenshot?

0 Kudos
Message 9 of 11
(4,592 Views)

Thank you for your help.

 

I put here what I see when I speak about "dynamic event in grey".

 

bye

0 Kudos
Message 10 of 11
(4,563 Views)