LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event structure for the disable property node

Afternoon Gurus,

 

I am writing a piece of code which has several parallel event structures, each with several cases embedded. Within 3 or 4 of these cases I need to enable and disable many numeric controls. Always the same ones to the same state.


Rather than have a disabled property node for each controller in each case, I was thinking of having a new event with one set of the disabled property nodes in and then use a FGV as the selector (enabled, disabled, disabled and greyed), which is set in the cases. Is this a good way of doing this or is there something neater. Attached is a PNG which is just a simplification of the problem.

 

Mucho ta-ness!

"When I read about the horrors of drinking, I gave up reading"
0 Kudos
Message 1 of 5
(2,606 Views)

First of all, you do not need 3 event structures.  One structure is plenty if you have the proper underlying architecture. 

 

For disabling a number of controls, I like to create a subVI that accepts an array of references and a boolean.  Inside the subVI is an autoindexing for loop that loops thru all the references and disables/enables based on the value of the boolean.  I'm sure there are more advanced solutions but this works well for me. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 5
(2,596 Views)

@MancPablo wrote:

I am writing a piece of code which has several parallel event structures


For a GUI, that is a bad idea.  You should have 1 event structure handle all of the events for a GUI.  Users are too slow to notice otherwise.  If you need them to spawn off parallel processes, use a Queued Message Handler.

 

As far as your actual question, the more I see, the more confused I am for what you want.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 5
(2,595 Views)

Thanks guys,

 

I guess being self taught on LabVIEW shows. I shall go and Google Queued Message Handler and take it from there.

 

Paul

"When I read about the horrors of drinking, I gave up reading"
0 Kudos
Message 4 of 5
(2,580 Views)

Ok, off piste here but looking at the QMH, it seems to be a different way of doing the same thing I am. The event handling loop is triggered by some user interface (a button is pressed or a value changed) and that is queued for the message handling loop. The MHL then dequeues and takes the appropriate action based on the message which will match a certain case within the MHL..

 

I have effectively a event handling loop, but instead of a queue, I am putting variables into a FGV and then triggering a case in a different event loop, which is the equivalent of the MHL.

 

or not?

"When I read about the horrors of drinking, I gave up reading"
0 Kudos
Message 5 of 5
(2,576 Views)