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: 

Handling UI while running a "program"

My LabVIEW program, which controls a special-purpose scientific machine, involves a central "interpreter" which runs a script controlling the operation of the machine. Most of the user interface involves configuration and testing of the machine, and then the running of a script. While the script is running, most of the user interface should be locked, but a few elements need to remain active because the user is able to pause, abort, modify, and monitor the execution in certain ways while it is in progress.

 

This doesn't flow automatically well with the While loop / Event structure model, because once the user clicks the button to run the script, the Event structure is busy running that subroutine, and is unavailable to handle other user actions. Please recommend: what are best practices for dealing with this situation? Write a subsidiary While / Event loop that is only allowed to run when the primary one is busy running a script?

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

Hi Ken,

 

if i was writing to a single file from single FIFO, then it was working Perfectly.. but when i was trying to write into 2 or more files at once from different FIFOs i am not getting all the data into the files.

The inability of the event structure to handle the next events is because of YOUR programming faults! If you would apply a recommended programming scheme this would be no problem at all…

 

Ever heard of producer-consumer scheme? Or QMH implementations? Or ActorFramework? Any scheme which is able to handle different portions of code in parallel?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(1,929 Views)

A default setting in an event is "Lock panel while Active" (or similar). This will prevent any and all click actions to have an effect. It sounds like you'll need to not have this option and instead set a number of Controls to Disabled (through a property node). The effect will be that you queue up events that will fire after the current one. (Actually this is irrelevant if the event is fast)

For user experience it still requires the event to finish somewhat fast, which is why it will need to be offloaded to a Consumer loop or asynchronous VI.

 

So; Quick events can be handled in the event structure. Slow events needs to be offloaded. When working on the Heavy offloaded task you'll need to disable (and grey?) some Controls.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 3 of 3
(1,911 Views)