Skip to content

Script example: editor integration for KUKA robot components

This script solution enables optimization for the upload and comparison of KUKA robot projects. The process of this script function takes place in three steps:

  • The server-controlled data backup takes place via a UNC Job, whereby only the most recent backup is archived (upload optimization).
  • The backup is unpacked before the comparison, so that the contents of the backup can be compared (comparison optimization).
  • In addition, it is checked whether the timestamp of the robot backup has changed (upload optimization) and, if necessary, a warning is displayed to the user.

Required files for this script function

File name Description Functionality
ScriptAfterUpload.exe Provided in the script package Links the project file configurably with an editor depending on the component type ID
ScriptAfterUpload.ini Can be edited with a text editor Defines the AfterUpload script for a specific component type ID
ScriptBeforeCompare.exe Provided in the script package Configures the comparison process depending on the component type ID the required editor.
ScriptBeforeCompare.ini Can be edited with a text editor Defines the BeforeCompare script for a specific component type ID
Kuka.script Can be edited with a text editor Script processed by the script interpreter

Prerequisite for the script solution

The Kuka robot (KR C2 or KR C4) must be configured so that a backup is copied to a defined directory (e.g. locally on the robot), which octoplant needs to be able to read via the UNC job. The latest backup is downloaded via this script function and archived as a backup in octoplant .

Setting up the script

Activating ScriptAfterUpload.exe

Copy the application to the Server scripting directory.

Editing ScriptAfterUpload.ini

We recommend that you add a possibly already existing file ScriptAfterUpload.ini from the Server scripting directory. If this file does not (yet) exist, use the template from the script package.

  1. Activate the Kuka script by entering the connection from the component type ID to the script in the [General] section.
  2. If several different component types are to be linked to the script, a new entry must be made for each component type ID.
  3. Save the file.
  4. Copy the ScriptAfterUpload.ini file to the Server scripting directory.

Example:

[General]
// Mapping for Kuka_Robot components
{Component type ID}=Kuka

Specific example:

[General]
581E9C1B48714ED6ADEE19E5351811BB=Kuka

Activating ScriptBeforeCompare.exe

Copy the application to the Server scripting directory and to the Server scripting directory for automatic update of client.

Editing ScriptBeforeCompare.ini

We recommend that you add a possibly already existing file ScriptAfterUpload.ini from the Server scripting directory. If this file does not (yet) exist, use the template from the script package.

Info

The adjustments for the ScriptBeforeCompare.ini file must be made twice, once for the configuration in the server script directory and once for the configuration in the client script directory. Although the configuration files for server and client have the same name, they may have different contents (related to script configurations for other components).

  1. Activate the Kuka script by entering the connection from the component type ID to the script in the [General] section.
  2. If several different component types are to be linked to the script, a new entry must be made for each component type ID.
  3. Save the files.
  4. Copy the ScriptBeforeCompare.ini file for the server to the Server scripting directory.
  5. Copy the ScriptBeforeCompare.ini file for the client to the Server scripting directory for automatic update of client.

Example:

[General]
// Mapping for Kuka_Robot components
{Component type ID}=Kuka

Specific example:

[General]
581E9C1B48714ED6ADEE19E5351811BB=Kuka

Editing Kuka.script

  1. Open the Kuka.script file in the text editor.
  2. If necessary, make the adjustments listed in the following table.
  3. Save the file.
  4. Copy the file to the Server scripting directory tab.

Script:

Function ScriptAfterUpload
{
file.deleteold
{
root $vdog::specific->dirbackup
spec ftLastWriteTime
keep 1
}

Warning.IfDateEqual
}

Function ScriptBeforeCompare
{
provideArchive
unzip
dir.exitIfEmpty $vdog::workdirS
}

Customizations

Line 7:

Keep 1 defines that only the last (most recent) backup is archived. If required, the number of backups can be adjusted here.

Line 10:

The command can be replaced with: Abort.IfDateEqual. This means that if the current backup has the same timestamp as the backup from the previous job execution, the job is acknowledged with an error (and no longer as a warning).

Setting up job for Kuka upload

  1. Start the AdminClient and open the Jobs module.
  2. Select the KUKA project to be backed up.
  3. Select the Create button.
  4. Select the Network (UNC) job under Upload type in the Job configuration.
  5. Enter your access data under Username and Password.
  6. Enter the path to the directory on the KUKA Controller in the Resource field (\IP\Share\ or \computer name\share) and Subdirectory.
  7. If necessary, reduce the network load by activating the checkbox.
  8. Activate the Make offline project available to scripting interface checkbox.
  9. Activate the Enable custom configuration for this job checkbox if you want to change the comparison settings.
  10. Save the job.
  11. The job can now be executed.