From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Design Patterns for poor souls on LabVIEW Base

Solved!
Go to solution

Hi,

   I attempting to design an application which requires the use of the event structure. Unfortunatley, I only have LabVIEWBase, so need to invent the wheel somewhat. The architecture I am trying to develop needs to support a User interface with 30-40 controls, all with associated readand write buttons.

   When one of the values in controls changes I wish to execute a peice of code (assumably a state of a state machine). I also need some code to be executed when a read or set button is pressed.

   On top of all of this, I need the "quit" menu item to execute some code before quitting the application.

 

Can anyone please help or suggest some archetecture? 

 

Many thanks, Alec

0 Kudos
Message 1 of 9
(3,665 Views)

There is a built in pattern available.

From the menu choose File >> New... In the following dialog open the tree view to VI >> From Template >> Frameworks  and choose Dialog (Base Package).

Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 2 of 9
(3,657 Views)
haha, I think you slightly underestimate the complexity of the tasks in hand. I need a scalabale (large scale) and controlled architecture
0 Kudos
Message 3 of 9
(3,648 Views)

We were developing large app s in LV well before the Event structure was introduced.

 

We had to poll FP objects back then to determine if they changed state.

 

The good news is you do ahve property nodes availabe so you could "divide and conquer" You could set-up sets of sub-VI's that accept a control ref and run there own loop watching for value changes. The change could be submited to a queue and then your GUI would read the queue (to see if anything changed) and based on the messages it receive act accordingly.

 

So watchers combined with queues can be used as the "poor-man's Event Structure". Not as easy as an event structure but but functionally very similar.

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 9
(3,633 Views)

I'm not certain how compatible all the Open G tools are with LabVIEW Base.  But they're worth having a look at. Especially the JKI Statemachine

 

 

---------------------
Patrick Allen: FunctionalityUnlimited.ca
Message 5 of 9
(3,631 Views)

The JKI state machine will probably not work in LabVIEW base, because it uses the event structure.

 

Still, I would think most of the rest of the code could be used. We simply would place some polling code and a small wait inside the idle case to replace the event structure.

Message 6 of 9
(3,595 Views)
Solution
Accepted by topic author alecjcook

While downloading the JKI Statemachine, also download the other Open G tools Smiley Happy

 

You then have a vi called "Data Changed__ogtk.vi" that outputs a "True" when the data on the input has changed Smiley Surprised

Wire the controls that need to be monitored to mutiple instances of that VI and go to the states according to the outputs.

Message 7 of 9
(3,590 Views)
For anyone reading this in the future, the JKI statemachine CAN be used in LabVIEW Base, and it will continue to use the event structure which can be used to execute the "idle" state, but no extra, user defined events can be added to the event structure, Thank you National Instruments!
Message 8 of 9
(3,554 Views)

i will publish the references of my queues using FGV to make them target form another loops

0 Kudos
Message 9 of 9
(2,604 Views)