LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

share variable to trigger message

Solved!
Go to solution

Hello to all of you.

I have an application using share variable boolean to trigger my message.

The problem is the message keep popup as long the share variable boolean data is true.

How to overome this problem, so that it only prompt one time after OK button has acknowledged?

Thank you.

0 Kudos
Message 1 of 6
(4,205 Views)

Simply turn the Shared Variable off after it's been used.

Momentary Message.png

0 Kudos
Message 2 of 6
(4,201 Views)

Bob_Schor, thanks for prompt reply.

This while loop is too fast and it keep resetting SV, the message not able to popup. Occasionally SVE failure happen shown

"LabVIEW DSC:  (Hex 0xC004FF00) The OPC Server returned a value with a bad status for an unknown reason. Consult the vendor documentation for your OPC Server to resolve this error.This error or warning occurred while reading the following Shared Variable: \\My Computer\Message\Message02
\\192.168.1.12\Message\Message02".

 

Is it possible use event structure to handle this problem? 

0 Kudos
Message 3 of 6
(4,183 Views)

I need advise and help to resolve this issue.

Hope someone can give a hand, thank you.

0 Kudos
Message 4 of 6
(4,116 Views)
Solution
Accepted by topic author sjw9201m

Hi,

 

You need to use case structure to show the message when variable is true. At the moment when the event happens you set the message to show out and in the next few microseconds you set it to hide. Obviously you'll not get the behaviour you expect - there is no chgance to see the message and you might get some errors because you close a message before it pop up.

 

Unfortunately I use LV2014 so I can't open your code but to fix it - simply draw case structurs around the message VI and place the reset variable into the TRUE case. Add some Wait VI into your loop (20-30mS) to slow down the execution of the loop. At the moment you call the loop many thousands times per second and I'm sure you waste a lot of processing time for nothing. Technically you don't need  immediatly to show the message on the screen - it's interaction with the user which may take really long.

0 Kudos
Message 5 of 6
(4,105 Views)

Luben, thanks for your advised.

 

0 Kudos
Message 6 of 6
(4,082 Views)