Daklu Posted August 18, 2007 Report Share Posted August 18, 2007 I have one variable I need to compare against several other variables in order to choose which case to run. It's easy to do in text languages using ElseIf or Select statements, but I can't figure out if it is possible for Labview case structures to be defined by variables. Pseudocode[/u]If A<W then [u] Quote Link to comment
Aristos Queue Posted August 18, 2007 Report Share Posted August 18, 2007 QUOTE(Daklu @ Aug 17 2007, 02:57 PM) I have one variable I need to compare against several other variables in order to choose which case to run. It's easy to do in text languages using ElseIf or Select statements, but I can't figure out if it is possible for Labview case structures to be defined by variables.Pseudocode [/u]If A<W then [u] The syntax is in the online help for the case structure. In general, wire the variable to the selection terminal (the '?' terminal) and then put the test in the case selector. For numerics: ..1 is anything less than or equal to 1 3..5 is anything between 3 and 5 inclusively 4 is just 4 4.. is anything greater than or equal to 4 default is anything not covered by any case ..1, 3.. is anything less than/equal to 1 or greater than/equal to three. Quote Link to comment
Val Brown Posted August 18, 2007 Report Share Posted August 18, 2007 QUOTE(Daklu @ Aug 17 2007, 12:57 PM) I have one variable I need to compare against several other variables in order to choose which case to run. It's easy to do in text languages using ElseIf or Select statements, but I can't figure out if it is possible for Labview case structures to be defined by variables.Pseudocode[/u]If A<W then[u] Yes this is quite easy to do. If you want to implement precisely what you've written, use the Less Than function from the Comparison pallette and wire its boolean output to the input of your Case Structure. Quote Link to comment
Daklu Posted August 18, 2007 Author Report Share Posted August 18, 2007 Sorry for the double post. IE choked while I was writing this and unbeknownst to me posted a garbled, incomplete message. See the other post instead. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.