LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can a binary file be read incrementally?

Hi ayscr,

 


@ayscr wrote:

Hi johntrich,

 

I have an older version of Labview (2011) and can't open this.

P.S.: It sounds like your version of Labview allows you to feed a refnum into the Read From Binary File function, which mine doesn't


Even LV2011 allowed to use file refnums for ReadBinaryFile as can be seen here:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 11 of 14
(672 Views)

Thanks all for your replies, with the refnum (where it asks for a path in 2011) and the file open and close outside the loop it works!

0 Kudos
Message 12 of 14
(668 Views)

I apologize for not paying attention to the version you posted. I know you got to the solution but I attached a 2011 version of my edits. I got rid of your sequence structure and cleaned up the code a little also.

0 Kudos
Message 13 of 14
(645 Views)

Hi ayscr,

 

You probably already figured this out, but Read (and Write) from(to) Text File are some special sort of polymorphic.

If you read the detailed help for Read from Text File, you see the following description for the file input:

 

file can be a refnum or absolute file path. If it is a path, this function opens the file specified by the path. The default is to display a file dialog box and prompt you to select a file.

 

Generally when you want to use a file more than once, it's better to open the file (with Open/Create/Replace File) and close it (with Close File) separately, and just keep the reference (often with a Shift Register or in a class' private data, or similar).


GCentral
0 Kudos
Message 14 of 14
(614 Views)