LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling event from an event

Solved!
Go to solution

Hi All,

 

probably that is already solved many times but a reasonably searching time leads to nothing useful.

I am newbie in Labview and I have to edit an existing program.

 

So what I like to do, is to trigger an existing events from a new event, which I am implementing currently.

 

This old event is triggered by a value change of a button.

Now, I try to change this value by my new event (this works) but the old event is not starting.

 

Maybe one of you have the patient to help me with that.

 

Attached a example vi.

 

Cheers, Johann

 

BTW: If this works out with a letch button I would be even better 🙂

0 Kudos
Message 1 of 9
(5,313 Views)

The vi you attached looks blank to me.  Perhaps re-upload?

0 Kudos
Message 2 of 9
(5,300 Views)

Hope now it is there

0 Kudos
Message 3 of 9
(5,296 Views)
Solution
Accepted by topic author JoZem

You should re-iterate on the very basics of LV: Dataflow programming.

Also you have to be aware of caveats of event structures.

 

Hints:

  • Move ONE event structure into the main loop
  • Remove both inner loops
  • Configure the event structure to handle both events
  • Add a stop button including event handling code and to stop the (outer) sole remaining loop
  • Write values to terminals, not variables. Variables have their use cases. These are much different to what you coded, no variables needed at all
  • Never implement an infinite loop unless for RT and FPGA target
  • There is only one VI implementation pattern which uses a while loop with TRUE connected to "Stop when true": It's called Functional Globale Variable (FGV, aka Action Engine). Your VI is no FGV
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 4 of 9
(5,288 Views)

Thanks for the help...

 

I missed the event source.

And sorry for the bad example.

 

Best, JOhann

0 Kudos
Message 5 of 9
(5,277 Views)
0 Kudos
Message 6 of 9
(5,177 Views)

For some reason you are still using two loops and two event structures. Why?

Also use a feedback node instead of the local variable to toggle the current value.

0 Kudos
Message 7 of 9
(5,166 Views)

Here is basically the same functionality. No locals or property nodes needed.

 

 

0 Kudos
Message 8 of 9
(5,160 Views)

Hi,

 

as I mentioned I like to modify an exsiting program. And I only want to add an additonal  event  that calls the other events. That  is why I splitted  into two parts to have a minimal example that is close to my problem. 

 

Thanks for the other solution. Nice to see how it could work differently.

 

Best Johann

0 Kudos
Message 9 of 9
(5,132 Views)