cancel
Showing results for 
Search instead for 
Did you mean: 

Auto Download robot programs

Valued Contributor
Valued Contributor

Hi

 

I am trying to create a auto robot downloader of all the robot operation to a specific place. I have had a look and there is a DCMUtilities that does only robot programs and not operations. Any help would be great thank

 

Regards

15 REPLIES

Re: Auto Download robot programs

Siemens Legend Siemens Legend
Siemens Legend

Hi,

 

I did something similar in the past maype this code helps you.

 

TxOlpControllerUtilities txOlpControllerUtilities = new TxOlpControllerUtilities();
foreach (TxRoboticProgram prog in TxApplication.ActiveDocument.RoboticProgramRoot.DirectChildPrograms)
{
string path = @"C:\temp\testprog.src";
ITxRoboticDownloader downloader = txOlpControllerUtilities.GetInterfaceImplementationFromController(prog.Robot.Controller.Name,
typeof(ITxRoboticDownloader),
typeof(TxControllerAttribute),
"NameOfController") as ITxRoboticDownloader;
downloader.Download(prog, path, true);
}

 

Good luck

 

Best regards

Patrick

Re: Auto Download robot programs

Valued Contributor
Valued Contributor

Hi

 

Great thanks for the help. I am getting an error please see below with the below line. Which is strange because I am pulling the controller string directly from the robot

 

ITxRoboticDownloader downloader = OlpControllerUtil.GetInterfaceImplementationFromController(robot.Controller.Name, typeof(ITxRoboticDownloader), typeof(TxControllerAttribute), robot.Controller.Name);

 

dowloaderror.GIF

Re: Auto Download robot programs

Siemens Legend Siemens Legend
Siemens Legend

Hi,

 

It looks like your Controller is not compatible with your PS version.

e.g. you have installed PS13.0 but you use kuka-krc-bmw controller for PS13.0.2.

 

The best will be to uninstall the actual controller via Windows -> Control Panel -> Programs and Features.

 

Download the correct robot controller from GTAC for you installed PS version.

 

Best regards

Patrick

 

Re: Auto Download robot programs

Genius
Genius

RobSimCoder schrieb:

 

ITxRoboticDownloader downloader = OlpControllerUtil.GetInterfaceImplementationFromController(robot.Controller.Name, typeof(ITxRoboticDownloader), typeof(TxControllerAttribute), robot.Controller.Name);

 


The problem is in the last argument of the GetInterfaceImplementationFromController method. You pass the value of the property to the method instead of the property name.

 

Try

ITxRoboticDownloader downloader = OlpControllerUtil.GetInterfaceImplementationFromController(robot.Controller.Name, typeof(ITxRoboticDownloader), typeof(TxControllerAttribute), "ControllerName");

Re: Auto Download robot programs

Valued Contributor
Valued Contributor

Hi

 

Great thank you this now works. But there are two thing it is not doing like the normal downloader.

 

1. It does not create the *.olp program.

2. It does not create the .dat global template file.

 

I have had a look but I cannot see how to pull this information from the robot setup and into the download.

 

Thanks again for the help

Re: Auto Download robot programs

Genius
Genius

Does the command create a logfile?

If so, are there any informations about *.olp and *.dat template?

Re: Auto Download robot programs

Siemens Phenom Siemens Phenom
Siemens Phenom

Do you mean, you do not get same generated files whether you download from Process Simulate / Select Operation / Download To Robot or via your command that uses the API?

In theory, there should be no difference.

Re: Auto Download robot programs

Genius
Genius

I created a simple class to test the code.

The *.olp file is not created using the API.

There is an error message in the logfile.

Spoiler
Warnung: Keine Programmvorlage ausgewaehlt, benutze vorgegebene default.tdat.
Fehler: Datei P:\PStest\RobotsMachineDataFiles\7A04DD66-AC4D-4FEB-995B-942477431099\program.olp kann zum Schreiben nicht geoeffnet werden
Fehler: Datei P:\PStest\RobotsMachineDataFiles\7A04DD66-AC4D-4FEB-995B-942477431099\program.olp kann zum Schreiben nicht geoeffnet werden
Warnung: Keine Programmvorlage ausgewaehlt, benutze vorgegebene default.tsrc.

The path to program.olp is completely wrong.

The correct path to the RobotsMachineDataFiles-Directory is D:\eMSysRoot\RobotsMachineDataFiles\

I passed E:\program.src as the path for the Download method.

Process Simulate is started in Visual Studio, and my code is in a directory on P:\

Re: Auto Download robot programs

Siemens Phenom Siemens Phenom
Siemens Phenom

Strange. There is no reason download from API will find wrong machine data file folder (or at least a different one from download for PSR menus)...