LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I jump to an event case from another case?

I would like to be able to go to a certain case from another case that is in the same event structure.
0 Kudos
Message 1 of 11
(5,080 Views)
If the other event is triggered by a value change of a control, you can write to that value with a property node set to "Value(signaling)" in the current event.

It gets triggered even if you don't write a different value to it.

(AFAIK, this needs LabVIEW 7 or higher).
Message 2 of 11
(5,078 Views)
You can use a user event. Say you want event case1 to call event case2. Event case1 can generate a user event that is handled by event case2. I've attached a quick example. A dialog is displayed in the case that handles Button1 and my user event. The case for Button2 generates a user event. So, pressing either button will display the dialog.
Message 3 of 11
(5,080 Views)

Hi Lavezza,

I am having the same question (see this please) and I believe that the solution may be around what you explained with your example User_Event_to_call_another_Event_case.vi,

My specific problem is that I can not reselect fron the slider a new directory to then load the test sequences to run. Could you try my example?

 

Thanks

JLM

0 Kudos
Message 4 of 11
(4,837 Views)

The simplest approach is to add the second event into the same event case.  This only works if both events will do exactly the same thing.  The next method also simple is using the signalling node.  A slightly more complex put more flexible solution is to cascade the events usinf user events.  The method I use is to use a queued state machine, there is an event loop which queues up strings of states for a consumer loop to execute.  This is a little more complex to implement but is a very powerful and flexable architecture.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 5 of 11
(4,836 Views)
Paul,
could you provide an example or address me to find out about all your suggestions ?
For what regards the first approach, provably due to my inexperience, I can not have the visualization of the cluster/slide of the directory selector up the event is not accessed, I mean that the MMI will show a zone without any element for a short period. probably this is not correct. Then, I never used the signaling node. I would like to evaluate the third (state machine) approach you suggested.
 
Thank
JL
0 Kudos
Message 6 of 11
(4,809 Views)
Great reply, Paul !
- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 7 of 11
(4,799 Views)
Jose,
 
I think the state machine that Paul was mentioning can be found by creating a new VI from a template.  If you go to New... >> From Template >> Frameworks >> Design Patterns >> Producer/Consumer Design Pattern (events).  This will set up a framework that will queue an event when it happens, then in parallel, a state machine is reading the state off of the queue and performing actions as indicated by the state.  This is simply a framework, and does nothing by itself, but if you have events that occur and you want to do actions in the same order as the events, this is the way to go.
 
Best of Luck,

Message Edited by Coal Man on 05-10-2007 08:46 AM

Brian Coalson

Software Engineer
National Instruments
0 Kudos
Message 8 of 11
(4,752 Views)
My mistake, that structure will just give you a producer/consumer loop to pass data based on events.  You would have to edit the consumer loop to have a case structure inside of it that would decide which case to execute based on what was dequeued.  Sorry for the confusion.
Brian Coalson

Software Engineer
National Instruments
0 Kudos
Message 9 of 11
(4,745 Views)

Thanks I have not had a chance to post an example.  One expansion on the queue, you are not limited to just sending an enum state, you can catually queue up a cluster which can contain states and parameters.  This is a very flexable application architecture.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 10 of 11
(4,725 Views)