LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom "display message" vi does not initially show text

Solved!
Go to solution

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!

0 Kudos
Message 1 of 11
(2,843 Views)
Solution
Accepted by evannfernandez

try making your message indicator, "visible" through property node

Hardware%20Dialog%20with%20Timeout[2]_BD.png

Message 2 of 11
(2,833 Views)

You have a greedy loop hogging the cpu and preventing the update to the indicator!  Toss any kind of delay in the while loop.


"Should be" isn't "Is" -Jay
Message 3 of 11
(2,821 Views)

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?

0 Kudos
Message 4 of 11
(2,807 Views)

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.

0 Kudos
Message 5 of 11
(2,800 Views)
Solution
Accepted by evannfernandez

@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:

No Button Dialog.png

 


"Should be" isn't "Is" -Jay
Message 6 of 11
(2,791 Views)

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.

0 Kudos
Message 7 of 11
(2,790 Views)

Ah, I see, Jeff. I appreciate you taking the time to post that.

I'll give it a try.

0 Kudos
Message 8 of 11
(2,788 Views)

@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!

0 Kudos
Message 9 of 11
(2,784 Views)

@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.  


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 11
(2,777 Views)