LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Separating every second term from a string in to two arrays

Hey everyone,

The device I'm using outputs a string such that I every second term is the same parameter (i.e. the output string is of the form: voltage,current,voltage,current,voltage,current...).  As such, I'm trying to find a convenient method of separating every second term from the output string a group them together in an array of their own, before finally creating a 2-D array. That is, at the end of it all, I want to finish up with a two column array: one column listing voltage and the other listing the associated value of the current.

As it stands, I have thrown together a VI which can successfully split every second term in to the two array as required.  However, the nature of my design means that evey second term of each array is left blank.  For clariity, I've attached the VI in question.

I'd be most grateful for any tips you guys could offer.
0 Kudos
Message 1 of 4
(2,307 Views)
Form an array from the string using Spreadsheet String to Array.  Then use Decimate Array to form 2 arrays, odd elements in one and even elements in the other.  Notice that your input string does not have a number after the last field, so that last field is not included in the array.
 

Message Edited by tbob on 03-20-200605:32 PM

Message Edited by tbob on 03-20-200605:33 PM

- tbob

Inventor of the WORM Global
Download All
Message 2 of 4
(2,301 Views)

Hi Nio,

      Dunno if this will help - just some ideas...

Cheers.

When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 3 of 4
(2,301 Views)
Thanks for the replies guys.  You've been incredibly helpful 🙂
0 Kudos
Message 4 of 4
(2,275 Views)