LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

To associate the value of a control like a value of a selector of a CASE Structure

I need that the value of the selector of a CASE Structure is dinámic. To need to connect the value of the selector with a numeric Control
0 Kudos
Message 1 of 4
(2,909 Views)
The Case selector value can only be decided during edit mode. It can not be dynamic in execution.

Joe
0 Kudos
Message 2 of 4
(2,909 Views)
I'm not sure exactly what you mean. A case selector may be a Boolean, a string, an enum, or a number. You cannot dynamically add cases though so you would have to anticipate each possible value when you write the program. You can even specify a range. For example, if you have a numeric control wired to the selector, a value of ..0 in the case selector label would handle x less than or equal to 0, 1..3 would handle x greater or equal to 1 and less than or equal to 3, 4.. would be x greater than or equal to 4.
0 Kudos
Message 3 of 4
(2,909 Views)
"Joe Guo" wrote in message
news:50650000000500000073720100-1079395200000@exchange.ni.com...
> The Case selector value can only be decided during edit mode. It can
> not be dynamic in execution.
>
> Joe

....but there are several options to get the same result...

The simplest one is to compare a (dynamic) value with another (dynamic)
value for equality. The true or false can be used in a case selector.

A bit more 'advanced' is to use an array of values. Use the "search 1D
array" function to search a match. The function returns -1..N, where N is
the number of elements. Wire this to the case selector, and you can compare
a dynamic value with other dynamic values. The values can be strings,
numbers, enums, etc. Only difference with a static c
ompare is the case
names.

Regards,

Wiebe.
0 Kudos
Message 4 of 4
(2,909 Views)