LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modify a program to store data on txt file

Hello everyone. I am new to LabView and I would like to do something simple. I have this program from a wavemeter "BristolExample" which has an Autoscan mode. It reads the instantaneous wavelength on the equipment until the "Stop" button is pressed. I want to store those values as a function of time on a .txt file. No need to plot anything, I just need the file. How can I do that?  

0 Kudos
Message 1 of 9
(2,878 Views)

Check out the functions in the File IO tab. Write to Spreadsheet file would work if you want to write it all at once. Write to Text File is another good choice if you're writing it incrementally.

0 Kudos
Message 2 of 9
(2,872 Views)

Hi gibbsphe,

 

How can I do that? I am new to LabView and I would like to do something simple.

Well, the simple answer is: "Learn LabVIEW and program the changes according to your requirements!"

 

The longer answer is:

This is a very old example VI. It was created with a LabVIEW version lacking most current features of recent LabVIEW versions. It was created using a very bad coding style (especially to actual coding standards).

You would be better by creating a whole new program (and project)! (But then again: Learn LabVIEW.)

 

The quick&dirty answer is:

Add another loop to handle any FileIO and write your data to a file.

Best regards,
GerdW


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

Hi,

 

First step, as you new in LabVIEW I recommend you to start learning LabVIEW. Link below is a quick LabVIEW Getting Started:

 

LabVIEW provides some built-in examples. You can just go to menu Help>> Find Examples and from NI Example Finder wizard, search for keywords: Write Text File, File and etc. Some examples will be filtered so that you can open them to learn how write text files.

 

LabVIEW help also provide function descriptions and example path to learn that. See the online help for File I/O functions:

 

 

Regards,

 

0 Kudos
Message 4 of 9
(2,817 Views)

I am afraid I don't have time to rewrite the whole project just to get a file from that loop. I will try to find a workaround. 

0 Kudos
Message 5 of 9
(2,806 Views)

@gibbsphe wrote:

I am afraid I don't have time to rewrite the whole project just to get a file from that loop. I will try to find a workaround. 


I don't have 7Zip so I can't see your code. It would be better to just zip the file in Windows and/or upload the file(s) directly. In any event, I suspect that GerdW was trying to give you advice to save time (and a lot of headaches).

0 Kudos
Message 6 of 9
(2,793 Views)

@johntrich1971  escreveu:

@gibbsphe wrote:

I am afraid I don't have time to rewrite the whole project just to get a file from that loop. I will try to find a workaround. 


I don't have 7Zip so I can't see your code. It would be better to just zip the file in Windows and/or upload the file(s) directly. In any event, I suspect that GerdW was trying to give you advice to save time (and a lot of headaches).


Here is a windows zip. I tried to contact the manufacturer for a newer version, but they don't have one. 

0 Kudos
Message 7 of 9
(2,777 Views)

You can write to file using the functions that SSPTest suggested, but I agree with GerdW that you would be much more well served to rewrite the program. There are lots of things in this program which could cause problems in the future. 

0 Kudos
Message 8 of 9
(2,751 Views)

Please don't use 7 Zip here.

PaulG.

LabVIEW versions 5.0 - 2020

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 9 of 9
(2,742 Views)