LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to execute multiple event from an event structure at once?

So I have an event structure with multiple events that have buttons on the front panel and I want to be able to switch multiple buttons at the same time with one button (execute multiple events with one event or action). How do I go about this?

0 Kudos
Message 1 of 10
(3,024 Views)

State machine, or rather a Queued Message Handler.  Have each button go to a state.  Then you can have one button that goes to each of those states one at a time in the order you want.  I'd recommend the JKI State Machine.

0 Kudos
Message 2 of 10
(3,013 Views)

You can have one button that sends a value to multiple Value (Signalling) properties for the other buttons.

 

But you can never have multiple event cases in a structure execute at once.  It can queue up multiple events, but an event won't execute until the previous event is done executing.

0 Kudos
Message 3 of 10
(2,998 Views)

would you be able to point me to any examples?

0 Kudos
Message 4 of 10
(2,997 Views)

@mshask wrote:

So I have an event structure with multiple events that have buttons on the front panel and I want to be able to switch multiple buttons at the same time with one button (execute multiple events with one event or

 

action). How do I go about this?


From the description. You need  1 to many synchronization method.  

 

That means Notifier.  Gather all the data elements you need and fire the notifier (not sure about a channel option).  You will need a parallel loop for each notifier consumer and they could act on separate elements of the notifier data.  Each parallel loop will see the notification at the same time and do its job while the other things do their business.   

 

OS and hardware limited of course.  For instance you can only send one message at a time on the same GPIB bus and there are a finite number of hyperthreaded cores in the CPU.

 

There is a notifier shipping example showing this


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 10
(2,974 Views)

@JÞB wrote:

@mshask

That means Notifier.  Gather all the data elements you need and fire the notifier (not sure about a channel option). 


That's called a Tag Channel.  It's a Notifier on Steroids.

 

Bob Schor

Message 6 of 10
(2,962 Views)

where is this example located?

0 Kudos
Message 7 of 10
(2,955 Views)

To find examples in LabVIEW:

  • Start LabVIEW.
  • Under "Help", click Find Examples.
  • Do a Search, for example, "Notifiers".
  • Click on an "interesting topic".

In LabVIEW 2018, doing this will bring up several examples.  One "Wait on Multiple Notifiers" example suggests that you can stop routines using the Notifier by releasing it, thereby causing Errors on any routines using it.  What?  Sloppy, a mis-use of the Error Line!

 

But there's also the final entry brought up by the Example search, for Channel Basics.lvproj.  Example 3 shows the Tag Channel in action as a Super Notifier, with its ability to (if you choose to do so) send a "This is the Last Notification" notice to all listeners, who can decide to exit if that's appropriate.  Civilized -- telling your colleagues that you are done with their services, rather than simply shooting them all ...

 

Bob Schor

0 Kudos
Message 8 of 10
(2,942 Views)

Here is the JKI State Machine:

http://sine.ni.com/nips/cds/view/p/lang/en/nid/209025

 

And here is a video showing some of its basic functionality.

https://www.youtube.com/watch?v=XJFujhIuZdU

 

The other suggestions given are also useful and can probably do what you want, but personally I'd do it with a QMH.

0 Kudos
Message 9 of 10
(2,937 Views)

@mshask wrote:

where is this example located?


Not sure exacty...  I'd just open any LabVIEW window.  Go to the Menu》Help》Example finder.  Sip coffee... keyword search "Notifier" and read the discription text in the top left pane til it sounded about right.  Maybe I'd even open something else and learn the wrong things by accident. 

 

I let NI R&D worry about where they put it.


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 10
(2,936 Views)