Sunteți pe pagina 1din 102

ROBOT

KR C ...

KUKA.PLC Multiprog

Release 1.1

Issued: 16 Mar 2006

Version: 01

KUKA.PLC Multiprog 1.1 10.05.01 en

1 of 99

e Copyright 2005

KUKA Roboter GmbH


Zugspitzstrasse 140
D--86165 Augsburg
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 claim 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 99

KUKA.PLC Multiprog 1.1 10.05.01 en

Contents
1

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.1

Target group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.2

Safety . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.3

Overview of the document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.4

Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

KUKA.PLC Multiprog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10

3.1

Preconditions for installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10

3.2
3.2.1
3.2.2

Installing KUKA.PLC Multiprog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


Installing on non--KR C controllers under Windows 98, ME, 2000 and XP . . . . . . . . . . . . . .
Installing on a KR C controller or Office Lite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10
11
12

Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

14

4.1

Configuring a task priority in ProConOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

15

4.2

Configuring allotment of CPU computing time to tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16

4.3

Configuring the robot controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

17

4.4

Configuring ProConOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

17

4.5
4.5.1
4.5.2
4.5.3

Configuring the ProConOS / robot controller interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


Configuring peripheral I/Os . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring communication I/Os . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I/O configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

18
18
19
20

4.6

Configuring the ProConOS/MULTIPROG interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

22

4.7

Creating a ProConOS file directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

23

Scheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

24

Controlling ProConOS by means of KRL . . . . . . . . . . . . . . . . . . . . . . . . . .

26

6.1

IOCTL function: Start, stop and call up status of ProConOS . . . . . . . . . . . . . . . . . . . . . . . . .

26

Configurable ProConOS parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

28

7.1

DEBUG parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

28

7.2

RESET parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

28

7.3

RELOAD parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

28

7.4

PRIOVISOR parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

29

7.5

PRIOUSER parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

29

7.6

PRIOSYSTEM parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

29

7.7

PRIOINTERNAL parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

30

KUKA.PLC Multiprog 1.1 10.05.01 en

3 of 99

KUKA.PLC Multiprog

7.8

MINCAPACITY parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

30

7.9

MAXCAPACITY parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

30

7.10

DELRETAIN parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

31

7.11

DELRETAINFILE parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

31

7.12

AUTOARCHIVERETAIN parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

31

7.13

RETAINSIZE parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

32

7.14

RESTOREOUTPUTS parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

32

7.15

ROOTPATH parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

32

7.16

BINPATH parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

32

7.17

LIBPATH parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

33

7.18

LIBRARIES parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

33

7.19

CPUASSIGNMENT parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

34

7.20

SERIAL parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

35

7.21

COM parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

35

7.22

BAUDRATE parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

36

7.23

SIGNALFILES parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

36

7.24

SIGNALFILEREAD parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

36

Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

38

8.1
8.1.1
8.1.2
8.1.3
8.1.3.1
8.1.3.2
8.1.3.3
8.1.3.4
8.1.3.5
8.1.3.6
8.1.3.7
8.1.3.8
8.1.4
8.1.4.1
8.1.4.2

ExtensionLib library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SaveRetain function: save remanent data by program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PlcSleep function: provide CPU computing time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
File services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FileOpen function: opening a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FileClose function: closing a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FileWrite function: writing data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FileRead function: reading data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FileSeek function: changing the file position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FileGetInfo function: file information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FileDelete function: deleting a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Accessing KR C signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KrcSignalRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KrcSignalWrite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

38
38
39
40
41
42
43
44
45
46
47
48
49
49
50

8.2
8.2.1
8.2.2
8.2.3
8.2.4
8.2.5
8.2.6
8.2.7
8.2.8
8.2.9
8.2.10

KrcLib library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadAxisAct function: reading $AXIS_ACT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadAxisActEx function: reading $AXIS_ACT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadBaseAct function: reading $ACT_BASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadOvPro function: reading $OV_PRO: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
WriteOvPro function: writing $OV_PRO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadPosAct function: reading $POS_ACT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadSenInt function: reading $SEN_PINT[ ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
WriteSenInt function: writing $SEN_PINT[ ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadSenReal function: reading $SEN_PREA[ ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
WriteSenReal function: writing $SEN_PREA[ ] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

51
51
53
55
56
56
57
58
58
59
59

4 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

8.2.11
8.2.12
8.2.13
8.2.14
8.2.15
8.2.16
8.2.17

ReadToolAct function: reading $ACT_TOOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


ReadModeOp function: reading $MODE_OP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadProState function: Reading $PRO_STATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DisplayKCPNotifyMsg function: displaying acknowledgement messages . . . . . . . . . . . . . . .
DisplayKCPStatusMsg function: displaying status messages . . . . . . . . . . . . . . . . . . . . . . . . .
ClearKCPStatusMsg function: clearing status messages . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ClearAllKCPStatusMsg function: clearing all status messages . . . . . . . . . . . . . . . . . . . . . . . .

60
60
61
61
62
62
63

8.3
8.3.1
8.3.2
8.3.3
8.3.4

KrcExVarLib library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ReadPLCBool, ReadPLCInt, ReadPLCReal functions: reading a single value . . . . . . . . . .
WritePLCBool, WritePCLInt, WritePLCReal functions: writing a single value . . . . . . . . . . . .
ReadPLCBoolEx, ReadPLCIntEx, ReadPLCRealEx functions: reading multiple values . .
WritePLCBoolEx, WritePCLIntEx, WritePLCRealEx functions: writing multiple values . . . .

64
65
66
67
68

8.4
8.4.1
8.4.2
8.4.3
8.4.4
8.4.5
8.4.6

SerialLib library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SerialOpen function: opening a channel to a serial device . . . . . . . . . . . . . . . . . . . . . . . . . . .
SerialClose function: closing a channel to a serial device . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SerialReceive function: reading from a serial device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SerialSend function: writing to a serial device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SerialCommand function: commands for serial channels . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SerialGetInfo function: information about a serial channel . . . . . . . . . . . . . . . . . . . . . . . . . . . .

69
70
73
74
75
76
77

8.5
8.5.1
8.5.2
8.5.3
8.5.4

3964Lib library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
P3964Open function: creating a connection to a 3964(R) device . . . . . . . . . . . . . . . . . . . . . .
P3964Close function: closing a connection to a 3964(R) device . . . . . . . . . . . . . . . . . . . . . .
P3964Receive function: reading from a 3964(R) device . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
P3964Send function: writing to a 3964(R) device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

78
79
82
83
84

8.6
8.6.1
8.6.2
8.6.3
8.6.4
8.6.5
8.6.6
8.6.7

KcpLib library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KcpSetKeys function: supply key information to library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KcpSystemKeys function: KCP system keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KcpLeftKeys function: left--hand KCP status keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KcpTopKeys function: KCP menu keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KcpRightKeys function: right--hand KCP status keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KcpBottomKeys function: lower KCP softkeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example: time switching diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

85
86
86
87
88
89
90
91

8.7
8.7.1
8.7.2

AutoExtLib library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Function: KRC_AutoExt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Function: VKRC_AutoExt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

92
93
95

Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

96

9.1

Log file proconos.log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

96

9.2

Error codes for ExtensionLib library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

96

9.3

Error codes for library SerialLib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

97

9.4

Error codes for 3964Lib library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

98

KUKA.PLC Multiprog 1.1 10.05.01 en

5 of 99

KUKA.PLC Multiprog

Introduction
This document describes the software package KUKA.PLC Multiprog and its interaction
with the development environment ProConOS.
KUKA.PLC Multiprog is a SoftPLC for use in the KR C robot controller.

1.1

Target group
This document is intended for robot programmers and personnel with the appropriate
training. Configuration of KUKA.PLC Multiprog 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.

1.2

Safety
WARNING!
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.
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.

6 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

1.3

Introduction (continued)

Overview of the document


Chapter 2 introduces the functions of the KUKA.PLC Multiprog components.
Chapter 3 provides a step--by--step description of how to install the KUKA.PLC Multiprog
components.
Chapter 4 provides a description of how to configure the KUKA.PLC Multiprog components.
Chapter 6 provides a description of the options for controlling ProConOS by means of KRL.
Chapter 7 provides a description of the predefinable parameters of the KUKA.PLC Multiprog
components.
Chapter 8 provides a description of the libraries which can be loaded by means of the
predefinable KUKA.PLC Multiprog component parameters described in Chapter 6.
Chapter 9 provides information for use in troubleshooting.

1.4

Trademarks
ProConOS and Multiprog are registered trademarks of KW--Software GmbH.
GraphWorX32 is a registered trademark of Iconics Inc.
Adobe and Acrobat are either registered trademarks or trademarks of Adobe Incorporated.
VxWorks is a trademark of Wind River Systems Inc.

KUKA.PLC Multiprog 1.1 10.05.01 en

7 of 99

KUKA.PLC Multiprog

KUKA.PLC Multiprog
The KUKA.PLC Multiprog software package is a supplement to the existing software of a
KR C controller. It extends the range of possible solutions for automation tasks already
provided by KRL (KUKA Robot Language).
KUKA.PLC Multiprog thus represents an expanded development environment for PLC
applications. KUKA.PLC Multiprog comprises a number of components, which can be
installed either on the KR C controller itself, or on a development computer.
In this case, the development computer can be used as a development environment for PLC
applications, which are subsequently executed on the KR C controller.
The description and operator control of the KUKA.PLC Multiprog components are described
in detail in the corresponding handbooks.
The KUKA.PLC Multiprog components are:
G

ProConOS runtime system.


KUKA.PLC Multiprog uses the ProConOS runtime system to execute PLC applications.
VxWorks real--time operating system. ProConOS is compatible with the IEC standard
61131--3, and thus employs standardized syntax and semantics. ProConOS can be
configured by means of an initialization file, and can be adapted flexibly to the
requirements of the robot system.

MULTIPROG PLC development environment


MULTIPROG is a PLC development environment which can be used to develop PLC
applications.

MULTIPROG sample project


The sample project demonstrates the capabilities of MULTIPROG.

KR C controller

Windows operating system

Development computer

Windows operating system

MULTIPROG

PLC application development

KUKA Router

KR C controller

VxWorks real--time operating system

Fig. 1 Installation on development computer and KR C controller

8 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

KUKA.PLC Multiprog (continued)

KUKA.PLC Multiprog 1.1 10.05.01 en

9 of 99

KUKA.PLC Multiprog

Installation

3.1

Preconditions for installation


KUKA.PLC Multiprog software license
A separate valid software license must be present each time KUKA.PLC Multiprog is
installed.

3.2

Installing KUKA.PLC Multiprog


KUKA.PLC Multiprog is installed from the KUKA.PLC Multiprog CD--ROM.

10 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

3.2.1

Installation (continued)

Installing on non--KR C controllers under Windows 98, ME, 2000 and XP


Hardware and software requirements
--

Operating systems MS Windows 98, Windows ME, Windows 2000, Windows XP

--

Administrator access rights

--

INTEL Pentium processor

--

At least 64 MB main memory (RAM)

--

At least 200 MB hard disk space

--

For remote operation: network connection

Info
The term non--KR C controllers includes development computers, host computers,
visualization computers, etc.
Procedure:
(1)

Insert CD.
The Setup program is started automatically. If the Autorun function has been
deactivated in the operating system, the program Setup.exe in the root directory of the
CD--ROM must be started manually.

(2)

The license agreement dialog is displayed:


KUKA.PLC Multiprog -- Install Shield Wizard
Read the license agreement carefully and confirm by pressing Next.

(3)

Following confirmation, the Setup program analyzes the computer environment (KR C
or non--KR C) and suggests the components to be installed:
KUKA.PLC Multiprog -- Install Shield Wizard
Select Components...
O ProConOS
O ProConOS OPC Server
X Multiprog
Adapt the suggested selection as required and confirm by pressing Next.

(4)

The next window is displayed:


KUKA Technology Setup
Preparing installation of Multiprog...
Installing Multiprog...

(5)

Once the installation has been completed, the following is displayed.


KUKA.PLC Multiprog -- Install Shield Wizard
The system needs a cold boot

The KR C must be rebooted to save the registration entries for the OPC Server. The
installation process is now complete.

KUKA.PLC Multiprog 1.1 10.05.01 en

11 of 99

KUKA.PLC Multiprog

3.2.2

Installing on a KR C controller or Office Lite


Hardware and software requirements
--

KR C with software version KR C V5.2 or higher

--

At least 20 MB hard disk space

--

Operating system Windows XP embedded

--

Administrator access rights

--

INTEL Pentium processor

--

At least 64 MB main memory (RAM)

--

At least 200 MB hard disk space

--

For remote operation: network connection

Procedure:
(1)

Insert CD. The Setup Manager dialog window is displayed. If the Autorun function has
been deactivated in the operating system, the program Setup.exe in the root directory
of the CD--ROM must be started.

(2)

The license agreement dialog is displayed.


Read the license agreement carefully and confirm by pressing Next.

(3)

Following confirmation, the Setup program analyzes the computer environment (KR C
or non--KR C) and suggests the components to be installed:
KUKA.PLC Multiprog -- Install Shield Wizard
Select Components...
X ProConOS
O ProConOS OPC Server
O Multiprog
Adapt the suggested selection as required and confirm by pressing Next.

(4)

The next window is displayed:


KUKA Technology Setup
Preparing installation of ProConOS...
Installing KUKA Router...
Installing OPC Server...
Installing ProConOS...

(5)

Once the installation has been completed, the following is displayed.


KUKA.PLC Multiprog -- Install Shield Wizard
The system needs a cold boot

The KR C must be rebooted to save the registration entries for the OPC Server. The
installation process is now complete.

12 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

Installation (continued)

KUKA.PLC Multiprog 1.1 10.05.01 en

13 of 99

KUKA.PLC Multiprog

Configuration
Once the KUKA.PLC Multiprog components have been installed (see Chapter 3), they can
then be configured. As a rule, configuration is not necessary.
ProConOS is configured by means of an initialization file which can be modified using an
ASCII--capable text editor.

14 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

4.1

Configuration (continued)

Configuring a task priority in ProConOS


Info
When the Scheduler is active, priorities are assigned automatically.
The ProConOS priority model describes the fundamental relationships between the priorities
and the various ProConOS tasks. The priority indicates a precedence in the allocation of
CPU computing time and the use of system resources. The priority of tasks is defined in the
initialization file ...\krc\init\proconos.ini.
Each task is assigned unambiguously to a task range. This relationship is preset, and cannot
be changed. Each task range is assigned a priority; this priority is assigned to each task
located in the task range. Each task range is represented by a parameter in the initialization
file. The value of this parameter defines the priority of the tasks located in this task range.
The task ranges are:
G

ProConOS Supervisor tasks (High Level tasks)


This task range contains all tasks which have a higher priority than the highest--priority
user task, for example robot tasks. (PRIOVISOR parameter, see Section 7.4)
Default value of Supervisor tasks: 141

ProConOS User tasks and the ProConOS Default task (ProConOS Level tasks)
This task range contains the PLC tasks and the Default task. (Parameter PRIOUSER,
see Section 7.5)
Default value of User tasks: 142 to 149

ProConOS System tasks (Low Level tasks)


Low Level tasks have a lower priority than the Default task (see Section 7.5).
(Parameter PRIOSYSTEM, see Section 7.6)
Default value of System tasks: 218 to 223

ProConOS Internal tasks (Parameter PRIOINTERNAL see Section 7.7)


Default value of Internal tasks: 200

Priority
0

Highest priority (ProConOS Scheduler)

141

ProConOS Supervisor task (default PRIOVISOR)

200

ProConOS Internal tasks (default PRIOINTERNAL)

201

ProConOS User tasks (default PRIOUSER)

216

ProConOS Default task (calculated automatically)

218

ProConOS System tasks (default PRIOSYSTEM)

235

ProConOS User tasks (minimum value PRIOUSER)

250

Lowest priority

15

Number of tasks

Fig. 2 Task priorities


KUKA.PLC Multiprog 1.1 10.05.01 en

15 of 99

KUKA.PLC Multiprog

4.2

Configuring allotment of CPU computing time to tasks


The allotment of CPU computing time to tasks is defined in the initialization file
...\krc\init\proconos.ini.
In order to ensure that low priority tasks will be allotted computing time, ProConOS cyclically
checks the allocation of CPU computing time between low priority tasks and high priority
tasks.
A percentage (parameter MINCAPACITY, see Section 7.8) is selected, which is allocated
to the higher--priority group, and another percentage (Parameter MAXCAPACITY, see
Section 7.9), which this group is not allowed to exceed.
The portion of CPU computing time defined by the parameter MINCAPACITY which is not
required according to the situation by High Level tasks and ProConOS tasks (not including
the default task) will be left to execute the default task.
If, however, the portion of CPU computing time taken by the High Level tasks and the
ProConOS tasks together exceeds the MAXCAPACITY value, it is assumed that not enough
CPU computing time is available for lower--priority tasks.
In this case, ProConOS is stopped, and an exception (PLC overload) is initiated.
If the parameter CPUASSIGNMENT (see Section 7.19) is activated, this function is
automatically executed and the parameters MINCAPACITY and MAXCAPACITY are
deactivated.
Priority
0
High level

Te

ProConOS level

T1

Default

Default

Default
Ts

Ts

Low level

250
Time

Te: Program run time


Ts: Free time slice

Fig. 3 Allotment of time to tasks

16 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

Configuration (continued)

Example
The parameter values in this example are:
MINCAPACITY=50
MAXCAPACITY=70
The situations:

4.3

If the High Level tasks use 30% of the CPU computing time, and the PLC tasks 10%
of the CPU computing time, then 10% of the CPU computing time is allotted to the
Default task. 50% of the CPU computing time will remain for the Low Level tasks
(including Windows tasks).

If the High Level tasks use 50% of the CPU computing time, and the PLC tasks 20%
of the CPU computing time, then no CPU computing time is allotted to the Default task.

If the sum of the CPU computing time of the High Level tasks exceeds 70% of the CPU
computing time, then an exception will be initiated.

Configuring the robot controller


The robot controller is configured automatically during the set--up process by means of the
following entries in the file ...\krc\init\iosys.ini:
[DRIVERS]
PROCONOS=<driver number>,pcosInit,pcosdrv.o
[PROCONOS]
INB511=0

4.4

Configuring ProConOS
Procedure:
(1)

Open the file ...\krc\init\proconos.ini in a text editor and modify the parameter values
(parameters, see Chapter 7).

(2)

Depending on which parameter values have been modified, it may be necessary to


reboot the KR C or ProConOS.

KUKA.PLC Multiprog 1.1 10.05.01 en

17 of 99

KUKA.PLC Multiprog

4.5

Configuring the ProConOS / robot controller interface


The interface driver is loaded automatically when ProConOS is started. It is parameterized
via the I/O configuration of the ProConOS project in Multiprog.
ProConOS can use this interface to access 4096 inputs and outputs of the robot controller. Inputs
and outputs which are used exclusively by means of ProConOS should be defined starting at
I/O number 1032. Inputs 1025 and 1026 are already assigned in the robot controller.

4.5.1

Configuring peripheral I/Os


ProConOS can access physically existing inputs and outputs (I/Os) of the KR C controller.
The I/O mapping of the KR C controller is defined in the file c:\krc\init\iosys.ini. The
configuration of the peripheral outputs in the iosys.ini file should be divided into blocks which
are as small as possible.
ProConOS
Inputs
Start address

Periphery

KR C
Inputs

Outputs

Outputs

Inputs

KRC Byte
start address

Length

Outputs
Start address

KRC Byte
start address

Length

Fig. 4 Configuration of peripheral I/Os


Access by ProConOS to the KR C I/Os is defined in the Multiprog I/O configuration.
The start address specifies the first byte in ProConOS from which I/Os can be transferred.
The length specifies the number of bytes transferred.
The KRC Byte start address specifies the first byte in the KR C from which I/Os can be
transferred.

18 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

4.5.2

Configuration (continued)

Configuring communication I/Os


The ProConOS/KR C interface can be used by ProConOS to exchange data with the KR C
by means of I/Os which do not exist physically. Outputs configured in ProConOS are
transferred directly to the input map of the KR C. Read accesses to inputs configured in this
way are redirected to the KR C outputs.
If a task is to be assigned to the inputs or outputs, this must be declared accordingly.
ProConOS

KR C
Inputs

Inputs
KRC Byte
start address

Start address
Length
INPUT

Outputs
Start address
Length
OUTPUT

Outputs
KRC Byte
start address

Fig. 5 Configuration of communication I/Os


The start address specifies the first byte in ProConOS from which I/Os can be transferred.
The length specifies the number of bytes transferred.
The KRC Byte start address specifies the first byte in the KR C from which I/Os can be
transferred.

KUKA.PLC Multiprog 1.1 10.05.01 en

19 of 99

KUKA.PLC Multiprog

4.5.3

I/O configuration

Fig. 6 I/O configuration


The start address specifies the first byte in ProConOS from which I/Os can be transferred.
The length specifies the number of bytes transferred.
The parameter Refresh must be set to by task. If the task <standard> is selected, the inputs
will be read at the beginning of the default task work cycle, and the outputs will be written
at the end of the default task work cycle.
If a different task is specified, the inputs will be read at the beginning of the work cycle for
this task, and the outputs will be written at the end of the work cycle for this task.
The parameter Device must be set, in this case, to Driver.
The driver--specific data can be entered in the KRC I/O dialog, which is called by clicking the
Driver Parameter button.

Fig. 7 KRC I/O dialog


KR C Byte start address: This parameter specifies the byte from which the KR C I/Os will
be accessed.
Peripheral I/O: Connection with signals from the periphery that physically exist
(see Section 4.5.1)
Communication I/O: Communication between ProConOS and KR C via I/Os
(see Section 4.5.2)
Data type: Number of I/Os transferred in one cycle
20 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

Configuration (continued)

KRC bit address: $IN[9...88] or $OUT[9...88]


Block--by--block configuration with Interbus
This kind of configuration in the iosys.ini file is to be preferred.
[INTERBUS]
; ------- Inputs -------INB20=0,x10
;--------- Outputs -----OUTB20=0,x10

Byte--by--byte configuration with Interbus


In a byte--by--byte configuration of a field bus, only one ProConOS write cycle is required
when one ProConOS output byte is modified.
[INTERBUS]
; ------- Inputs -------INB20=0,x10
;--------- Outputs -----OUTB20=0
OUTB21=1
OUTB22=2
OUTB23=3
OUTB24=4
OUTB25=5
OUTB26=6
OUTB27=7
OUTB28=8
OUTB29=9

KUKA.PLC Multiprog 1.1 10.05.01 en

21 of 99

KUKA.PLC Multiprog

4.6

Configuring the ProConOS/MULTIPROG interface


A connection to ProConOS can be made by via a network card in the KR C and an external
Windows network. This connection can be created by means of the Windows program KUKA
Router: the KUKA Router can route any desired TCP/IP ports. Thus it is also possible to
access VxWin from a remote computer via Telnet.
For information about using VxWin via Telnet, see the documentation for the KUKA Router.

KR C controller
Windows operating system
TCP/IP address, e.g.: 172.16.0.111

KUKA Router

Development computer
Windows operating system
TCP/IP address, e.g.: 172.16.0.177

MULTIPROG
PLC application development

ProConOS
Runtime system

KR C controller
VxWorks real--time operating system
TCP/IP address 192.0.1.1
Fig. 8 ProConOS/MULTIPROG interface
The KUKA Router is installed and configured along with ProConOS.
No settings need to be modified.

22 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

4.7

Configuration (continued)

Creating a ProConOS file directory


In order to organize the files created by ProConOS more clearly, it is possible to create a
separate directory for them.
Procedure:
(1)

Create a directory, e.g. c:\krc\roboter\PlcData.


The file services refer to the directory c:\krc\roboter.

(2)

Create a registry key for reading and writing the directory:


HKEY_LOCAL_MACHINE\SOFTWARE\KUKA Roboter GmbH\Cross3\
Interfaces\FTP\local\User\target\Dir\PlcData
Default character string value: %InstallationDir%\\Roboter\\PlcData
DWORD value: Rights=dword:00000007
(Rights= is only required for the cross--integrated FTP server in versions KR C V4.1
and VKR C V3.3x.)

KUKA.PLC Multiprog 1.1 10.05.01 en

23 of 99

KUKA.PLC Multiprog

Scheduler
The ProConOS Scheduler can be used to configure the allocation of computing time in the
KR C between ProConOS and Windows.
The Scheduler is activated and configured by means of the CPUASSIGNMENT entry in the
[PROCONOS] section of the ProConOS.ini file (see Section 7.19).

ProConOS
R_INT
S_INT
Win

12

IPO cycle 1

10

11

12

Ticks

IPO cycle 2

Fig. 9 Allocation of computing time with the Scheduler activated


When the Scheduler is active, the priorities of the following tasks are calculated automatically:
G

Supervisor Task

User Task

Default Task

When the Scheduler is active, management of the priority of ProConOS and VxWorks tasks
by means of the parameters MINCAPACITY and MAXCAPACITY is deactivated.
The allocation of computing time to the two interpreters in the KR C, R--INT and S--INT, is
not affected by the Scheduler.

24 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

Scheduler (continued)

KUKA.PLC Multiprog 1.1 10.05.01 en

25 of 99

KUKA.PLC Multiprog

Controlling ProConOS by means of KRL

6.1

IOCTL function: Start, stop and call up status of ProConOS


ProConOS can be controlled by means of KRL applications using the function IOCTL. The
following functions can be executed:
G

Start ProConOS

Stop ProConOS

Call up status of ProConOS

Parameters
G

Driver number (nDrvNum): The driver number can be obtained from the file iosys.ini
(see Section 4.3)

Function number (nFunction)

Additional parameter (nParameter)

Action

Call up status
of ProConOS

Start ProConOS
Co
OS

Stop
p ProC OS
ConOS

26 of 99

Function
no.
nFunction
3

Parameter

1000

0: Cold start (all


variable
a ab e contents
co te ts
are deleted and
1: ProConOS could not be started
re--initialized)
1: Warm restart
0: ProConOS is running
(all variable contents are deleted
and re--initialized, 1: ProConOS could not be started
except for remanent data)

1001

nParameter
0

Return value

The value returned by the function is


binary coded. However, at no time will
more than one bit be set.
Bit 0: POWER ON (ProConOS is
running, and no PLC program is loaded.)
Bit 1: RUN (The PLC program is
running.)
Bit 2: STOP (The PLC program is
loaded and is not running.)
Bit 3: HALT (The PLC program has
been stopped, e.g. by a breakpoint.)
Bit 5: LOADING (The PLC program is
being loaded.)
0: ProConOS is running

3: Hot restart (no 0: ProConOS is running


variable
a ab e contents
co te ts
are deleted and
1: ProConOS could not be started
re--initialized)
0
0: ProConOS has been stopped
1: ProConOS could not be stopped

KUKA.PLC Multiprog 1.1 10.05.01 en

Controlling ProConOS by means of KRL (continued)

Syntax
IOCTL ( INT nDrvNum, INT nFunction, INT nParameter) : INT
Example
Call up status of ProConOS

PLCSTATE = IOCTL(13,3,0)

Warm restart ProConOS

RESULT = IOCTL(13,1000,1)

Stop ProConOS

RESULT = IOCTL(13,1001,0)

KUKA.PLC Multiprog 1.1 10.05.01 en

27 of 99

KUKA.PLC Multiprog

Configurable ProConOS parameters


This chapter provides detailed descriptions of the parameters in the initialization file
...\krc\init\proconos.ini. The parameter values are used to configure ProConOS during
initialization.
If a parameter is not present in the initialization file, it can be inserted in the order listed here.

7.1

DEBUG parameter
The value of this parameter is used to define whether, in addition to error messages, test
outputs are to be displayed on the Telnet shell or not. The KR C must be restarted after this
parameter is changed.
Info
This function is intended for Debug operation only. The test output should not be set in
normal operation.
Range of values

7.2

DEBUG=0

Error messages are displayed on the Telnet shell (default value).

DEBUG=1

Test outputs and error messages are displayed on the Telnet shell.

RESET parameter
The value of this parameter is used to define the way in which ProConOS is reset. ProConOS
must be restarted after the value of this parameter is changed.
Range of values
RESET=0
RESET=1

ProConOS is not reset by the action (default value).


ProConOS is stopped and cold started
(all variable contents are deleted and re--initialized).

RESET=2

ProConOS is stopped and warm started


(all variable contents are deleted and re--initialized, except for remanent data).
ProConOS is stopped and hot started
(no variable contents are deleted and re--initialized).

RESET=3

7.3

RELOAD parameter
If Reconfigure I/O system is carried out on the KR C controller, all of the outputs are reset,
the drivers are reloaded and changes in configuration files take effect. This value is used to
define whether or not ProConOS is to be stopped and restarted. ProConOS must be
restarted after the value of this parameter is changed.
Range of values
RELOAD=0 ProConOS is not affected by the action (default value).
RELOAD=1 ProConOS is stopped and hot restarted.

28 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

7.4

Configurable ProConOS parameters (continued)

PRIOVISOR parameter
The value of this parameter specifies the priority of the ProConOS Supervisor task. The
ProConOS Supervisor task must have the highest priority of all ProConOS tasks. An
example of a Supervisor task is exception handling. For further information, please refer to
Chapter 4. The KR C must be restarted after this parameter is changed.
Range of values
The parameter value PRIOVISOR must be larger than PRIOUSER (see Section 7.5).

7.5

PRIOVISOR=0

Highest priority

PRIOVISOR=187

Default priority (default value)

PRIOVISOR=234

Lowest priority

PRIOUSER parameter
The value of this parameter specifies the priority of the ProConOS User tasks. MULTIPROG
allows the assignment of 15 priority levels, which can be mapped on ProConOS by means
of PRIOUSER. The priority defined via this parameter corresponds to priority 1 in
MULTIPROG. The Default task has the lowest priority level of the user tasks. The priority
of the Default task cannot be defined, since it is calculated by ProConOS from the value of
the PRIOUSER parameter (DEFAULT TASK = PRIOUSER + 15). The Default task receives
computing time if no other ProConOS task requires computing time.
For further information, please refer to Chapter 4. The KR C controller must be restarted after
this parameter is changed.
Range of values
The value of the PRIOUSER parameter must be greater than the value of the
PRIOVISOR parameter plus 1 (PRIOUSER PRIOVISOR + 1) (see Section 7.4).

7.6

PRIOUSER=0

Highest priority

PRIOUSER=201

Default priority (default value)

PRIOUSER=235

Lowest priority

PRIOSYSTEM parameter
The value of this parameter specifies the priority of the ProConOS System task. The
functions of the ProConOS System tasks are communication with MULTIPROG, debugging
and memory management. System tasks receive the lowest priority level. For further
information, please refer to Chapter 4. The KR C controller must be restarted after this
parameter is changed.
Range of values
The value of the PRIOSYSTEM parameter is greater than or equal to the value of the
PRIOUSER parameter plus 16 (PRIOSYSTEM PRIOUSER + 16) (see Section 7.5).
PRIOSYSTEM=0

Highest priority

PRIOSYSTEM=217

Default priority (default value)

PRIOSYSTEM=250

Lowest priority

KUKA.PLC Multiprog 1.1 10.05.01 en

29 of 99

KUKA.PLC Multiprog

7.7

PRIOINTERNAL parameter
The value of this parameter defines the priority of two tasks which are used for internal
management purposes:
--

one task that initializes and starts the ProConOS runtime system

--

another task that saves the remanent data to the hard drive in the event of a power
failure (Powerfail)

The KR C must be restarted after this parameter is changed.


Range of values
The priority is freely selectable, but should be adjusted to suit the overall system.

7.8

PRIOINTERNAL=0

Highest priority

PRIOINTERNAL=200

Default priority (default value)

PRIOINTERNAL=250

Lowest priority

MINCAPACITY parameter
The value of this parameter defines the minimum CPU utilization level, in percent, of the
ProConOS tasks and the higher--priority tasks, e.g. VxWin.
If the parameter CPUASSIGNMENT (see Section 7.19) is activated, this parameter is
ignored. The KR C must be restarted after this parameter is changed.
Range of values

7.9

MINCAPACITY=0

Minimum CPU utilization 0%

MINCAPACITY=50

Minimum CPU utilization 50% (default value)

MINCAPACITY=100

Minimum CPU utilization 100%

MAXCAPACITY parameter
The value of this parameter defines the maximum CPU utilization level, in percent, of the
ProConOS tasks and the higher--priority tasks, e.g. VxWin.
If the parameter CPUASSIGNMENT (see Section 7.19) is activated, this parameter is
ignored. The KR C must be restarted after this parameter is changed.
Range of values

30 of 99

MAXCAPACITY=0

Maximum CPU utilization 0%

MAXCAPACITY=70

Maximum CPU utilization 70% (default value)

MAXCAPACITY=100

Maximum CPU utilization 100%

KUKA.PLC Multiprog 1.1 10.05.01 en

7.10

Configurable ProConOS parameters (continued)

DELRETAIN parameter
Info
If remanent variables are inserted in the variable list, all of the subsequent variables are
shifted. Thus with DELRETAIN=1 the consistency of the subsequent remanent variables cannot be ensured. Therefore new variables should be inserted only at the end of
the variable list.
The value of this parameter defines whether the remanent data are deleted or retained. The
KR C must be restarted after this parameter is changed.
Range of values

7.11

DELRETAIN=0

Remanent data are retained.

DELRETAIN=1

Remanent data are set to their initialization values (default value)

DELRETAINFILE parameter
The value of this parameter defines whether the file with the remanent data is deleted after
being read in.
Range of values

7.12

DELRETAINFILE=0

The file with the remanent data is not deleted (default value).

DELRETAINFILE=1

The file with the remanent data is deleted.

AUTOARCHIVERETAIN parameter
The value of this parameter defines whether the remanent data is saved in the file when the
KR C is shut down.
It is generally only necessary to prevent saving if the data are already saved by another
application (see Section 9.2.1).
Range of values
AUTOARCHIVERETAIN=0

The remanent data are not saved.

AUTOARCHIVERETAIN=1

The remanent data are saved (default value).

KUKA.PLC Multiprog 1.1 10.05.01 en

31 of 99

KUKA.PLC Multiprog

7.13

RETAINSIZE parameter
Info
If the value of this parameter is changed, these settings must be defined in MULTIPROG.
The value of this parameter defines the size of the area for the remanent data in bytes. This
size can be adjusted if necessary.
If the value of the RETAINSIZE parameter is changed or the size of the data area is changed,
certain settings must be reconfigured in MULTIPROG.
Range of values
RETAINSIZE=512

7.14

Default size 512 bytes

RESTOREOUTPUTS parameter
Reconfigure I/O system triggers the following processes in the KR C:
G

All outputs are reset

All drivers are reloaded

All modifications in the configuration files take effect

Range of values

7.15

RESTOREOUTPUTS=0

Do not restore values (default value)

RESTOREOUTPUTS=1

Restore values

ROOTPATH parameter
The value of this parameter defines the directory in which the ProConOS files (e.g. the
remanent data) are kept. The directory must be read-- and write--enabled. The KR C must
be restarted after this parameter is changed.
Syntax
ROOTPATH=c:\program_files\krc\binAbsolute path (default value)

7.16

BINPATH parameter
The value of this parameter defines the directory in which the runtime module with the file
name proconos.o is located. The KR C must be restarted after this parameter is changed.
Syntax
Either absolute paths or relative paths can be used as the value.
BINPATH=c:\program_files\krc\bin Absolute path (default value)
BINPATH=bin

32 of 99

Relative path within the root directory

KUKA.PLC Multiprog 1.1 10.05.01 en

7.17

Configurable ProConOS parameters (continued)

LIBPATH parameter
The value of this parameter defines the directory in which the ProConOS libraries are
located. The default setting is the LIB directory in the KR C directory. The KR C controller
must be restarted after this parameter is changed.
Syntax
LIBPATH=c:\program_files\krc\lib Absolute path (default value)
Relative path within the root directory

LIBPATH=bin

7.18

LIBRARIES parameter
The value of this parameter defines which modules and libraries can be dynamically
reloaded. The KR C must be restarted after this parameter is changed.
Range of values
LIBRARIES=ExtensionLib.o

ExtensionLib library (see Section 8.1)

LIBRARIES=KrcLib.o

KrcLib library (see Section 8.2)

LIBRARIES=KrcExVarLib.o

KrcExVarLib library (see Section 8.3)

LIBRARIES=SerialLib.o

SerialLib library (see Section 8.4)

LIBRARIES=3964Lib.o

3964Lib library (see Section 8.5)

LIBRARIES=KcpLib.o

KcpLib library (see Section 8.6)

Multiple values are separated by commas, e.g.:


LIBRARIES=KrcLib.o,SerialLib.o

KUKA.PLC Multiprog 1.1 10.05.01 en

33 of 99

KUKA.PLC Multiprog

7.19

CPUASSIGNMENT parameter
Info
This function may only be used after consultation with the KUKA Roboter Service department. This function can adversely affect the real--time behavior of the robot system.
The value of this parameter defines the time slice of the CPU computing time in which the
ProConOS tasks are executed. If this parameter is active or entered in the initialization file,
the MINCAPACITY and MAXCAPACITY parameters are deactivated automatically and the
priorities of the Supervisor task, the User task and the Default task are calculated
automatically.
The KR C must be restarted after this parameter is changed.
Syntax
The value which is represented here by the placeholder [time_slice_x] defines the time slice
during which ProConOS is allotted exclusive use of the processor time. Multiple values are
separated by commas.
CPUASSIGNMENT=[time_slice_1],[time_slice_2],[time_slice_n]

Example: Execution of ProConOS in time slices 3 and 9 (default).


CPUASSIGNMENT=3,9

34 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

7.20

Configurable ProConOS parameters (continued)

SERIAL parameter
The value of this parameter defines whether or not a serial interface is available for
ProConOS. The serial interface between a development computer (MULTIPROG) and the
KR C (ProConOS) can be used to transfer programs when no TCP/IP network is available.
The KR C must be restarted after this parameter is changed.
In order to configure the activated serial interface, it is also necessary to configure the
parameters COM (see Section 7.21) and BAUDRATE (see Section 7.22).
Range of values

7.21

SERIAL=0

Serial interfaces are deactivated for ProConOS (default value)

SERIAL=1

Serial interfaces are activated for ProConOS

COM parameter
Info
If the value of this parameter is changed, the values of the parameters COM1 and
COM2 must be adapted in the [SERIAL] section of the initialization file c:\krc\roboter\init\hw_inf.ini.
Info
Please ensure that no conflicts with other devices or applications are created on the
serial interface, for example with SerialLib or 3964Lib.
The value of this parameter defines whether serial interface 1 (COM 1) or serial interface 2
(COM 2) is used. This parameter is only active if the parameter SERIAL is activated (see
Section 7.20).
The KR C must be restarted after this parameter is changed.
Range of values
COM=1

Serial interface 1 (COM 1) is used


In the [SERIAL] section of the file c:\program_files\krc\init\hw_inf.ini:
COM1=ENABLE
COM2=DISABLE

COM=2

Serial interface 2 (COM 2) is used


In the [SERIAL] section of the file c:\program_files\krc\init\hw_inf.ini:
COM1=DISABLE
COM2=ENABLE

KUKA.PLC Multiprog 1.1 10.05.01 en

35 of 99

KUKA.PLC Multiprog

7.22

BAUDRATE parameter
Info
The value of this parameter must also be defined in the resource settings in the MULTIPROG wt project.
Operator control of MULTIPROG is described in the attached manufacturer documentation.
The value of this parameter defines the baud rate of the COM interface which has been
defined by means of the COM parameter (see Section 7.21).
This parameter is only active if the parameter SERIAL is activated (see Section 7.20).
The KR C must be restarted after this parameter is changed.
Range of values

7.23

BAUDRATE=2400

COM interface with 2,400 baud

BAUDRATE=4800

COM interface with 4,800 baud

BAUDRATE=9600

COM interface with 9,600 baud

BAUDRATE=19200

COM interface with 19,200 baud

SIGNALFILES parameter
The parameter SIGNALFILES serves to signal *.dat files to the ProConOS system that are
used to access I/O data symbolically. It is preset during setup with the files C:\KRC\Roboter\KRC\R1\System\$Config.dat and C:\KRC\Roboter\KRC\Steu\Mada\$Machine.dat
and can be expanded as required.
The functionality is currently used by the AutoExtLib and ExtensionLib libraries.

7.24

SIGNALFILEREAD parameter
The signal files referred to in 7.23 are read in accordance with the entry SIGNALFILEREAD.
If this entry is set to =BOOT, the signal files are read once when ProConOS or the controller
is started. Otherwise, the signal files are reloaded every time ProConOS program execution
is started. If Automatic External interface signals are to be reconfigured, ProConOS must
be stopped and restarted.

36 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

Configurable ProConOS parameters (continued)

KUKA.PLC Multiprog 1.1 10.05.01 en

37 of 99

KUKA.PLC Multiprog

Libraries
This chapter describes the libraries which can be dynamically loaded by means of
ProConOS.
The libraries are loaded by means of the value of the parameter LIBRARIES (see
Section 7.18) in the initialization file proconos.ini.

8.1

ExtensionLib library
This section describes the ProConOS functions of the library ExtensionLib.

8.1.1

SaveRetain function: save remanent data by program


This function block can be used to save remanent data via PLC programs. Saving can take
several hundreds of milliseconds, depending on the volume of the data. For this reason, the
function block should be executed either in the SPG2 stop task, or in another task which is
not monitored by the watchdog.

Fig. 10 SaveRetain function block symbol


Parameter

38 of 99

I/O

Description

Enable

Data
type
BOOL

IN

Success

BOOL

OUT

A rising edge at this input activates the functionality of the function module.
FALSE: An error occurred when saving the remanent data.
TRUE: The remanent data were saved successfully.

KUKA.PLC Multiprog 1.1 10.05.01 en

8.1.2

Libraries (continued)

PlcSleep function: provide CPU computing time


Info
This function may only be used after consultation with the KUKA Roboter Service department. This function can adversely affect the real--time behavior of the robot system.
This function block can be used to provide CPU computing time to lower--priority tasks of the
lower--level operating system.

Fig. 11 PlcSleep function block symbol


Parameter
SleepTime

KUKA.PLC Multiprog 1.1 10.05.01 en

Data
type
BOOL

I/O

Description

IN

CPU computing time in milliseconds which is to


be provided.

39 of 99

KUKA.PLC Multiprog

8.1.3

File services
The function blocks listed in this section give ProConOS access to the file system. With this
function block, a maximum of 31 files can be open at the same time. When ProConOS is
started, all files which are still open are automatically closed. Since values are saved in each
instance of the function block, a separate instance must be created for each action.
Each of these function blocks has the input Enable and the output Done. The Enable input
is used to initiate the file action. For files which were opened by means of ExtLib, the output
Done reports the end of the action, regardless of whether or not it was successfully executed.
The input Enable remains set to the value 1 until the action has been ended. The output
Done is reset when Enable is reset.

Enable
Action
Done
Time
Fig. 12 Enable and Done signals
For information on creating the ProConOS data directory, see also Section 4.7.

40 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

8.1.3.1

Libraries (continued)

FileOpen function: opening a file


This function block can be used to open a file for subsequent read or write access. Especially
with large files, it is important to keep in mind that when the file is opened its entire contents
are read and buffered in VxWORKS. Modifications which are made after opening the file, for
example under Windows, are only recognized when the file is opened again.

Fig. 13 FileOpen function block symbol


Parameter

I/O

Description

Enable

Data
type
BOOL

IN

FileName

STRING

IN

Options
p

BYTE

IN

Done

BOOL

OUT

Result

INT

OUT

FileId

BYTE

OUT

Activation input: A rising edge causes the input


parameters to be transferred and the action
Open file to be initiated
The name and path of the file which is to be
opened. Directory levels in the path are separated by two backslashes (e.g.
PlcData\\Test.dat).
0: Read access
1: Write access
2: Read and write access
5: Write access (the file is created if it is not already present)
7: Read and write access (the file is created if it
is not already present)
This parameter is set to the value 1 when the
action has been completed. In order to determine
whether the action was successfully completed,
the Result parameter of this function must also
be evaluated.
0: Action successful
Otherwise: error (see Section 9.2)
The unambiguous reference number for the
opened file; must be buffered for use in subsequent function calls.

KUKA.PLC Multiprog 1.1 10.05.01 en

41 of 99

KUKA.PLC Multiprog

8.1.3.2

FileClose function: closing a file


This function block can be used to close a file opened by means of the FileOpen function
(see Section 8.1.3.1). Changes to the contents of the file are only written to the file when
it is closed.

Fig. 14 FileClose function block symbol


Parameter

42 of 99

I/O

Description

Enable

Data
type
BOOL

IN

FileId

BYTE

IN

Done

BOOL

OUT

Result

INT

OUT

Activation input: A rising edge causes the input


parameters to be transferred and the action
Close file to be initiated
The unambiguous reference number for an
opened file; generated by the FileOpen function
(see Section 8.1.3.1).
This parameter is set to the value 1 when the
action has been completed. In order to determine
whether the action was successfully completed,
the Result parameter of this function must also
be evaluated.
0: successful
Otherwise: error (see Section 9.2)

KUKA.PLC Multiprog 1.1 10.05.01 en

8.1.3.3

Libraries (continued)

FileWrite function: writing data


This function module can be used to write data from ProConOS variables to an opened file.
Changes are only written to the file when it is closed.

Fig. 15 FileWrite function block symbol


Parameter

I/O

Description

Enable

Data
type
BOOL

IN

FileId

BYTE

IN

Data

ANY

IN

Done

BOOL

OUT

Result

INT

OUT

Activation input: A rising edge causes the input


parameters to be transferred and the action
Write data to be initiated
The unambiguous reference number for an
opened file; generated by the FileOpen function
(see Section 8.1.3.1).
The variable with data which are to be written to
the file. This variable can be of any data type,
e.g. BYTE, INT, STRING, STRUCT, etc.
This parameter is set to the value 1 when the
action has been completed. In order to determine
whether the action was successfully completed,
the Result parameter of this function must also
be evaluated.
0: successful
1: error (see Section 9.2)

KUKA.PLC Multiprog 1.1 10.05.01 en

43 of 99

KUKA.PLC Multiprog

8.1.3.4

FileRead function: reading data


This function block can be used to read data of ProConOS variables from an opened file.
Since when the file is opened its entire contents are read and buffered in VxWORKS, any
changes which are made after it is opened, e.g. under Windows, are only recognized after
the file is opened again.

Fig. 16 FileRead function block symbol


NOTE
Output parameters of data type ANY are displayed on the left side of the function block.
I/O

Description

Enable

Data
type
BOOL

IN

FileId

BYTE

IN

Data

ANY

OUT

Size
Done

INT
BOOL

IN
OUT

Result

INT

OUT

Activation input: a rising edge causes the input


parameters to be transferred and the Read data
action to be initiated.
The unambiguous reference number for an
opened file; generated by the FileOpen function
(see Section 8.1.3.1).
The variable to which data are to be assigned
from the file. These variables can be of any data
type, e.g. BYTE, INT, STRING, STRUCT, etc.
Number of characters to be read
This parameter is set to the value 1 when the
action has been completed. In order to determine
whether the action was successfully completed,
the Result parameter of this function must also
be evaluated.
0: successful
Otherwise: error (see Section 9.2)

Parameter

44 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

8.1.3.5

Libraries (continued)

FileSeek function: changing the file position


This function block can be used to change the position in the file where writing or reading is
carried out.

Fig. 17 FileSeek function block symbol


Parameter

I/O

Description

Enable

Data
type
BOOL

IN

FileId

BYTE

IN

Start

BYTE

IN

Offset

INT

IN

Done

BOOL

OUT

Result

INT

OUT

Activation input: A rising edge causes the input


parameters to be transferred and the action File
information to be initiated
An unambiguous reference number for an
opened file; generated by the FileOpen function
(see Section 8.1.3.1).
The start point within the file and the position
from which repositioning is to be carried out:
0: current file position
1: beginning of the file (offset must be positive)
2: end of the file (offset must be negative)
The number of bytes by which the file position is
to be changed.
This parameter is set to the value 1 when the
action has been completed. In order to determine
whether the action was successfully completed,
the Result parameter of this function must also
be evaluated.
0: successful
Otherwise: error (see Section 9.2)

KUKA.PLC Multiprog 1.1 10.05.01 en

45 of 99

KUKA.PLC Multiprog

8.1.3.6

FileGetInfo function: file information


This function block can be used to read information about an opened file. This module does
not have any Done output, i.e. the values of the output parameters are available immediately
after the module is called.

Fig. 18 FileGetInfo function block symbol


Parameter

46 of 99

I/O

Description

Enable

Data
type
BOOL

IN

FileId

BYTE

IN

Result

INT

OUT

FileName
FilePos
LastError

STRING
DINT
DINT

OUT
OUT
OUT

Activation input: A rising edge causes the input


parameters to be transferred and the action File
information to be initiated
An unambiguous reference number for an
opened file; generated by the FileOpen function
(see Section 8.1.3.1).
0: successful
Otherwise: error (see Section 9.3)
File name
The current file position.
The operating system error number of the last
error to occur. This information is needed for detailed troubleshooting.

KUKA.PLC Multiprog 1.1 10.05.01 en

8.1.3.7

Libraries (continued)

FileDelete function: deleting a file


This function block can be used to delete a file from the hard disk of the KR C controller.

Fig. 19 FileDelete function block symbol


Parameter

I/O

Description

Enable

Data
type
BOOL

IN

FileName
Done

STRING
BOOL

INT
OUT

Result

INT

OUT

Activation input: A rising edge causes the input


parameters to be transferred and the action
Delete file to be initiated
The file name of the file to be deleted.
This parameter is set to the value 1 when the
action has been completed. In order to determine
whether the action was successfully completed,
the Result parameter of this function must also
be evaluated.
0: successful
Otherwise: error (see Section 9.2)

KUKA.PLC Multiprog 1.1 10.05.01 en

47 of 99

KUKA.PLC Multiprog

8.1.3.8

Example
In this example, the file c:\krc\roboter\PlcData\Test.dat is deleted, created again, opened,
written with a BYTE and a STRING, and closed, all in MULTIPROG.

Fig. 20 File operation example

48 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

8.1.4

Libraries (continued)

Accessing KR C signals
The function blocks KrcSignalRead and KrcSignalWrite allow symbolical access to the I/Os
of the KR C controller. This enables I/O assignment without a PLC project and without Multiprog. The assignment between the symbol and the I/O address is made by means of a KR C
signal declaration. For further information, see Sections 7.23 and 7.24.
Info
It must be remembered that accessing I/Os during a PLC cycle violates the PLC principle which stipulates that input data must not be changed at any point in the cycle and
that outputs are written at the end of the cycle.
Info
When attempting to write to system outputs, it is possible that a message may be generated cyclically in the message window. This can cause the message buffer to overflow, thereby disabling the controller.
Info
It must be borne in mind that the status setting of outputs which are simultaneously being written to from elsewhere, e.g. by KrcloDrv and the KrcSignalWrite function block,
will be unpredictable.

8.1.4.1

KrcSignalRead
The KrcSignalRead function block allows I/O data to be read symbolically.
KrcSignalRead_1
KrcSignalRead
SignalName

Error

Value
Although the parameter Value appears as an input, the read value is written to the linked
variable.
Parameter
SignalName
Value
Error

Data
type
STRING
ANY
INT

Description
Name of the signal that is to be read
Read value
Error code

Error codes
Code
0
--2
--6

KUKA.PLC Multiprog 1.1 10.05.01 en

Meaning
Successful
Signal not found
Buffer too small

49 of 99

KUKA.PLC Multiprog

8.1.4.2

KrcSignalWrite
The KrcSignalWrite function block allows I/O data to be written symbolically.
KrcSignalWrite_1
KrcSignalWrite
SignalName

Error

Value

Parameter
SignalName
Value
Error

Data
type
STRING
ANY
INT

Description
Name of the signal that is to be written
Value to be written
Error code

Error codes
Code
0
--2
--6

50 of 99

Meaning
Successful
Signal not found
Buffer too small

KUKA.PLC Multiprog 1.1 10.05.01 en

Libraries (continued)

8.2

KrcLib library
This library carries out read and write access to robot data. During installation, this library
is inserted as a project library in MULTIPROG.

8.2.1

ReadAxisAct function: reading $AXIS_ACT


Info
This function may only be used after consultation with the KUKA Roboter Service
department. This function can adversely affect the real--time behavior of the robot
system. To prevent this, if allowed by the application, the actual position should be read
by a task that is processed a maximum of once every 12 ms.
This function block can be used to read by means of the variable $AXIS_ACT the current
actual robot position values of axes A 1 to A 6.

Fig. 21 ReadAxisAct function block symbol


Parameter
A1
A2
A3
A4
A5
A6

KUKA.PLC Multiprog 1.1 10.05.01 en

Data
type
REAL
REAL
REAL
REAL
REAL
REAL

I/O

Element

Description

OUT
OUT
OUT
OUT
OUT
OUT

$AXIS_ACT.A1
$AXIS_ACT.A2
$AXIS_ACT.A3
$AXIS_ACT.A4
$AXIS_ACT.A5
$AXIS_ACT.A6

Angle A 1
Angle A 2
Angle A 3
Angle A 4
Angle A 5
Angle A 6

51 of 99

KUKA.PLC Multiprog

Examples
The example shows a call in the programming language IL:
CAL
LD
ST
LD
ST
LD
ST
LD
ST
LD
ST
LD
ST

ReadAxisAct_1
ReadAxisAct_1.A1
AxisAct.A1
ReadAxisAct_1.A2
AxisAct.A2
ReadAxisAct_1.A3
AxisAct.A3
ReadAxisAct_1.A4
AxisAct.A4
ReadAxisAct_1.A5
AxisAct.A5
ReadAxisAct_1.A6
AxisAct.A6

The example shows a call in the programming language ST:


ReadAxisAct_1();
AxisAct.A1:=ReadAxisAct_1.A1;
AxisAct.A2:=ReadAxisAct_1.A2;
AxisAct.A3:=ReadAxisAct_1.A3;
AxisAct.A4:=ReadAxisAct_1.A4;
AxisAct.A5:=ReadAxisAct_1.A5;
AxisAct.A6:=ReadAxisAct_1.A6;

52 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

8.2.2

Libraries (continued)

ReadAxisActEx function: reading $AXIS_ACT


Info
This function may only be used after consultation with the KUKA Roboter Service
department. This function can adversely affect the real--time behavior of the robot
system. To prevent this, if allowed by the application, the actual position should be read
by a task that is processed a maximum of once every 12 ms.
This function block can be used to read by means of the variable $AXIS_ACT the current
actual values of axes A 1 to A 12.

Fig. 22 ReadAxisActEx function block symbol


Parameter
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12

KUKA.PLC Multiprog 1.1 10.05.01 en

Data
type
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL
REAL

I/O

Element

Description

OUT
OUT
OUT
OUT
OUT
OUT
OUT
OUT
OUT
OUT
OUT
OUT

$AXIS_ACT.A1
$AXIS_ACT.A2
$AXIS_ACT.A3
$AXIS_ACT.A4
$AXIS_ACT.A5
$AXIS_ACT.A6
$AXIS_ACT.A7
$AXIS_ACT.A8
$AXIS_ACT.A9
$AXIS_ACT.A10
$AXIS_ACT.A11
$AXIS_ACT.A12

Angle A 1
Angle A 2
Angle A 3
Angle A 4
Angle A 5
Angle A 6
Angle A 7
Angle A 8
Angle A 9
Angle A 10
Angle A 11
Angle A 12

53 of 99

KUKA.PLC Multiprog

Example
The example shows a call in the programming language IL:
CAL
LD
ST
LD
ST
LD
ST
LD
ST
LD
ST
LD
ST
LD
ST
LD
ST
LD
ST
LD
ST
LD
ST
LD
ST

ReadAxisActEx_1
ReadAxisActEx_1.A1
AxisAct.A1
ReadAxisActEx_1.A2
AxisAct.A2
ReadAxisActEx_1.A3
AxisAct.A3
ReadAxisActEx_1.A4
AxisAct.A4
ReadAxisActEx_1.A5
AxisAct.A5
ReadAxisActEX_1.A6
AxisAct.A6
ReadAxisActEx_1.A7
AxisAct.A7
ReadAxisActEx_1.A8
AxisAct.A8
ReadAxisActEx_1.A9
AxisAct.A9
ReadAxisActEx_1.A10
AxisAct.A10
ReadAxisActEx_1.A11
AxisAct.A11
ReadAxisActEx_1.A12
AxisAct.A12

The example shows a call in the programming language ST:


ReadAxisActEx_1();
AxisAct.A1:=ReadAxisActEx_1.A1;
AxisAct.A2:=ReadAxisActEx_1.A2;
AxisAct.A3:=ReadAxisActEx_1.A3;
AxisAct.A4:=ReadAxisActEx_1.A4;
AxisAct.A5:=ReadAxisActEx_1.A5;
AxisAct.A6:=ReadAxisActEx_1.A6;
AxisAct.A7:=ReadAxisActEx_1.A7;
AxisAct.A8:=ReadAxisActEx_1.A8;
AxisAct.A9:=ReadAxisActEx_1.A9;
AxisAct.A10:=ReadAxisActEx_1.A10;
AxisAct.A11:=ReadAxisActEx_1.A11;
AxisAct.A12:=ReadAxisActEx_1.A12

54 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

8.2.3

Libraries (continued)

ReadBaseAct function: reading $ACT_BASE


This function block can be used to read by means of the variable $ACT_BASE the current
position of the base origin.

Fig. 23 ReadBaseAct function block symbol


Parameter

I/O

bValid

Data
type
BOOL

X
Y
Z
A
B
C

REAL
REAL
REAL
REAL
REAL
REAL

OUT
OUT
OUT
OUT
OUT
OUT

KUKA.PLC Multiprog 1.1 10.05.01 en

Element

Description

$ACT_BASE.X
$ACT_BASE.Y
$ACT_BASE.Z
$ACT_BASE.A
$ACT_BASE.B
$ACT_BASE.C

FALSE: no tool present


TRUE: tool present
X coordinate
Y coordinate
Z coordinate
Orientation A
Orientation B
Orientation C

OUT

55 of 99

KUKA.PLC Multiprog

8.2.4

ReadOvPro function: reading $OV_PRO:


This function block can be used to read by means of the variable $OV_PRO the current
override of the KR C.
The return value of this function is the override within a value range from 0 to 100.

Fig. 24 ReadOvPro function block symbol

8.2.5

WriteOvPro function: writing $OV_PRO


This function block can be used to set by means of the variable $OV_PRO the current
override of the KR C.
The input parameter is the override within a value range from 0 to 100.

Fig. 25 WriteOvPro function block symbol

56 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

8.2.6

Libraries (continued)

ReadPosAct function: reading $POS_ACT


Info
This function can adversely affect the real--time behavior of the robot system. To prevent this, if allowed by the application, the actual position should be read by a task that
is processed a maximum of once every 12 ms.
This function block can be used to read by means of the variable $POS_ACT the current
actual values of the robot position.

Fig. 26 ReadPosAct function block symbol


Parameter

I/O

bValid

Data
type
BOOL

X
Y
Z
A
B
C

REAL
REAL
REAL
REAL
REAL
REAL

OUT
OUT
OUT
OUT
OUT
OUT

KUKA.PLC Multiprog 1.1 10.05.01 en

Element

Description

$POS_ACT.X
$POS_ACT.Y
$POS_ACT.Z
$POS_ACT.A
$POS_ACT.B
$POS_ACT.C

FALSE: not valid


TRUE: valid
X coordinate
Y coordinate
Z coordinate
Orientation A
Orientation B
Orientation C

OUT

57 of 99

KUKA.PLC Multiprog

8.2.7

ReadSenInt function: reading $SEN_PINT[ ]


This function block can be used to read 20 KR C variables of the type Integer which are
available for KRL programming, which contain freely available integer and real values, and
which can be accessed by means of the sensor interface.

Fig. 27 ReadSenInt function block symbol


Parameter
Index
Function result

8.2.8

Data
type
BYTE
DINT

I/O

Description

IN
OUT

Index of the KR C variables from 1 to 20


Value of variable

WriteSenInt function: writing $SEN_PINT[ ]


This function block can be used to write to 20 KR C variables of the type Integer which are
available for KRL programming, which contain freely available integer and real values, and
which can be accessed by means of the sensor interface.

Fig. 28 WriteSenInt function block symbol


Parameter
Index
Value

58 of 99

Data
type
BYTE
DINT

I/O

Description

IN
OUT

Index of the KR C variables from 1 to 20


Value of variable

KUKA.PLC Multiprog 1.1 10.05.01 en

8.2.9

Libraries (continued)

ReadSenReal function: reading $SEN_PREA[ ]


This function block can be used to read 20 KR C variables which are available for KRL
programming, which contain freely available integer and real values, and which are available
by means of the sensor interface.

Fig. 29 ReadSenReal function block symbol


Parameter
Index
Function result

8.2.10

Data
type
BYTE
DINT

I/O

Description

IN
OUT

Index of the KR C variables from 1 to 20


Value of variable

WriteSenReal function: writing $SEN_PREA[ ]


This function block can be used to read 20 KR C variables which are available for KRL
programming, which contain freely available integer and real values, and which are available
by means of the sensor interface.

Fig. 30 WriteSenReal function block symbol


Parameter
Index
Value

KUKA.PLC Multiprog 1.1 10.05.01 en

Data
type
BYTE
REAL

I/O

Description

IN
IN

Index of the KR C variables from 1 to 20


Value of variable

59 of 99

KUKA.PLC Multiprog

8.2.11

ReadToolAct function: reading $ACT_TOOL


This function block can be used to read by means of the variable $ACT_TOOL the current
position of the tool origin.

Fig. 31 ReadToolAct function block symbol


Parameter

8.2.12

I/O

bValid

Data
type
BOOL

X
Y
Z
A
B
C

REAL
REAL
REAL
REAL
REAL
REAL

OUT
OUT
OUT
OUT
OUT
OUT

Element

Description

$ACT_BASE.X
$ACT_BASE.Y
$ACT_BASE.Z
$ACT_BASE.A
$ACT_BASE.B
$ACT_BASE.C

FALSE: no tool present


TRUE: tool present
X coordinate
Y coordinate
Z coordinate
Orientation A
Orientation B
Orientation C

OUT

ReadModeOp function: reading $MODE_OP


This function block can be used to read by means of the variable $MODE_OP the current
operating mode.

Fig. 32 ReadModeOp function block symbol


Parameter
Return value

60 of 99

Data
type
BYTE

I/O

Description

OUT

1: T1
2: T2
3: AUT
4: EXT

KUKA.PLC Multiprog 1.1 10.05.01 en

8.2.13

Libraries (continued)

ReadProState function: Reading $PRO_STATE


This function block can be used to read by means of the variable $PRO_STATE the current
status of the Submit interpreter and robot interpreter.

Fig. 33 ReadProState function block symbol


Parameter

8.2.14

I/O

Description

Index

Data
type
BYTE

IN

Return value

BYTE

OUT

0: Submit interpreter
1: Robot interpreter
0: invalid index
1: no program selected
2: program selected but not yet started
3: program is being executed
4: program stopped
5: program has been completely executed

DisplayKCPNotifyMsg function: displaying acknowledgement messages


This function block can be used to display messages to the user in the PLC application.
Info
This function should not be used to display cyclic messages. Otherwise there is a risk
that individual messages can no longer be displayed, or that the KRC message buffer
will overflow.

Fig. 34 DisplayKCPNotifyMsg function block symbol


Parameter
Msg
Enable

Data
type
STRING
BOOL

KUKA.PLC Multiprog 1.1 10.05.01 en

I/O

Description

IN
IN

A message to be displayed (max. 28 characters)


The trigger for starting the action

61 of 99

KUKA.PLC Multiprog

8.2.15

DisplayKCPStatusMsg function: displaying status messages


This function block can be used to display status messages to the user in the PLC
application. This function sends back an unambiguous message number which can be used
to clear the message (see Section 8.2.16). Status messages cannot be acknowledged.

CAUTION!
This function should not be used to display cyclic messages. Otherwise there is a risk that
individual messages can no longer be displayed, or that the KRC message buffer will
overflow.
Info
This function should not be used to display cyclic messages. Otherwise there is a risk
that individual messages can no longer be displayed, or that the KRC message buffer
will overflow.

Fig. 35 DisplayKCPStatusMsg function block symbol


Parameter
Msg
Enable
MsgNr

8.2.16

Data
type
STRING
BOOL
DINT

I/O

Description

IN
IN
OUT

A message to be displayed (max. 28 characters)


The trigger for starting the action
The unambiguous message number

ClearKCPStatusMsg function: clearing status messages


This function block can be used to have a status message acknowledged by the PLC
program. Status messages cannot be acknowledged by the user.

Fig. 36 ReadPosAct function block symbol


Parameter

62 of 99

I/O

Description

MsgNr

Data
type
DINT

IN

Enable

BOOL

IN

Unambiguous message number from previous call of


DisplayKCPStatusMsg (see Section 8.2.15).
The trigger for starting the action

KUKA.PLC Multiprog 1.1 10.05.01 en

8.2.17

Libraries (continued)

ClearAllKCPStatusMsg function: clearing all status messages


This function block can be used to clear all active status messages.

Fig. 37 ClearAllKCPStatusMsg function block symbol


Parameter
Enable

KUKA.PLC Multiprog 1.1 10.05.01 en

Data
type
BOOL

I/O

Description

IN

The trigger for starting the action

63 of 99

KUKA.PLC Multiprog

8.3

KrcExVarLib library
This library makes it possible to read and write in an array. The KR C makes available the
following array variables, which can be used for data exchange between ProConOS and the
KR C software:
G

$SOFTPLCBOOL[1 to n]

$SOFTPLCINT[1 to n]

$SOFTPLCREAL[1 to n]

Files
This library comprises the following files:
File name
KrcExVarLib.o
tmp.o
KrcExVarLib.fwl
KrcExVarLib.pou

64 of 99

Path
ProConOS library directory
<mwtdir>\MWT\PLC\
FW_LIB\KrcExVarLib
<mwtdir>\MWT\PLC\
FW_LIB\KrcExVarLib
<mwtdir>\MWT\PLC\
FW_LIB\KrcExVarLib

Description
The executable binary file
The description of the MULTIPROG
library
The description of the MULTIPROG
library
The description of the MULTIPROG
library

KUKA.PLC Multiprog 1.1 10.05.01 en

8.3.1

Libraries (continued)

ReadPLCBool, ReadPLCInt, ReadPLCReal functions: reading a single value


The function blocks ReadPLCBool, ReadPLCInt and ReadPLCReal can each be used to
read a single value from an array.
This example shows the function block ReadPLCBool, which reads the value of the KR C
variable $SOFTPLCBOOL[1] and assigns it to the ProConOS variable bValue1.
The result is saved in the variable bResult1.

Fig. 38 ReadPLCBool function block symbol

Parameter
Index
Value

Result

KUKA.PLC Multiprog 1.1 10.05.01 en

Data
type
INT
BOOL
DINT
REAL
BOOL

I/O

Description

IN
OUT
OUT
OUT
OUT

Index valid from 1 to n


Value from the arrayy

TRUE: error
FALSE: OK

65 of 99

KUKA.PLC Multiprog

8.3.2

WritePLCBool, WritePCLInt, WritePLCReal functions: writing a single value


The function blocks WritePLCBool, WritePLCInt and WritePLCReal can each be used to
write a single value to an array.
This example shows the function block WritePLCBool, which reads the value of the KR C
variable $SOFTPLCBOOL[99] and assigns it to the ProConOS variable nValue1. The result
is saved in the variable bResult1.

Fig. 39 WritePCLInt function block symbol

Parameter
Index
Value

Result

66 of 99

Data
type
INT
BOOL
DINT
REAL
BOOL

I/O

Description

IN
OUT
OUT
OUT
OUT

Index valid from 1 to n


Value from the arrayy

TRUE: error
FALSE: OK

KUKA.PLC Multiprog 1.1 10.05.01 en

8.3.3

Libraries (continued)

ReadPLCBoolEx, ReadPLCIntEx, ReadPLCRealEx functions: reading multiple


values
The function blocks ReadPLCBoolEx, ReadPLCIntEx and ReadPLCRealEx can each be
used to read a number of values from an array.
MULTIPROG function block symbol
This example shows the function block ReadPLCBoolEx, which reads the values of the KR C
variable $SOFTPLCBOOL[10 to 29] and assigns them to the ProConOS array arrBool1.
The result is saved in the variable bResult1.

Fig. 40 ReadPLCBoolEx function block symbol

I/O

Description

Index

Data
type
INT

IN

Amount
BoolArray

BYTE
BOOL

IN
OUT

DintArray

DINT

OUT

RealArray

REAL

OUT

Result

BOOL

OUT

The start index for reading within a range of values from 1 to 128.
Number of variables to be read
ProConOS ARRAY[1 to n] which receives the
data from $SOFTPLCBOOL[1 to 128]; is used
with ReadPLCBoolEx
ProConOS ARRAY[1 to n] which receives the
data from $SOFTPLCINT[1 to 128]; is used with
ReadPLCIntEx
ProConOS ARRAY[1 to n] which receives the
data from $SOFTPLCREAL[1 to 128]; is used
with ReadPLCRealEx
TRUE: error
FALSE: OK

Parameter

KUKA.PLC Multiprog 1.1 10.05.01 en

67 of 99

KUKA.PLC Multiprog

8.3.4

WritePLCBoolEx, WritePCLIntEx, WritePLCRealEx functions: writing multiple values


The function blocks WritePLCBoolEx, WritePLCIntEx and WritePLCRealEx can each be
used to write a number of values to an array.
This example shows the function block WritePLCRealEx, which writes the values of the
ProConOS array arrReal1 to the KR C variables $SOFTPLCBOOL[1 to 20]. The result is
saved in the variable bResult1.

Fig. 41 WritePLCRealEx function block symbol

Parameter

68 of 99

I/O

Description

Index

Data
type
INT

IN

Amount
BoolArray

BYTE
BOOL

IN
IN

DintArray

DINT

IN

RealArray

REAL

IN

Result

BOOL

OUT

The start index for reading within a range of values from 1 to 1024.
Number of variables to be read
ProConOS ARRAY[1 to n] from which the data
are written to $SOFTPLCBOOL[1 to n]; is used
with WritePLCBoolEx
ProConOS ARRAY[1 to n] from which the data
are written to $SOFTPLCINT[1 to n]; is used with
WritePLCIntEx
ProConOS ARRAY[1 to n] from which the data
are written to $SOFTPLCREAL[1 to n]; is used
with WritePLCRealEx
TRUE: error
FALSE: OK

KUKA.PLC Multiprog 1.1 10.05.01 en

8.4

Libraries (continued)

SerialLib library
This library enables ProConOS to communicate with external devices by means of a serial
interface.
KR C settings
In order for this library to work properly, several settings have to be made:
G

In the KR C environment, the file hw_inf.ini must be modified. In the section [SERIAL],
the parameter corresponding to each serial port, COM[1] to COM[4], must be set to the
value ENABLE.

In the individual section [COM1] to [COM4] of the file serial.ini , the parameter PROC
must be set to the value 0. This value means that no protocol is used.

The selected port must not be identical to the port defined for serial transmission in the
file ...krc\init\proconos.ini.

Files
File name
SerialLib.o
tmp.o
SerialLib.fwl
SerialLib.pou

KUKA.PLC Multiprog 1.1 10.05.01 en

Path
ProConOS library directory
<mwtdir>\MWT\PLC\
FW_LIB\SerialLib
<mwtdir>\MWT\PLC\
FW_LIB\SerialLib
<mwtdir>\MWT\PLC\
FW_LIB\SerialLib

Description
The executable binary file.
The description of the MULTIPROG
library
The description of the MULTIPROG
library
The description of the MULTIPROG
library

69 of 99

KUKA.PLC Multiprog

8.4.1

SerialOpen function: opening a channel to a serial device


Info
In order to avoid memory fragmentation, this function should not be called cyclically.
This function block can be used to open a channel to a serial device. The channel must be
configured for it to be used.

Fig. 42 SerialOpen function block symbol

70 of 99

Parameter
Enable

Data type
BOOL

I/O
IN

Config

SerConfig

IN

Result

INT

OUT

Port

UINT

OUT

Description
A flag controlled by the rising edge. To execute
the function, it must be called twice. The first
time this parameter is called, the value FALSE
must be assigned, and the second time it is
called, the value TRUE must be assigned.
Structure of the configuration, see following
section Configuring the channel.
0: successful
Otherwise: error (see Section 9.3)
A number referring to the connection; must be
saved for subsequent functions:
SerialClose
(see Section 8.4.2)
SerialReceive (see Section 8.4.3)
SerialSend
(see Section 8.4.4)
SerialCommand (see Section 8.4.5) and
SerialGetInfo
(see Section 8.4.6)

KUKA.PLC Multiprog 1.1 10.05.01 en

Libraries (continued)

Configuring the channel


To configure the channel, the structure SerConfig must be filled out.
TYPE
SerConfig: (* for use with SerialOpen *)
STRUCT
ComPort
: UINT; (* 1=COM1, 2=COM2 etc.)
Baudrate
: UINT;
Options
: INT;
MaxMsgLen
: INT;
END_STRUCT;
END_TYPE
Structure elements
Element
ComPort

Values
1 for COM 1
2 for COM 2

Baudrate

Options
MaxMsgLen

2400
4800
9600 (default value)
19200
---

KUKA.PLC Multiprog 1.1 10.05.01 en

Description
If a serial connection exists between MULTIPROG and ProConOS,
ProConOS the same serial COM
port may not be used (see Section 7.20).
Baud rate of the serial connection.

See following section Channel options


Maximum message length for sending by
means of the function SerialSend
(see Section 8.4.4).

71 of 99

KUKA.PLC Multiprog

Channel options
The options element of the P3964Config structure is bit--coded, and has the following meaning:
Bit pos.
0 and 1

Name
Databits

2 and 3

Parity

Stopbits

Reuse serial interface

Flush buffer

Close hard

8 to 14
15

Reserved
Debug

Description
0: 8 data bits
1: 7 data bits
2: 6 data bits
3: 5 data bits
0: no parity
1: odd parity
2: even parity
3: no parity
0: one stop bit
1: two stop bits
0: The serial interface being used must always
be closed by means for the function SerialClose (see Section 8.4.2).
1: The serial interface is reused without any
previous call of the SerialClose (see Section
8.4.2).
0: The data in the receive and send queues of
the serial interface are not deleted when the
function SerialOpen is called.
1: The data in the receive and send queues of
the serial interface are deleted when the function SerialOpen is called.
0: An error appears when an attempt is made to
close a serial channel which still contains sent
or received data.
1: The channel is closed regardless of
whether or not sent or received data are still
present.
[Reserved for future use]
This option is only available if the parameter
DEBUG (see Section 7.1) is activated.
0: The debug output on the Telnet shell for
this connection is deactivated.
1: The debug output on the Telnet shell for
this connection is activated.

Example
The example shows the use of the parameter in the programming language IL:
VAR
Config : SerialConfig;
VAR_END
LD 16#80D0
(* 8,no,1 reuse=on, flush=on, close hard=on *)
ST Config.Options

72 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

8.4.2

Libraries (continued)

SerialClose function: closing a channel to a serial device


Info
In order to avoid memory fragmentation, this function should not be called cyclically.
This function block can be used to close an existing serial channel.

Fig. 43 SerialClose function block symbol


Parameter

I/O

Description

Enable

Data
type
BOOL

IN

Port

INT

IN

Result

INT

OUT

A flag controlled by a rising edge. To execute the


function, it must be called twice. The first time
this parameter is called, the value FALSE must
be assigned, and the second time it is called, the
value TRUE must be assigned.
A number referring to the connection; was generated by a function call of SerialOpen (see Section 8.4.1).
The port number is no longer valid once this
function has been called.
0: successful
Otherwise: error (see Section 9.3)

KUKA.PLC Multiprog 1.1 10.05.01 en

73 of 99

KUKA.PLC Multiprog

8.4.3

SerialReceive function: reading from a serial device


This function block can be used to receive data by means of a serial channel.

Fig. 44 SerialReceive function block symbol


NOTE
Output parameters of data type ANY are displayed on the left side of the function block.
I/O

Description

Enable

Data
type
BOOL

IN

Port

INT

IN

Timeout

INT

IN

Data

ANY

OUT

Size
Result

INT
INT

IN
OUT

RcvSize

INT

OUT

A flag controlled by a rising edge. To execute the


function, it must be called twice. The first time
this parameter is called, the value FALSE must
be assigned, and the second time it is called, the
value TRUE must be assigned.
Note: After a Receive job has been issued by the
rising edge, the function must be called cyclically
until all of the data have been received or a fault
occurs.
A number referring to the connection; was generated by a function call of SerialOpen (see Section 8.4.1).
The maximum time in milliseconds within which
all data must be received.
A buffer for saving the received data; can be of
any desired data type.
Number of bytes to be received
0: successful
Otherwise: error (see Section 9.3)
Number of bytes received

Parameter

74 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

8.4.4

Libraries (continued)

SerialSend function: writing to a serial device


This function block can be used to send data by means of a serial channel.

Fig. 45 SerialSend function block symbol


NOTE
Output parameters of data type ANY are displayed on the left side of the function block.
I/O

Description

Enable

Data
type
BOOL

IN

Port

INT

IN

Data

ANY

IN

Size
Result

INT
INT

IN
OUT

A flag controlled by a rising edge. To execute the


function, it must be called twice. The first time
this parameter is called, the value FALSE must
be assigned, and the second time it is called, the
value TRUE must be assigned.
A number referring to the connection; was generated by a function call of SerialOpen (see Section 8.4.1).
A buffer for saving the received data; can be of
any desired data type.
Number of bytes to be sent
0: successful
Otherwise: error (see Section 9.3)

Parameter

KUKA.PLC Multiprog 1.1 10.05.01 en

75 of 99

KUKA.PLC Multiprog

8.4.5

SerialCommand function: commands for serial channels


This function block can be used to send a command to a serial channel.

Fig. 46 SerialCommand function block symbol


Parameter

76 of 99

I/O

Description

Enable

Data
type
BOOL

IN

Port

INT

IN

Command

UINT

IN

Param

INT

IN

Result

INT

OUT

A flag controlled by a rising edge. To execute the


function, it must be called twice. The first time
this parameter is called, the value FALSE must
be assigned, and the second time it is called, the
value TRUE must be assigned.
A number referring to the connection; was generated by a function call of SerialOpen (see Section
8.4.1).
Command type
1: All data in the send and receive buffers are
deleted and the channel is emptied when this
function is called with this value. The parameter
Param has no effect here.
2: In order to switch the Telnet debug feature on
and off during runtime, this function block must
be called using this value.
An additional parameter.
0: switches the debug output off
1: switches the debug output on
0: successful
Otherwise: error (see Section 9.3)

KUKA.PLC Multiprog 1.1 10.05.01 en

8.4.6

Libraries (continued)

SerialGetInfo function: information about a serial channel


This function block can be used to obtain information about a serial channel.

Fig. 47 SerialGetInfo function block symbol


Parameter

I/O

Description

Port

Data
type
INT

IN

Info

SerInfo

IN

Result

INT

OUT

A number referring to the channel; was generated


by a function call of SerialOpen
(see Section 8.4.1).
Structure of the configuration
(see section SerInfo information structure)
0: successful
Otherwise: error (see Section 9.3)

SerInfo information structure


TYPE
SerInfo: (* for use with
STRUCT
bSending
bReceiving
nSendPending
nReceivePending
END_STRUCT;
END_TYPE

SerialGetInfo *)
:
:
:
:

BOOL;
BOOL;
UINT;
UINT;

Structure elements Description


bSending
g
FALSE: Sending not active
TRUE: Sending active
bReceiving
g
FALSE: Receiving not active
TRUE: Receiving active
nSendPending
The number of bytes in the output queue
nReceivePending
The number of bytes in the input queue

KUKA.PLC Multiprog 1.1 10.05.01 en

77 of 99

KUKA.PLC Multiprog

8.5

3964Lib library
This library supports serial connections based on the 3964 protocol, thus enabling data
exchange between a 3964R--compatible device and ProConOS.
All data packets sent are transmitted by ProConOS to the 3964 driver. The interface between
ProConOS and the 3964 driver is the library 3964Lib. The serial transfer is the responsibility
of the 3964 task, which is a component of the 3964 driver.
The advantage of this system is that sending and receiving are not executed so that they
block each other, but rather asynchronously. This results in minimal use of CPU capacity
within the ProConOS task.
ProConOS

3964 lib

3964

COM

3964 task

Fig. 48 Connection between ProConOS and 3964--compatible device


Settings
The settings for the data bits, stop bits and parity of the serial ports are made according to
the 3964R specification:
Data bits:

Stop bits:

Parity:

even

KR C settings
In the KR C environment, the file hw_inf.ini must be modified. For each serial port, the
corresponding entry COM[1 to 4] in the section [SERIAL], must be set to the value ENABLE.
This applies to the normal 3964(R) ports and the serial trace ports.

78 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

8.5.1

Libraries (continued)

P3964Open function: creating a connection to a 3964(R) device


Info
In order to avoid memory fragmentation, this function should not be called cyclically.
This function block can be used to create a 3964(R) connection.

Fig. 49 P3964rOpen function block symbol

Parameter
Enable

Data type
BOOL

I/O
IN

Config

P3964Config

IN

Result

INT

OUT

Port

INT

OUT

Description
A flag controlled by a rising edge. To execute the
function within a cycle, it must be called twice.
The first time this parameter is called, the value
FALSE must be assigned, and the second time it
is called, the value TRUE must be assigned.
Structure of the connection, see Configuring
the connection.
0: successful
Otherwise: error (see Section 9.4)
The port number referring to the connection;
must be saved for calling subsequent function
blocks.
P3964Close (see Section 8.5.2),
P3964Receive (see Section 8.5.3) and
P3964Send (see Section 8.5.4).

Configuring the connection


To configure the connection, the structure P3964Config must be filled out.
TYPE
P3964Config:
STRUCT
ComPort
Options
Baudrate
CharTxTime
ZVZ
QVZ
UEBZ
NumSendTelegrams
NumRecvTelegrams
SizeRecvTelegrams
TaskPrio
END_STRUCT;
END_TYPE
KUKA.PLC Multiprog 1.1 10.05.01 en

:
:
:
:
:
:
:
:
:
:
:

INT; (* 1=COM1, 2=COM2 etc.)


INT;
INT;
INT;
INT;
INT;
INT;
INT;
INT;
INT;
INT;

79 of 99

KUKA.PLC Multiprog

Structure elements
Description
If a serial connection exists between
MULTIPROG and ProConOS, the same
serial COM port may not be used (see
2 for COM 2
Section 7.20).
Options
See the following table Connection options for details
Baudrate
2400
Baud rate for the serial connection
4800
9600 (default value)
19200
CharTxTime
0 (default value)
Time in milliseconds to send a character
ZVZ
220 (default value)
Maximum time in milliseconds between
receiving two characters
QVZ
2000 (default value) Time in milliseconds within which a receiving device must answer the request to
send of a connected device (with DLE)
UEBZ
4000 (default value) The monitoring time
NumSendTelegrams 10 (default value)
The maximum number of sent telegrams
buffered
NumRecvTelegrams 10 (default value)
The maximum number of received telegrams buffered
SizeRecvTelegrams 500 (default value)
The maximum size of a received telegram
in bytes
TaskPrio
PRIOINTERNAL
The priority of send and receive tasks
(see Section 7.7)

Element
ComPort

80 of 99

Values
1 for COM 1

KUKA.PLC Multiprog 1.1 10.05.01 en

Libraries (continued)

Connection options
The options element of the P3964Config structure is bit--coded, and has the following
meaning:
Bit pos.
0

Name
Protocol type
yp

Reuse serial interface

Protocol priority
p
y

3 to 11
12

Reserved
Debug

13

Trace

14 and 15

Trace interface

Description
0: 3964R
1: 3964
0: The serial interface being used must always be
closed by means of P3964Close.
1: The serial interface is reused without any previous
call of P3964Close.
0: low
1: high
Reserved for future use
To use this option, the entry DEBUG must be set in
the file ProConOS.ini.
0: The debug output on the Telnet shell for this connection is deactivated.
1: The debug output on the Telnet shell for this connection is activated.
This option may only be used by experienced
users! It should only be used for debug purposes,
since it increases the execution time of the
function block.
0: Trace option is deactivated
1: Trace output to the additional serial interface is
activated
The interface for the trace output. These two bits
are only evaluated if bit 13 is set to the value 1.
Interfaces may not be used more than once.
00: COM 1
01: COM 2
10: COM 3
11: COM 4

Example
The example shows the use of the parameter in the programming language IL:
VAR
Config : P3964Config;
VAR_END
LD 16#0002
ST Config.Options

KUKA.PLC Multiprog 1.1 10.05.01 en

(* reuse serial interface = on *)

81 of 99

KUKA.PLC Multiprog

8.5.2

P3964Close function: closing a connection to a 3964(R) device


This function block can be used to close an existing connection.

Fig. 50 P3964rClose function block symbol


Parameter

82 of 99

I/O

Description

Enable

Data
type
BOOL

IN

Port

INT

IN

Result

INT

OUT

A flag controlled by a rising edge. To execute the


function, it must be called twice. The first time
this parameter is called, the value FALSE must
be assigned, and the second time it is called, the
value TRUE must be assigned.
A number referring to the connection; was generated by a function call of 3964Open
(see Section 8.5.1).
The port number is no longer valid once this
function has been called.
0: successful
1: error (see Section 9.4)

KUKA.PLC Multiprog 1.1 10.05.01 en

8.5.3

Libraries (continued)

P3964Receive function: reading from a 3964(R) device


This function block can be used to receive data by means of a 3964(R) connection.

Fig. 51 P3964rReceive function block symbol


Info
Output parameters of data type ANY are displayed on the left side of the function block.
I/O

Description

Port

Data
type
INT

IN

Result

INT

OUT

Data

ANY

OUT

Size

INT

OUT

A number referring to the connection; was generated by a function call of 3964Open


(see Section 8.5.1)
0: successful
40: receive buffer empty
Otherwise: error (see Section 9.4)
A buffer for saving the received data; can be of
any desired data type.
Number of bytes received

Parameter

KUKA.PLC Multiprog 1.1 10.05.01 en

83 of 99

KUKA.PLC Multiprog

8.5.4

P3964Send function: writing to a 3964(R) device


This function block can be used to send data by means of a P3964(R) connection.

Fig. 52 P3964rSend function block symbol


Info
Output parameters of data type ANY are displayed on the left side of the function block.
I/O

Description

Enable

Data
type
BOOL

IN

Port

INT

IN

Data

ANY

IN

Size
Result

INT
INT

IN
OUT

A flag controlled by a rising edge. To execute the


function, it must be called twice. The first time
this parameter is called, the value FALSE must
be assigned, and the second time it is called, the
value TRUE must be assigned.
A number referring to the connection; was generated by a function call of 3964Open
(see Section 8.5.1).
A buffer containing the data to be sent; can be of
any desired data type.
The number of bytes to be sent.
0: successful
Otherwise: error (see Section 9.4)

Parameter

84 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

8.6

Libraries (continued)

KcpLib library
The functions of this library can be used to give PLC programs access to the keys of the KCP.
The information of the KCP key is transmitted to the active application by means of the CAN
bus and the Windows operating system. If the active application is a visualization system with
an embedded KCP OCX, then the information of the KCP key is transmitted to ProConOS
via OPC and written to the variable nKcpKeyInfo, which must be declared as DINT and be
accessible via OPC.
This variable must be linked to the input with the same name in the function module
KcpSetKeys (see Section 8.6.1). In addition to information about which key is being pressed,
the variable also holds the screen number. This enables ProConOS to execute the
corresponding actions, depending on which screen is being displayed on the visualization
(see Section 8.6.4).
KR C
Windows operating system
KCP controller
(KCP OCX)
OPC

Windows system

TCP/IP

KCP service

KCP task

ProConOS
runtime system

KcpLib
library

CAN bus

KR C
VxWorks real--time operating system

Fig. 53 Access by ProConOS to KCP keys

KUKA.PLC Multiprog 1.1 10.05.01 en

85 of 99

KUKA.PLC Multiprog

8.6.1

KcpSetKeys function: supply key information to library


This function block can be used to feed information about the KCP keys to the library KcpLib.
This function may only be called once per cycle.

Fig. 54 KcpSetKeys function block symbol


Parameter
nKcpKeyInfo
nResult

8.6.2

Data
type
DINT
INT

I/O

Description

IN
OUT

The KCP key information received via OPC


0: OK
--1: error, wrong data type at the input of the
function nKcpKeyInfo

KcpSystemKeys function: KCP system keys


This function block can be used to have three KCP system keys processed in the PLC
program.

Fig. 55 KcpSystemKeys function block symbol


Parameter

86 of 99

I/O

Description

bStop

Data
type
BOOL

OUT

bStartPlus

BOOL

OUT

bStartMinus

BOOL

OUT

Program stop key: The output becomes TRUE if


this KCP key is pressed
Program start forwards key: The output becomes
TRUE if this KCP key is pressed
Program start backwards key: The output becomes
TRUE if this KCP key is pressed

KUKA.PLC Multiprog 1.1 10.05.01 en

8.6.3

Libraries (continued)

KcpLeftKeys function: left--hand KCP status keys


This function block can be used to process the status of the six left--hand KCP keys in the
PLC program.

Fig. 56 KcpLeftKeys function block symbol


Parameter

I/O

Description

byValidPictureNum

Data
type
BYTE

IN

bLeft1

BOOL

OUT

The screen number of the visualization which is


valid for this instance of the function block
First left--hand KCP key: The output becomes
TRUE if this KCP key is pressed and the screen
number is valid

to ...
bLeft6

BOOL

OUT

KUKA.PLC Multiprog 1.1 10.05.01 en

Sixth left--hand KCP key: The output becomes


TRUE if this KCP key is pressed and the screen
number is valid

87 of 99

KUKA.PLC Multiprog

8.6.4

KcpTopKeys function: KCP menu keys


This function block can be used to process the status of the eight upper KCP keys in the PLC
program.

Fig. 57 KcpTopKeys function block symbol


Parameter

88 of 99

I/O

Description

byValidPictureNum

Data
type
BYTE

IN

bTop1

BOOL

OUT

The screen number of the visualization which is


valid for this instance of the function block
Left--hand upper KCP key: The output becomes
TRUE if this key is pressed and the screen
number is valid

to ...
bTop8

BOOL

OUT

Right--hand upper KCP key: The output


becomes TRUE if this key is pressed and the
screen number is valid

KUKA.PLC Multiprog 1.1 10.05.01 en

8.6.5

Libraries (continued)

KcpRightKeys function: right--hand KCP status keys


This function block can be used to process the status of the KCPs six plus keys and six minus
keys in the PLC program.

Fig. 58 KcpRightKeys function block symbol


Parameter

I/O

Description

byValidPictureNum

Data
type
BYTE

IN

bRightMinus1

BOOL

OUT

The screen number of the visualization which is


valid for this instance of the function block
First KCP minus key: The state becomes TRUE
if this KCP key is pressed and the screen
number is valid

to ...
bRightPlus6

BOOL

OUT

KUKA.PLC Multiprog 1.1 10.05.01 en

Sixth KCP plus key: The state becomes TRUE


if this KCP key is pressed and the screen
number is valid

89 of 99

KUKA.PLC Multiprog

8.6.6

KcpBottomKeys function: lower KCP softkeys


This function block can be used to process the seven lower KCP keys in the PLC program.

Fig. 59 KcpBottomKeys function block symbol


Parameter

90 of 99

I/O

Description

byValidPictureNum

Data
type
BYTE

IN

bBottom1

BOOL

OUT

The screen number of the visualization which is


valid for this instance of the function block
Left--hand lower KCP key: The state becomes
TRUE if this KCP key is pressed and the screen
number is valid

to ...
bBottom7

BOOL

OUT

Right--hand lower KCP key: The state becomes


TRUE if this KCP key is pressed and the screen
number is valid

KUKA.PLC Multiprog 1.1 10.05.01 en

8.6.7

Libraries (continued)

Example: time switching diagram


This example shows the time switching diagram of the KCP key and two instances of the
function block KcpTopKeys, which is used with various screen numbers.
A special sequence is defined which ensures that an action started with a particular screen
number is completely executed.

(not pressed)
KCP key

Screen
no. 1

Screen
no. 2

Screen Screen
no. 1
no. 2

(pressed)
fb output #1
fb output #2

Time
Fig. 60 Time switching diagram of the KCP key

Fig. 61 KcpTopKeys 1 function block symbol

Fig. 62 KcpTopKeys 2 function block symbol

KUKA.PLC Multiprog 1.1 10.05.01 en

91 of 99

KUKA.PLC Multiprog

8.7

AutoExtLib library
The function blocks KRC_AutoExt and VKRC_AutoExt from the ProConOS library AutoExt-Lib, make it possible to operate the Automatic External interfaces of the KR C and VKR C
directly, without the need to use ProConOS I/Os. If an attempt is made to use the wrong block
for the specific controller, an error message is generated when the project is downloaded in
Multiprog.
The required signal declarations are read from the files C:\KRC\Roboter\KRC\R1\System\$Config.dat and C:\KRC\Roboter\KRC\Steu\Mada\$Machine.dat. The associated I/Os
are read or written directly by the function blocks.
The entry SIGNALFILES in the file ProConOS.ini is automatically set by the setup program
and should not be modified.
The signal files are read in accordance with the entry SIGNALFILEREAD. If this entry is set
to =BOOT, the signal files are read once when ProConOS or the controller is started.
Otherwise, the signal files are reloaded every time ProConOS program execution is started.
If Automatic External interface signals are to be reconfigured, ProConOS must be stopped
and restarted.
More detailed information can be found in the relevant controller documentation.

92 of 99

KUKA.PLC Multiprog 1.1 10.05.01 en

8.7.1

Libraries (continued)

Function: KRC_AutoExt
The function block KRC_AutoExt can be used in the KR C to operate the Automatic
External interface.
To select a KRL program, its program number must be applied to the input PGNO and
acknowledged in accordance with the value of the variable PGNO_VALID. The actual
program number and parity are formed according to the values of PGNO_FBIT,
PGNO_LENGTH , PGNO_TYPE, and PGNO_PARITY.
If the program number at input PGNO cannot be displayed with the bits defined in
PGNO_LENGTH, program number 0 is written to the input map.

Fig. 63 Function block symbol KRC_AutoExt

KUKA.PLC Multiprog 1.1 10.05.01 en

93 of 99

KUKA.PLC Multiprog

94 of 99

Parameter
PGNO
PGNO_VALID
EXT_START
MOVE_ENABLE
CONF_MESS
DRIVES_ON
DRIVES_OFF
I_O_ACT

Data typ
INT
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL

Variable KRL
PGNO_FBIT
PGNO_VALID
$EXT_START
$MOVE_ENABLE
$CONF_MESS
$DRIVES_ON
$DRIVES_OFF
$I_O_ACT

Meaning
Program number
Program number valid
Program start
Drives enable
Acknowledge messages
Switch on drives
Switch off drives
Activate interface

STOPMESS
ALARM_STOP
USER_SAF
PGNO_REQ
PGNO_REFL

BOOL
BOOL
BOOL
BOOL
INT

$STOPMESS
$ALARM_STOP
$USER_SAF
PGNO_REQ
PGNO_FBIT_REFL

APPL_RUN
PERI_RDY
T1
T2
AUT
EXT
ON_PATH
NEAR_POSRET
PRO_ACT
PRO_MOVE
IN_HOME
IN_HOME1
IN_HOME2
IN_HOME3
IN_HOME4
IN_HOME5
ERR_TO_PLC
RC_RDY1
ROB_CAL
I_O_ACTCONF
ROB_STOPPED

BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL

APPL_RUN
$PERI_RDY
$T1
$T2
$AUT
$EXT
$ON_PATH
$NEAR_POSRET
$PRO_ACT
$PROMOVE
$IN_HOME
$IN_HOME1
$IN_HOME2
$IN_HOME3
$IN_HOME4
$IN_HOME5
ERR_TO_PLC
$RC_RDY1
$ROB_CAL
$I_O_ACTCONF
$ROB_STOPPED

Robot collective fault


Robot Emergency Stop
Operator safety
Program number request
Reflected program number, --1 if
deactivated
(REFLECT_PROG_NR=0)
Robot program running
Drives are activated
T1 mode
T2 mode
Automatic mode
External mode
Robot on path
Robot near the path
Robot program execution active
Robot program motion active
Robot in home position 1
Robot in home position 2
Robot in home position 3
Robot in home position 4
Robot in home position 5
Robot in home position 6
Controller or technology fault
Controller ready
Robot mastered
Interface active
Robot not in motion

KUKA.PLC Multiprog 1.1 10.05.01 en

8.7.2

Libraries (continued)

Function: VKRC_AutoExt
The function block VKRC_AutoExt can be used in the VKR C to operate the Automatic
External interface.
To select a KRL Folge (program), its Folge number must be applied to the input FOLGE and
acknowledged at the input SRB.
The actual Folge number is formed according to the values of P_FBIT, P_LEN and P_TYPE.

Fig. 64 Funktionsblocksymbol VKRC_AutoExt

Parameter
ANTEIN
SRB
FOLGE

Data typ
BOOL
BOOL
INT

Variable KRL
$DRIVES_ON
SRB
P_FBIT

Meaning
Drives enable
Start Folge
Folge number

BEREIT
FOLGE_REFL
FOLGE_ALT
RK23
RK8
RK9
RK100
WPROZ
WSLAV
LPKT
PF0
SAK

BOOL
INT
INT
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL
BOOL

$RC_RDY1
R_FBIT
P_OLD
$PR_MODE
$SS_MODE
$EXT
RK100
WPROZ
WSLAV
LPKT
PF0
$NEAR_POSRET

Ready for operation


Reflected Folge number
Last Folge in Automatic mode
Programming mode
Single Step Betrieb
Automatic mode
Enable start actuators
Wait for process
Wait for slave
Last point reached
Home position
Block coincidence, robot on path

KUKA.PLC Multiprog 1.1 10.05.01 en

95 of 99

KUKA.PLC Multiprog

Troubleshooting

9.1

Log file proconos.log


Errors are logged in the file proconos.log, and provide information about possible causes.
Error
Error message in MULTIPROG
Invalid firmware function or
function block xxx

Remedy
G
Ensure that the file name of the library is entered
as the value of the parameter LIBRARIES
(see Section 7.18).

Ensure that the corresponding library file is


located in the ProConOS library directory (see
Section 7.17).
Serial function blocks are not dis- Link library in MULTIPROG
played in MULTIPROG.
G

9.2

Error codes for ExtensionLib library


Error code
0
--1
--2
--3
--4
--5
--6
--7
--8
--9
--10
--11
--12

96 of 99

Description
Action successfully completed
General error
An operation has already been started for this file
The parameter FileId is invalid
File not present
Internal error: Unknown command
An attempt has been made to open more than 31 files
Internal error: No system memory available
Internal error: Message queue
End of file reached
File was opened as read--only
File was opened as write--only
Buffer too small

KUKA.PLC Multiprog 1.1 10.05.01 en

9.3

Troubleshooting (continued)

Error codes for library SerialLib


Error code
--1
--2

--3
--4
--5
--6
--7
--8
--9
--10
--11
--12
--13
--14

KUKA.PLC Multiprog 1.1 10.05.01 en

Description
General error
User buffer is too small
In SerialOpen, the size of the SerialConfig structure is incorrect
and must be changed.
Change the size of the send/receive buffer in SerialSend/SerialReceive.
The maximum length of a ProConOS string is 80 characters.
Timeout received
Reception failed
Send/receive already active
Underlying serial initiation failed
Underlying serial opening failed
Underlying serial closing failed
Maximum number of instances reached
Invalid instance: check port number
Receive buffer empty. (information rather than an error)
Serial interface is already in use. Change the serial interface and
define the Reuse serial interface bit in the configuration
Unknown command: check command parameters of the SerialCommand function block
Serial hardware driver does not support the modification of data
bits, parity and stop bits.
Define: data bits=0, parity=no and stop bits=1

97 of 99

KUKA.PLC Multiprog

9.4

Error codes for 3964Lib library


Error code
--1
1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
30
31

32
33
34
35
36
37
38
39
40
41
42

98 of 99

Description
General error
User buffer is too small. In x3964rOpen, the size of the P3964 Config
structure is incorrect, and must be changed. The size of the send/receive
buffer must be changed in x3964rSend/x3964rReceive. The maximum
length of a ProConOS string is 80 characters
Delete telegram by means of ioctl()
Transfer aborted
Internal receive buffer too small
No receive buffer available
No queue available for messages
No memory available
Fatal internal error
Timeout when reading from serial device
Cannot establish connection (no DLE)
No DLE received
A character was received during transmission
Individual DLEs not receiving any DLW+DLE or DLE+ETX
Unable to transfer message
Impermissible character was received (no STX)
BCC checksum error
Both partners have high priority
Cannot configure serial device: check baud rate
Cannot open serial device
KR C: Activate serial device in hw_inf.ini and set PROC=0 to standalone
in serial.ini: Change the file vxworks.st to a version which supports serial
interfaces (contact the supplier)
Cannot close serial channel
Cannot open 3964 channel
Cannot create 3964 channel
Cannot create 3964 channel
Cannot open 3964 channel
Cannot find 3964 channel
Maximum number of 3964 instances reached
Invalid instance: check port number
Receive buffer empty. This is not an error, but is provided for your
information.
Serial interface is already in use. Change the serial interface and set the
reuse bit in the configuration.
Send queue is full. P3964Send called too often; reduce frequency or
increase baud rate.
To eliminate this error, terminate the connection and establish it again.

KUKA.PLC Multiprog 1.1 10.05.01 en

Troubleshooting (continued)

KUKA.PLC Multiprog 1.1 10.05.01 en

99 of 99

Index

Symbols

$SOFTPLCBOOL, 64
$SOFTPLCINT, 64
$SOFTPLCREAL, 64

DEBUG, 28
Deleting a file, 47
DELRETAIN, 31
DELRETAINFILE, 31
Displaying acknowledgement messages, 61
Displaying status messages, 62
DisplayKCPNotifyMsg, 61
DisplayKCPStatusMsg, 62

Numbers
3964Lib, 78, 98

A
AUTOARCHIVERETAIN, 31

E
ExtensionLib, 38, 96

B
BAUDRATE, 36
BINPATH, 32

F
File information, 46
File services, 40
FileClose, 42
FileDelete, 47
FileGetInfo, 46
FileOpen, 41
FileRead, 44
FileSeek, 45
FileWrite, 43

C
Call up status of ProConOS, 26
Changing the file position, 45
ClearAllKCPStatusMsg, 63
Clearing all status messages, 63
Clearing status messages, 62
ClearKCPStatusMsg, 62
Closing a channel to a serial device, 73
Closing a connection to a 3964(R) device, 82
Closing a file, 42
College, 6
COM, 35
Commands for serial channels, 76
Configuration, 14
Configuring a peripheral interface and peripheral I/Os, 18
Configuring a task priority in ProConOS, 15
Configuring allotment of CPU computing time to
tasks, 16
Configuring ProConOS, 17
Configuring the ProConOS/KRC interface and
communication I/Os, 19
Configuring the ProConOS/MULTIPROG interface, 22
Configuring the robot controller, 17
Controlling ProConOS by means of KRL, 26
CPU computing time, 15, 16
CPUASSIGNMENT, 16, 30, 34
Creating a connection to a 3964(R) device, 79
Creating a ProConOS file directory, 23
Index -- i

H
Hard disk space, 12
Hardware requirements, 11, 12
High Level tasks, 15

I
I/O mapping, 18
Information about a serial channel, 77
Installation, 10
Installing components, 10
Interbus, 21
IOCTL, 26

K
KCP menu keys, 88
KCP system keys, 86
KcpBottomKeys, 90
KcpLeftKeys, 87
KcpLib, 85, 92
KcpRightKeys, 89

Index

KcpSetKeys, 86
KcpSystemKeys, 86
KcpTopKeys, 88
KrcExVarLib, 64
KrcExVarLib.fwl, 64
KrcExVarLib.o, 64
KrcExVarLib.pou, 64
KrcLib, 51
KRL, 26
KUKA College, 6
KUKA Router, 22

Preconditions for installation, 10


PRIOINTERNAL, 15, 30
PRIOSYSTEM, 15, 29
PRIOUSER, 15, 29
PRIOVISOR, 15, 29
ProConOS, 8
ProConOS Default task, 15
ProConOS Internal tasks, 15
ProConOS Level tasks, 15
ProConOS parameters, 28
ProConOS priorities model, 15
ProConOS real--time operating system, 8
ProConOS Supervisor tasks, 15
ProConOS User tasks, 15
PROCONOS.LOG, 96
proconos.log, 96
Provide CPU computing time, 39

L
Left--hand KCP status keys, 87
LIBPATH, 33
LIBRARIES, 33
Log file PROCONOS.LOG, 96
Low Level tasks, 15
Lower KCP softkeys, 90

M
MAXCAPACITY, 16, 30
MINCAPACITY, 16, 30
MULTIPROG, 8
MULTIPROG sample project, 8

N
nDrvNum, 26
nFunction, 26
nParameter, 26

O
Opening a channel to a serial device, 70
Opening a file, 41

P
P3964Close, 82
P3964Open, 79
P3964Receive, 83
P3964Send, 84
PLC development environment, 8
PLC tasks, 15
PlcSleep, 39

R
ReadAxisAct, 51
ReadAxisActEx, 53
ReadBaseAct, 55
Reading, 65, 67
Reading $ACT_BASE, 55
Reading $ACT_TOOL, 60
Reading $AXIS_ACT, 51, 53
Reading $MODE_OP, 60
Reading $OV_PRO, 56
Reading $POS_ACT, 57
Reading $PRO_STATE, 61
Reading $SEN_PINT[ ], 58
Reading $SEN_PREA[ ], 59
Reading data, 44
Reading from a 3964(R) device, 83
Reading from a serial device, 74
ReadModeOp, 60
ReadOvPro, 56
ReadPLC, 65
ReadPLC*Ex, 67
ReadPosAct, 57
ReadProState, 61
ReadSenInt, 58
ReadSenReal, 59
ReadToolAct, 60
RELOAD, 28
RESET, 28
Index -- ii

Index

RESTOREOUTPUTS, 32
RETAINSIZE, 32
Right--hand KCP status keys, 89
Robot Programmer, 6
Robot tasks, 15
ROOTPATH, 32

S
Safety, 6
Save remanent data by program, 38
SaveRetain, 38
Scheduler, 24
Scheduler , 15
SERIAL, 35
SerialClose, 73
SerialCommand, 76
SerialGetInfo, 77
SerialLib, 69, 97
SerialLib.fwl, 69
SerialLib.o, 69
SerialLib.pou, 69
SerialOpen, 70
SerialReceive, 74
SerialSend, 75
Setup, 10
Software license, 10
Software requirements, 11, 12
Start ProConOS, 26
Stop ProConOS, 26
Supply key information to library, 86
System resources, 15

T
Target group, 6
Telnet, 22
tmp.o, 64, 69
Trademarks, 7
Training, 6
Troubleshooting, 96

V
VxWin, 22

Index -- iii

W
WriteOvPro, 56
WritePLC, 66
WritePLC*Ex, 68
WriteSenInt, 58
WriteSenReal, 59
Writing, 66, 68
Writing $OV_PRO, 56
Writing $SEN_PINT[ ], 58
Writing $SEN_PREA[ ], 59
Writing data, 43
Writing to a 3964(R) device, 84
Writing to a serial device, 75

S-ar putea să vă placă și