LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Request feature - allow one/two/three button messages to launch asychronously

Hey fancy folk,

 

Pretty sure there has to be a place to put this other than the LabVIEW main forum, but I couldn't find it easily.  If so, can someone link me to the area and I'll add my request there.

 

Digressing, I'd like to request a feature in LV to allow the developer to run the one/two/three button message asynchronously so it doesn't halt VI execution.  There are times when I want to launch a message to the user but I don't want the execution of the main code to stop.  

 

One such example is when my state machine sees an error at a specific state, I want to launch the popup then saying something went wrong and goto the "safe state" state of my state machine then shutdown.  I could set a flag and store a string in the error case to launch the message in the shutdown case, but I feel like that doesn't flow as well as having the message in the error case of the state.   

 

Another example is when there are multiple loops running (such as consumer/producer with a UI loop) and a loop which process the data detects a system fault so it sends a stop command to the other loops which then all stop execution.  If there is the the one button message in the process data loop (so its easier flows more logically that this loop detected the error) then that loop hangs and doesn't shutdown until the user clicks the button.  In this case, I would just want the user to know that "error X happened and we shutdown the system to protect the UUT" then execute the shutdown routine for all the loops instead of hanging there.  It's not that this message is unimportant, it's very important to let the user know what happened, but when a test runs for multiple days and checked in on occasionally, it'd be nice to be able to stop the main VI and launch the popup letting the user know the test stopped.

 

My current work around is to create a VI that launches an async execution of a popup VI where I pass the message to the async launcher which passes it to the popup. It works, but its tedious.

 

Thanks,

Matt

If you want to find useful posts, you have to make useful posts. Please try to provide how you solve your posted problems for future users, a better forum helps the community out.
0 Kudos
Message 1 of 8
(1,474 Views)

@Matt_AM wrote:

Hey fancy folk,

 

Pretty sure there has to be a place to put this other than the LabVIEW main forum, but I couldn't find it easily.  If so, can someone link me to the area and I'll add my request there.

 

Digressing, I'd like to request a feature in LV to allow the developer to run the one/two/three button message asynchronously so it doesn't halt VI execution.  There are times when I want to launch a message to the user but I don't want the execution of the main code to stop.  

 

One such example is when my state machine sees an error at a specific state, I want to launch the popup then saying something went wrong and goto the "safe state" state of my state machine then shutdown.  I could set a flag and store a string in the error case to launch the message in the shutdown case, but I feel like that doesn't flow as well as having the message in the error case of the state.   

 

Another example is when there are multiple loops running (such as consumer/producer with a UI loop) and a loop which process the data detects a system fault so it sends a stop command to the other loops which then all stop execution.  If there is the the one button message in the process data loop (so its easier flows more logically that this loop detected the error) then that loop hangs and doesn't shutdown until the user clicks the button.  In this case, I would just want the user to know that "error X happened and we shutdown the system to protect the UUT" then execute the shutdown routine for all the loops instead of hanging there.  It's not that this message is unimportant, it's very important to let the user know what happened, but when a test runs for multiple days and checked in on occasionally, it'd be nice to be able to stop the main VI and launch the popup letting the user know the test stopped.

 

My current work around is to create a VI that launches an async execution of a popup VI where I pass the message to the async launcher which passes it to the popup. It works, but its tedious.

 

Thanks,

Matt


The idea exchange is where you want to make this suggestion.  Anything that gets a certain amount of kudos gets consideration from NI - and many, many LabVIEW features came from there.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 8
(1,457 Views)

Instead of a popup, you could just have a text indicator and red LED in a corner of the front panel to give user feedback about error status.

 

Instead of doing an asynchronous launch, just create a small subVI that opens the front panel when called to display your message in a string indicator, but then ends without closing its front panel. Since execution completes immediately, it will not block dataflow of the caller. Later you can dismiss it with the {X} in the upper right.

Message 3 of 8
(1,456 Views)

@altenbach wrote:

Instead of doing an asynchronous launch, just create a small subVI that opens the front panel when called to display your message in a string indicator, but then ends without closing its front panel. Since execution completes immediately, it will not block dataflow of the caller. Later you can dismiss it with the {X} in the upper right.


Here's a quick example for that (LV2015):

 

The subVI could easily be modified to include more information, add caller name, timestamp, etc. or even keep the last N messages in a shift register. Here's the entire "code" of the subVI!!!

 

It's all in the "window appearance" configuration!

 

altenbach_0-1666107626633.png

 

 

Message 4 of 8
(1,431 Views)

How exactly do you want the 2 or 3 button dialogs to work if they're called asynchronously? Those dialogs need to return which button they press.

 

I've made my own reuse ones that pop up another VI asynchronously. It's only tedious to do once, then you have a library that can use those two VI's forever. I think I had the "launcher" VI return an event reference or something so the caller VI could listen to the events if it wanted to, or it could ignore them if it wanted to. If you're using the Actor framework, they could easily integrate as actors (and IMHO would be a good place for the older style message templates rather than the newer interfaces). I haven't used the Delacor QMH but I bet you could make it a module there as well.

0 Kudos
Message 5 of 8
(1,396 Views)

It wouldnt so much be a dialog that requires feedback from the user, I just used the term dialog to convey the idea of a popup message that was already built into LabVIEW.  For me its more of a "Hey this happened" message to the user while the rest of the code completes its process. 

 

An example would be "hey, we had a fault in state X and we shut down" popup Vi placed in the state X.  My logic is that you can easily find where the errored state is due to where the popup message VI is place and the rest of the code can safely shutdown without needing the user to create a reentrant VI to display a message with a boolean then another VI that acts as a launcher in state X to launch the original reentrant VI.  Streamline the process kind of thing.

If you want to find useful posts, you have to make useful posts. Please try to provide how you solve your posted problems for future users, a better forum helps the community out.
0 Kudos
Message 6 of 8
(1,299 Views)

Since it's just info that doesn't demand any user interaction, altenbach's suggestion should do the trick nicely!   I've been occasionally using that same "trick" for at least 15 years.  I think I've experimented with the "Floating" option under VI Properties->Window Appearance too, but don't remember my conclusion offhand.  You can experiment too and make your own preference.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 7 of 8
(1,279 Views)

@altenbach wrote:

 

 

... just create a small subVI that opens the front panel when called to display your message in a string indicator, but then ends without closing its front panel. Since execution completes immediately, it will not block dataflow of the caller. Later you can dismiss it with the {X} in the upper right.


I have used this trick in the past. 😁

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
0 Kudos
Message 8 of 8
(1,274 Views)