LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write characters to File.vi

Why did NI decided to not support "Write characters to File.vi" in LV8.2.  I know there are work-arounds, but its such a handy/popular vi what was the reasoning?
 
Thanks,
sdavidson
0 Kudos
Message 1 of 5
(9,280 Views)
Because the "Write to Text File" does it, and having two functions doing the same thing would be redundant. What is it that you're trying to do that you can't do with "Write to Text File"?
0 Kudos
Message 2 of 5
(9,268 Views)

Smercurio_fc,

The Write to Text File does not automatically create or append to a file in one step.  If you use an existing file path, then it will create or overwrite the file.  If you use a refnum then you can use a pointer to get to the end of the file then append data, else it will write data who knows where.  The old vi would create the file if it didn’t exits, and append data if it did exist.  It was a very simple process to create logging files.  But that is not the part that bothers me.  Since they did change a nice existing function for some reason, I would like to know the reason incase there is an issue and I am creating a problem/future problem somewhere.

 

Thanks for your time.

0 Kudos
Message 3 of 5
(9,249 Views)
I don't believe there was anything inherently "wrong" with the "Write Characters to File" VI. If anything, it was just sloppy coding. If you were to take a look at it, it was made up of subVIs, and then the individual subVIs were humongous. I'd guess NI was just trying to simplify the whole thing. There's nothing preventing you from using the old VI in 8.2. You can copy the VI (along with the associated first-level VIs) from the "file.llb" library to your project folder if you don't want to break your code. All the intrinsic functions would get replaced with the 8.2 versions. A better solution is to whip up your own. I know, that's not the point of your message. However, sometimes it's better to move forward if it's an improvement, and in this case I believe recoding to make use of 8.2 functions would be an improvement.

If you want to take a look at an alternative, written using pure 8.2 functions, see the attached VI that you can use as a starting point.
0 Kudos
Message 4 of 5
(9,231 Views)
I had the same thought when I saw this new VI. "Why can't I easily append? What is this new VI?" However I have since realized that Write to Text File is a much better function. The main advantage is that you can use it with a file refnum and it will write to the file without opening and closing it. Of course this could be done before, but why have a separate VI to handle it? Write to Text File is more robust. It can handle several different scenarios of writing to a file. This makes things easier and saves palette space.
0 Kudos
Message 5 of 5
(9,226 Views)