Error 10 When Using Copy Function in LabVIEW

Updated Apr 29, 2024

Reported In

Software

  • LabVIEW

Issue Details

I am trying to log my data where when the .dat file is bigger than the size specified, it will convert it to an Excel file and save the file. However, while converting, I received the below error at the copy function.

Error 10 occurred at Copy in <file name>

Possible reason(s):

LabVIEW: (Hex 0xA) Duplicate path.
=========================
Asynchronous I/O operation in progress.


Error 10.png

How can I fix the error?

Solution

The error you’re encountering occurs because a file with the same name already exists at the specified path in LabVIEW. Consequently, LabVIEW cannot create the file. To ensure that your file is always the latest version, you should set the overwrite input on the Copy function to TRUE (the default is FALSE). When set to TRUE, the function replaces existing files or folders in the target path.

If you want to keep every file, you will need to check whether the file already exists and add something to the file name if it exists. For instance, you can refer to the Create File with Incrementing Suffix.vi, which is available under File I/O » Advanced File Functions in the Functions Palette.