LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

insert array subset

I am a bit unsure of what you are attempting to do, however, if it is to create a case structure with different cases for each string you need to change the text in the 'Selector Label' at the top of the structure to the text you want to match for a particular case.  So, "True" could be replaced by "Transistor" and "False" by "Diode".  Then you can add a third case by right-clicking and choosing 'Add case after' to use as a new default case where neither Transistor or Diode are found.  Check out the example VI I attached to this message, I think this is what you are looking to do.

-Bob
Message 21 of 33
(1,919 Views)
OK, here's what I understood from that. In order to be able to unbundle a selector (diode or Trans), I need to make the input array an array of clusers instead of an array of strings. Does this mean, I will have an array of clusters composed of strings and this is what gives me the unbundability (if that's a word)? Also, How does this give me the ability to use the element in the array as a selector?
0 Kudos
Message 22 of 33
(1,893 Views)
This will illustrate what corrys is recommending I believe.

Basically, playing around with the case structure or reading about the case structure in the LabVIEW help are good ways of learning how to use it.

-Bob
Message 23 of 33
(1,889 Views)
I'm trying to use an enum for the selector an stay away from typing in the selector. Basically I have an array that will come in and I will look at the second column (as in the previous attachment) and as I scan down the elements in the array, whether it says Diode or Transistor, it must select the correct case.
0 Kudos
Message 24 of 33
(1,888 Views)
There are so many ways to use case structures.  However, in the example I just attached to the previous post, the first case structure changes the output based on the string given to the case structure.  You can index through the array of strings using the index control on the front panel.  Is this similar to what you are looking for?

-Bob
0 Kudos
Message 25 of 33
(1,885 Views)
Similar in some ways. I will see what I can do. Thanks for you help.
0 Kudos
Message 26 of 33
(1,879 Views)
This is kind of what I had in mind in my previous post.  The cluster acts sort of like an additional dimension of your array, except that it contains various data types (and must be handled slightly different, of course).
 

Message Edited by corys on 08-17-2007 04:05 PM

-Cory
0 Kudos
Message 27 of 33
(1,876 Views)
I was able to get this program working thanks to the help that was provided. I have another small thing, that I have been stuck on for a couple of days now. Here's what I am trying to do:
I have a string input separated with tabs and end ofl ine constants. I am trying to extract the separated items and send them to their corresponding places in a cluster. In the example code that I have provided, the first item that is extracted is a number and it is sent to the cluster number. The second item is the sting element in the cluster that is inside of the array that is insided the main cluster (i hope that makes sense). I have the first part working in my other code, but I am unable to get items to to the array in the internal cluster. Please help. You will notice that there is a straight through path for case 1 and I am thinking that this is needed in order to get into the main cluster and then deal with it as a second entitiy, therefore I have the second for loop and case structore. The string that I was testing with is: \r\t400\r\n\ttest\r\n\t. Also, if I need to I can create a separate post for this.

Message Edited by rlg50 on 08-24-2007 10:21 AM

0 Kudos
Message 28 of 33
(1,846 Views)
I would recommend creating another post since this is a new topic and creating a new thread helps to maintain the 'search' ability of the forums for future users with the same issue.  I am glad we were able to get everything else working for you!  Have a great weekend!

-Bob
0 Kudos
Message 29 of 33
(1,836 Views)


@rlg50 wrote:
Also, if I need to I can create a separate post for this.

Yes, please do! Since you have posted at least three code pictures in this long thread, it is not clear what spcific VI you mean. Nobody wants to sift through an long old thread to solve a new problem.

And please, instead of a code pciture, attach the real VI! It is much easier to troubleshoot. Really! 🙂

0 Kudos
Message 30 of 33
(1,835 Views)