LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

No more than 2 event structure?

I don't anderstand how can I do my programm because I read that we must not use 2 events structures in one loop. But concerning my programms for instance I have to fill arrays only when I press each appropriate "Ok" button (for instance for 5 case I have to press 5 different OK button ) and so on (when I press OK number 6 the program write to excel program.. when I press OK number 7.. )
How can I do it? I need to create 7 events structures for 7 actions?
labview 7.0
0 Kudos
Message 1 of 6
(2,697 Views)


@ramiral wrote:
I don't anderstand how can I do my programm because I read that we must not use 2 events structures in one loop. But concerning my programms for instance I have to fill arrays only when I press each appropriate "Ok" button (for instance for 5 case I have to press 5 different OK button ) and so on (when I press OK number 6 the program write to excel program.. when I press OK number 7.. )
How can I do it? I need to create 7 events structures for 7 actions?




You do not need a separate event structure for each event. You can create multiple event cases to be handled by one event structure. To create addtional event cases right click on the event sturctures text ring and select "add event case". This will open a dialog box in which you can configure your the event case. You select the control that you want to monitor by it's "owned label". So, you will want to click on controls, select the control that this case should monitor and under event select "value change".

For an examle click, File, New. This will open the template browser. In the template browser click on the "+" by Frameworks and then select "Dialog Using Events".

Chad
0 Kudos
Message 2 of 6
(2,684 Views)
When they say not to use two event structures in one loop they are refering to the number of actual "event structures" that are dropped on to the diagram, not the number of events that one structure can handle. You could have "an event" configured for each of your "ok" buttons, and then have those events, when triggered, select a different case of a case structure, possibly on the "timeout" event. If you built it like that, make sure to have a timeout value wired to the upper left corner, or it will default to -1 (never timeout).

Here is a very simple example of one way to implement it.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 6
(2,683 Views)
I anderstand what you mean but all my program will be in the event structure?
Do you have the exemple for labview 7.0?
labview 7.0
0 Kudos
Message 4 of 6
(2,670 Views)

@ramiral wrote:
I need to create 7 events structures for 7 actions?

You need one event struture that handles seven different events. If there is code that is common to all events, it should be outside the event structure, but inside the while loop.

Your description is not entirely clear and it would help if you could attach a small example VI. SOme questions:
  • Do these events need to occur in a specific order? I would assume that event #7 should only be allowed to execute if all other events have executed.
  • What is the meaning of "fill arrays". Is each event modifying different elements of the same array or does each event fill his own array?
  • 0 Kudos
    Message 5 of 6
    (2,655 Views)
    For "event" in order I use flat sequence to develop the common code.
    "fill arrays" : It means that the user can enter a string in one string control for instance, and when He press OK, one action occures...
    Actually I use case structures for each button (if true...) but I think it's better to create events structures? no?

    Sorry I'm French..

    PS: I not attach my VI now because it's really an horrible draft.....

    Message Edited by ramiral on 04-11-2005 09:28 AM

    labview 7.0
    0 Kudos
    Message 6 of 6
    (2,650 Views)