09-27-2018 01:23 PM
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?
09-27-2018 01:37 PM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-27-2018 01:57 PM
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.
09-27-2018 01:57 PM
would you be able to point me to any examples?
09-27-2018 02:31 PM - edited 09-27-2018 02:33 PM
@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
09-27-2018 03:12 PM
09-27-2018 03:19 PM
where is this example located?
09-27-2018 03:53 PM
To find examples in LabVIEW:
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
09-27-2018 03:59 PM - edited 09-27-2018 04:04 PM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-27-2018 04:02 PM
@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.