LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

file copy

Hello everyone,

I have to open a single file from a selected source folder, modifiy it using Notepad and then copy it to a destination folder (usually different from the source one).

Also, I have to back up some files, so I want to be able to select multiple files or to select a whole folder, and then to copy it into another folder. I attach the vi.

I think my coding is redundant, but I need to configure the "copy" objects and the paths in slightly different ways. Any suggestion for a more elegant implementation?

Further, when I try to copy a folder into the same location, even if I select "overwrite" I get an error 7 (I attach the screenshot). Any ideas on this? Thanks

Download All
0 Kudos
Message 1 of 6
(2,256 Views)

Try to share the code in LV 2017 or Lower.

 

 

Presuming that you will be modifying the programmatically, In that case read the content from the file modify it and save as different file Name, in that case you will have back up file as well as modified file.

Can repeat same for multiple files in a folder as well.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 6
(2,253 Views)

I attach the code in v 2016

0 Kudos
Message 3 of 6
(2,203 Views)

Hi Davide,

 


@DavideB wrote:

Any suggestion for a more elegant implementation?

Put a wait statement in the loop: no need to spin as fast as possible!

Your Stop button is missing its label: NEVER delete the label of frontpanel elements!

 


@DavideB wrote:

Further, when I try to copy a folder into the same location, even if I select "overwrite" I get an error 7 (I attach the screenshot).


How are you trying to "copy a folder"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 6
(2,198 Views)

Thanks for your suggestions,

but my point is: there are two case structures, which are pretty much the same, beside the configuration of "browse" options.

Can I someway do with just one case, properly configured?

0 Kudos
Message 5 of 6
(2,193 Views)

Hi Davide,

 


@DavideB wrote:

but my point is: there are two case structures, which are pretty much the same, beside the configuration of "browse" options.

Can I someway do with just one case, properly configured?


Use the FileDialog function to browse for files/folders:

  1. place it in your block diagram
  2. open its frontpanel (its an ExpressVI)
  3. copy the subVI inside to your blockdiagram

Now you have a FileDialog function with a "browse options" input and you programmatically decide which kind of options you allow to browse for…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 6
(2,165 Views)