You are on page 1of 40

SOFTWARE

KR C2

KUKA.PLC WinAC 1.1

KUKA System Software (KSS) 5.5, 5.6

Issued: 19 Aug 2009 Version: 03

KUKA.PLC WinAC 10.02.03 en 1 of 38


e Copyright 2005

KUKA Roboter GmbH


This documentation or excerpts therefrom may not be reproduced or disclosed to third parties without the express permission of the publishers.
Other functions not described in this documentation may be operable in the controller. The user has no claims to these functions, however, in
the case of a replacement or service work.
We have checked the content of this documentation for conformity with the hardware and software described. Nevertheless, discrepancies
cannot be precluded, for which reason we are not able to guarantee total conformity. The information in this documentation is checked on a
regular basis, however, and necessary corrections will be incorporated in subsequent editions.
Subject to technical alterations without an effect on the function.

2 of 38 KUKA.PLC WinAC 10.02.03 en


Contents

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1 Target group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Safety . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 System requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3.1 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3.2 Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4 About this documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1 Licensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 Installing Step 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2.1 Hardware update (HW update) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2.2 Installing the KUKA Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3 Functional principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1 Functional principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2 Inputs and outputs (I/O) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.2.1 KR C I/O system (input/output system) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.2.2 Field bus drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3 WinAC.ini file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.4 IOSys.ini file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5 KUKA.PLC WinAC user interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

5 Programming KUKA.PLC WinAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21


5.1 Creating a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

6 System functions (SFCs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27


6.1 KRCLib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.2 Description of the SFC 50xx blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.2.1 SFC 5000 -- ReadAxisAct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.2.2 SFC 5001 -- ReadAxisActEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.2.3 SFC 5002 -- ReadPosAct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.2.4 SFC 5003 -- ReadBaseAct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.2.5 SFC 5004 -- ReadToolAct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.2.6 SFC 5005 -- ReadOvPro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.2.7 SFC 5006 -- ReadModeOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.2.8 SFC 5007 -- ReadProState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.2.9 SFC 5008 -- WriteOvPro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.2.10 SFC 5009 -- SetNotifyMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.2.11 SFC 5010 -- SetStatusMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
6.2.12 SFC 5011 -- ClearStatusMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

KUKA.PLC WinAC 10.02.03 en 3 of 38


KUKA.PLC WinAC 1.1

6.2.13 SFC 5012 -- ClearAllStatusMessages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31


6.2.14 SFC 5013 -- ReadBool; SFC 5014 -- ReadInt; SFC 5015 -- ReadReal . . . . . . . . . . . . . . . . . 31
6.2.15 SFC 5016 -- WriteBool; SFC 5017 -- WriteInt; SFC 5018 -- WriteReal . . . . . . . . . . . . . . . . . . 31

8 Saving boot projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

9 OPC Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

9 KUKA Router . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

4 of 38 KUKA.PLC WinAC 10.02.03 en


1 Introduction

1 Introduction
KUKA.PLC WinAC comprises a real--time runtime system for KUKA robots, a development
environment for PLC applications, and additional optional components which are helpful for
the development of PLC applications.
In addition to control and visualization functions, tasks with large quantities of data and fast
technological functions can be performed on the PC platform. KUKA.PLC WinAC offers the
following advantages:
G No PLC hardware is required for the communication with the periphery.
G If the KR C and KUKA.PLC WinAC use the field bus system at the same time, no
additional field bus hardware is required.
G KUKA.PLC WinAC can access all the available KR C field bus systems.

1.1 Target group


This document is intended for robot programmers and personnel with the appropriate
training. In particular, configuration of the KUKA.PLC WinAC components requires
advanced specialized knowledge concerning the robot system.
Moreover, this document assumes that the user has knowledge of PLCs.

Information about Robot Programmer training courses at KUKA College is available on the
Internet under www.kuka--roboter.de.

Sufficient knowledge of KR C2 robot controllers and their configuration is required.

1.2 Safety
This document must be kept available at all times either as a hard copy or in electronic form
at the robot system or the development computer. For example, a hard copy can be inserted
at the back of the KR C Operating Handbook.
Observe the safety instructions in the document “Safety, General” of the KR C Operating
Handbook.

WARNING!
In exceptional cases, incorrect configuration or operation can lead to material
damage and/or personal injury. It is therefore absolutely essential for configuration
to be carried out exclusively by trained personnel.

KUKA.PLC WinAC 10.02.03 en 5 of 38


KUKA.PLC WinAC 1.1

1.3 System requirements


1.3.1 Software
G KUKA System Software (KSS), Version 5.5, 5.6
G Step 7 from Siemens (not included in the KUKA.PLC WinAC package)

1.3.2 Hardware
G KUKA KR C2 robot controller
G Processor min. 733 MHz CPU
G Main memory min. 256 MB RAM

1.4 About this documentation


This documentation contains a description of the software for the “KUKA.PLC WinAC”
technology package, including:
G Installing KUKA.PLC WinAC
G Functional principle of KUKA.PLC WinAC
G User interface of KUKA.PLC WinAC
G Programming KUKA.PLC WinAC
G System functions (SFCs)
G Saving boot projects
G OPC Server
G KUKA Router

Information about the KUKA System Software (KSS) can be found in the operating and
programming handbooks supplied with the robot.

6 of 38 KUKA.PLC WinAC 10.02.03 en


2 Installation

2 Installation
Place the CD in the CD--ROM drive of the control cabinet. Open Setup.exe on the KUKA.PLC
WinAC CD--ROM. Follow the installation instructions.
Setup procedure:
G If KUKA.PLC WinAC is installed over an identical existing version, the setup program
offers to uninstall the existing version.
G If no version of KUKA.PLC WinAC is installed, installation of KUKA.PLC WinAC is
started.
The system must be rebooted (cold start) to complete the installation.

2.1 Licensing
Attach the supplied licensing sticker to the KR C control cabinet!

2.2 Installing Step 7


Step 7 is not included in the KUKA.PLC WinAC package and must not be installed on the
robot controller. Install Step 7 on your workstation PC or laptop.

Carry out the installation as described in the Step 7 manual from Siemens.

KUKA.PLC WinAC 10.02.03 en 7 of 38


KUKA.PLC WinAC 1.1

2.2.1 Hardware update (HW update)


To ensure that the KUKA--specific CPU is detected, a hardware update (HW update) must
be carried out with Step 7.
This is done as follows:
G Start HW Config.
G In the “Options” menu, select the function “Install Hardware Updates”.
G Specify the following directory on the KUKA.PLC WinAC CD--ROM: Step7/HSP.

Fig. 3 Hardware configuration

If you have any questions regarding the hardware update, refer to the [Siemens “Help”
menu] or contact [Siemens Support].

8 of 38 KUKA.PLC WinAC 10.02.03 en


2 Installation (continued)

2.2.2 Installing the KUKA Library


The KUKA Library is included in the KUKA.PLC WinAC package and must be installed under
Step 7.
This is done as follows:
G Select the menu item File > Unarchive
G Enter the source directory \Step7\Kuka_Lib.zip on the KUKA.PLC WinAC CD--ROM
G Specify the target directory installation_directory\S7LIBS under Step7
Following installation, the Library should appear in the block editor (see following illustration).

Fig. 4 KUKA Library

KUKA.PLC WinAC 10.02.03 en 9 of 38


KUKA.PLC WinAC 1.1

10 of 38 KUKA.PLC WinAC 10.02.03 en


3 Functional principle

3 Functional principle
3.1 Functional principle
The following diagram illustrates the time distribution on the KUKA robot controller without
KUKA.PLC WinAC.
Tasks/Priority

R_INT

S_INT

Win

12 1 2 3 4 5 6 7 8 9 10 11 12 1
Ticks
IPO cycle 1 IPO cycle 2

Tasks/Priority = task priorities


R_INT = robot interpreter
S_INT = Submit interpreter
Ticks = 2 ms time slices
IPO cycle 1/2 = robot cycle
Win = Windows

Fig. 5 Time distribution without KUKA.PLC WinAC

KUKA.PLC WinAC 10.02.03 en 11 of 38


KUKA.PLC WinAC 1.1

The following diagram illustrates the time distribution on the KUKA robot controller with
KUKA.PLC WinAC.
Tasks/Priority

KUKA.PLC WinAC

R_INT

S_INT

Win

12 1 2 3 4 5 6 7 8 9 10 11 12 1
Ticks
IPO cycle 1 IPO cycle 2

Tasks/Priority = task priorities


KUKA.PLC WinAC = Soft PLC
(Software Programmable Logic Controller)
R_INT = robot interpreter
S_INT = Submit interpreter
Ticks = 2 ms time slices
IPO cycle 1/2 = robot cycle
Win = Windows

Fig. 6 Time distribution with KUKA.PLC WinAC

Fig. 6 clearly shows that the two interpreters in the KUKA robot controller, R_INT and S_INT,
are not adversely affected by KUKA.PLC WinAC. Multiple tasks are supported and must
share the KUKA.PLC WinAC time slices.
Effect of the time distribution on the PLC:
The processing time distribution applied in Fig. 5 and Fig. 6 is 12 ms. This means that the
minimum cycle time corresponds to this time distribution, as a new cycle cannot begin until
12 ms after the time slice in which the last cycle was started.

12 of 38 KUKA.PLC WinAC 10.02.03 en


3 Functional principle (continued)

3.2 Inputs and outputs (I/O)


3.2.1 KR C I/O system (input/output system)
KUKA.PLC WinAC can read outputs from the robot I/O system and write to its inputs.

3.2.2 Field bus drivers


Integrated into the KUKA robot system, KUKA.PLC WinAC supports the field buses from
KUKA Roboter.
KUKA.PLC WinAC can access the following drivers:
G KUKA Interbus PCI master/slave (IBS PCI SC/RI--LK (fiber--optic), IBS PCI SC/RI--IT
(copper))
G KUKA ProfiBus PCI master/slave (CP5613/14)

It is not possible to use Step 7 for configuring the field buses. This is carried out using *.ini
files. See Section 3.3 “WinAC.ini file” for information about this.

KUKA.PLC WinAC 10.02.03 en 13 of 38


KUKA.PLC WinAC 1.1

3.3 WinAC.ini file


The WinAC.ini file is the configuration file for KUKA.PLC WinAC. Inputs and outputs are
declared here, and debug and log levels are set here.
;-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
------
; configuration file WinAC
;-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
------
;
; Khadkikar 2004 KUKA Controls GmbH creation
; Zurbau 2008.10.29 KUKA Roboter GmbH TSM Log
;
;-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
------
; section [CONFIGURATION] : configuration
;
;
; LOGLEVEL and DEBUG : enables printing on Telnet shell and LogFIle, this value can be
; a combination (the sum) of the following
;
; 0 : no printings on Telnet-- shell (default: DEBUG=0)
; 1 : error printings are enabled
; 2 : warning printings are enabled
; 4 : info printings are enabled
;
; example DEBUG=3: error and warning printings are enabled
;
; TSM : when the WinAC changes its state to STOP a TSM-- Log / WinView file will be saved. The corresponding
; options should be set in progresss.ini
;
; 0 : log file disabled
; 1 : log file enabled
; SLEEP_TIME : minimum delay between executions of the free cycle in ms
;
; TIME_OFFSET : The Offset of your local time to GMT +/-- hh:mm
;
;-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
------
; section [WINAC] : fieldbus drivers
;-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
------
; This section describes the fieldbus drivers to be loaded with the WinAC
; startup.
;-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
------

[CONFIGURATION]

LOGLEVEL=1
DEBUG=1
TSM=0
SLEEP_TIME=12
TIME_OFFSET=+01:00

[WINAC]
;-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
------
; Example
;
; WinAC In/Out ByteNo. = FieldbusDriver In/Out ByteNo, SlaveAddress,Number of elements, 0 = no swaping
;
; OutByte 10 = PBMASL,OutByte2,123,1,0
; OutByte 10 = InterBusPCI,OutByte2,0,1,0
;
; KrcIoSys is no FieldBUs Driver, so swapping necessary
;
; InByte0=KrcIoSys,OutByte0,0,1,0
; OutByte0=KrcIoSys,InByte0,0,1,0
;-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
------

14 of 38 KUKA.PLC WinAC 10.02.03 en


3 Functional principle (continued)

TSM entry:
If WinAC switches to the STOP state, a TSM log / WindView file is generated and saved on
the hard drive (under LOG). This is necessary for debugging purposes. During production
operation, this value should be set to 0.

SLEEP_TIME entry:
The minimum idle time defines the idle time that is added during execution of the free cycle
(OB1). For further information, see Siemens WinAC RTX documentation under ”Tuning the
Performance of the Controller”.

The WinAC.ini file is based on the following syntax:


WinAC In/Out ByteNo. = FieldBusDriver In/Out ByteNo, SlaveAddress,Number of elements,
0 = no swapping
The WinAC inputs/outputs with number consist of the field bus driver, the inputs/outputs of
the field bus driver with number, the slave address, the element number and the assignment
with or without swapping.
G without swapping = 0
G with swapping = 1

KUKA.PLC WinAC supports the Motorola protocol: most significant byte at the lowest
memory address.
Swapping is required if a field bus device supports the Intel protocol (most significant
byte at the highest memory address). If swapping is set to 1, the bytes in a word or the
words in a DWord are swapped.

KUKA.PLC WinAC 10.02.03 en 15 of 38


KUKA.PLC WinAC 1.1

Examples:

Output byte 10 of KUKA.PLC WinAC is output byte 2 on Profibus device 123, without
swapping.
Explanation of the example
In this example, KUKA.PLC WinAC has an output byte with the number 10:
Syntax: outByte10
Field bus driver is a Profibus device
Syntax: PBMASL
Field bus driver has an output byte with the number 2:
Syntax: OutByte2
The element is the Profibus device and it has the number 123:
Syntax: 123
“Without swapping” corresponds to the number 0:
Syntax: 0

The complete syntax for the example is thus:


OutByte10 = PBMASL,OutByte2,123,1,0
Further examples:
Output word 10 of WinAC is output word 2 on Profibus device 123, with swapping:
OutWord10 = PBMASL,OutWord2,123,1,1
Output double word 10 of WinAC is output double word 2 on Profibus device 123, with
swapping:
OutDWord10 = PBMASL,OutDWord2,123,1,1
Input byte 10 of WinAC is input byte 2 on Interbus, without swapping:
InByte10 = InterBusPCI,InByte2,0,1,0
Input word 10 of WinAC is input word 2 on Interbus, with swapping:
InWord10 = InterBusPCI,InWord2,0,1,1
Input double word 10 of WinAC is input double word 2 on Interbus, with swapping:
InDWord10 = InterBusPCI,InDWord2,0,1,1

16 of 38 KUKA.PLC WinAC 10.02.03 en


3 Functional principle (continued)

3.4 IOSys.ini file


The IOSys.ini file is the file used to load the drivers and configure the robot I/Os. KUKA.PLC
WinAC is treated as a driver in the robot system, i.e. to start KUKA.PLC WinAC, the
corresponding lines must be entered in the IOSys.ini file. This should be done automatically
during installation. In this case, KUKA.PLC WinAC is automatically started when the KR C
is booted.
WINAC=101,winacInit,WinACLoader.o
[WINAC]
INB511=0
The following is an extract from the IOSys.ini file.
;==========================================================
; IOSYS.INI - Configuration file for the IO-- System
;==========================================================
; For configuration help go to the end of this file.
;-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

; ATTENTION !!!! Since V5.0 Build13 we have removed the DeviceNet


; driver ”dndrv.o”. Now you have to use the driver
; “dn2drv.o” and the appropriate syntax (form 2)

[CONFIG]
VERSION=2.00

[DRIVERS]
WINAC=101,winacInit,WinACLoader.o
;CNKE2=21,cnke2CPInit,cnke2drv.o
.
.
.
.
.
.
.
.
.
.
[CNKE1]
; =ConNo, additional offset,xSize

[CNKE2]
; =ConNo, additional offset,xSize

[IOLINKING]

[WINAC]
INB511=0

[END SECTION]

;==========================================================
.
.
.
.
;-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
; 04/02/02 section [IOLINKING] added

KUKA.PLC WinAC 10.02.03 en 17 of 38


KUKA.PLC WinAC 1.1

18 of 38 KUKA.PLC WinAC 10.02.03 en


4 KUKA.PLC WinAC user interface

4 KUKA.PLC WinAC user interface


The KUKA.PLC WinAC user interface shows the user the current status of KUKA.PLC
WinAC. It is also possible to change the status here. It is called via Monitor > WinAC Panel.

Fig. 7 KUKA.PLC WinAC user interface

There are two user levels. A User can only view the status of the PLC. An Expert or
Administrator can also modify the operating status of the PLC.
The functions RUN, RUNP, STOP, MRES and Close can be selected on the KUKA.PLC
WinAC user interface using softkeys.

Function Description
RUN PLC executes its programs and is not programmable
RUNP PLC executes its programs and is programmable
STOP PLC executes no programs and is programmable
MRES PLC is set to the STOP state and its programs are deleted
Close Closes the KUKA.PLC WinAC user interface

KUKA.PLC WinAC 10.02.03 en 19 of 38


KUKA.PLC WinAC 1.1

20 of 38 KUKA.PLC WinAC 10.02.03 en


5 Programming KUKA.PLC WinAC

5 Programming KUKA.PLC WinAC


5.1 Creating a project

Fig. 8 Creating a program


First create a new project. To do this, select the menu item File > New > User projects.

On creation of a new project, you will be asked where the project is to be created. This is
also where the file will be saved. Save your project after every modification!

KUKA.PLC WinAC 10.02.03 en 21 of 38


KUKA.PLC WinAC 1.1

Fig. 9 PC Station

Select the line “Beispiel_KUKA” in this window. Then press the right mouse button. Selecting
“Insert new object” and the line “SIMATIC PC Station” causes the Configuration line to be
displayed on the right--hand side of the window. Double--clicking on this line displays the
following window.

Fig. 10 Hardware configuration (HW Config)

In line 2 (Index column in Fig. 10) in the window “HW Config”, enter the WinAC for the robot.

22 of 38 KUKA.PLC WinAC 10.02.03 en


5 Programming KUKA.PLC WinAC (continued)

Fig. 11 Properties
The Order No. 6ES7 671--0XC00--0YB0 / V4.0 and the full designation “WinLC VxR V4.0;
Software Logic Controller for VxWin (Windows XP with VxWorks); firmware V4.0” are
displayed under Properties.

KUKA.PLC WinAC 10.02.03 en 23 of 38


KUKA.PLC WinAC 1.1

Fig. 12 IE General
IE General (IE = Industrial Ethernet) must then be entered in line 3 (Index column in Fig. 10).

Fig. 13 IP address
Then enter the IP address of the robot controller.

24 of 38 KUKA.PLC WinAC 10.02.03 en


5 Programming KUKA.PLC WinAC (continued)

Fig. 14 Target modules


Remember to compile and save. Load the configuration into the controller. The following
menus are available for this:
-- Station > Save and compile (Ctrl+S).
-- Target system > Load to modules (Ctrl+L).

KUKA.PLC WinAC 10.02.03 en 25 of 38


KUKA.PLC WinAC 1.1

26 of 38 KUKA.PLC WinAC 10.02.03 en


6 System functions (SFCs)

6 System functions (SFCs)


KUKA.PLC WinAC contains robot--specific functions. These are grouped together in
KRCLib.
The KRCLib blocks can only be used in IL.

6.1 KRCLib
KUKA Library KRCLib must be installed.

See Section 1.2.2.

6.2 Description of the SFC 50xx blocks


6.2.1 SFC 5000 -- ReadAxisAct
CALL SFC 5000
OUT0:= // axis 1
OUT1:= // axis 2
OUT2:= // axis 3
OUT3:= // axis 4
OUT4:= // axis 5
OUT5:= // axis 6

OUT0 -- OUT5 are of type REAL.


They indicate the current actual values of the axes.

6.2.2 SFC 5001 -- ReadAxisActEx


CALL SFC 5001
IN0 := // desired axis X
OUT1:= // axis X

IN0 is of type BYTE


OUT1 is of type REAL
Indicates the current actual value of the desired axis.

6.2.3 SFC 5002 -- ReadPosAct


CALL SFC 5002
OUT0:= // validity bit
OUT1:= // X coordinate
OUT2:= // Y coordinate
OUT3:= // Z coordinate
OUT4:= // orientation A
OUT5:= // orientation B
OUT6:= // orientation C

OUT0 is of type BOOL, TRUE = valid


OUT1 – OUT6 are of type REAL
The actual position values of the robot path are indicated.

KUKA.PLC WinAC 10.02.03 en 27 of 38


KUKA.PLC WinAC 1.1

6.2.4 SFC 5003 -- ReadBaseAct


CALL SFC 5003
OUT0:= // validity bit
OUT1:=:= // X coordinate
OUT2:= // Y coordinate
OUT3:= // Z coordinate
OUT4:= // orientation A
OUT5:= // orientation B
OUT6:= // orientation C

OUT0 is of type BOOL, TRUE = valid


OUT1 – OUT6 are of type REAL
The current position of the base origin is indicated.

6.2.5 SFC 5004 -- ReadToolAct


CALL SFC 5004
OUT0:= // validity bit
OUT1:= // X coordinate
OUT2:= // Y coordinate
OUT3:= // Z coordinate
OUT4:= // orientation A
OUT5:= // orientation B
OUT6:= // orientation C

OUT0 is of type BOOL, TRUE = valid


OUT1 – OUT6 are of type REAL
The current position of the tool origin is indicated.

6.2.6 SFC 5005 -- ReadOvPro


CALL SFC 5005
OUT0:= // override

OUT0 is of type BYTE


Indicates the current override value.

6.2.7 SFC 5006 -- ReadModeOP


CALL SFC 5006
OUT0:= // operating mode

OUT0 is of type BYTE


Indicates the current operating mode (T1, T2, AUT or EXT).

28 of 38 KUKA.PLC WinAC 10.02.03 en


6 System functions (SFCs) (continued)

6.2.8 SFC 5007 -- ReadProState


CALL SFC 5007
IN0 := // index
OUT1:= // return value

IN0 is of type BOOL


0: Submit interpreter
1: Robot interpreter
OUT1 is of type BYTE
0: Invalid index
1: No program selected
2: Program selected, but not started
3: Program is being executed
4: Program stopped
5: Program has been completely executed

6.2.9 SFC 5008 -- WriteOvPro


CALL SFC 5008
IN0 := // override

IN0 is of type BYTE


The override is set.

6.2.10 SFC 5009 -- SetNotifyMessage


CALL SFC 5009
IN0 := // string
IN1 := // set
IO2 := // confirm

IN0 is of type ANY


IN1 is of type BOOL
IO2 is of type BOOL
Enables the system to generate an acknowledgement message in the message window of
the robot controller.
The string (user--defined) is indicated at IN0. The message (string) is generated with IN1.
IN1 and then IO2 must subsequently be reset.

KUKA.PLC WinAC 10.02.03 en 29 of 38


KUKA.PLC WinAC 1.1

6.2.11 SFC 5010 -- SetStatusMessage


CALL SFC 5010
IN0 := // string
IN1 := // set
OUT2:= // message number
IO3 := // confirm

IN0 is of type ANY


IN1 is of type BOOL
OUT2 is of type BYTE
IO3 is of type BOOL
Enables the system to generate a status message in the message window of the robot
controller.
The string (user--defined) is indicated at IN0. The message (string) is generated with IN1.
IN1 and then IO3 must subsequently be reset. The message number which can be used to
clear the message is received at OUT2.

6.2.12 SFC 5011 -- ClearStatusMessage


CALL SFC 5011
IN0 := // set
IN1 := // message number
IO2 := // confirm

IN0 is of type BOOL


IN1 is of type BYTE
IO2 is of type BOOL
Enables the system to clear a status message in the message window of the robot controller.
The message number (user--defined) is indicated at IN1. The message (string) is cleared
with IN0. IN1 and then IO2 must subsequently be reset.

30 of 38 KUKA.PLC WinAC 10.02.03 en


6 System functions (SFCs) (continued)

6.2.13 SFC 5012 -- ClearAllStatusMessages


CALL SFC 5012
IN0 := // set
IO1 := // confirm

IN0 is of type BOOL


IO1 is of type BOOL
Clears all the status messages that have been generated.
The messages are cleared with IN0. IN1 and then IO1 must subsequently be reset.

6.2.14 SFC 5013 -- ReadBool; SFC 5014 -- ReadInt; SFC 5015 -- ReadReal
ReadBool, ReadInt and ReadReal can be used to read individual values from an array. They
all have the same parameters. The following is the example for ReadBool:
CALL SFC 5013
IN0 := // index
OUT1:= // value
OUT2:= // result

IN0 is of type BYTE


OUT1 is of type BOOL, INT, REAL
OUT2 is of type BOOL
The index (user--defined) is specified at IN0, OUT1 supplies the value (index--specific) from
the array, OUT2 supplies the result (TRUE = error, FALSE = OK)

6.2.15 SFC 5016 -- WriteBool; SFC 5017 -- WriteInt; SFC 5018 -- WriteReal
WriteBool, WriteInt and WriteReal can be used to write individual values to an array. They
all have the same parameters. The following is the example for WriteBool:
CALL SFC 5016
IN0 := // index
IN1 := // value
OUT2:= // result

IN0 is of type BYTE


IN1 is of type BOOL, INT, REAL
OUT2 is of type BOOL
The index (user--defined) is specified at IN0, IN1 is the writing value (index--specific) from
the array, OUT2 supplies the result (TRUE = error, FALSE = OK)
The index (user--defined) is specified at IN0, IN1 is the writing value (index--specific) from
the array, OUT2 supplies the result (TRUE)

KUKA.PLC WinAC 10.02.03 en 31 of 38


KUKA.PLC WinAC 1.1

32 of 38 KUKA.PLC WinAC 10.02.03 en


7 Saving boot projects

7 Saving boot projects


On creation of a new project, you will be asked where the project is to be created. This is also
where the file will be saved. Save your project after every modification! Projects can be
compressed using Step 7 via the menu File > Archive. A *.zip file is created.

See Step 7 online help.

The boot project is located on the robot, in the directory C:\krc\tp\winac, and is called
WinLCVXR.v7. It can also be saved manually. The procedure here is the same as for a
normal file.

KUKA.PLC WinAC 10.02.03 en 33 of 38


KUKA.PLC WinAC 1.1

34 of 38 KUKA.PLC WinAC 10.02.03 en


8 OPC Server

8 OPC Server
KUKA.PLC WinAC contains an OPC Server. This is installed automatically.

For more information, read the original Siemens documentation that is installed with the
software. It can be found under START > Programs > Simatic > Documentation.

KUKA.PLC WinAC 10.02.03 en 35 of 38


KUKA.PLC WinAC 1.1

36 of 38 KUKA.PLC WinAC 10.02.03 en


9 KUKA Router

9 KUKA Router
The KUKA Router is installed with the correct configuration. Should it be necessary, however,
to set up a route manually for KUKA.PLC WinAC, it must be ensured that Port 102 is routed
to the kernel system (generally 192.0.1.1).

Fig. 15 Router
Double--clicking on the tray icon causes the router to be displayed.

Fig. 16 Configuration dialog


Double--clicking on a destination address opens the configuration dialog. In order, for
example, to make the kernel system of the robot accessible via the network, “192.0.1.1” must
be entered here.

Fig. 17 Calling the configuration dialog via the pop--up menu

KUKA.PLC WinAC 10.02.03 en 37 of 38


KUKA.PLC WinAC 1.1

Alternatively, you can right--click to open a pop--up menu and then select “Configure”.

Fig. 18 Port numbers and port name


Double--clicking on a port (individual route) opens the configuration dialog. In addition to the
port number itself, an optional port name can be assigned here, which will then appear in the
detail view of the application window. If a port number on the PC is executed on the router
and has to be available on the target PC, the problem can be solved by means of so--called
port mapping. In this case the parameters “Source Port” and “Target Port” would be different.

Fig. 19 Calling the port window via the pop--up menu


Alternatively, you can right--click to open a pop--up menu and then select “Configure”.

38 of 38 KUKA.PLC WinAC 10.02.03 en


Index

C O
ClearAllStatusMessages, 31 OPC Server, 35
ClearStatusMessage, 30
Creating a program, 21 P
PC Station, 22
Port mapping, 38
D
Port name, 38
Debug and log levels, 14 Port number, 38
Priority, 11, 12

F
R
Field bus drivers, 13
ReadAxisAct, 27
ReadAxisActEx, 27
H ReadBaseAct, 28
ReadBool, 31
Hardware, 6
ReadInt, 31
Hardware configuration, 22
ReadModeOP, 28
Hardware update (HW update), 8 ReadOvPro, 28
ReadPosAct, 27
ReadProState, 29
I
ReadReal, 31
IE General, 24 ReadToolAct, 28
Inputs and outputs (I/O), 13 RUN, 19
Installation, 7 RUN--P, 19
Installing Step 7, 7
Installing the KUKA Library, 9 S
IOSys.ini file, 17
Save project, 21
IP address, 24 Saving boot projects, 33
IPO cycle, 11, 12 SetNotifyMessage, 29
SetStatusMessage, 30
SFC 50xx blocks, 27
K
Software, 6
KR C I/O system, 13 Source Port, 38
KRCLib, 27 Step 7, 7
KUKA KR C2 robot controller, 6 STOP, 19
KUKA Router, 37 System functions (SFCs), 27
KUKA.PLC WinAC, 11
T
L Target Port, 38
Tasks, 11, 12
Licensing, 7 Ticks, 11, 12
Time distribution with KUKA.PLC WinAC, 12
Time distribution without KUKA.PLC WinAC,
M 11
MRES, 19 Tray icon, 37

Index -- i
Index

W
WinAC user interface, 19
WinAC.ini, 14
WriteBool, 31
WriteInt, 31
WriteOvPro, 29
WriteReal, 31

Index -- ii

You might also like