Tc3 Robotics Mxautomation: Manual
Tc3 Robotics Mxautomation: Manual
TwinCAT 3
Version: 1.4
Date: 2016-11-17
Order No.: TF5120
Table of Contents
Table of Contents
1 Notes on the documentation .................................................................................................................... 6
3 Introduction................................................................................................................................................ 8
3.1 Target group ..................................................................................................................................... 8
3.2 Industrial robot documentation ......................................................................................................... 8
3.3 Terms used....................................................................................................................................... 8
4 Product description................................................................................................................................... 9
4.1 Overview........................................................................................................................................... 9
4.1.1 Components.......................................................................................................................... 9
4.1.2 Communication ..................................................................................................................... 9
4.1.3 WorkVisual............................................................................................................................ 9
4.2 Intended use ..................................................................................................................................... 9
4.2.1 Misuse................................................................................................................................... 9
5 Safety........................................................................................................................................................ 10
6 Installation................................................................................................................................................ 11
6.1 System requirements...................................................................................................................... 11
6.1.1 Hardware ............................................................................................................................ 11
6.1.2 Software.............................................................................................................................. 11
7 Programming ........................................................................................................................................... 12
7.1 Overview of function blocks ............................................................................................................ 12
7.2 Frequently used input/output signals in the function blocks ........................................................... 16
7.2.1 Input signals........................................................................................................................ 16
7.2.2 Output signals ..................................................................................................................... 16
7.2.3 Signal sequence for execution of ExecuteCmd .................................................................. 17
7.3 Frequently used input/output signals in the MC function blocks..................................................... 18
7.3.1 Input signals........................................................................................................................ 18
7.3.2 Output signals ..................................................................................................................... 18
7.3.3 Signal sequence for execution of Execute.......................................................................... 19
7.4 Structures for motion programming (STRUCT) .............................................................................. 19
7.4.1 APO .................................................................................................................................... 20
7.4.2 PTP_APO (INT) .................................................................................................................. 20
7.4.3 CP_APO (INT) .................................................................................................................... 20
7.4.4 COORDSYS ....................................................................................................................... 21
7.4.5 E6AXIS ............................................................................................................................... 21
7.4.6 E6POS ................................................................................................................................ 21
7.4.7 FRAME ............................................................................................................................... 22
7.5 Integer variables ............................................................................................................................. 22
7.5.1 BufferMode ......................................................................................................................... 22
7.5.2 QueueMode ........................................................................................................................ 23
7.5.3 CircType.............................................................................................................................. 23
7.5.4 OriType ............................................................................................................................... 23
7.5.5 Status.................................................................................................................................. 23
7.6 Data of a Cartesian workspace....................................................................................................... 24
7.6.1 Origin and orientation.......................................................................................................... 24
7.6.2 Dimensions ......................................................................................................................... 24
7.7 Data of an axis-specific workspace ................................................................................................ 24
7.7.1 Robot axes.......................................................................................................................... 25
7.7.2 External axes ...................................................................................................................... 25
7.8 Programming tips for TC3 mxAutomation....................................................................................... 25
7.8.1 Instancing............................................................................................................................ 25
7.8.2 ExecuteCmd ....................................................................................................................... 26
8 Messages ............................................................................................................................................... 117
8.1 Error messages of the mxA interface in the robot interpreter ....................................................... 117
8.2 Error messages of the mxA interface in the submit interpreter..................................................... 121
8.3 Errors in the function block ........................................................................................................... 125
8.4 ProConOS errors .......................................................................................................................... 128
The responsible staff must ensure that the application or use of the products described satisfy all the
requirements for safety, including all the relevant laws, regulations, guidelines and standards.
Disclaimer
The documentation has been prepared with care. The products described are, however, constantly under
development.
We reserve the right to revise and change the documentation at any time and without prior announcement.
No claims for the modification of products that have already been supplied may be made on the basis of the
data, diagrams and descriptions in this documentation.
Trademarks
Beckhoff®, TwinCAT®, EtherCAT®, Safety over EtherCAT®, TwinSAFE®, XFC® and XTS® are registered
trademarks of and licensed by Beckhoff Automation GmbH.
Other designations used in this publication may be trademarks whose use by third parties for their own
purposes could violate the rights of the owners.
Patent Pending
The EtherCAT Technology is covered, including but not limited to the following patent applications and
patents:
EP1590927, EP1789857, DE102004044764, DE102007017835
with corresponding applications or registrations in various other countries.
The TwinCAT Technology is covered, including but not limited to the following patent applications and
patents:
EP0851348, US6167425 with corresponding applications or registrations in various other countries.
EtherCAT® is registered trademark and patented technology, licensed by Beckhoff Automation GmbH,
Germany
Copyright
© Beckhoff Automation GmbH & Co. KG, Germany.
The reproduction, distribution and utilization of this document as well as the communication of its contents to
others without express authorization are prohibited.
Offenders will be held liable for the payment of damages. All rights reserved in the event of the grant of a
patent, utility model or design.
2 Safety instructions
Safety regulations
Please note the following safety instructions and explanations!
Product-specific safety instructions can be found on following pages or in the areas mounting, wiring,
commissioning etc.
Exclusion of liability
All the components are supplied in particular hardware and software configurations appropriate for the
application. Modifications to hardware or software configurations other than those described in the
documentation are not permitted, and nullify the liability of Beckhoff Automation GmbH & Co. KG.
Personnel qualification
This description is only intended for trained specialists in control, automation and drive engineering who are
familiar with the applicable national standards.
Description of symbols
In this documentation the following symbols are used with an accompanying safety instruction or note. The
safety instructions must be read carefully and followed without fail!
Risk of injury!
Failure to follow the safety instructions associated with this symbol endangers the life and
health of persons.
WARNING
Personal injuries!
Failure to follow the safety instructions associated with this symbol can lead to injuries to
persons.
CAUTION
Tip or pointer
This symbol indicates information that contributes to better understanding.
Note
Note on safety
Familiarize yourself also when reading other documentations with the safety signs used
therein and with the meaning of these safety signs.
Carefully attend to safety signs and notes on safety also within other documentations.
DANGER
3 Introduction
For optimal use of KUKA robots, we recommend that our customers take part in a course of
training at KUKA College. Information about the training program can be found at
www.kuka.com or can be obtained directly from our subsidiaries.
Note
4 Product description
4.1 Overview
Die TwinCAT library contains function blocks for programming automation tasks with TwinCAT 3.
4.1.1 Components
The following software components are included in the TwinCAT library:
• Function blocks for TwinCAT 3
4.1.2 Communication
For data exchange between the PLC and the robot controller the terminal EL6695-1001 by KUKA can be
used.
4.1.3 WorkVisual
The following software is required for configuring the field buses and mapping the field bus signals:
• WorkVisual 4.0
The offline part of KUKA.PLC mxAutomation is intended for use with TwinCAT 3.1.4020.14 or higher.
Any other or additional use is considered misuse and is not allowed. The manufacturer cannot be held liable
for any resulting damage. The risk lies entirely with the user.
Operation in accordance with the intended use also requires compliance with the start-up and configuration
instructions in this documentation.
4.2.1 Misuse
Any use or application deviating from the intended use is deemed to be misuse and is not allowed. This
includes e.g.:
• Incorrect configuration (not in compliance with this documentation). This might result in the robot
executing different actions from those planned by the PLC programmer.
• Use in a programming environment other than TwinCAT 3.1.4020.14 or higher.
5 Safety
This documentation contains safety instructions which refer specifically to the software described here.
Familiarize yourself also when reading other documentations with the safety signs used
therein and with the meaning of these safety signs.
Carefully attend to safety signs and notes on safety also within other documentations.
DANGER
The fundamental safety information for the industrial robot can be found in the “Safety” chapter of the
Operating and Programming Instructions for System Integrators or the Operating and Programming
Instructions for End Users.
The “Safety” chapter in the operating and programming instructions of the KUKA System
Software (KSS) must be observed. Death to persons, severe injuries or considerable dam-
age to property may otherwise result.
DANGER
6 Installation
6.1.1 Hardware
Robot controller:
• KR C4
• Or KR C4 compact
External PLC:
• Beckhoff TwinCAT 3 controller
6.1.2 Software
Robot controller:
• KUKA System Software 8.3
Standard laptop/PC:
• WorkVisual 4.0
Industrial PC/Embedded-PC
• TwinCAT 3.1.4020.14 or higher
7 Programming
Administrative functions
KRC_ReadSoftEnd >>> "Reading the software limit switches
of the robot axes". [} 49]
KRC_ReadSoftEndExt >>> "Reading the software limit switches
of the external axes". [} 50]
KRC_WriteSoftEnd >>> "Writing the software limit switches
of the robot axes". [} 50]
KRC_WriteSoftEndExt >>> "Writing the software limit switches
of the external axes". [} 51]
KRC_AutoStart >>> "Automatically starting function
blocks and signals". [} 62]
Motion programming
KRC_JogLinearRelative >>> "Jogging to a relative end position".
[} 64]
KRC_JogToolRelative >>> "Jogging to a relative end position in
the TOOL coordinate system". [} 66]
KRC_Jog >>> "Jogging to an end position". [} 68]
Interrupt programming
KRC_DeclareInterrupt >>> "Declaring interrupts". [} 52]
Interrupt programming
KRC_ActivateInterrupt >>> "Activating interrupts". [} 54]
KRC_DeactivateInterrupt >>> "Deactivating interrupts". [} 55]
KRC_ReadInterruptState >>> "Reading the state of an interrupt".
[} 55]
Diagnostic functions
KRC_ReadMXAStatus >>> "Reading the current state of the
mxA interface". [} 82]
KRC_ReadMXAError >>> "Reading error messages of the mxA
interface". [} 82]
KRC_ReadKRCError >>> "Reading error messages of the
robot controller". [} 83]
KRC_MessageReset >>> "Resetting error messages of the
mxA interface". [} 83]
KRC_Diag >>> "Reading diagnostic signals". [} 85]
KRC_Error >>> "Reading and acknowledging error
states". [} 87]
In order to be able to use these function blocks, the KUKA.ConveyorTech technology pack-
age must be installed on the robot controller.
Note
In order to be able to use these function blocks, the KUKA.VectorMove technology package
must be installed on the robot controller.
Note
AxisGroupIdx
This signal input is used to set the number of the axis group addressed by a function block.
5 axis groups (robot and external axes) can be controlled by the PLC.
ExecuteCmd
If this signal is set, mxAutomation transfers the associated function block to the robot. The function block is
stored in a statement buffer by the robot, provided there is still sufficient space in the buffer. If the
ExecuteCmd input is reset, mxAutomation deletes the function block from the buffer again unless execution
of the statement has already begun.
Busy
This signal output indicates that the associated function block is currently being transferred to the robot’s
statement buffer or has already been transferred. It is reset when the ExecuteCmd input is reset.
Active
This signal output indicates that the associated function block is currently being executed on the robot. It is
reset when the ExecuteCmd input is reset.
Approximate positioning is not possible with the active output because the next motion instruction is not sent
until the previous motion has been executed. Approximate positioning is only possible if the Busy output of
the previous function block is connected to the ExecuteCmd input of the following block.
Done
This signal output indicates that the associated function block has been successfully executed by the robot.
It is reset when the ExecuteCmd input is reset.
Error
This signal output indicates that an error has occurred during execution of the associated function block on
the robot. In this case, the signal output ErrorID contains an error number. It is reset when the ExecuteCmd
input is reset.
ErrorID
This signal output contains an error number.
The errors and error causes corresponding to the error number are described here: >>> "Messages". [} 117]
Aborted
This signal output is set either when the function block KRC_Abort is executed or when a statement is
executed in the ABORTING mode. It is reset when the ExecuteCmd input is reset.
Example
The signal diagram applies in the following case:
• A statement has been transferred by means of ExecuteCmd and successfully executed.
Item Description
1 The function block is transferred to the robot (= request to execute
the statement).
2 The statement is transferred.
3 The statement is currently being executed.
4 The statement was completed successfully. Neither has an error
occurred, nor has the statement been aborted, e.g. by KRC_Abort.
The Error signal would be set instead of the Done signal in the
case of an error, and the Aborted signal would be set instead of the
Done signal if the statement is aborted.
5 If the ExecuteCmd input is reset, the outputs too are reset.
Variations
• ExecuteCmd is reset before Done is set. The statement will be executed in this case but the Done
signal will not be set. This means there is no confirmation that the statement has been executed.
• ExecuteCmd is reset before Error or Aborted is set. The statement will be aborted in this case but
neither the Error nor the Aborted signal will be set. This means there is no confirmation that the
statement has been aborted.
• ExecuteCmd is reset before Active is set. In this case the function block will be deleted from the
robot’s statement buffer.
• ExecuteCmd is reset before Busy is set. The funcion block will not be transferred to the robot in this
case and the statement will therefore not be executed.
AxisGroupIdx
This signal input is used to set the number of the robot addressed by a function block.
Execute
If this signal is set, mxAutomation transfers the associated function block to the robot. The function block is
stored in a statement buffer by the robot, provided there is still sufficient space in the buffer. If the Execute
input is reset, mxAutomation deletes the function block from the buffer again unless execution of the
statement has already begun.
ComBusy
This signal output indicates that the associated function block has been sent from the PLC to the robot’s
statement buffer and has been correctly transferred.
ComDone
This signal output indicates that the associated function block has been sent from the PLC to the robot’s
statement buffer and has been correctly transferred. This signal output is identical to the Done signal output
of the KRC function blocks. We recommend using this signal output for the approximation of motions.
Busy
This signal output indicates that execution of the associated function block has begun. However, it is
possible that the function block has not yet been transferred to the robot’s statement buffer. In this respect,
this signal output differs from the Busy signal output of the KRC function blocks.
Active
This signal output indicates that the associated function block is currently being executed on the robot. It is
reset when the Execute input is reset.
Approximation is not possible with the Active output because the next motion instruction is not sent until the
previous one is executed. Approximation is only possible if the ComDone output of the previous function
block is connected to the Execute input of the subsequent block.
Error
This signal output indicates that an error has occurred during execution of the associated function block on
the robot. In this case, the signal output ErrorID contains an error number. It is reset when the Execute input
is reset.
ErrorID
This signal output contains an error number.
The errors and error causes corresponding to the error number are described here: >>> "Messages". [} 117]
CommandAborted
This signal output indicates that execution of a statement or motion has been aborted.
Example
The signal diagram applies in the following case:
• A statement has been transferred by means of Execute and successfully executed.
Item Description
1 The function block is transferred to the robot (= request to execute
the statement).
2 The statement has been transferred (= is located in the robot’s
statement buffer). The ComDone and ComBusy outputs are set.
3 The statement is currently being executed.
4 The statement was completed successfully. Neither has an error
occurred, nor has the statement been aborted, e.g. by KRC_Abort.
The Error signal would be set instead of the Done signal in the
case of an error, and the Aborted signal would be set instead of the
Done signal if the statement is aborted.
5 If the Execute input is reset, the outputs too are reset.
7.4.1 APO
Approximation parameters for a KRC_Move motion command
Element Type Description
PTP_MODE PTP_APO (INT) >>> "PTP_APO (INT)". [} 20]
CP_MODE CP_APO (INT) >>> "CP_APO (INT)". [} 20]
CPTP INT Approximation distance for PTP motions (= furthest distance
before the end point at which approximate positioning can
begin)
• 1 … 100 %
Maximum distance 100 %: half the distance between the
start point and the end point relative to the contour of the
PTP motion without approximate positioning
CDIS REAL Distance parameter (unit: mm)
Approximation starts, at the earliest, when the distance to
the end point falls below the value specified here.
CORI REAL Orientation parameter (unit: °)
Approximation starts, at the earliest, when the dominant
orientation angle (rotation or swiveling of the longitudinal
axis of the tool) falls below the angle distance to the end
point specified here.
CVEL INT Velocity parameter
• 1 … 100 %
The approximation parameter specifies the percentage of
the programmed velocity at which the approximate
positioning process is started, at the earliest, in the
deceleration phase towards the end point.
7.4.4 COORDSYS
Coordinate system to which the Cartesian coordinates of the end position refer in a KRC_Move or KRC_Jog
motion command
Element Type Description
Tool INT Number of the TOOL coordinate system
• -1: coordinate system is not changed
• 0: NULLFRAME
• 1 … 16: TOOL_DATA[1 … 16]
Default: -1
Base INT Number of the BASE coordinate system
• -1: coordinate system is not changed
• 0: NULLFRAME
• 1 … 32: BASE_DATA[1 … 32]
Default: -1
IPO_MODE INT Interpolation mode
• 0: The tool is a fixed tool (#BASE).
• 1: The tool is mounted on the mounting flange (#TCP).
Default: 0
7.4.5 E6AXIS
Angular values or translation values of the axes in an axis group for a KRC_MoveAxis motion command
Element Type Description
A1 REAL Position of robot axis A1 (unit: mm or °)
A2 REAL Position of robot axis A2 (unit: mm or °)
A3 REAL Position of robot axis A3 (unit: mm or °)
A4 REAL Position of robot axis A4 (unit: mm or °)
A5 REAL Position of robot axis A5 (unit: mm or °)
A6 REAL Position of robot axis A6 (unit: mm or °)
E1 REAL Position of external axis E1 (optional), (unit: mm or °)
E2 REAL Position of external axis E2 (optional), (unit: mm or °)
E3 REAL Position of external axis E3 (optional), (unit: mm or °)
E4 REAL Position of external axis E4 (optional), (unit: mm or °)
E5 REAL Position of external axis E5 (optional), (unit: mm or °)
E6 REAL Position of external axis E6 (optional), (unit: mm or °)
7.4.6 E6POS
Cartesian coordinates of the end position for a KRC_Move or KRC_Jog motion command
Element Type Description
X REAL Offset in X direction (unit: mm)
Y REAL Offset in Y direction (unit: mm)
Z REAL Offset in Z direction (unit: mm)
A REAL Rotation about Z axis
• -180° … +180°
7.4.7 FRAME
Space coordinates and orientation for the TOOL or BASE coordinate system
Element Type Description
X REAL Offset in X direction (unit: mm)
Y REAL Offset in Y direction (unit: mm)
Z REAL Offset in Z direction (unit: mm)
A REAL Orientation of the Z axis
• -180° … +180°
B REAL Orientation of the Y axis
• -180° … +180°
C REAL Orientation of the X axis
• -180° … +180°
7.5.1 BufferMode
Mode in which a statement is executed on the robot controller
7.5.2 QueueMode
Mode in which a statement is executed on the robot controller
Value Name Description
0 DIRECT The statement is executed directly by the submit interpreter
(Submit program).
Note: This mode is not available for certain function blocks.
1 ABORTING The statement is executed immediately by the robot
interpreter (main program). First, all active motions and
buffered statements are aborted and the robot is braked to a
standstill.
2 BUFFERED The statement is buffered. Buffered statements are executed
by the robot interpreter (main program) according to the FIFO
principle.
7.5.3 CircType
Orientation control for circular motion
Value Name Description
0 BASE Base-related orientation control during a circular motion
1 PATH Path-related orientation control during a circular motion
7.5.4 OriType
Orientation control for the TCP
Value Name Description
0 VAR The orientation of the TCP changes continuously during the
motion.
1 CONSTANT The orientation of the TCP remains constant during the
motion.
2 JOINT The orientation of the TCP changes continuously during the
motion, but not uniformly. This is done by linear transformation
(axis-specific motion) of the wrist axis angles.
Note: This orientation type is not suitable if a specific
orientation must be maintained exactly.
7.5.5 Status
Current state of the mxA interface (function block KRC_ReadMXAStatus)
7.6.2 Dimensions
The dimensions of a Cartesian workspace are specified with the following elements.
Element Data type Unit
X1 REAL mm
X2 REAL mm
Y1 REAL mm
Y2 REAL mm
Z1 REAL mm
Z2 REAL mm
7.8.1 Instancing
The following function blocks may only be instanced once per robot. In the case of multiple instancing, the
signals of the most recently called function block are output.
• KRC_ReadAxisGroup
• KRC_Intialize
• KRC_SetOverride
• KRC_AutomaticExternal
• KRC_AutoStart
• KRC_Diag
• KRC_WriteAxisGroup
All other function blocks used in the mxAutomation robot program can be created as a multi-instance call.
The advantage of this is that not every function block requires a data block of its own.
7.8.2 ExecuteCmd
• As far as possible, an ExecuteCmd input should only ever be simultaneously set for a function block
of the same robot.
• After an ExecuteCmd input has been activated, do not reset it again until the function block has
confirmed execution of the statement by means of the Done signal or indicated by means of the Error
or Aborted signal that the statement has not been executed. If the ExecuteCmd input is reset
beforehand, there is no confirmation that the statement has been executed.
• By linking the Busy output of a function block to the ExecuteCmd input of the following block, it is
possible to transfer a sequence of consecutive functions to the statement buffer and to execute them.
• ExecuteCmd should not be used as a start signal for a sequence of statements. This might result in
the transfer of the following statements taking up valuable time.
Execution of a statement sequence should be triggered with KRC_WaitForInput instead. Linking the Busy
and ExecuteCmd signals ensures that execution of the planned steps can be started without delay as soon
as the corresponding input signal is received.
Description
The function block KRC_ReadAxisGroup translates the TwinCAT-specific interface to the robot controller into
the non-PLC-specific structure of an axis group.
The function block KRC_ReadAxisGroup must always be called at the start of the program.
Access to the axis group structure is only permissible between KRC_ReadAxisGroup and
KRC_WriteAxisGroup.
Note
The function block may only be instanced once per axis group. In the case of multiple in-
stancing, the signals of the most recently called function block are output.
Note
Inputs
Parameter Type Description
KRC4_Input POINTER TO Structure map of the input range of the
BYTE robot controller
AxisGroupIdx INT Index of axis group
• 1…5
Outputs
Parameter Type Description
ErrorID DINT Error number
Error BOOL TRUE = error in function block
Description
The function block KRC_WriteAxisGroup translates the non-PLC-specific structure of an axis group into the
TwinCAT-specific interface to the robot controller.
The function block KRC_WriteAxisGroup must always be called at the end of the program.
Access to the axis group structure is only permissible between KRC_ReadAxisGroup and
KRC_WriteAxisGroup.
Note
The function block may only be instanced once per axis group. In the case of multiple in-
stancing, the signals of the most recently called function block are output.
Note
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
KRC4_Output POINTER TO Structure map of the output range of the
BYTE robot controller
Outputs
Parameter Type Description
ErrorID DINT Error number
Error BOOL TRUE = error in function block
Description
The function block KRC_Initialize initializes the mxA interface on the robot controller. Statements cannot be
transferred until the interface has been initialized.
During initialization, the versions of the PLC library and mxA interface are compared and checked for
compatibility. The 1st and 2nd digits of the version must match.
The function block may only be instanced once per axis group. In the case of multiple in-
stancing, the signals of the most recently called function block are output.
Note
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
Outputs
Description
The function block KRC_SetOverride sets the program override.
Program override is the velocity of the robot during program execution. The program override is specified as
a percentage of the programmed velocity. The override setting is transferred to the robot during every PLC
cycle. If the override setting is changed, this change is detected by the robot and applied.
The override is only applied in Automatic External mode so that the override can be set via the smartPAD in
the test modes T1 and T2, e.g. for teaching.
The function block may only be instanced once per axis group. In the case of multiple in-
stancing, the signals of the most recently called function block are output.
Note
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
Override INT Set the program override.
• 0 … 100 %
Outputs
Parameter Type Description
ActualOverride INT Current override setting
• 0 … 100%
ErrorID DINT Error number
Valid BOOL TRUE = data are valid
Description
The function block KRC_AutomaticExternal activates the Automatic External interface and reads the
interface signals.
The function block may only be instanced once per axis group. In the case of multiple in-
stancing, the signals of the most recently called function block are output.
Note
Inputs
Outputs
Description
The function block KRC_ReadActualPosition reads the current Cartesian actual position of the robot
$POS_ACT. This is updated cyclically.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
Outputs
Parameter Type Description
Valid BOOL TRUE = data are valid
Position E6POS Current Cartesian actual position $POS_ACT
The data structure E6POS contains all
components of the Cartesian actual position (=
position of the TCP relative to the origin of the
BASE coordinate system).
X, Y, Z REAL Current actual position in the X, Y, Z directions
A, B, C REAL Orientation A, B, C in the current actual position
Status INT Status of the current actual position
Turn INT Turn of the current actual position
Tool INT Number of the currently used TOOL coordinate
system $ACT_TOOL
Base INT Number of the currently used BASE coordinate
system $ACT_BASE
IPOMode INT Current interpolation mode in the main run
$IPO_MODE_C
Description
The function block KRC_ReadActualAxisPosition reads the current axis-specific robot position $AXIS_ACT.
This is updated cyclically.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
Outputs
Parameter Type Description
Valid BOOL TRUE = data are valid
AxisPosition E6AXIS Current axis-specific robot position $AXIS_ACT
The data structure E6AXIS contains all the axis
positions of the axis group.
A1 … A6 REAL Current position of robot axes A1 to A6
E1 … E6 REAL Current position of external axes E1 to E6
Description
The function block KRC_ReadActualVelocity reads the current actual velocity at the TCP of the robot
$VEL_ACT.
The current path velocity can only be read for CP motions in program mode.
Note
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
Outputs
Parameter Type Description
Valid BOOL TRUE = data are valid
Value REAL Current path velocity $VEL_ACT (unit: m/s)
Description
The function block KRC_ReadActualAxisVelocity reads the current axis-specific velocity of the robot
$VEL_AXIS_ACT.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL The statement is executed in the case of a rising
edge of the signal.
Outputs
Parameter Type Description
ErrorID DINT Error number
Description
The function block KRC_ReadActualAcceleration reads the current Cartesian acceleration at the TCP of the
robot $ACC_CAR_ACT.
Note
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL The statement is executed in the case of a rising
edge of the signal.
Outputs
Parameter Type Description
ErrorID DINT Error number
ACC_ABS REAL Current Cartesian acceleration relative to the
absolute value of the overall acceleration lX + Y
+Zl (unit: m/s2)
Description
The function block KRC_ReadDigitalInput polls and reads a digital input of the robot controller. This function
is executed in the Submit interpreter.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL The statement is executed in the case of a rising
edge of the signal.
Number INT Number of the digital input
• 1 … 2 048
Outputs
Parameter Type Description
ErrorID DINT Error number
Done BOOL TRUE = statement has been executed
Value BOOL Value of the digital input
Error BOOL TRUE = error in function block
Description
The function block KRC_ReadDigitalInput1To8 polls and reads the digital inputs 1 to 8 of the robot controller.
This function is executed in the Submit interpreter. The input values can be read continuously without
triggering a blockade.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
Outputs
Parameter Type Description
Valid BOOL TRUE = data are valid
IN1 … IN8 BOOL Actual value of the digital input $IN[1] … $IN[8]
Error BOOL TRUE = error in function block
ErrorID DINT Error number
Description
The function block KRC_ReadDigitalInputArray polls and reads multiple digital inputs of the robot controller.
This function is executed in the Submit interpreter.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL The statement is executed in the case of a rising
edge of the signal.
Startnumber INT Number of the first digital output that is polled
• 1 … 2 048
Outputs
Parameter Type Description
Done BOOL TRUE = statement has been executed
Values BOOL[200] Values of the digital inputs
Error BOOL TRUE = error in function block
ErrorID DINT Error number
Description
The function block KRC_ReadDigitalOutput polls and reads a digital output of the robot controller. This
function is executed in the Submit interpreter.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL The statement is executed in the case of a rising
edge of the signal.
Number INT Number of the digital output
• 1 … 2 048
Outputs
Parameter Type Description
ErrorID DINT Error number
Done BOOL TRUE = statement has been executed
Value BOOL Value of the digital output
Error BOOL TRUE = error in function block
Description
The function block KRC_WriteDigitalOutput writes a digital output or a pulse output on the robot controller.
This function is executed in the Submit interpreter.
Inputs
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
Description
The function block KRC_WriteDigitalOutput1To8 writes the digital outputs 1 to 8 on the robot controller. This
function is executed in the Submit interpreter. The output values can be written continuously without
triggering a blockade.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
OUT1 … OUT8 BOOL Setpoint value of the output
$OUT[1] … $OUT[8]
Outputs
Parameter Type Description
ErrorID DINT Error number
Error BOOL TRUE = error in function block
Description
The function block KRC_ReadAnalogInput polls and reads an analog input of the robot controller. This
function is executed in the Submit interpreter.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL The statement is executed in the case of a rising
edge of the signal.
Outputs
Parameter Type Description
ErrorID DINT Error number
Done BOOL TRUE = statement has been executed
Value REAL Value of the analog input
Error BOOL TRUE = error in function block
Description
The function block KRC_ReadAnalogOutput polls and reads an analog output of the robot controller. This
function is executed in the Submit interpreter.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL The statement is executed in the case of a rising
edge of the signal.
Number INT Number of the analog output
• 1 … 32
Outputs
Parameter Type Description
Value REAL Value of the analog output
ErrorID DINT Error number
Done BOOL TRUE = statement has been executed
Error BOOL TRUE = error in function block
Description
The function block KRC_WriteAnalogOutput polls and writes an analog output of the robot controller. This
function is executed in the Submit interpreter.
Inputs
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
Description
The function block KRC_WaitForInput stops the program until a digital input takes the defined value.
Program execution is then resumed.
Inputs
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Active BOOL TRUE = statement is currently being executed
(robot is waiting for an input)
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement has been aborted
Error BOOL TRUE = error in function block
Description
The function block KRC_SetCoordSys can be used to set the tool, base and interpolation mode without
having to execute a motion at the same time. This function is required, for example, to read the current
position in different coordinate systems.
Inputs
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
Description
The function block KRC_ReadToolData reads the TOOL data of the robot.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL The statement is executed in the case of a rising
edge of the signal.
ToolNo INT Number of the TOOL coordinate system
• 1 … 16: TOOL_DATA[1 … 16]
Outputs
Parameter Type Description
ToolData FRAME >>> "FRAME". [} 22]
ErrorID DINT Error number
Done BOOL TRUE = statement has been executed
Error BOOL TRUE = error in function block
Description
The function block KRC_WriteToolData writes the TOOL data of the robot.
Inputs
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
Description
The function block KRC_ReadBaseData reads the BASE data of the robot.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL The statement is executed in the case of a rising
edge of the signal.
BaseNo INT Number of the BASE coordinate system
• 1 … 32: BASE_DATA[1 … 32]
Outputs
Parameter Type Description
BaseData FRAME >>> "FRAME". [} 22]
ErrorID DINT Error number
Done BOOL TRUE = statement has been executed
Error BOOL TRUE = error in function block
Description
The function block KRC_WriteBaseData writes the BASE data of the robot.
Inputs
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
Description
The function block KRC_ReadLoadData reads the load data of the robot (payload data or supplementary
load data). This function is executed in the Submit interpreter.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL The statement is executed in the case of a rising
edge of the signal.
Tool INT Number of the TOOL coordinate system for
reading the payload data or number for reading
the supplementary load data
• 1 … 16: TOOL_DATA[1 … 16]
• -1: Supplementary load A1
• -2: Supplementary load A2
• -3: Supplementary load A3
Outputs
Parameter Type Description
M REAL Mass
X, Y, Z REAL Position of the center of gravity relative to the
flange
Description
The function block KRC_WriteLoadData writes the load data of the robot (payload data or supplementary
load data).
Inputs
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
Description
The function block KRC_ReadSoftEnd reads the software limit switches of the robot axes. This function is
executed in the Submit interpreter.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL The statement is executed in the case of a rising
edge of the signal.
Outputs
Description
The function block KRC_ReadSoftEndExt reads the software limit switches of the external axes. This
function is executed in the Submit interpreter.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL The statement is executed in the case of a rising
edge of the signal.
Outputs
Description
The function block KRC_WriteSoftEnd writes the software limit switches of the robot axes.
Inputs
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
Description
The function block KRC_WriteSoftEndExt writes the software limit switches of the external axes.
Inputs
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
Description
The function block KRC_DeclareInterrupt declares an interrupt to a digital input. There are 8 predefined
interrupts available for this.
Syntax
GLOBAL INTERRUPT DECL 90+Interrupt WHEN $IN[Input] == InputValue DO Subprogram
Inputs
Outputs
Description
The function block KRC_ActivateInterrupt activates a previously declared interrupt. There are 8 predefined
interrupts available for this.
An interrupt cannot be processed until the interrupt has been activated by the main run of the robot
interpreter. The function block KRC_WaitForInput can be used to monitor and check whether an interrupt is
active.
Inputs
Outputs
Description
The function block KRC_DeactivateInterrupt deactivates a previously declared interrupt. There are 8
predefined interrupts available for this.
Syntax
INTERRUPT OFF 90+Interrupt
Inputs
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
Description
The function block KRC_ReadInterruptState reads the state of an interrupt in the advance run. This is
updated cyclically.
A distinction can be made between the state of the interrupt in the advance run and the state in the main run.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
Interrupt INT Number of the interrupt
• 1…8
Outputs
Description
The function block KRC_SetDistanceTrigger triggers a path-related switching action in the case of PTP or
LIN motions.
The Trigger triggers a defined statement. The statement refers to the start point or end point of the motion
block in which the Trigger is situated in the program. The statement is executed parallel to the robot motion.
The statement can be shifted in time. It is then not triggered exactly at the start or end point, but brought
forward or delayed.
If a trigger calls a subprogram, it counts as an active interrupt until the subprogram has
been executed. Up to 16 interrupts may be active at any one time.
Note
Further information on triggers, on offsetting the switching point and on the offset limits can
be found in the documentation by KUKA.
Note
Inputs
Outputs
Description
The function block KRC_SetPathTrigger triggers a path-related switching action in the case of CP motions.
The Trigger triggers a defined statement. The statement refers to the end point of the motion block in which
the Trigger is situated in the program. The statement is executed parallel to the robot motion.
The statement can be shifted in time and/or space. It is then not triggered exactly at the end point, but
beforehand or afterwards.
Path triggers can only be activated before CP motions. If the subsequent motion is not a
CP motion, the robot controller issues an error message.
Note
If a trigger calls a subprogram, it counts as an active interrupt until the subprogram has
been executed. Up to 16 interrupts may be active at any one time.
Note
Further information on triggers, on offsetting the switching point and on the offset limits can
be found in the documentation by KUKA.
Note
Inputs
Outputs
Description
The function block KRC_Abort cancels all active and buffered statements and motions.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL The statement is executed in the case of a rising
edge of the signal.
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Description
The function block KRC_Interrupt triggers an interrupt with a BRAKE or BRAKE F statement.
If a BRAKE statement is active, no more statements are processed via the mxA interface.
The function block KRC_Abort is also no longer processed. KRC_Abort cannot cancel the
program until it has been resumed with KRC_Continue, i.e. the BRAKE statement is no
Note longer active.
While the BRAKE statement is active, the program can only be canceled by means of a
RESET of the function block KRC_AutomaticExternal.
Inputs
Outputs
Description
The function block KRC_Continue can be used to resume execution of a program that has been stopped by
means of an interrupt.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
Enable BOOL The statement is executed in the case of a rising
edge of the signal.
In the case of an interrupt triggered by a BRAKE
or BRAKE F statement, the program can only be
resumed when the interrupt is no longer active
and the input Enable is set to TRUE.
Outputs
Parameter Type Description
ErrorID DINT Error number
Error BOOL TRUE = error in function block
Description
The function block KRC_AutoStart controls the existing signals and function blocks in a typical sequence of
statements. The signals for activating the Automatic External interface are checked prior to starting. If one or
more signals is missing, corresponding error numbers are displayed.
The drives are activated with an edge. For this reason, the DRIVES_ON input on the func-
tion block KRC_AutomaticExternal should not be permanently activated.
Note
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
Outputs
Parameter Type Description
Busy BOOL The sequence is active but not yet completed.
Done BOOL The sequence is completed.
DispActive BOOL TRUE = robot program is active
ResetValid BOOL TRUE = conditions for a RESET at the function
block KRC_AutomaticExternal are met
Error BOOL TRUE = error in function block
ErrorID DINT Error number
Note
Further information about the basics of motion programming – motion types, orientation
control, and approximate positioning – is contained in the operating and programming in-
structions for the KUKA System Software.
Note
Description
The function block KRC_JogLinearRelative can be used to move to a Cartesian end position with a linear
motion. The coordinates of the end position are relative to the current position. Status and Turn of the end
position are ignored, i.e. the axis positions at the end position are not unambiguously defined.
The function is always executed in ABORTING mode, i.e. all active motions and buffered statements are
canceled, the robot is braked and the linear motion is then executed.
Inputs
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Active BOOL TRUE = motion is currently being executed
Done BOOL TRUE = motion has stopped
Aborted BOOL TRUE = statement/motion has been aborted
Error BOOL TRUE = error in function block
Description
The function block KRC_JogToolRelative can be used to move to a Cartesian end position in the TOOL
coordinate system with a linear motion. The coordinates of the end position are relative to the current
position. Status and Turn of the end position are ignored, i.e. the axis positions at the end position are not
unambiguously defined.
The function is always executed in ABORTING mode, i.e. all active motions and buffered statements are
canceled, the robot is braked and the linear motion is then executed.
Inputs
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Active BOOL TRUE = motion is currently being executed
Done BOOL TRUE = motion has stopped
Aborted BOOL TRUE = statement/motion has been aborted
Error BOOL TRUE = error in function block
Description
The function block KRC_Jog can be used to move to an end position with a linear motion or a point-to-point
motion.
The function is always executed in ABORTING mode, i.e. all active motions and buffered statements are
canceled, the robot is braked and the motion is then executed.
Inputs
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Active BOOL TRUE = motion is currently being executed
Done BOOL TRUE = motion has stopped
Aborted BOOL TRUE = statement/motion has been aborted
Error BOOL TRUE = error in function block
For information on the frequently used signals in the MC function blocks, see >>> "Fre-
quently used input/output signals in the MC function blocks". [} 18]
Note
Description
The function block MC_MoveLinearAbsolute is used to execute a linear motion to a Cartesian end position.
The coordinates of the end position are absolute.
Inputs
Outputs
Parameter Type Description
ComDone BOOL TRUE = statement was completely transferred
and confirmed by the robot controller.
ComBusy BOOL TRUE = statement is currently being transferred
and has not yet been confirmed by the robot
controller.
Busy BOOL TRUE = function block has not yet been
executed completely.
Active BOOL TRUE = motion is currently being executed
Done BOOL TRUE = motion has stopped
CommandAbor BOOL TRUE = statement/motion has been aborted
ted
Error BOOL TRUE = error in function block
ErrorID DINT Error number
Description
The function block MC_MoveLinearRelative is used to execute a linear motion to a Cartesian end position.
The coordinates of the end position are relative to the current position.
A REL statement always refers to the current position of the robot. For this reason, if a REL
motion is interrupted, the robot executes the entire REL motion again, starting from the po-
sition at which it was interrupted.
Note
Inputs
Outputs
Parameter Type Description
ComDone BOOL TRUE = statement was completely transferred
and confirmed by the robot controller.
ComBusy BOOL TRUE = statement is currently being transferred
and has not yet been confirmed by the robot
controller.
Busy BOOL TRUE = function block has not yet been
executed completely.
Active BOOL TRUE = motion is currently being executed
Done BOOL TRUE = motion has stopped
CommandAbor BOOL TRUE = statement/motion has been aborted
ted
Error BOOL TRUE = error in function block
ErrorID DINT Error number
Description
The function block MC_MoveDirectAbsolute executes a point-to-point motion to a Cartesian end position.
The coordinates of the end position are absolute.
Inputs
Outputs
Parameter Type Description
ComDone BOOL TRUE = statement was completely transferred
and confirmed by the robot controller.
ComBusy BOOL TRUE = statement is currently being transferred
and has not yet been confirmed by the robot
controller.
Busy BOOL TRUE = function block has not yet been
executed completely.
Active BOOL TRUE = motion is currently being executed
Done BOOL TRUE = motion has stopped
CommandAbor BOOL TRUE = statement/motion has been aborted
ted
Error BOOL TRUE = error in function block
ErrorID DINT Error number
Description
The function block MC_MoveDirectRelative executes a point-to-point motion to a Cartesian end position. The
coordinates of the end position are relative to the current position.
A REL statement always refers to the current position of the robot. For this reason, if a REL
motion is interrupted, the robot executes the entire REL motion again, starting from the po-
sition at which it was interrupted.
Note
Inputs
Outputs
Parameter Type Description
ComDone BOOL TRUE = statement was completely transferred
and confirmed by the robot controller.
ComBusy BOOL TRUE = statement is currently being transferred
and has not yet been confirmed by the robot
controller.
Description
The function block MC_MoveAxisAbsolute is used to execute a point-to-point motion to an axis-specific end
position. The axis positions are absolute.
Inputs
Outputs
Parameter Type Description
ComDone BOOL TRUE = statement was completely transferred
and confirmed by the robot controller.
ComBusy BOOL TRUE = statement is currently being transferred
and has not yet been confirmed by the robot
controller.
Description
The function block MC_MoveCircularAbsolute executes a circular motion to a Cartesian end position. In
order for the robot controller to be able to calculate the circular motion, an auxiliary position must be
specified in addition to the end position.
The coordinates of the auxiliary position and end position are absolute. The auxiliary position cannot be
approximated. The motion always stops exactly at this point.
Inputs
Outputs
Parameter Type Description
ComDone BOOL TRUE = statement was completely transferred
and confirmed by the robot controller.
ComBusy BOOL TRUE = statement is currently being transferred
and has not yet been confirmed by the robot
controller.
Busy BOOL TRUE = function block has not yet been
executed completely.
Active BOOL TRUE = motion is currently being executed
Done BOOL TRUE = motion has stopped
Description
The function block MC_MoveCircularRelative executes a circular motion to a Cartesian end position. In order
for the robot controller to be able to calculate the circular motion, an auxiliary position must be specified in
addition to the end position.
The coordinates of the auxiliary position and end position are relative to the current position (= start position
of the circular motion). The auxiliary position cannot be approximated. The motion always stops exactly at
this point.
A REL statement always refers to the current position of the robot. For this reason, if a REL
motion is interrupted, the robot executes the entire REL motion again, starting from the po-
sition at which it was interrupted.
Note
Inputs
Outputs
Parameter Type Description
ComDone BOOL TRUE = statement was completely transferred
and confirmed by the robot controller.
ComBusy BOOL TRUE = statement is currently being transferred
and has not yet been confirmed by the robot
controller.
Description
The function block KRC_ReadMXAStatus reads the current state of the mxA interface.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
Outputs
Parameter Type Description
Status INT >>> "Status". [} 23]
ErrorID DINT Error number
Error BOOL TRUE = error in function block
Description
The function block KRC_ReadMXAError is used to read the current error state of an axis group. Only error
messages generated by the mxA interface are displayed.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
Outputs
Parameter Type Description
ErrorID DINT Error number
Error BOOL TRUE = error in function block
Description
The function block KRC_MessageReset resets the current error state of an axis group. Only error messages
generated by the mxA interface are reset.
Error messages from the robot controller are reset by means of the function block KRC_AutomaticExternal
(input CONF_MESS).
Note
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
MessageReset BOOL TRUE = reset message
Outputs
Parameter Type Description
ErrorID DINT Error number
Error BOOL TRUE = error in function block
Description
The function block KRC_ReadKRCError reads the current error state of the robot controller. Only error
messages generated by the robot controller are displayed.
Error messages from the robot controller are reset by means of the function block KRC_AutomaticExternal
(input CONF_MESS).
Note
Inputs
Outputs
Description
The function block KRC_Diag reads the diagnostic signals of the robot controller.
The function block may only be instanced once per axis group. In the case of multiple in-
stancing, the signals of the most recently called function block are output.
Note
Inputs
Outputs
Description
The function block KRC_Error collectively reads and acknowledges the current error state of the mxA
interface, the error state of the robot controller and the error state of the function blocks.
If more than one error has occurred in the function block at the same time, only the error number of the most
recent error is displayed. Errors in a function block cause the motion enable to be canceled.
If more than one error has occurred at the same time, these errors are displayed with the following priority
ranking:
The function block KRC_Error contains all diagnostic function blocks, which means that this block displays
all important diagnostic data.
The $STOPMESS signal can only be reset if there is no error and the drives are switched
on. The drives must therefore be activated with the DRIVES_ON signal via the function
block KRC_Error. The drives are activated with an edge. For this reason, the DRIVES_ON
Note input on the function block KRC_AutomaticExternal should not be permanently activated.
Inputs
Outputs
Description
The function block KRC_ReadSysVar reads a system variable. This function is executed in the Submit
interpreter.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL The statement is executed in the case of a rising
edge of the signal.
Index INT Index of the system variable
• 1: $ADVANCE
So far, only the system variable $ADVANCE can be read. If required for the customer-spe-
cific application, the list of readable system variables can be expanded by KUKA.
Note
Outputs
Parameter Type Description
Value1 … REAL Value of the system variable
Value10 If the system variable is a structure type, up to
10 components of the structure can be read.
ErrorID DINT Error number
Done BOOL TRUE = statement has been executed
Error BOOL TRUE = error in function block
Description
The function block KRC_WriteSysVar writes a system variable.
Inputs
So far, only the system variable $ADVANCE can be written. If required for the customer-
specific application, the list of writable system variables can be expanded by KUKA.
Note
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Description
The function block KRC_BrakeTest calls the program for the brake test. The brake test is started at the
position at which the robot is located when the program is called.
The brake test must be performed with a program override of 100% (function block
KRC_SetOverride).
Note
During the brake test, all brakes are checked to see whether the wear limit has been reached. For this
purpose, the robot accelerates to a defined velocity limit. Once the robot has reached the velocity, the brake
is applied and the result for this braking operation is displayed.
If the brake test is successful, the robot is located back at the start position at the end of the measurement.
If the brake test fails, i.e. a brake has been identified as being defective, the robot moves directly to a parking
position. The coordinates of the parking position must be specified in the function block.
Parking position
The parking position must be selected in a position where no persons are endangered if the robot sags
because of the defective brake. The transport position, for example, can be selected as the parking position.
Further information about the transport position is contained in the robot operating or as-
sembly instructions.
Note
Detailed information about the brake test is contained in the documentation by KUKA.
Note
Inputs
Outputs
Description
The function block KRC_MasRef is used to execute the mastering test.
After the function block has been called, the robot moves in a linear direction from the current position to the
reference position. Once the robot has reached the reference position, the current axis values are compared
with the axis values which have been saved in KUKA.SafeOperation. The robot then moves back to the start
position (= position before the function block was called).
The reference position is defined in the function block with the input parameter Position
and corresponds to the reference position defined with KUKA.SafeOperation.
Note
If the deviation between the current position and the reference position is too great, the mastering test has
failed.
Detailed information about the mastering test can be found in the documentation
KUKA.SafeOperation.
Note
Inputs
Outputs
Description
The function block KRC_ReadSafeOPStatus reads signals of the safety controller. (Only relevant if
KUKA.SafeOperation is installed.)
Inputs
Outputs
Description
The function block KRC_ReadTouchUPState reads the current state of the TouchUp status keys on the
smartPAD. In order to be able to teach points using the status keys on the smartPAD, the function block
must be linked to the function block KRC_TouchUP.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
Outputs
Parameter Type Description
Index INT Number selected using the status key on the
smartPAD to teach a position
• 1 … 100
ErrorID DINT Error number
Valid BOOL TRUE = data are valid
TouchUP BOOL State of the TouchUp status key on the
smartPAD
TRUE = TouchUp status key has been pressed.
Error BOOL TRUE = error in function block
Description
The function block KRC_TouchUP can be used to teach a point directly in the PLC. Tool, base and
interpolation mode of this point are automatically set by the function block.
Memory
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL TRUE = the point is taught.
Index INT Number under which the taught point is saved in
the PLC
• 1 … 100
Outputs
Parameter Type Description
ErrorID DINT Error number
Done BOOL TRUE = statement has been executed
Error BOOL TRUE = error in function block
Description
The settings for the advance run are modified using the function block KRC_SetAdvance.
The advance run is the maximum number of motion blocks that the robot controller calculates and plans in
advance during program execution. The actual number is dependent on the capacity of the computer. The
advance run is required, for example, in order to be able to calculate approximate positioning motions.
If the program execution is reset, the set values are reset to the default values.
Note
Inputs
Outputs
Parameter Type Description
Busy BOOL TRUE = statement has been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement has been aborted
Error BOOL TRUE = error in function block
ErrorID DINT Error number
Description
Function block KRC_GetAdvance reads the values that have been set in the function block
KRC_SetAdvance.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL The statement is executed in the case of a rising
edge of the signal.
Outputs
7.13.10 Calculating the Cartesian robot position from the axis angles
Description
The function block KRC_Forward uses specified axis angles to calculate the Cartesian robot position. The
function block can only be executed by the robot interpreter.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL Starts/buffers the statement at a rising edge of
the signal.
Axis_Values E6AXIS Axis-specific values that are to be converted to
Cartesian coordinates
The data structure E6AXIS contains the angle
values or translation values for all axes of the
axis group in this position.
CheckSoftEnd BOOL Checks whether the specified axis angles lie
within the software limit switches. If not, an error
number is displayed.
BufferMode INT >>> "BufferMode". [} 22]
Outputs
Parameter Type Description
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Position E6POS Cartesian robot position calculated from the
specified axis angles
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
ErrorID DINT Error number
Description
The function block KRC_Inverse uses a specified Cartesian robot position to calculate the axis angles. The
function block can only be executed by the robot interpreter.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL Starts/buffers the statement at a rising edge of
the signal.
Position E6POS Cartesian robot position
PosValidS BOOL TRUE = The Status value contained in the
Position parameter is valid.
FALSE = The Status value is unknown.
PosValidT BOOL TRUE = The Turn value contained in the
Position parameter is valid.
FALSE = The Turn value is unknown.
Start_Axis E6Axis Axis-specific values at the start point of the
motion
The start point is the axis-specific position from
which the robot moves to the position that is to
be calculated.
CheckSoftEnd BOOL Checks whether the values from the Start_Axis
parameter lie within the software limit switches.
If not, an error number is displayed.
BufferMode INT >>> "BufferMode". [} 22]
Outputs
Parameter Type Description
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
AxisPosition E6AXIS Axis angles that have been calculated from the
specified Cartesian robot position
The data structure E6AXIS contains all the axis
positions of the axis group.
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
ErrorID DINT Error number
Description
The function block KRC_ConvIniOff is used to initialize a conveyor. The AMI is set to the state #INITIALIZED
and the conveyor distance to 0.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL Starts/buffers the motion in the case of a rising
edge of the signal.
ConveyorNumb INT Number of the conveyor
er • 1…3
BufferMode INT >>> "BufferMode". [} 22]
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
Description
The function block KRC_ConvOn activates the AMI, i.e. sets it to the #ACTIVE state. If the AMI is activated,
the synchronization signals at the input of interface X33 (Fast Measurement) are evaluated.
The conveyor offset can be detected out in the background leaving the robot controller free to perform other
tasks. This allows the robot to carry out on-the-fly tracking of a part on the conveyor.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL Starts/buffers the motion in the case of a rising
edge of the signal.
ConveyorNumb INT Number of the conveyor
er • 1…3
BufferMode INT >>> "BufferMode". [} 22]
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
Description
The function block KRC_ConvFollow enables the robot to follow a workpiece on the conveyor.
KRC_ConvFollow can be used to define a range on the conveyor in which the robot starts to track the
workpiece.
If the workpiece has already exceeded the maximum conveyor distance (input MaxDistance) when the
function block is called, the output MaxDistanceReached is set.
This function block can only be executed if the AMI has been activated using KRC_Con-
vOn.
Note
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL Starts/buffers the motion in the case of a rising
edge of the signal.
ConveyorNumb INT Number of the conveyor
er • 1…3
StartDistance REAL Distance traveled by the workpiece while the
robot waits before starting to track the workpiece
on the conveyor.
• In the case of a linear conveyor:
Specification in millimeters
• In the case of a circular conveyor:
Specification in degrees
MaxDistance REAL Maximum distance traveled by the workpiece
before the robot starts to synchronize itself with
the workpiece.
• In the case of a linear conveyor:
Specification in millimeters
• In the case of a circular conveyor:
Specification in degrees
Note: This input is not monitored during
synchronized motions of the conveyor. The
distance covered by the workpiece is monitored
by an interrupt. The corresponding settings are
made in WorkVisual.
BufferMode INT >>> "BufferMode". [} 22]
Outputs
Parameter Type Description
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement has been aborted
MaxDistanceR BOOL TRUE = the maximum distance traveled by the
eached workpiece (input MaxDistance) was already
exceeded at the time of execution. The
statement was not executed. Execution of the
program is stopped (WAIT FOR FALSE) and is
waiting for the program to be aborted.
Error BOOL TRUE = error in function block
Description
The function block KRC_ConvSkip is used to determine which workpieces are to be picked up, e.g. every
second workpiece, every third workpiece, etc. A total of up to 1024 workpieces can be monitored in the
background.
If the workpiece has already exceeded the maximum conveyor distance (input MaxDistance) when the
function block is called, the output MaxDistanceReached is set.
This function block can only be executed if the AMI has been activated using KRC_Con-
vOn.
Note
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL Starts/buffers the motion in the case of a rising
edge of the signal.
ConveyorNumb INT Number of the conveyor
er • 1…3
PieceNumber INT The number entered specifies which workpieces
are to be picked up.
Examples:
• 1: Every workpiece is picked up.
• 3: Every 3rd workpiece is picked up.
• 5: Every 5th workpiece is picked up.
StartDistance REAL Distance traveled by the workpiece while the
robot waits before starting to track the workpiece
on the conveyor.
• In the case of a linear conveyor:
Specification in millimeters
• In the case of a circular conveyor:
Specification in degrees
Outputs
Parameter Type Description
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement has been aborted
MaxDistanceR BOOL TRUE = the maximum distance traveled by the
eached workpiece (input MaxDistance) was already
exceeded at the time of execution. The
statement was not executed. Execution of the
program is stopped (WAIT FOR FALSE) and is
waiting for the program to be aborted.
Error BOOL TRUE = error in function block
ErrorID DINT Error number
Description
The function block KRC_ActivateConvInterrupt activates the following interrupts:
• Alarm distance monitoring
• Maximum distance monitoring
• $STOPMESS error monitoring
An interrupt cannot be processed until the interrupt has been activated by the main run of the robot
interpreter.
The monitoring functions are activated by the function blocks KRC_ConvFollow and KRC_ConvSkip insofar
as these have been successfully synchronized with a workpiece. Calling this function block is only necessary
if the monitoring function is to be ended and reactivated.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL Starts/buffers the motion in the case of a rising
edge of the signal.
ConveyorNumb INT Number of the conveyor
er • 1…3
BufferMode INT >>> "BufferMode". [} 22]
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
Description
The function block KRC_DeactivateConvInterrupt deactivates the following interrupts:
• Alarm distance monitoring
• Maximum distance monitoring
• $STOPMESS error monitoring
It is advisable to call this function block if leaving the conveyor area, or if monitoring is not
desired.
Note
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL Starts/buffers the motion in the case of a rising
edge of the signal.
ConveyorNumb INT Number of the conveyor
er • 1…3
BufferMode INT >>> "BufferMode". [} 22]
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
Description
The function block KRC_VectorMoveOn is used to move a robot along a defined vector in Cartesian space.
Here, the robot is moved by an external force.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL Starts/buffers the motion in the case of a rising
edge of the signal.
X REAL Defines the direction of the vector
Y REAL The vector must be specified in relation to the
Z REAL TCP of the TOOL coordinate system. The last
taught point before the function block is called is
A REAL
the root point of the vector.
B REAL
Limits:
C REAL
• Translational motion (X, Y, Z): max.
200 mm in the positive and negative
directions
• Rotational motion (A, B, C): max. 30° in
the positive and negative directions
VectorLimit REAL Permissible vector length limit; unit: %
If this value is exceeded, the robot is stopped
with ramp-down braking.
MaxDuration REAL Length of time after which VectorMove is
deactivated if an error has occurred
TorqueOffsetV REAL Defines the resistance torque of the robot
alue The resistance torque is the torque with which
the robot acts against the external force. It has
the effect that the robot only begins to move
when a specific amount of force is exerted.
The resistance torque can be defined in addition
to the holding torque. The holding torque
depends on the robot position, type, size and
additional load.
BufferMode INT >>> "BufferMode". [} 22]
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Description
The function block KRC_VectorMoveOff is used to deactivate the function block KRC_VectorMoveOn.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL Starts/buffers the motion in the case of a rising
edge of the signal.
BufferMode INT >>> "BufferMode". [} 22]
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
Description
The function block KRC_WriteWorkspace is used to configure Cartesian (= cubic) workspaces for the robot.
Workspaces serve to protect the system. A maximum of 8 Cartesian workspaces can be configured at any
one time. The workspaces may overlap.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL Starts/buffers the motion in the case of a rising
edge of the signal.
WorkspaceNo INT Number of workspace
• 1…8
WorkspaceMod INT Mode for workspaces
e • 0: #OFF
• 1: #INSIDE
• 2: #OUTSIDE
• 3: #INSIDE_STOP
• 4: #OUTSIDE_STOP
Note: Further information about the mode for
workspaces is contained in the operating and
programming instructions for the KUKA System
Software (KSS).
WorkspaceDat BOX >>> "Data of a Cartesian workspace". [} 24]
a
BufferMode INT >>> "BufferMode". [} 22]
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
Description
The function block KRC_ReadWorkspace reads the configuration of the Cartesian workspaces for the robot.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL Starts/buffers the motion in the case of a rising
edge of the signal.
WorkspaceNo INT Number of workspace
• 1…8
Outputs
Parameter Type Description
Done BOOL TRUE = statement has been executed
WorkspaceMod INT Mode for workspaces
e • 0: #OFF
• 1: #INSIDE
• 2: #OUTSIDE
• 3: #INSIDE_STOP
• 4: #OUTSIDE_STOP
Note: Further information about the mode for
workspaces is contained in the operating and
programming instructions for the KUKA System
Software (KSS).
WorkspaceDat BOX >>> "Data of a Cartesian workspace". [} 24]
a
Error BOOL TRUE = error in function block
ErrorID DINT Error number
Description
The function block KRC_WriteAxWorkspace is used to configure axis-specific workspaces for the robot.
These serve to protect the system. A maximum of 8 axis-specific workspaces can be configured at any one
time. The workspaces may overlap.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL Starts/buffers the motion in the case of a rising
edge of the signal.
WorkspaceNo INT Number of workspace
• 1…8
WorkspaceMod INT Mode for workspaces
e • 0: #OFF
• 1: #INSIDE
• 2: #OUTSIDE
• 3: #INSIDE_STOP
• 4: #OUTSIDE_STOP
Note: Further information about the mode for
workspaces is contained in the operating and
programming instructions for the KUKA System
Software (KSS).
WorkspaceDat AXBOX >>> "Data of an axis-specific workspace". [} 25]
a
BufferMode INT >>> "BufferMode". [} 22]
Outputs
Parameter Type Description
ErrorID DINT Error number
Busy BOOL TRUE = statement is currently being transferred
or has already been transferred
Done BOOL TRUE = statement has been executed
Aborted BOOL TRUE = statement was aborted before it was
processed in the advance run
Error BOOL TRUE = error in function block
Description
The function block KRC_ReadAxWorkspace reads the configuration of the axis-specific workspaces for the
robot.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
ExecuteCmd BOOL Starts/buffers the motion in the case of a rising
edge of the signal.
WorkspaceNo INT Number of workspace
• 1…8
Outputs
Parameter Type Description
Done BOOL TRUE = statement has been executed
WorkspaceMod INT Mode for workspaces
e • 0: #OFF
• 1: #INSIDE
• 2: #OUTSIDE
• 3: #INSIDE_STOP
• 4: #OUTSIDE_STOP
Note: Further information about the mode for
workspaces is contained in the operating and
programming instructions for the KUKA System
Software (KSS).
WorkspaceDat AXBOX >>> "Data of an axis-specific workspace". [} 25]
a
Error BOOL TRUE = error in function block
ErrorID DINT Error number
Description
The function block KRC_ReadWorkstates reads the current status of the workspaces. The status of the
workspaces is updated cyclically.
Inputs
Parameter Type Description
AxisGroupIdx INT Index of axis group
• 1…5
Outputs
Parameter Type Description
Valid BOOL TRUE = data are valid
WORKSTATE1 BOOL Status of the workspaces
WORKSTATE2 BOOL
WORKSTATE3 BOOL
WORKSTATE4 BOOL
WORKSTATE5 BOOL
WORKSTATE6 BOOL
WORKSTATE7 BOOL
WORKSTATE8 BOOL
AXWORKSTATE1 BOOL
AXWORKSTATE2 BOOL
AXWORKSTATE3 BOOL
AXWORKSTATE4 BOOL
AXWORKSTATE5 BOOL
AXWORKSTATE6 BOOL
AXWORKSTATE7 BOOL
AXWORKSTATE8 BOOL
Error BOOL TRUE = error in function block
8 Messages
63 INVALID SYS An invalid value has been programmed in a Program a valid value
VAR VALUE KRC_WriteSysVar function block for the system (parameter Value1 …
variable. Value10).
463 INVALID SYS An invalid value has been programmed in a Program a valid value
VAR VALUE KRC_WriteSysVar function block for the system (parameter Value1 …
variable. Value10).
464 SYS VAR NOT An error occurred when writing a system variable.
WRITEABLE The specified system variable does not exist or may not be written in the current
operating state.
465 INVALID REAL The programmed Real value is invalid. Program a valid value:
VALUE • -2,147,483,500 …
+2,147,483,500
466 ERROR Error writing an output. The output may already be Use a different digital
SETTING assigned by the system. output (parameter
OUTPUT Number):
• 1 … 2 048
467 ERROR An error occurred when writing a software limit switch. Program valid values for
SETTING One possible error, for example, is writing a rotational the software limit switches
SOFTEND axis with a value outside the range +/-360°. (see machine data).
468 INVALID TECH A TechFunctionID for which no technology function is Contact service.
FUNCTION stored has been transferred in a KRC_TechFunction
INDEX function block.
469 INVALID TECH An invalid value has been programmed in a Contact service.
FUNCTION KRC_TechFunction function block for a parameter.
PARAMETER