LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I extract "sandwiched" subarrays based on repeated predefined numbers in LabVIEW?

I was doing the same thing that Christian suggested and make one string to search. Here is an example on how to do this:

 

aeastet_0-1750778187893.png

I only tested it with the data that you provided, It may need some tweaking.

Tim
GHSP
0 Kudos
Message 11 of 16
(175 Views)

Hi,

 

The termination characters will always be a single character or two repeating numbers. The starting character of the sandwich will always be a single character (e.g. a 1 or an S). The beginning of the sandwich is independent of the end of the sandwich so it can begin with a 1 and end with a 33, or begin with an S and end with an S. 

 

Row 2 is a sandwich because it gets terminated by the S (I see now that i forgot to add that the sandwich can also be terminated by the single character).

 

Yes, the output will only contain one of the termination characters. So if it gets terminated by 22 the last element will only be a 2. Also if it gets terminated by a single character such as S, the last element will be the S.

 

 

 

 

0 Kudos
Message 12 of 16
(147 Views)

Hi, thanks for the solution. I am running LV2018 so I can't open the code but I will try to implement it based on the picture. How do your other cases look inside the case structure?

0 Kudos
Message 13 of 16
(144 Views)

Here is a 2017 version

Tim
GHSP
0 Kudos
Message 14 of 16
(121 Views)

Based on your new requirements you are going to have to make some tweaks to this program to get you where you need to go. Try some different data sets and come back if you get stuck.

Tim
GHSP
0 Kudos
Message 15 of 16
(117 Views)

If you only need the meat and not the bread, you can use this.

0 Kudos
Message 16 of 16
(78 Views)