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.
- Activate the Kuka script by entering the connection from the component type ID to the script in the [General] section.
- If several different component types are to be linked to the script, a new entry must be made for each component type ID.
- Save the file.
- Copy the
ScriptAfterUpload.ini
file to the Server scripting directory.
Example:
Specific example:
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).
- Activate the Kuka script by entering the connection from the component type ID to the script in the [General] section.
- If several different component types are to be linked to the script, a new entry must be made for each component type ID.
- Save the files.
- Copy the
ScriptBeforeCompare.ini
file for the server to the Server scripting directory. - Copy the
ScriptBeforeCompare.ini
file for the client to the Server scripting directory for automatic update of client.
Example:
Specific example:
Editing Kuka.script¶
- Open the
Kuka.script
file in the text editor. - If necessary, make the adjustments listed in the following table.
- Save the file.
- 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¶
- Start the AdminClient and open the Jobs module.
- Select the KUKA project to be backed up.
- Select the Create button.
- Select the Network (UNC) job under Upload type in the Job configuration.
- Enter your access data under Username and Password.
- Enter the path to the directory on the KUKA Controller in the Resource field (\IP\Share\ or \computer name\share) and Subdirectory.
- If necessary, reduce the network load by activating the checkbox.
- Activate the Make offline project available to scripting interface checkbox.
- Activate the Enable custom configuration for this job checkbox if you want to change the comparison settings.
- Save the job.
- The job can now be executed.