LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to check range before execution

Hi all,

  I find that Labwindows allows user to choose the valid range of data for controls in the user interface. When user input anything beyond the set range, there will be a red-frame box to indicate the error range. but if I intentionally input something beyond the range and some code (which will read the number input from that control), I found that the program will run also. So, range validation doesn't really stop the execution of the code. Is that any way to raise an error so to stop the execution of the code if there is any data with invalid range? Thanks.

0 Kudos
Message 1 of 5
(4,104 Views)

None that I know of Smiley Sad

 

You have two alternatives:

- set controls with Range checking = Coerce

- issue a ValidatePanel before processing user input and stop if return value = 0



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 5
(4,102 Views)

In your callback you can check for EVENT_VAL_COERCED

0 Kudos
Message 3 of 5
(4,099 Views)

@Wolfgang wrote:

In your callback you can check for EVENT_VAL_COERCED


Thanks. I think that's what I am looking for

0 Kudos
Message 4 of 5
(4,086 Views)

Glad to hear, good luck and post back if you succeeded.

0 Kudos
Message 5 of 5
(4,083 Views)