02-22-2011 04:22 AM
Hi all,
In my application I am using a Read from spreadsheet function to display the contents of a txt file saved in my computer continuously every 3 mins. This txt file gets updated once approximately every 3 minutes. Now the problem which I am facing is, If the txt files is getting updated at the exact time when the vi is trying to open the txt file it gives an error saying, "file already open!! Continue or Stop" If I press Continue it misses the values from the file. Is there any alternative to avoid this happening. It happens only once or twice in an hour. But still this error becomes fatal as there is a data loss.
Can anyone please help find a way to avoid this error.
Regards,
Nitz
02-22-2011 04:43 AM
Hi Nitzz,
If you are accessing the same file frequently in two different places then access it using the low level file IO functions.
Open the file reference at start and keep that in memry using global variable or functional global then close the same at the end of the application.