Check if a Particular File is Open in LabVIEW

Updated Dec 18, 2019

Reported In

Software

  • LabVIEW

Issue Details

I would like to check if a particular file is open on my computer in LabVIEW in order to do something like sharing a single file between multiple LabVIEW users or a .exe. Is there a VI that does this?

Solution

Most of theĀ File I/O VIs and Functions throw an error if the file in question is open when the VI executes. To check if a file is open, you can use a File I/O function, such as Open/Create/Replace File, and evaluate the error code to see if the file is open. For example, Open/Create/Replace File gives error code 5 if you attempt to open a file that is already open. See the attached VI for an example.

Attachments