LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with User Data Entry Into a Control

I'm writing some code where the user must correctly enter numeric data for a number of parameters (eg wavelength, time, energy etc) before the program continues (eg via a 'click button when done' type command). I'm using a while loop to lock the done button out and hold progress of the program until all data entered is valid (eg using a boolean AND statement across all data input parameters) For example, the entered time must between 30-60 seconds and a boolean test on the time will remain low until the time is within this band.

Unfortunately, I've noticed that non-labview users do not click away from the control box (or use the tick box) when entering data, and a problem arises when they have establised valid data, bu
t then start to enter stupid data in a control field (eg time = -5 seconds). If they don't confirm the data input (eg by using the tick box) my boolean trap stays high and the done button is available to allow them out of the loop. Unfortunately, once on the other side of the loop, the control carries through time = -5 seconds, which of course screws up the analysis!!!

I have solved the problem in my own way, but my solution is not elegant, and users complain that the controls are 'clicky'. {And no, I can't tell them to enter the data properly!!!}

Has anyone come across a neat solution to this problem?
0 Kudos
Message 1 of 3
(2,724 Views)
For that specific example where you merely have to check the range, you can set the range properties of numeric controls before entering the loop. Then LabVIEW will automatically coerce user input.

For more complicatated validation, use the trick illustrated in the picture: the Stop button is fed to a shift register so the loop iterates one more time to validate inputs before exiting.


LabVIEW, C'est LabVIEW

Message 2 of 3
(2,724 Views)
Thanks Jean-Pierre,

Excellent.

I think this will do the trick; I've tried just about everything else (including local variables and tunnels etc), but I think your solution is the one that will do it. I'll give it a go.

Incidentally, I couldn't use the coerce option because I wanted to avoid forcing the user to any particular data value, especially extreme ones at either end of the range!!

Thanks

Blueside
0 Kudos
Message 3 of 3
(2,724 Views)