From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I detect xcopy completion in Labview?

Solved!
Go to solution

I'm using System Exec.vi to call xcopy in dos command. I've tried to leave "Wait Until Completion?" input as True and that didn't work -- nothing was copied. So I changed it to False and it worked: the directories, folders and files were copied successfully. Now my question is: how will my labview program know when the xcopy finishes? Is there any way to read it's exit code? How?

 

Thanks very much!

0 Kudos
Message 1 of 11
(4,393 Views)

Hi,

 

Random doubt. Why do you want to run xcopy in system exe when you already have a COPY function in the File I/O palette? Check the attached example.

Regards,
Nitz

(Give kudos to good Answers, Mark it as a Solution if your problem is Solved;)) 

0 Kudos
Message 2 of 11
(4,381 Views)

xcopy has many more options but the lv copy does almost the same job without the options,

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 3 of 11
(4,373 Views)

Thanks Nitz and Akiel for looking at my issues! I'd love to give you guys Kudos if my problem was resolved!

 

The reason I'm using xcopy is that the copy.vi in Labview didn't work with our NFS from a unix box. I posted some questions about this issues with NFS and didn't get good answers. Then I tried copy and xcopy in dos command, they worked. For copy, I left Wait until completion? to True and it worked fine. For xcopy, I had to change Wait Until Completion? to False to get it working. I don't know why. Maybe it has something to do with large amount of data transfer. (for copy, the file sizes are very small). Therefore I'm trying to find out how to detect when the xcopy finishes.

 

I apologize if I made a mistake by openning this new thread here so you guys didn't get the whole picture of my issues.

 

I hope you guys or someone else can help me out!

 

Many thanks!

 

0 Kudos
Message 4 of 11
(4,344 Views)

perhaps monitor the dos windows (its an ouput from system exec) for a return to the prompt or similar. this works even if you have chosen not to actually display the command prompt

 

no problem, btw kudos is for good answers or answers that point you towards a solution, mark as solution is self eplainitory

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 5 of 11
(4,342 Views)
Solution
Accepted by topic author djfasd

Another suggestion - try to use robocopy instead of xcopy.

 

Andrey.

 

Message 6 of 11
(4,337 Views)

Perhaps the reason xcopy fails when you wait for completion is that the output size > 4096.

Try wiring a bigger number to that input.

0 Kudos
Message 7 of 11
(4,321 Views)

Hi Andrey,

 

I downloaded windows resource kits and tried robocopy. It did work with System Exec while the Wait Until Completion set to default (True)! So this way, my labview program will know when the copy tasks finishes. Thank you so much for the great idea!

 

Regards.

 

0 Kudos
Message 8 of 11
(4,300 Views)

Hi pcardinale,

 

I've tried to increase that number to 99999999 and it didn't help.

 

Thank you for your effort trying to help!

0 Kudos
Message 9 of 11
(4,299 Views)

Hi Akiel,

 

I've tried to monitor that output and for some reason, I was never able to see anything from it.

 

I appreciate your time and effort very much!

 

Regards.

0 Kudos
Message 10 of 11
(4,296 Views)