LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Separate array 2d and save

Solved!
Go to solution

Hi, I need to get an array of 2 dimensions below and put each variable inside an array. It would separate this array with all information in multiple arrays, with information only from the corresponding variable. In the end I need to save these array.

 

Array

CU:OK

CU:ERROR

FIBER_C:H

FIBER_D:H

HALOGEN:OFF

THAR:OFF

THAR_T:0

THAR_C:0.66

HALOGEN_C:-0.17

MOTORS_C:-0.12

0 Kudos
Message 1 of 12
(2,526 Views)

Hi Rafael,

 

In the end I need to save these array.

To me this looks like a text with some linefeeds, but surely not like an "array"…

 

(You seem to use the colon as separator char, so use ArrayToSpreadsheetString/SpreadsheetStringToArray with colon!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 12
(2,514 Views)

The array is like this. What I said before was just an example of the message I will receive via serial.

 

image.png

0 Kudos
Message 3 of 12
(2,509 Views)

Hi Rafael,

 

when you have an array of strings you can apply the suggestion from my previous message…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 12
(2,503 Views)

When the message is sent by the serial and transforms it into a 2-dimensional array, using the logic below. I need now to remove each variable from that and save it to another array.

 

image.png

0 Kudos
Message 5 of 12
(2,496 Views)

What exactly do you mean by "remove each variable"?  Show us an example of how you want your final array to look.

 

It sounds to me like you are just trying to index out a column.

0 Kudos
Message 6 of 12
(2,484 Views)

It would stay that way. Each variable in an array with its results.

 

image.png

0 Kudos
Message 7 of 12
(2,479 Views)

Hi Rafael,

 

why do you want to place each "variable" in a 2D array?

Please provide more information on how you need all those data!

 

(I could imagine using a key-value pair table, implemented using Variant attributes in a FGV.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 12
(2,473 Views)

It was an idea, but it could be in a matrix too, the important thing is to separate the variables.

0 Kudos
Message 9 of 12
(2,461 Views)

It appears that you already have your "variables" separated in your third message in this post. Just use the output of your separated "variables" and wire an Index Array to get your individual values/data.

0 Kudos
Message 10 of 12
(2,453 Views)