LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help me out with a simple dialog box task

i have used a single dialog box connected to a case structure..but the problem is it only executes true case after pressing "OK" button.

i need the false case to keep on executing untill "OK" button is pressed.. please heelp me out..

0 Kudos
Message 1 of 7
(3,337 Views)
Duplicate - http://forums.ni.com/t5/LabVIEW/i-need-the-false-case-to-keep-on-executing-untill-quot-OK-quot/td-p/...

It is extremely irritating when you post the same question multiple times. Just rude behavior.
0 Kudos
Message 2 of 7
(3,333 Views)

are you expecting like this ,

 

Image.png

Munna
0 Kudos
Message 3 of 7
(3,319 Views)

In true case i have done addition operation and when i run the vi it will display a message dilog box .

before clicking the message dialog box i need false condition keep on exicuting till i press the dilog box..but its not happening ...

 

 

please find the png file attached

 

thank u

0 Kudos
Message 4 of 7
(3,307 Views)

Hi modi,

 

THINK DATAFLOW! Use probes to see why it only executes the TRUE case of your case structure…

 

As you seem to be new to LabVIEW I want to suggest taking all the free online beginner courses offered by NI on their website. They are for FREE!

(And PLEASE stop creating duplicate posts for the very same problem…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 7
(3,303 Views)

I agree that the spamming of the same question over and over is annoying and makes me LESS likely to help you. However, I will try to answer you.

 

I believe that you are probably fairly new to LabVIEW. LabVIEW is a dataflow language. As such, each node operates as soon as all of its nodes have data. Your One Button Dialog Box does not produce data until the button is pressed. Therefore, there is no way for the Case structure to execute either the True or the False case until the One Button Dialog Box produces its data.

 

So, there are several ways to work with this. Several have already been suggest in this or one of the other 3 queries.

 

You could place the button on the front panel. If it is on the front panel, it will be read immediately and the value of the button will be available. If it is inside of the loop, the value will be available each time the loop is run. So the suggestion to use a button on the front panel would be a good one.

 

If you need to use the dialog box, you could use a producer-consumer architecture. The dialog would be in the producer and the case code would be in the consumer. I think that this is not as good of a solution, but if this is part of a larger application it may be desirable to you for other reasons. There is an example producer-consumer that you can find in the example finder and I think that there is a template for one as well.

 

There are other ways to do this as well, but they get more and more complicated and I don't think you have the experience necessary to accomplish them. I also don't think you need to make things that complicated for such a simple task.

 

Good luck and try not to duplicate questions again.

 

0 Kudos
Message 7 of 7
(3,268 Views)