LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write file error 8

Once the file is created subsequent writes show Error code 8 out of the "Write File" VI LV6. (Cannot upgrade the code at this time). I'm using open/create/Replace File VI along with the Write File VI. Creating the file run OK, once I go back and rerun for a write the "Write File" reports Error code 8. How do I fix this issue.... using LV6.

 

ErrorCode8.PNG

0 Kudos
Message 1 of 10
(4,862 Views)

Error 8, in the context of reading/writing is a permission error.

If you are reading, check that you are allowed read access for the folder/file you want to read.

If you are writing, check that you are allowed to write into that folder.

Cory K
0 Kudos
Message 2 of 10
(4,852 Views)

I noticed that in the image you attached, you are trying to write something to the C: drive.

Are you an administrator on that machine? That may be what is giving you a hard time.

Cory K
0 Kudos
Message 3 of 10
(4,851 Views)

The file created by the open/create/Replace VI attributes are NOT set to READ ONLY. See the pic below. If the LV creates the file it should be able to subsequently write to the same file. Once again this is LV version 6. It didn't work this way before... I took a look at a few things in the code and noticed this anomaly.

ErrorCode8Properties.PNG

 

BTW, there are root or branch level folder showing the Read Only attribute is inherited from parent folder... but my whole C drive is this way... but LV should be able to write to the file regardless....

Message Edited by richjoh on 12-22-2009 03:53 PM
0 Kudos
Message 4 of 10
(4,843 Views)

The above code works just fine on my virtual machine running LV 6i no matter how many times you run it.. Is your screenshot based on the first write, or a subsequent write? It shows 0 bytes.

 


richjoh wrote:
BTW, there are root or branch level folder showing the Read Only attribute is inherited from parent folder... but my whole C drive is this way... but LV should be able to write to the file regardless....

Why? LabVIEW does not override the file system's permissions, but this would not be due to the "Read Only" attribute for a folder. This is basically meaningless on Windows. For a folder what matters is the Access Control List. Assuming, of course, that you're dealing with an NTFS file system.

 

0 Kudos
Message 5 of 10
(4,835 Views)

Take a look at the pics below. I create the file, close it, open it, write to it, spur error code 8... bizaar... Some hidden permission but I don't know where.... I'm an Administrator on the PC.

 

LV6BD_WriteFile.PNG

 

MyTestFileProperties.PNG

0 Kudos
Message 6 of 10
(4,828 Views)

If your root folder is showing that you do not have write access, there is a good chance the children folders would also not allow write access (except for your 'documents and settings >> user' folder)

Cory K
0 Kudos
Message 7 of 10
(4,826 Views)

Hello,

 

 

Change the "open or create" option to "Create or Replace".

 

Or delete the file before running the application (if you still want to stick to the "Open or create" option)

 

I believe that LabVIEW tries to open the file in your case since it already exists and by making the option to "create or replace" it will overwrite the existing file

 

Regards
Guru (CLA)
0 Kudos
Message 8 of 10
(4,802 Views)

Problem went away after uninstall LV 6 then reinstalling LV6.... . I believe the problem had to do with installing in c:\Labview6 folder versus (the Legacy) C:\labview folder where the company wants it. The initial UNinstall may have not have been a complete removal on a prior install.

 

Thanks for the help.

0 Kudos
Message 9 of 10
(4,772 Views)
So you were trying to write into the LabVIEW install directory?  Why in the world would you do that? Smiley Surprised
0 Kudos
Message 10 of 10
(4,764 Views)