Example of script editor integration for KUKA robot components
This script solution enables optimization for the upload and the comparison of KUKA robot projects. There are three steps to this script function:
- The server controlled data backup is carried out via a UNC job, where only the latest backup is archived (upload optimization)
- The backup is unzipped, so that the contents of the backup can be compared (comparator optimization)
- Additionally, it will also check whether the timestamp of the robot backup has changed (upload optimization) and a warning is displayed to the user
Necessary files for this script function:
File nam | Description | Functio |
---|---|---|
ScriptAfterUpload.exe | Available in the scripting package | Links the configurable project file with an editor, depending on the Component type ID |
ScriptAfterUpload.ini | Can be edited with a text editor | Define the script AfterUpload for a specific component type ID |
ScriptBeforeCompare.exe | Available in the scripting package | Depending on the Component type ID, configure the comparator process for the required editor |
ScriptBeforeCompare.ini | Can be edited with a text editor | Define the script BeforeCompare for a specific component type ID |
Kuka.script | Can be edited with a text editor | Script, which was processed by the script interpreter |
Requirements for the script solution:
The KUKA robots (KR C2 and KR C4) need to configured so that a backup is copied into a defined directory (for example, locally on the robot). octoplant needs to be able to read this directory via the UNC job. The latest backup is downloaded via this script function and then archived in the octoplant system
Set up script
Activate ScriptAfterUpload.exe
Copy the application into the Server script directory
Edit ScriptAfterUpload.ini
We recommend that you edit the ScriptAfterUpload.ini taken from the Server scripting directory. If this file is not yet available, use the template from the scripting package.
- Activate the KUKA script, in which you enter the connection of the Component type ID to the script in the section [General]
- If more than one different component type is connected to the script, a new entry is required for each component type
- Save the file
- Copy the file
ScriptAfterUpload.ini
into the Server script directory.
Example:
1 2 3
[General] // Mapping for Kuka_robots components<ComponentTypeID>
=Kuka
Specific example:
1 2
[General] 581E9C1B48714ED6ADEE19E5351811BB=Kuka
Activate ScriptBeforeCompare.exe
Copy the application into the Server scripting directory and into Server scripting directory for automatic update of client.
Edit ScriptBeforeCompare.ini
We recommend that you edit theScriptBeforeCompare.ini
file taken from the Server scripting directory If this file is not yet available, use the template from the scripting package.
Note
Please note that changes to theScriptBeforeCompare.ini
file need to be carried out twice, once for the
Configuration of the Server scripting directory and once for the Configuration of the Server scripting directory for automatic update of client. Although the configuration files for server and client have the same name, they may have different content (related to the script configuration for other components).
- Activate the KUKA script, by entering the Component type ID connection to the script in the section [General])
- If more than one different component type is connected to the script, a new entry is required for each component type
- Save the files
- Copy the ScriptBeforeCompare.ini file into theServer scripting directory and into the Server scripting directory for automatic update of client.
Example:
1 2 3
[General] // Mapping for Kuka_robots components<ComponentTypeID>
=Kuka
Specific xample:
1 2
[General] 581E9C1B48714ED6ADEE19E5351811BB=Kuka
Edit the Kuka.script
- Open the Kuka.script in the text editor
- If necessary, make the adjustments listed in the table below.
- Save the file
- Copy the file into the Server scripting directory
Script:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Function ScriptAfterUpload { file.deleteold { root $vdog::specific->dirbackup spec ftLastWriteTime keep 1 }
Warning.IfDateEqual }
Function ScriptBeforeCompare { provideArchive unzip dir.exitIfEmpty $vdog::workdirS }
Lines | Descriptio |
---|---|
7 | keep 1 is used to determine, that only the last (latest) backup in octoplant will be archived. The number of backups can be configured here. |
1 | The command can be replaced with: Abort.IfDateEqualIn the event that the current backup has the same timestamp as the backup from the previous job execution, the job will end with an error (and a warning will not be provided). |
Set up job for the KUKA upload
- Open the AdminClient
- Click on the Jobs button
- Select the KUKA project that you want to backup
- Click on Create
- In Job configuration, under Upload type select the Job Network (UNC)
- Under User name and Password enter your details
- In the field Resources (
\IPShare
or\ComputernameShare
), and Subdirectory enter the path to the directory of the KUKA controller - Reduce the network load by activating the buttons
- Activate the option Make offline project available to scripting interface
- Activate the option Enable custom configuration for this job, if you want to make changes to the comparator settings
- Save your job
- The job can now be executed