LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save data

Hello, I would like you to help me create a VI that saves vectors into an Excel file that I have generated with another VI. For example, I have vectors of resistances, temperatures, and other individual elements like various types of errors. This data saving VI should save the arrays into an Excel file (each array in a separate column that I can name). Additionally, I would like it to save the date, time, and the user's name. Could you upload an example that accomplishes this?" thank's.

0 Kudos
Message 1 of 7
(352 Views)

Hi John,

 


@John96Dee wrote:

Hello, I would like you to help me create a VI that saves vectors into an Excel file that I have generated with another VI. For example, I have vectors of resistances, temperatures, and other individual elements like various types of errors. This data saving VI should save the arrays into an Excel file (each array in a separate column that I can name). Additionally, I would like it to save the date, time, and the user's name. Could you upload an example that accomplishes this?"


Do you really need Excel or would a simple CSV file be sufficient?

What are "vectors" in LabVIEW? I guess you talk about 1D arrays…

How/where do you want to place the "name of your columns"?

 

You can create a 2D array of strings and place all your data in the correct elements of this array, then save the array using WriteDelimitedSpreadsheetFile…

Best regards,
GerdW


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

Csv in good; yes i have  3 different array 1D; In the file, each created column must have a name, for example 'temperature', 'resistances', 'error 1', 'error 2', etc. Can you show me an example VI? Thank you

in addition, I would like the operator's name, date, and time to be saved in the file.

i'm uploading an image of what I have done; I think there are many errors

0 Kudos
Message 3 of 7
(335 Views)

Hi John,

 


@John96Dee wrote:

Csv in good; yes i have  3 different array 1D; In the file, each created column must have a name, for example 'temperature', 'resistances', 'error 1', 'error 2', etc. Can you show me an example VI?


You already provide that example with your image…

 


@John96Dee wrote:

I would like the operator's name, date, and time to be saved in the file.


Then you need to add those items to your CSV file: place some controls, and build the string arrays as required to write them to your CSV file…

 


@John96Dee wrote:

i'm uploading an image of what I have done; I think there are many errors


You know we cannot edit/debug/run images in LabVIEW, don't you?

 

Why do you "think" there might be errors? Why don't you know?

Why don't you debug your VI to find those errors (if they exist)…

Best regards,
GerdW


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

ok if you want, i upload the VI. Is my firt time with saving data and  i try to use my vi but it give me error n.7 i dont know solve it. 

0 Kudos
Message 5 of 7
(300 Views)

Hi John,

 


@John96Dee wrote:

i try to use my vi but it give me error n.7 i dont know solve it. 


Which filepath do you use?

As soon as I use valid values for path and "Utente" your VI works without errors…

 

You forgot to add controls for your other needed data (username, etc.).

But with your VI you know how to

  • create a CSV file
  • write a row of headers
  • write/append a 2D array of value

Now you just need to append some more data! (And implementing error handling would help, too.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(297 Views)
  • Your path needs to be an existing folder, so make sure to adjust the browse option accordingly.
  • Your "Utente" control should be set to "limit to single line"
  • You don't need to wire a timestamp to "format date/time" because the default is the current time
  • It seems easier to do everything at once using "format into string"
  • You need to transpose your 2D array to get three columns (or set transpose=true in the file IO)
  • Why have all these scattered scalar strings instead of a string array diagram constant?
  • Why is the front panel such a mess?

Here's one possible cleaned up version (I probably would make the time format a bit nicer, though).

 

altenbach_0-1720372372769.png

 

0 Kudos
Message 7 of 7
(254 Views)