LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

file - read only

I create new file using only "Write Characters To File".
(I don't want user to see dialog to choose file name,etc.)

I create .CSV file, and I want to set file as read only for any
other applications except LabView. When MS Excel opens this file
LabView is unable to write data to it.

Is it any simple way to solve this ? Or di I must use .vi's that show dialog
to chose file and dir.

-jcz-
0 Kudos
Message 1 of 3
(3,494 Views)
Hi,

when MS Excel open a file it takes exclusive rights for file during this time. In this case it's regardless which applikation will access to the file (LabVIEW or an other instance of MS Excel, all applications can open in read mode only).

My recommendation:
Try to open the CSV-File in Excel via "Data->External Data" instead "File->Open". For these purpose you must create a new ODBC-Connection to CSV-File. Perhaps there is an option to "share database" (I'm not shure, please trying). In this way Excel is loading a copy of content of the CSV-File only when trigger by user.
Christian

Test Engineering
digades GmbH
www.digades.com
0 Kudos
Message 2 of 3
(3,494 Views)
When a file has been marked as "read only", then Excel open it in read only mode, and the file remains accessible to other applications. What you have to do is to switch the "Acces Rights"(in the advanced file function subpalette) between $80 and $100, to respectively unlock and lock the file, at each write operation in LabVIEW.
Chilly Charly    (aka CC)
0 Kudos
Message 3 of 3
(3,494 Views)