LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using vi scripting to create a case structure switched on numbers (not strings)

Solved!
Go to solution

I can successfully create and populate a case structure using labview scripting.  However, the frames each have a string label.  How do I set each case to be a number, not a string?  The only applicable property node I can find is CaseSel->FrameNames, but that expects an array of strings, and therefore the resulting case structure switches on "0", "1", "2", etc. instead of 0, 1, 2 (i.e. strings instead of numbers).

 

I am programatically creating other code as well, including a subtraction function, the output of which is connected to the case selector terminal (in other words, I've ensured I have something that produces a number - not a string - wired to the case selector).

 

Thanks in advance for any help

0 Kudos
Message 1 of 4
(2,670 Views)
Solution
Accepted by topic author bmishoe

nevermind...figured it out.

 

for anyone who is interested - if you have an array of integers, and then convert it to a string array and pass that string array to the FrameNames input of the CaseSel method, it will create the case struct as a struct of ints.

0 Kudos
Message 2 of 4
(2,660 Views)

In more general terms:

 

The FrameName strings except everything that is allowed to be typed in manual. So what LabVIEW shows in there when you edit them manually, you can put in there with scripting. With integers for example, ..1 is valid, or 2.., or 1..6, 7..10, default. That's the way it is, and it's not always easy. Parsing back those FrameNames can be difficult, especially when supporting Strings, Integers, Errors and Enums.

 

Please consider selecting a (your own reply) solution, or everyone will open this post to see if they can help assuming your still looking for a solution.

0 Kudos
Message 3 of 4
(2,618 Views)

Do you have any example code?

0 Kudos
Message 4 of 4
(2,203 Views)