LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing in 3 or more excel columns in the same time

Solved!
Go to solution

Hello together,

i want to write 3 or more measurement values in single columns in the same time to an excel file. In addition i want to write the current date and time in single column as well as in each row in the respective column.

I have tryed diffrent things, to write with normal vi's as well as in low level vi's but in all of them i have the problem that the formatting doesn't work well.

Has someone an idea how i can solve this problems?

In advanced thanks for your help.

0 Kudos
Message 1 of 8
(2,075 Views)
Solution
Accepted by topic author DDsaaD

Hi DMego,

 


@DDsaaD wrote:

Has someone an idea how i can solve this problems?

Change the working mode of the first BuildArray node to "not concatenate inputs" to create a 2D array containing five columns…

Best regards,
GerdW


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

Thanks that works great.

 

Have you got perhaps an idea how i can write new data in the next free row, so that i don't must create everytime a new file? That would be the next and last step but at the moment im not sure how i can solve it.

0 Kudos
Message 3 of 8
(2,055 Views)

Hi DMego,

 

then you should not create a new report each time, but only once before the loop…

 

Another note: because of those "default if unwired" tunnels you also don#t close the report properly!

Best regards,
GerdW


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

Some suggestions:

  • There's a pretty good Example here in the Forums for using the Report Generation Toolkit to write Excel Documents.  Open the Forum, type "Revised Excel" in the Search bar, and open the "obvious choice".
  • In the Excel Specific, Excel General functions, there's a function that will return the Last Row of an Excel Worksheet.
  • If you are going to operate on an Excel Worksheet through several loops, put the opening and closing of the Excel object "outside" the While or For loop.  Remember how Data Flow works -- Open, take the Object Reference into a Loop (or sub-VI), do whatever you want to using it, and when the Loop exits, use the Object Reference to Dispose Report (you might want to Save to File first ...).

Bob Schor

0 Kudos
Message 5 of 8
(2,044 Views)

Hi Bob_Schor,

 

i have read your post to the Report generation Toolkit, thanks for that information.

But i have still the same problem, that only one line updates itself again and again and i don't find the problem.

I have how you recommanded positioned the individual parts are outside the loop.

I'm not sure if i use correctly the function for the Last Row of the Excel Worksheet.

Is it right to set the offset (number of loop runs ) to write to the next line?

0 Kudos
Message 6 of 8
(1,944 Views)

Hi DMego,

 


@DDsaaD wrote:

But i have still the same problem, that only one line updates itself again and again and i don't find the problem.

I have how you recommanded positioned the individual parts are outside the loop.

I'm not sure if i use correctly the function for the Last Row of the Excel Worksheet.

Is it right to set the offset (number of loop runs ) to write to the next line?


What's the point in using this FOR loop where you format your sample data into strings? What's the point to use the loop iterator ("Anzahl Messungen") to set the FOR loop iterations? (In the first iteration NO data is created, in the 999th iteration you create an array containing 999 identical rows!?)

Have you read the help for the RGT functions? ExcelEasyTable has an input labelled "start" - have you considered to use it?

 

Your VI becomes a mess more and more. All those sequences frames makes me think you really should use a state machine approach! (This also would help to get rid of all those button local variables and all those repeated Enqueue operations…)

Best regards,
GerdW


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

Open the LabVIEW Forum.  In the Search bar, type "Revised Excel", wait 2 seconds, and choose the Obvious Choice.  Download the Example (which does not use the Last Row function, but does show you how to (if you know the Last Row) add data below the Last Row, as well as (I believe) to the Right of the Last Column.

 

And, as GerdW mentions, learning how the RGT functions, including EasyTable, work, and how to use all of their inputs, is also excellent advice.

 

Bob Schor

0 Kudos
Message 8 of 8
(1,914 Views)