NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

need to copy a file through teststand

I need to copy a file from one location to another location in windows. The two paths (source file path and destination file path) are in string variables that are stationglobals. To accomplish this task, I was able to create a LabVIEW code module and then call that vi from teststand. Is it possible to do this from within teststand and not using labview at all? I thought maybe there is some ActiveX method which can let me do this. I was looking through the list of available automation servers but could not find anything useful that will let me execute windows commands like copy.
 
Any comments/suggestions will be helpful.
 
Thanks
 
Anuj Gupta
0 Kudos
Message 1 of 7
(6,551 Views)

The Only way to do this is to use a module of some sort.  Even if you would have to call the System32.dll you would still have to use a module.  Is there a specific reason why you NEED to do it directly from TestStand? 

If you wanted to do  it through ActiveX then Microsoft would have to provide some sort of API that would allow you to make system calls like that.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 7
(6,508 Views)

Ok, thanks. The reason why I wanted to have it done inside teststand is because I want to reduce the dependence of my custom step types on external code modules. Having it done through a LabVIEW VI is great and easy, but its one more file to maintain.

Anuj

 

 

 

0 Kudos
Message 3 of 7
(6,504 Views)

I was able to do this, I am not sure if you had understood my question, but it turned out to be fairly simple. This is how it can be done:

1) Insert an ActiveX/COM action step.

2) Choose the automation server as Microsoft Scripting Runtime (Ver 1.0)

3) Choose the object class as FileSystemObject (IFileSystem3).

4) Call method CopyFile.

 

Anuj

Message 4 of 7
(6,485 Views)
Anuj, thanks for this information.  But what do you use for the object reference on the Active X/COM call window?  I've tried various objects to no avail.
0 Kudos
Message 5 of 7
(6,441 Views)

Instead of using a reference of an already created object, I just created a new object for this. So when you choose the object class, right below that, check mark the option 'Create Object'. Thats all you need to do.

Let me know if it doesn't work.

Anuj

Message 6 of 7
(6,435 Views)
I just found out that you could use a Call Executable step and call the command prompt and use the DOS commands to copy files.  That might be a lot easier than doing it the way you are doing it.
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 7 of 7
(6,420 Views)