LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

spreadsheet string to array

Solved!
Go to solution

Hello,

 

I have some code whereby I get data from an instrument and I want to save this data to a spreadsheet file.

 

At the moment I find that the saved spreadsheet is showing zeros. So I must have the spreadsheet string to array set up incorrectly.

 

Snippet of code here and complete .vi attached.

 

Capture.JPG 

0 Kudos
Message 1 of 6
(3,139 Views)

Hi nevica,

 

where are those zeros you're talking about?

 

When your SerialNumber and SpectrometerName don't consist just of numbers you surely get zeros when trying to convert from string to number…

Why don't you create an array of those two strings to save it directly using WriteToSpreadsheetFile? Why append them to one string and convert that string into a 2D array of numbers?

Best regards,
GerdW


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

How do i create an array of the two strings please?

 

It's actually what I tried in the first place but failed.

 

 

 

 

0 Kudos
Message 3 of 6
(3,128 Views)
Solution
Accepted by topic author nevica

Hi nevica,

 

but your input type is given as a 2D DBL array constant…

 

Edit after nevica changed the question:

Use BuildArray to create an array…

Best regards,
GerdW


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

It works, thanks!

0 Kudos
Message 5 of 6
(3,117 Views)

A new problem now. I want to 'save to spreadsheet file' a number array with the first column as a time stamp (a text field). 

 

I tried bundling the time stamp text with the number 1- D array but it didn't work.

 

How can I do this please?

 

OK, done it, converted number array into string array.

 

 

0 Kudos
Message 6 of 6
(3,102 Views)