1. Home
  2. Knowledge Base
  3. Versiondog Server
  4. Tutorials
  5. Scripting
  6. ScriptingPackageExamples
  7. KB-132757: Example of script editor integration for KUKA robot components

KB-132757: Example of script editor integration for KUKA robot components

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). versiondog 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 versiondog 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.

  1. Activate the KUKA script, in which you enter the connection of the Component type ID to the script in the section [General]
  2. If more than one different component type is connected to the script, a new entry is required for each component type
  3. Save the file
  4. Copy the fileScriptAfterUpload.iniinto 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.inifile 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.inifile 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).

  1. Activate the KUKA script, by entering the Component type ID connection to the script in the section [General])
  2. If more than one different component type is connected to the script, a new entry is required for each component type
  3. Save the files
  4. 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

  1. Open the Kuka.script in the text editor
  2. If necessary, make the adjustments listed in the table below.
  3. Save the file
  4. 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 versiondog 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

  1. Open the AdminClient
  2. Click on the Jobs button
  3. Select the KUKA project that you want to backup
  4. Click on Create
  5. In Job configuration, under Upload type select the Job Network (UNC)
  6. Under User name and Password enter your details
  7. In the field Resources (\IPShareor\ComputernameShare), and Subdirectory enter the path to the directory of the KUKA controller
  8. Reduce the network load by activating the buttons
  9. Activate the option Make offline project available to scripting interface
  10. Activate the option Enable custom configuration for this job, if you want to make changes to the comparator settings
  11. Save your job
  12. The job can now be executed

Last update: September 15, 2023

Related Articles

IMPRINT | PRIVACY POLICY | COOKIE POLICY

Privacy Preference Center