LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric Control depending on another control

Hi,

 

I could not figure an easy way or if LabVIEW already have something in this my situation.

 

I have a numeric control A, with default value of 4.  I have a control B with defualt value of 2. The user can change the values of both controls, however, I want the value of control B at any time to be less than or equal to the twice the value A.   i.e 2*Value B <= ValueA.

 

 When the user tries to violate this relation , either he will be unable to adjust the control, or a message will appear prompting him that the relationship of the two controls must be maintained without terminating the program.

 

Thanks

0 Kudos
Message 1 of 7
(3,206 Views)
Easy enough to do with an event structure set to monitor a value change of B and check it against A. Are you looking for something less elaborate?
Message 2 of 7
(3,200 Views)

My vote would be a case structure within an event structure.
The event trigger will be the user changing the control (A or B).

If you ratio is OK, have it follow the rest of the code in the case structure -->

If it is not, put a prompt in the false case, so it will prompt the user, but will keep running. 

Cory K
0 Kudos
Message 3 of 7
(3,196 Views)

 

Thanks tjazx9r and Cory. Yes I think using the case structure with event will be perfect, especially since the false case will warn the user but not terminate the program.

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

Using a event structure is a good idea. In addition you can control B using property nodes.

Just an idea!

Now Using LabVIEW 2019SP1 and TestStand 2019
Message 5 of 7
(3,172 Views)

You can achieve your objective with a simple event structure, and no case :

Set the response of B to values outside limits to coerce. Then, when the value of A is changed, adjust the maximum value of B. 

Accordingly, if you decrease A, B will be automatically decreased to respect the condition. And increasing A will makes more room for B to grow.

 (BTW, there is a contradiction in the way your question is formulated : the text and the equation are opposed). See the diagram below

 

Message Edité par chilly charly le 09-18-2008 12:16 AM
Chilly Charly    (aka CC)
Download All
Message 6 of 7
(3,171 Views)

Thanks a million GovBob and Chilly Charly.

 

Chilly, you were right, my equation and description were not consistent, in any case I got the idea. Most importantly, there is no need for a case structure to inform the user of the relationship, the software will force the relationship. LabVIEW is FANTASTIC

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