LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing values to a csv file using LabVIEW

Solved!
Go to solution

Hi Varghese,

 


@Varghese89 wrote:

1. Should I use one more "Write delimiter Spreadsheet" and add the header before the appending "Write delimiter Spreadsheet"

2. Which loop should I use?. Where can I adjust the time of execution in the loop.

 

Sorry, I am little confused as I am new to this. 


You always should say "THINK DATAFLOW!"… (Really!)

 

Right now the code inside the loop will write the VERY SAME values to the file as long as the loop iterates. (THINK DATAFLOW!)

 

I wrote above which code to place before, inside and after the loop. You decided to arrange the loop in a completely different place!

 

To limit the loop iteration rate you can simply place a wait function inside the loop…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 11 of 13
(105 Views)

Hi GerdW,

 

I tried looping in like you said. I am getting this error.

 

1. When I put everything inside the loop, The data is getting written after the wait period. But still I am using the continuously run. What to do if I want to write to another csv for reduced duration.

 

2. I don't understand how to add headers in the file, Should i use a separate "Write delimited spreadsheet" outside the loop. 

 

Your assistance has been immensely valuable to my learning. Thank you very much!

0 Kudos
Message 12 of 13
(93 Views)
Solution
Accepted by topic author Varghese89

Hi Varghese,

 


@Varghese89 wrote:

I tried looping in like you said. I am getting this error.


Because you still don't follow my suggestion. I wrote "close all references AFTER the loop", but you close the Modbus reference inside the loop…

 


@Varghese89 wrote:

1. When I put everything inside the loop, The data is getting written after the wait period. But still I am using the continuously run. What to do if I want to write to another csv for reduced duration.

 

2. I don't understand how to add headers in the file, Should i use a separate "Write delimited spreadsheet" outside the loop. 


  1. You should not use "run continuous". Point.
    When you want to save to "another" CSV then you need to implement code to save into a 2nd file…
  2. Yes. As I wrote before: "write the header BEFORE the loop".
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 13 of 13
(82 Views)