From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two Button dialog - Fire once

Solved!
Go to solution

I have an application where I need to get many responses from the user by way of two button dialogs. I need to sense the state change of a latched DI and when it goes HIGH, display a two button dialog box for the user to interact. Since this happens inside a 100ms while loop, I need to supress the dialog box after user choice is made. Otherwise the pop up will happen repeatedly as the DI is latched in HIGH state.

 

While I have been able to get the functionality with a shift register ( refer attachment in LV2009), I was wondering if there was a better way to do these kind of "once-only-messages" ?

 

Thanks

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 12
(4,993 Views)
I would just do it with a shift register.  You may be able to use some boolean logic with using the Implies boolean function.  It could possible minimize the embedded case structure, maybe even eliminate a shift register.  But I find the Implies function is not always easy to get working correctly right away, and may not be as easy to decode when you look at the VI later on.
Message 2 of 12
(4,984 Views)
I agree with Ravens - what you have may seem like a lot of wires to do a simple task, but it's in keeping with the dataflow idea.
Richard






0 Kudos
Message 3 of 12
(4,975 Views)

Well, you don't really have a 100ms loop, because the dialog box stalls the loop forever, or until the dialog is completed (whatever comes first ;)).

Is this acceptable? Personally, I don't like such dialogs. They are annoyong to the operator.

 

Here's a simpler version that only uses one feedback node.

 

Message Edited by altenbach on 02-05-2010 09:06 AM
Message 4 of 12
(4,968 Views)

The version is simpler. But there is one glitch. The lamp once switched ON remains so even when the switch is toggled to the "Disable" position.

 

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 5 of 12
(4,930 Views)

Perhaps you want something like this.

 

 

I moved the lamp indicator outside so it is always written to.  I also put a local variable for Enable Link inside the false case so that if you select no in the dialog, the switch returns to false.

Message Edited by Ravens Fan on 02-05-2010 08:47 PM
Message 6 of 12
(4,926 Views)
Solution
Accepted by topic author MogaRaghu

It is not a good idea to change the state of the Digital Input which is "Read Only"

 

The final VI with the required modification is as below :

 

OnlyOnce.PNG

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 7 of 12
(4,874 Views)

where can i find these?

Danybond_1-1574898458316.png

0 Kudos
Message 8 of 12
(3,515 Views)

feedback node.png

 

change direction.png

Message 9 of 12
(3,509 Views)

Hi Dany,

 

the other is a FALSE boolean constant from LabVIEW before LV2011 (or LV2010)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 12
(3,494 Views)