LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Filename to delimited spreadsheet

Solved!
Go to solution

Hi, Sorry, I've attached it as a V14.0 file. Please tell me you'd like an older version if necessary. Actually it has to be false, I must have clicked it accidentally while re-arranging it. But, I've tried the method given by the other users too and still come up with the Error 7 that the filepath is not correct. I tried giving the directory path and also the file path, but to no avail. 😞

0 Kudos
Message 11 of 19
(1,907 Views)
Solution
Accepted by raghav06

Hi raghav,

 

see changed sample VI, with some simplifications.

 

still come up with the Error 7 that the filepath is not correct.

What is your file path? Can you show an image showing the full path?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 12 of 19
(1,904 Views)
Solution
Accepted by raghav06

@GerdW wrote:

see changed sample VI, with some simplifications.


I simplified it even more.  There is not really any point in using the Write Delimited Spreadsheet when you are adding headers.  You already have the file open.  So just format the data into a string and write that string before you close the file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Download All
Message 13 of 19
(1,899 Views)

Hi crossrulz,

 

I was too lazy to put all those string constants into an array…

(Converting FormatIntoString to BuildArray was much easier.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 14 of 19
(1,893 Views)

Why do you have a naked event structure sitting there outside the loop?

 

If you hit the Save button before you hit the Stop button, you are going to lock up your front panel with no way to save your data.  You'll be forced to abort your VI.  Why?  Save:Value Change is set to lock the front panel until the event completes.  But you can't hit the stop button which ends the loops so you can get to the event structure because the front panel is locked.

 

Also, you are using Insert into Array in the loops just to put an element at the front of the array.  You should be using Build Array.  it is a much simpler function and the correct one to use 99% of the time.  Only use Insert into Array when you know you will be (or might be) inserting into the middle of an array.

 

 

0 Kudos
Message 15 of 19
(1,892 Views)

Thank you very much for the suggestion! 😄 It worked like a charm!

0 Kudos
Message 16 of 19
(1,882 Views)

@RavensFan wrote:

Why do you have a naked event structure sitting there outside the loop?

 

If you hit the Save button before you hit the Stop button, you are going to lock up your front panel with no way to save your data.  You'll be forced to abort your VI.  Why?  Save:Value Change is set to lock the front panel until the event completes.  But you can't hit the stop button which ends the loops so you can get to the event structure because the front panel is locked.

 

Also, you are using Insert into Array in the loops just to put an element at the front of the array.  You should be using Build Array.  it is a much simpler function and the correct one to use 99% of the time.  Only use Insert into Array when you know you will be (or might be) inserting into the middle of an array.

 

 


Hi! I agree with your point, but I could not think of an alternative for the event structure unfortunately. Can you suggest me anything, please?

0 Kudos
Message 17 of 19
(1,874 Views)

I would just wrap it in a sequence structure frame.

 

You are already set up so it will only save when the program ends.  You want to make sure the save button is read after the program ends and it will either execute the save routine or not.  It is basically a shot event, so no need to create an event structure for it.

Message 18 of 19
(1,870 Views)

@raghav06 wrote:

Hi! I agree with your point, but I could not think of an alternative for the event structure unfortunately. Can you suggest me anything, please?


How about no button and a flat sequence structure (just to make sure the file is not generated until the loop is complete).  No button needed.  Just log the data regardless.  If you later decide you don't want that file, you can delete it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 19 of 19
(1,869 Views)