LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying message for a certain period of time within a while loop

Hi there,

 

My question is very simple, yet I haven't found any solution on the forum.

 

My VI looks like the snippets attached to this post, and what I'd like to do is to keep the information displayed in the box for more than 500ms in order for the user to ... get the information.

 

Putting the information box outside the loop doesn't do the job, and I want to keep my loop looping every 500ms.

 

Any idea on how to fix that ?

 

Flo

0 Kudos
Message 1 of 20
(3,944 Views)

Just use a parallel loop where you get the msg via a notifier. There you can decide how long you want to show this msg...

 

EDit: another option I usually use is to create a dynamically callable pop-up subVI. If you call it dynamically, it will not block your main VI...

0 Kudos
Message 2 of 20
(3,934 Views)

Do you man a loop in a loop ?

0 Kudos
Message 3 of 20
(3,932 Views)

Hi ICCR,

 

no, a "parallel loop" means to have "loops in parallel" without dataflow dependencies!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 20
(3,927 Views)

ok... I am a bit confused now. Would you have an example, as a VI, that would show me where that could help me?

0 Kudos
Message 5 of 20
(3,923 Views)

Hi ICCR,

 

examine the example VIs on notifiers.

In the parallel loop reading the notifier you can decide how long you will display the message. In the simplest case you use the timeout of the ReadNotifier function for this purpose…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 20
(3,907 Views)

you can use queue

msg.png

0 Kudos
Message 7 of 20
(3,905 Views)

ok, so I tried with the notifiers and with one textbox, but it's half working: if i set a timer at , say, 3s, the box will not notifies everything. where am I wrong ?

 

0 Kudos
Message 8 of 20
(3,884 Views)

Just get rid of that second Notifier (stop condition). Just use a single Notifier for the string msg! When you stop your main While loop, use the Release Notifier, it will "kill" the top msg loop.

I guess your problem is with that Boolean Notifier.

 

By the way, your code is really messy, you should use subVIs to tidy it up. Also, since you use a 1 sec timeout to collect data via serial coms, any user GUI commands will wait up to 1 sec until they are fired. A producer consumer (Events) design would be much nicer for this case...

 

EDIT: The way you try to program is a no go, everything would be much easier with a clear state machine design.

0 Kudos
Message 9 of 20
(3,867 Views)

I have been told to use a producer - consummer VI. But I am quite new to Labview and beside my research I don't really understand/ see how to transform my code into P-C version. 

 

Help !! 😞

 

edit, I've added some modification to the code, getting rid of that second notifier in the second smaller loop. I've used a local variable to stop it instead of your recomendation (for the simple fact that I am lost !)

 

but now I've got no message at all...

 

Download All
0 Kudos
Message 10 of 20
(3,863 Views)