07-03-2017 11:05 AM
So I've figured out how to implement the Write to Text File function easily enough. With that I input some words into the input-string and when I run the program it creates a new text file in the location I want with the wording from the string in that file.
But...
I have to keep stopping and starting the program if I want to input anything else to that same input-string. I want the program to be able to keep running and when I type more into that input-string (while running) the program can save my new entry into the already created text file with some Save button or whatnot. The best I've found is a function that saves data to a spreadsheet. I feel like this is an easy fix.
Solved! Go to Solution.
07-03-2017 11:21 AM
Please supply some code so we can see what your current architecture looks like. Then we can make better suggestions.
But off the top of my head:
1. You will want to keep the file open as long as you could possibly be writing to it. This usually means open/create the file at the start of the application and close it at the end. Save the reference in a shift register.
2. The Save button can be done with either an Event Structure or a Case Structure. Which one is better for your situation would depend on your architecture.
07-03-2017 11:23 AM
07-03-2017 01:02 PM
Here you go.
07-03-2017 01:09 PM
@ShogunOrta wrote:
Here you go.
Where is the code that you want to build the text data from? Where is your loop?
07-03-2017 01:18 PM
I haven't implemented anything for the Save Button element. This is just the code I have for the basic file creation. I don't need you guys to come up with the button code. Just a suggestion or two would be helpful.
07-03-2017 01:42 PM
@ShogunOrta wrote:
Just a suggestion or two would be helpful.
Then go back and read my first post in this thread. Without more information, that is the best advice you are going to get.
07-03-2017 01:58 PM
Oh.... You did give me a suggestion. Sorry about that! Guess I was scrolling too quickly and missed your post. Thanks, I'll get on that!
07-03-2017 04:18 PM
Okay, here you go again. This time it's using an Event Structure. But alas, still no dice.
07-04-2017 02:16 AM - edited 07-04-2017 02:17 AM
Hi Orta,
But alas, still no dice.
Your VI is writing the "string 10" value to a file in several events.
What is the purpose of have 3 events all used to write string data to a file? The only difference is the file open mode…
What should happen in "Create" event? What should happen in the other two events?
You also forgot to implement atleast the simplest error handling!