10-19-2016 04:03 AM
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
10-19-2016 04:43 AM - edited 10-19-2016 04:46 AM
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...
10-19-2016 04:44 AM
Do you man a loop in a loop ?
10-19-2016 04:51 AM - edited 10-19-2016 04:52 AM
10-19-2016 04:59 AM
ok... I am a bit confused now. Would you have an example, as a VI, that would show me where that could help me?
10-19-2016 06:15 AM
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…
10-19-2016 06:17 AM
you can use queue
10-19-2016 08:45 AM
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 ?
10-19-2016 09:43 AM - edited 10-19-2016 09:46 AM
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.
10-19-2016 09:46 AM - edited 10-19-2016 09:54 AM
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...