LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Customize Array (first column and first row)

Solved!
Go to solution

 Hello everyone, I have a question: how can I insert words and numbers into the same array?

I create a VI that measure the temperature with an external instrument, and put the data into an array, which is saved.

Every row is a Thermocouple and every column is a measurement, but there is only numbers!!!
I would like to have the first column with the name of channels and fist row with the name of measurement.

I had create an excel of example to explain my wish (Cattura.PNG).

Thank you to everyone who will help me

Download All
0 Kudos
Message 1 of 11
(6,693 Views)

Hello,

 

I suggest to create an array of strings, and insert numbers there converted to strings toghether with headers.

 

Thanks,

Arev

 

CTO | RAFA Solutions

 

Certified-LabVIEW-Embedded-Systems-Developer_rgb.jpgCertified-LabVIEW-Architect_rgb.jpg

0 Kudos
Message 2 of 11
(6,687 Views)

Sorry but I don't think to know how do what you said. Can you explain how create an array of string? Do exist a tutorial that I can follow?

0 Kudos
Message 3 of 11
(6,674 Views)

You can use "Number to Fractional String" function available in String -> Number/String Conversion palette. I have shown an example below.

Number to string.JPG

 

After you can add your headers to the array and write it to the spreadsheet.

Message 4 of 11
(6,663 Views)

Hi Enrico,

 

use a table and set row/column headers as needed…

(You still need to format your numbers as a table is just a 2D array of strings - but it eases the data handling as row/column headers are not part of the data.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 11
(6,642 Views)

Thank you to everyone.

GerdW I've tried to do how you said me but now it write only the last measurement in the first column.

Also the headers are visible only in the Front pannel, they don't appear in my excel file.

Thanks

 

0 Kudos
Message 6 of 11
(6,583 Views)

Hi enrico,

 

but now it write only the last measurement in the first column.

Yes, you have programmed it that way! Your inner loop only outputs values of the last iteration…

Why do you need to transform the data into a matrix?

 

Also the headers are visible only in the Front pannel, they don't appear in my excel file.

As I wrote before: "it eases the data handling as row/column headers are not part of the data."

You need to write the headers seperately into your file - they are not part of the table data…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 11
(6,573 Views)

1) Why do you need to transform the data into a matrix?

   Because I'm tested a thermal camera. I would put the number of measurement that the VI had to do ("numero misure"), the time between two measurement ("Secondi tra una misura e l'altra") and at the end I would a matrix with all the data (every column a measurement and every row a channel), and I would that this matrix will be save in a excel file.

 

2) ok, I didn't read well, sorry

0 Kudos
Message 8 of 11
(6,555 Views)
Solution
Accepted by enricopug

You can insert required headers as column and row to the converted to string array, as in the image below.

 

Array.JPG

Message 9 of 11
(6,549 Views)

arevhamb thank you thank you thank you. You have risolved my ploblem.

 

0 Kudos
Message 10 of 11
(6,528 Views)