09-04-2014 10:43 AM - edited 09-04-2014 10:43 AM
Good morning, NI LabVIEW community.
I am working on a vi that displays a message to the user and then closes after five seconds. When I run the vi itself it works fine, but when it is inserted into another vi the text does not display when the vi runs for the first time. Anytime after that the text will display though.
I've searched for help and fiddled around with the wiring, but I'm still having this issue. Maybe it is just not possible to do. 😞
Any help will be appreciated!
Solved! Go to Solution.
09-04-2014 10:55 AM - edited 09-04-2014 11:02 AM
try making your message indicator, "visible" through property node
09-04-2014 11:02 AM
You have a greedy loop hogging the cpu and preventing the update to the indicator! Toss any kind of delay in the while loop.
09-04-2014 11:32 AM
Woohoo! That did it, apok!
Thanks for the quick response!
Jeff, I understand, but there is not a delay in the loop. Should I build this vi without a loop?
09-04-2014 11:51 AM
Your loop really isn't doing much other than providing a very fast running, CPU hogging mechanism to put a 5 second dealy between the FP Open and FP Close.
If replaced the while loop with a single frame sequence structure, then put a Wait (msec) function in there with the 5000 wired to it, it will effectively do the same thing without burning CPU cycles.
09-04-2014 12:08 PM
@evannfernandez wrote:
Woohoo! That did it, apok!
Thanks for the quick response!
Jeff, I understand, but there is not a delay in the loop. Should I build this vi without a loop?
There are tons of ways to built that vi that do not have greedy loops
To be consistant with personal design guidelines I have mentioned around here from time to time, I'd choose something very close to this:
09-04-2014 12:09 PM
RavensFan, thank you for the reply and clear explanation. I have implemented your suggestion.
It still requires a property node for the message set to "visible", but that isn't a problem.
09-04-2014 12:13 PM
Ah, I see, Jeff. I appreciate you taking the time to post that.
I'll give it a try.
09-04-2014 12:28 PM
@JÞB wrote:
You have a greedy loop hogging the cpu and preventing the update to the indicator! Toss any kind of delay in the while loop.
i didnt realize that....if you put in the "wait(ms)" in the loop, it would work!
09-04-2014 12:43 PM
@apok wrote:
@JÞB wrote:
You have a greedy loop hogging the cpu and preventing the update to the indicator! Toss any kind of delay in the while loop.
i didnt realize that....if you put in the "wait(ms)" in the loop, it would work!
Easy to miss and a subtle point about busted dataflow. Or I would have left the thread in your more than capable hands. Forcing a redraw with a property node also worked I assume but, simply masked the real problem and without datadependancy between the greedy loop and the p-node you are left at the mercy of the compiler as to when exactly that redraw is requested.