LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write data into an ascii file

Hi

The programme below is a dual channel frequency analyser simulation which store the frequency, real, imaginary data into an ascii.asc file in a folder in the PC. For each teration of the loop a pop up comes requesting to replace the file with new data. I require to save the data of the iteration when the averages are completed of the Frequency Response Function (say the data after the 100 avarage). How can I link the append to file signal of the Write to spread sheet vi of the programme with the averages completed signal of the FRF vi of the programme. By doing this I will have the data after the specified average being done on the input signal.

Can some one help me on this.

Thanks


Mal
0 Kudos
Message 1 of 8
(3,545 Views)
Hello malkoba,

you just have to set the input "append to file" of "Write to spreadsheet" to true. Then it will append the data and not ask you to replace.
Best regards,
GerdW


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

Thanks. But when it is done like that each file of each iteration is appended to the file of the previous iteration. Can it be possible to keep the switch false till all the averages are done in the FRF and make it true when the final iteration is completed. So that you only get the required file after the final iteration is completed.
Thanks

Mal
0 Kudos
Message 3 of 8
(3,531 Views)
Hello malkoba,

would it be easier to put the "write file" outside of the loop? (Generate all data in the loop and write it once out of the loop)
Best regards,
GerdW


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

I haven't tried that. But what do you think of this amendment.

Thanks

Mal
0 Kudos
Message 5 of 8
(3,525 Views)
Hello malkoba,

it's better than before, but not as good as taking the file write out of the loop. I cleaned up your vi a little bit...

At the moment you append to the file as long as the calculation runs. If the max number of averages is reached you want to replace your text file and will get a dialog window. Do you want to annoy the user with some unwanted dialogs? ("Replace a file? Why should I replace? I told you to write to that file!" and so on 🙂
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(3,517 Views)
Hi

Thanks. I will try the other option.

Mal
0 Kudos
Message 7 of 8
(3,511 Views)
I would do store data in variable and develop save routine in parallel loop for save at any point.
Leonardo de S. Cavadas
Maintenance Engineer and Inspection - Bureau Veritas do Brasil

Engineer Metallurgist with emphasis in Advanced Materials
Technologist in Computer Science
0 Kudos
Message 8 of 8
(3,277 Views)