LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wait for Numeric control input before continuing

I currently have a program which has a while loop outside and then a short sequence of events inside the while loop which will repeat until the stop button is pushed on the while loop.  In the first sequence, there is a numeric control and what I would like the program to do is to wait, maybe by blinking or something until a value in entered and then told to proceed before going to the next sequence but I don't know how to do that.  My next question is very similar as well.  The next sequence, the program communicates with a device and receives a value.  I would like the program to wait at the beginning of the sequence before communicating.  I am not too sure what type of function to use to accomplish this.  There is one value taken from each sequence and are put into a build array outside the sequence loop but within the while loop and then stored in a text file.  Please let me know your ideas and let me know if you have any questions.  I will be happy to email the program if you would like further description of the program.
Thanks,
Steve Coward
704-588-2340 x1685
Stephen Coward
Northrop Grumman
stephen.coward@ngc.com
0 Kudos
Message 1 of 11
(4,375 Views)

A few of things you could do.

1.  Have a dialog box pop that requests the user to enter the particular data.  Once the dialog box is OK'd, the program writes the value from the dialog box into the control.  (See One button dialog box on dialog and user interface palette.)

2.  Put an OK or continue button on your front panel.  Put the numeric control inside a loop.  Wire the continue button to the stop terminal of that loop.  (Make sure you put in a small wait statement as well in the loop so the loop doesn't spin too fast eating up all the CPU resources.)  Now when the Continue button is OK, the loop will end and the value from the control will be passed out to the rest of the program.

3.  You could also use the time delay functions if you want the program to pause for a specific amount of time.

0 Kudos
Message 2 of 11
(4,360 Views)
Hi Stephen,

in addition to Raven's comments look at the attachment.
I added the ok button to the front panel and a wait in it's own frame.

Please use more LV specific words to describe the vi (sequence/frame instead of "event"). And have a look at the examples coming with labview!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 11
(4,352 Views)
Very similar thread and LV8.0 version of the changed vi Smiley Wink
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 11
(4,347 Views)

Thanks for the quick reply but I was wondering if you could resend the LabVIEW program attachment in version 8.0 since I am not up to date on the latest LabVIEW version.

Thanks again!

Steve Coward

Stephen Coward
Northrop Grumman
stephen.coward@ngc.com
0 Kudos
Message 5 of 11
(4,344 Views)

The okay button worked great for sequence frame 0.  I would also like for the program to pause or wait for another okay or enter command or something before starting frame 1 (communication with the device).

You guys are a great help!

Steve

Stephen Coward
Northrop Grumman
stephen.coward@ngc.com
0 Kudos
Message 6 of 11
(4,337 Views)
Hi Steve,

in frame 0 you already wait for user saying "OK" - now you want to wait for "OK" before advancing to frame 1 ???Smiley Surprised

As said before:
- use the same structure to wait for user: while loop with OK-button (don't forget delay to avoid cpu-hogging)
- use a dialog box to wait for user interaction
- rethink your dataflow, maybe something like a state machine would be suited for your needs

Some hints:
- create constants by right-clicking the function/terminal to always get to correct datatype. this way you avoid those coercion dots as seen on your "wait until..." functions!
- try to use left-to-right wiring (style guide)
- you can connect error clusters directly to the selector of a case structure (stop condition of while loop; if-then-else function). no need to unbundle the status flag in frame 1&2
- why do you multiply by 1 in frame 0?
- frame 1 & 2 are (nearly) the same -> perfect for a sub-vi

Message Edited by GerdW on 10-02-2007 04:32 PM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 11
(4,332 Views)

Thanks GerdW and Ravens Fan for the help so far.  I really appreciate it.  I still have a few more things to figure out.  The time stamp that you helped me with, I would like it to take the current reading whenever the sequence is in frame 5 and also I would like the time to be formated like 10/4/07 2:23:17 PM or something like that (military or whatever).  And one of the very last things I would like to be able to do is like in sequence frame 0 when it stops to highlight or start blinking the Polarizer # numeric control indicator box for the user to know that it is time to choose a new number to input.  Also, when sequence frame 4 when it stops the second time, I would like the user to know that and to start blinking the okay? 2 button.  I hope I am making sense in these questions.

Thanks,

Steve

Stephen Coward
Northrop Grumman
stephen.coward@ngc.com
0 Kudos
Message 8 of 11
(4,297 Views)
Hi Steve,

to show a blinking button you can use the "blinking" property of the control! (See attachment...)

I also joined frame 0 & 1 - it's a logical step of your vi.
Usually a sequence structure ISN'T needed in LabView, you can control the process flow using wires Smiley Wink
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 11
(4,277 Views)
Thanks again Gerd W.  This is really coming together.  I only have a couple more things I would like to add:
 

What if I wanted to display on the front panel in real time the values from Polarizer #, P1, P2 and the last calculated value (P2/P1 * 100) called T% in a table or something like that.  What would I have to do?  Or it could just be Polarizer # and T% at the least.  I just want to let the user know the values in a list, spreadsheet or table as they go.  I think the very last thing would be able to stop the program at any point in time instead of at the end like I have it.  The problem with what I have is that the stop button will be pressed and then an additional loop will go on afterwards.  I want the program to end as soon as the stop button is pressed no matter what sequence it is.

Steve

Stephen Coward
Northrop Grumman
stephen.coward@ngc.com
0 Kudos
Message 10 of 11
(4,266 Views)