10-05-2011 05:32 PM
This is probably well known and nobody has bothered fixing it but the detailed Help of the "Read from Text File" function is sort of ambiguous:
- statement 1: refnum out is the refnum of the file that the function read. You can wire this output to another file function, depending on what you want to do with the file. The default is to close the file if it is referenced by a file path or selected from the file dialog box. If file is a refnum or if you wire refnum out to another function, LabVIEW assumes that the file is still in use until you close it.
- statement 2: If you wire a path to file, the function opens the file before reading from it and closes it afterwards.
I have found statement 1 to be correct, which makes statement 2 incomplete (and sort of tautological in the sense that 1) you expect LabVIEW to open the file before reading from it if you provide a path instead of a refnum... and 2) if you use a path input to file AND use the refnum out for some other function, the file is NOT closed, as correctly stated in statement 1).
Just sayin' ...
10-05-2011 10:39 PM
I agree that it could be read out in that fashion, but what the intended meaning was, is that the reference is closed if you just wire the path in. If you wire the path in, but still take the refnum out, it falls back on statement 1 and is correctly handled.
Regards,
10-06-2011 12:27 PM
It just happens that I am just warming up right now, so I am in a mood to clarify how MOST users read the help (especially when it is more than one short paragraph) and why this kind of phrasing is ambuguous: they glance at the help and if they find ONE bit of information that seems to address their question, they certainly won't bother to read the rest.
In my personal case scenario, I am quite familiar with this function, but for whatever reason, I just looked at the help file and read statement 2 above and that kind of scared me, as I was (for quite a long time) passing a path to the function and using the resulting reference output to manipulate the file some more. This is not a problem, but I had to read the help back and forth a couple of times to convince myself that I understood it.
If this feedback is of no use to NI, I will be glad to dispense from providing it in the future. I am certainly no linguist or even English major...
10-06-2011 12:37 PM
X,
It deeply concerns me that you would take my response to mean indifference. I certainly had no intention to belittle what you had to say. On the contrary, I took this up with the concerned team, and had a small discussion. If you say that what someone says on this forum is of lesser or no value to National Instruments, you could not be more wrong. It defeats the whole purpose of this public forum.
My point was not that it is not an issue, it certainly seems to be. Please be rest assured that even if it does not look like it from the outside, each comment however big or small is taken back to our workplaces and some thoughts poured over it.
On the whole, I recognise that I had a role to play in this misunderstanding of tone, and I sincerely apologise.
Warm Regards,
10-06-2011 12:50 PM
No need to apologize. It is difficult to be understood by everybody, so you have to draw a line in the sand somewhere...
Glad we agree that this particular bit of help could be improved.
10-11-2011 12:42 AM
Yes we do. And I was able to put this across to the right people.
A CAR has been filed to track this issue: 318477.
Thanks again for your valuable feedback!
You can see how seriously we take it 🙂
11-25-2011 05:09 PM
Another little "feature" with this function is that if you choose to read lines instead of just characters, the default is: if you don't connect the "Count" input, a single line is read (i.e. Count = 1). However, if you create a constant from the input, it is equal to "-1". I would expect "1". Note that the function does what it says, so the "feature" is just in this constant creation step.
12-13-2011 10:50 PM
Firstly apologies for the delay. I ought to have replied sooner.
I agree that this makes sense. I was kind of thrown off by this behaviour too. It seems non-intuitive at some level.
We will take a look at this a bit more comprehensively, because we need to be really sure to make a change such as this which will break many previous VIs.
Again,
Appreciate your help! Keep them coming!
Prashanth