LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Advice on communications between UI, event handler, and qsm with many variables.

Dear all.

 

I have been looking and looking through the forums, but have not really managed to reach a conclusion, so now I will try asking all you great developers out there.

 

My problem: 

I am creating code to control a setup on a microscope, namely controlling a pressure pump, stage, camera, shutter etc. This means I have a UI with a myriad of buttons and values with settings which control the parameters needed by the hardware. My usual approach is to bundle up VI server references for each item together with an event queue and then pass it as a type def. between the different parts of the program, such that my main VI simply contains a subVI with the UI, a sub VI with the event handler (dynamic events from the references), and a subVI with the queued state machine (event consumer). All linked together using the type def. cluster control. This does require a lot of property nodes, despite in most cases, I only need to read and/or write the value of the items being passed by the control ref. 

 

Is there a more elegant way to achieve this? I have been thinking about global variables. There are waaaaaaay too many variables to pass them through the connector panes alone.

 

Actually the software has been developed before, but I am updating to LV2017 (from 2011) and adding some new features. The previous developer had everything in one VI, and just used local variables to read and write the values. I judge that race conditions were not really an issue, as the values were used just once in each event, and the QSM would handle the events one at a time. However, I would prefer to be able to split each loop (event handler and QSM) into their own subVI for better readability.

 

I am sorry I don't have any code snippets or something to give you right now, as I have started over again (for the third time....) and the code is very much non-existing before I solve this problem, however, I think my question is more of a general one anyway. 

 

Thanks for your inputs!

 

0 Kudos
Message 1 of 3
(1,966 Views)

Been there, done that!

 

Here's the Most Important Step to recommend:  Be Sure To Use Version Control!!!  I've been using Subversion (with the TortoiseSVN client and the default Repository Model of a Repository for the Project, with trunk (where almost everything goes), tags (to mark "releases" or "versions"), and branches (rarely used, and only with a lot of caution).  Commit Early, Commit Often (at least once at the end of every day you make changes).

 

Bob Schor

 

 

0 Kudos
Message 2 of 3
(1,950 Views)

Install the package Hidden Gems.

 

You can then traverse all objects, get their labels and filter the controls depending on their label.

 

You may need to use to more specific class for advanced property nodes. (version 2015 attached)

 

mcduff

 

snip.png

 

0 Kudos
Message 3 of 3
(1,940 Views)