08-18-2009 01:52 PM
I used to use "Read from I16" VI to read a binary file on Labview 7.1. Now, I'm using Labview 8.5 which has "Read from binary" VI. However, Read from binary VI doesn't have "start with read offset". Could you please teach me how I can take this in a newer version?
Solved! Go to Solution.
08-18-2009 01:59 PM
Advanced File Functions: Set File Position.
Lynn
08-18-2009 02:34 PM
Thanks, Lynn. But I got one more problem. Since the data type of my input is "path" but not "refnum" which is input for "Set file position" VI. I know there is a VI converting 'refnum to path', but I don't know how to do the other way around. Could you tell me how to do it?
Best,
Jay
08-18-2009 03:32 PM
Jay,
Use the open file function. The Set File Position and Read from Binary File functions can be inside a loop if multiple reads will be performed. (The image is from LV2009 but I think the functions are the same in 8.x).
Lynn
08-18-2009 05:16 PM
Should I have "close file" VI?
Thanks,
Jay
08-19-2009 08:37 AM
Jay,
It is always safe to close each reference which has been opened. In some cases it is important to do so to prevent memory leaks. LV can do a pretty good job of closing references on its own, but it is not clear when it does so and when it may not, so closing explicitly is preferable.
Lynn
08-19-2009 11:48 AM
thank you so much Lynn