Jump to content

Random Access Files


Recommended Posts

I have been looking for a way to use random access files in labview. The closest thing i have seen is the datalog files, which are not completely what i am looking for. The datalog files can randomly read, but they only append to the end of the file. What i need is a way to read/write randomly to a specific location/record in a file. If i want to update record 15 with new information, i don't want to have to rewrite the whole file!!

Any help is greatly appreciated.

Eric

Link to comment

Look in the Advanced File Functions pallete, you should see "Seek". Pass in your file refnum along with your position before performing a write, using the same refnum. To avoid race conditions, be sure to wire the Seek refnum out and error out cluster from Seek to the Write...

(I'm at home today, and I'm not sure if the primatives for the file I/O palletes have changed with 8.0 / 8.20.)

post-949-1157035922.gif?width=400

Link to comment
Look in the Advanced File Functions pallete, you should see "Seek". Pass in your file refnum along with your position before performing a write, using the same refnum. To avoid race conditions, be sure to wire the Seek refnum out and error out cluster from Seek to the Write...

(I'm at home today, and I'm not sure if the primatives for the file I/O palletes have changed with 8.0 / 8.20.)

post-949-1157035922.gif?width=400

Look in the Advanced File Functions pallete, you should see "Seek". Pass in your file refnum along with your position before performing a write, using the same refnum. To avoid race conditions, be sure to wire the Seek refnum out and error out cluster from Seek to the Write...

(I'm at home today, and I'm not sure if the primatives for the file I/O palletes have changed with 8.0 / 8.20.)

post-949-1157035922.gif?width=400

I tried that in Labview 7.1 and it does not seem to work with records. (Its says it does.) I am trying to do this in 8.0.1

which says the offset is in bytes only ( i guess i could try records, but i doubt it works).

BTW, in Labview 8, SEEK has been changed to SET FILE POSITION.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.