LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

user interface

Solved!
Go to solution

Just use the Prompt User for Input VI.  Smiley Wink

 

EDIT:  BTW, I used property nodes to set the values before the loop starts which allows the user to change the values whil the loop runs.  If you don't want the controls available just erase them and wire the Value outputs of the Prompt User right into your loop and use them directly.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 11 of 19
(2,266 Views)

This is probably the simplest way to implement this with two controls. With more controls, you should bundle them in to a cluster.

SubVI.PNG

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 12 of 19
(2,264 Views)

Hi PalanvielT,

 

I tried to use event case structures but the values are not updated to main vi. Ihave attached the sample program that I have tried. Could you please tell me where I am doing wrong

Download All
0 Kudos
Message 13 of 19
(2,229 Views)

Hi vk92, 

 

I can take a look if you save for LV 2012. File >> Save for previous...

0 Kudos
Message 14 of 19
(2,222 Views)

You need to stop the while loop when the user clicks cancel or Okay. Really, you can just get rid of the while loop and the subVI will end after the user activates a single event in the structure.

 

Also, move all of your booleans to inside their respective event cases. This makes the button actuate back to false once the terminal is read from. Otherwise your buttons stay depressed.

Dialog.png

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 15 of 19
(2,219 Views)

Hi 

 

I have attached the 2012 version

Download All
0 Kudos
Message 16 of 19
(2,215 Views)

Yes, James has shown you the correct way to do it. Also, make it so that the user cannot close the window, or that closing the window does the same thing as a cancel. Please follow my advice from above:

 

"You don't need a loop, the event structure will wait until some event occurs. Then you can output the user input in a cluster from the "OK Button" case.

 

Set the VI to open when called and to close if it was originally closed afterward."

 

Edit: And of course the re-init to default are not necessary when you are reading the booleans correctly.

0 Kudos
Message 17 of 19
(2,212 Views)

Hi James. Morris

 

The problem is solved. But I can open it only once when I am running the program. I would like to open the sub vi multiple times and change the values when my program is running. Could you please help me with this.

 

Thank you

0 Kudos
Message 18 of 19
(2,208 Views)
Solution
Accepted by topic author vk92

Do not use the stacked sequence structure in your main program.

 

Put the event structure inside the while loop. Wire something to the timeout (top left of event structure) like 100ms, and put whatever you want to happen in the background there. In this case it looks like updating your graph.

0 Kudos
Message 19 of 19
(2,204 Views)