From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting array of strings to dynamic data to write to an excel file

I'm trying to write some parameters from labview to an xlsx file using Write to Measurment File. The problem is some of the parameters are strings and I cannot find a way to convert them to dynamic data. I have tried using Write to Spreadsheet but it can't write to xlsx files. I've read some related threads that suggested writing to CSV but these parameters must be written to an xlsx file.

0 Kudos
Message 1 of 9
(3,586 Views)

You haven't told us enough to be helpful, nor have you shown us the code (meaning the VIs, not pictures!) you are trying to develop.  Dynamic Data Wires are fairly Evil, difficult to use, and Don't Play Well with Others.  They are made (supposedly) for "Dynamic Data" -- a String is about as "un-Dynamic" as Data can be, hence your difficulty.

 

I'm sorry you are having trouble with an Express VI, another "Don't bother learning LabVIEW, we'll make it easy for you" simplification that NI has provided.  Maybe you need to learn LabVIEW, and get it to do what you want it to do, rather than the "simple things" that the Express VI lets you do.  It will be a little more work, but a whole lot more flexible ...

 

Bob Schor 

0 Kudos
Message 2 of 9
(3,515 Views)

Hi 5mk,

 

to extend Bob's excellent comment: Use functions from RGT (Report Generation Toolkit) to write your (array of) strings to your XLSX file.

 

LabVIEW comes with a huge library of example VIs: examine them to learn LabVIEW. And it also helps to follow the "Training" linnks offered in the header of the LabVIEW board…

Best regards,
GerdW


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

I've looked in the examples and there's only an example for creating html reports. 

 

I tried the report generation palette but none of the VIs could accept the input I want to use. I've attached an image of what I want the excel report to look like. The column headers don't change and my VI should append a new line after every run.

 

I've also attached the relevant portion of my code. The report generation VIs only accept strings or 2-D arrays as inputs. I only have a 1-D array to output and there doesn't seem to be an option for it.

Download All
0 Kudos
Message 4 of 9
(3,485 Views)

Hi 5m,

 

what about using BuildArray to create a 2D array from your 1D array?

Basic LabVIEW stuff...

Best regards,
GerdW


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

@GerdW wrote:

Hi 5m,

 

what about using BuildArray to create a 2D array from your 1D array?

Basic LabVIEW stuff...


Why is it that everyone who answers questions on coding forums has to be so condescending? 

Message 6 of 9
(3,477 Views)

Because you don't seem to know how to create a 2D array from your 1D array...

(Which is basic LabVIEW stuff.)

Best regards,
GerdW


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

Or in other words "Have you tried making your 1D array into a 2D array". No need for backhanded comments about how simple it is. I'm pretty sure you've not know how to do basic things and people didn't give you a hard time for not knowing. Just educate and move on. No need to be a dick.

Message 8 of 9
(3,468 Views)

@5m0k3w33d wrote:

I've looked in the examples and there's only an example for creating html reports. 

 


First, posting LabVIEW code as pictures is particularly frustrating for those of us (like GerdW, who has responded to >15,000 of these posts, trying to help other LabVIEW users), which is why the "Unwritten Rules of the Forum" (and I) request that you post your actual LabVIEW VIs.  This helps us (to help you) in numerous ways, including (a) letting us determine the Version of LabVIEW you are using (so we don't say "Use Channel Wires" if you are running LabVIEW 2012), (b) let us see all of your code clearly, full size, (c) let us see all the Cases of your Case structures, (d) let us "rearrange" your code so we can understand the Data Flow better, (e) let us try to Run your code and study its behavior, ...

 

So I don't know what Version of LabVIEW you tried to find RGT examples.  I will tell you that when I go to Examples and search for Reports, I get about a dozen RGT "hits", including multiple Excel Examples.  There is also an Example on the Forum that someone posted a few years ago that shows some of the RGT's Excel Bells and Whistles.  To find it, go to the search box at the beginning of the Forum and type <Quotation mark> Revised (this means type the literal string "Revised   with the leading Quote and following space, look at what pops up, and click on what is "obvious").  It should be self-explanatory.

 

The Forum is a place where people like GerdW, who use and love LabVIEW, are trying to help users of all levels with their LabVIEW questions and problems.  It is not a perfect mechanism -- sometimes communication is slow, suggestions are ignored or not understood, and frustrations mount.  I've also "been there, done that", so I hope to play "peace-maker" here.

 

See if the Examples can answer your question.  If you still can't find what you need, post your RGT code and whatever supplementary information you think will help us to help you, and we'll try to help.

 

Bob Schor

Message 9 of 9
(3,456 Views)