05-19-2009 04:19 PM
I have a LabView 8.6 application that writes to a .csv file on our network. The .vi opens the file, writes data then closes the file. This repeats about every 5 minutes. The amount of data we write is very small, only a few numbers and the time/date so the file should only be open for far less than a second. The problem is that another application (not LabView) needs to access that file and do something with that data. When that application tries to open the file it gets a network error such as "file being modified by another user" even though labView has closed the file. If I change the file location to the local drive, not the network, then there is no problem opening the file. Our network tech thinks the problem has to do with optimistic/pessimistic locks in the network system. When I close the labview application the file is available with no problem. Is there something in LabView such as permissions or semaphore I can put in place to fix this? The operating system is XP.
Thanks,
Glen
05-20-2009 04:30 PM
Hi Glen,
How are you writing to the file? What VI are you using?
And when you say 'close LabVIEW', do you mean close that specific VI, stop the VI, or close LabVIEW completely?
05-21-2009 07:08 AM
Hi Jeff,
The subVI is attached. It's a open/create/replace file, a set file position to move to the end of the file and a format into file and close. The subVI works file. It's just that the data file I write to is not available for other applications to read until I close LabView completely.
Thanks for looking at this,
Glen
05-21-2009 07:23 AM
This problem may arise when your .csv file is being accessed continuously by LabVIEW, even though it is writing data after 5 minutes. I suggest you create a timer of 5 minutes which would dynamically call the .vi file(which writes to the .csv file on the network ) each time after the timer resets and then close the reference after the writing.
Hopefully this would solve the problem.
-Parag D
05-21-2009 07:56 AM
05-21-2009 08:22 AM
05-22-2009 09:46 AM
What Parag says about LabVIEW holding onto the file makes sense. Loading it dynamically might alleviate the problem. Something along the lines of this KB is how you do it.