01-29-2013 11:26 AM
I'm very green and looking for some help.
I'm looking to create a log file that would look like this
Name, Date
P
I
D
[Time][AI0][AI1][AO1]
[1:00.25][data][data][data]
[1:00.5][data][data][data]
[1:00.75][data][data][data]
01-29-2013 11:40 AM
You will find what you need in the under the Files and Strings palettes. For the file you will want to use OPen, Write to Text File and Close. Open or create the new file in the beginning of your program and close it at the end. Use the Format String VI to create the format and content of your log file. You can find examples for formatting strings and writing to files in the examples that ship with LabVIEW.
01-29-2013 12:26 PM
Thanks for the help Mark,
Might you know where I find these examples?
01-29-2013 01:07 PM
Use the "Find Examples" under the help menu.
01-30-2013 09:52 AM
As the other poster mentioned, you should go ahead and explore the examples on the subject of strings:
concatenate strings.vi looks interesting. Check out the "array of strings" tab.
02-25-2020 10:14 PM
02-25-2020 11:20 PM
How does such a simple example warrant reopening a 7 year old thread to post this?
If you tried to add another line to the "log file" later on, do you know how your example would behave?
03-02-2020 06:26 PM
Because there was no simple example!!
You use the Write to Text File multiple times and it will add lines to text file.
03-02-2020 09:56 PM
@msidler wrote:
Because there was no simple example!!
You use the Write to Text File multiple times and it will add lines to text file.
No. If you repeatedly run the code you attached, only the last thing written will be saved in the file!
Every time you open the file, the file pointer is at the beginning, if you write a line, all other lines in that file will disappear.