Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
KR C ...
KUKA.PLC Multiprog
Release 1.1
Version: 01
1 of 99
e Copyright 2005
2 of 99
Contents
1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1
Target group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2
Safety . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3
1.4
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
KUKA.PLC Multiprog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10
3.1
10
3.2
3.2.1
3.2.2
10
11
12
Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14
4.1
15
4.2
16
4.3
17
4.4
Configuring ProConOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17
4.5
4.5.1
4.5.2
4.5.3
18
18
19
20
4.6
22
4.7
23
Scheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
24
26
6.1
26
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
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
8.2.11
8.2.12
8.2.13
8.2.14
8.2.15
8.2.16
8.2.17
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
96
9.2
96
9.3
97
9.4
98
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
1.3
Introduction (continued)
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.
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
KR C controller
Development computer
MULTIPROG
KUKA Router
KR C controller
8 of 99
9 of 99
KUKA.PLC Multiprog
Installation
3.1
3.2
10 of 99
3.2.1
Installation (continued)
--
--
--
--
--
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)
(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)
(5)
The KR C must be rebooted to save the registration entries for the OPC Server. The
installation process is now complete.
11 of 99
KUKA.PLC Multiprog
3.2.2
--
--
--
--
--
--
--
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)
(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)
(5)
The KR C must be rebooted to save the registration entries for the OPC Server. The
installation process is now complete.
12 of 99
Installation (continued)
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
4.1
Configuration (continued)
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
Priority
0
141
200
201
216
218
235
250
Lowest priority
15
Number of tasks
15 of 99
KUKA.PLC Multiprog
4.2
Te
ProConOS level
T1
Default
Default
Default
Ts
Ts
Low level
250
Time
16 of 99
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.
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)
17 of 99
KUKA.PLC Multiprog
4.5
4.5.1
Periphery
KR C
Inputs
Outputs
Outputs
Inputs
KRC Byte
start address
Length
Outputs
Start address
KRC Byte
start address
Length
18 of 99
4.5.2
Configuration (continued)
KR C
Inputs
Inputs
KRC Byte
start address
Start address
Length
INPUT
Outputs
Start address
Length
OUTPUT
Outputs
KRC Byte
start address
19 of 99
KUKA.PLC Multiprog
4.5.3
I/O configuration
Configuration (continued)
21 of 99
KUKA.PLC Multiprog
4.6
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
4.7
Configuration (continued)
(2)
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
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
Scheduler (continued)
25 of 99
KUKA.PLC Multiprog
6.1
Start ProConOS
Stop ProConOS
Parameters
G
Driver number (nDrvNum): The driver number can be obtained from the file iosys.ini
(see Section 4.3)
Action
Call up status
of ProConOS
Start ProConOS
Co
OS
Stop
p ProC OS
ConOS
26 of 99
Function
no.
nFunction
3
Parameter
1000
1001
nParameter
0
Return value
Syntax
IOCTL ( INT nDrvNum, INT nFunction, INT nParameter) : INT
Example
Call up status of ProConOS
PLCSTATE = IOCTL(13,3,0)
RESULT = IOCTL(13,1000,1)
Stop ProConOS
RESULT = IOCTL(13,1001,0)
27 of 99
KUKA.PLC Multiprog
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
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
RESET=2
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
7.4
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
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
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
PRIOSYSTEM=250
Lowest priority
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)
7.8
PRIOINTERNAL=0
Highest priority
PRIOINTERNAL=200
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
MINCAPACITY=50
MINCAPACITY=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
MAXCAPACITY=70
MAXCAPACITY=100
7.10
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
DELRETAIN=1
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
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
AUTOARCHIVERETAIN=1
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
RESTOREOUTPUTS parameter
Reconfigure I/O system triggers the following processes in the KR C:
G
Range of values
7.15
RESTOREOUTPUTS=0
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
7.17
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
LIBRARIES=KrcLib.o
LIBRARIES=KrcExVarLib.o
LIBRARIES=SerialLib.o
LIBRARIES=3964Lib.o
LIBRARIES=KcpLib.o
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]
34 of 99
7.20
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=1
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
COM=2
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
BAUDRATE=4800
BAUDRATE=9600
BAUDRATE=19200
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
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
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.
8.1.2
Libraries (continued)
Data
type
BOOL
I/O
Description
IN
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
8.1.3.1
Libraries (continued)
I/O
Description
Enable
Data
type
BOOL
IN
FileName
STRING
IN
Options
p
BYTE
IN
Done
BOOL
OUT
Result
INT
OUT
FileId
BYTE
OUT
41 of 99
KUKA.PLC Multiprog
8.1.3.2
42 of 99
I/O
Description
Enable
Data
type
BOOL
IN
FileId
BYTE
IN
Done
BOOL
OUT
Result
INT
OUT
8.1.3.3
Libraries (continued)
I/O
Description
Enable
Data
type
BOOL
IN
FileId
BYTE
IN
Data
ANY
IN
Done
BOOL
OUT
Result
INT
OUT
43 of 99
KUKA.PLC Multiprog
8.1.3.4
Description
Enable
Data
type
BOOL
IN
FileId
BYTE
IN
Data
ANY
OUT
Size
Done
INT
BOOL
IN
OUT
Result
INT
OUT
Parameter
44 of 99
8.1.3.5
Libraries (continued)
I/O
Description
Enable
Data
type
BOOL
IN
FileId
BYTE
IN
Start
BYTE
IN
Offset
INT
IN
Done
BOOL
OUT
Result
INT
OUT
45 of 99
KUKA.PLC Multiprog
8.1.3.6
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
8.1.3.7
Libraries (continued)
I/O
Description
Enable
Data
type
BOOL
IN
FileName
Done
STRING
BOOL
INT
OUT
Result
INT
OUT
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.
48 of 99
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
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
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
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
52 of 99
8.2.2
Libraries (continued)
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
54 of 99
8.2.3
Libraries (continued)
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
OUT
55 of 99
KUKA.PLC Multiprog
8.2.4
8.2.5
56 of 99
8.2.6
Libraries (continued)
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
$POS_ACT.X
$POS_ACT.Y
$POS_ACT.Z
$POS_ACT.A
$POS_ACT.B
$POS_ACT.C
OUT
57 of 99
KUKA.PLC Multiprog
8.2.7
8.2.8
Data
type
BYTE
DINT
I/O
Description
IN
OUT
58 of 99
Data
type
BYTE
DINT
I/O
Description
IN
OUT
8.2.9
Libraries (continued)
8.2.10
Data
type
BYTE
DINT
I/O
Description
IN
OUT
Data
type
BYTE
REAL
I/O
Description
IN
IN
59 of 99
KUKA.PLC Multiprog
8.2.11
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
OUT
60 of 99
Data
type
BYTE
I/O
Description
OUT
1: T1
2: T2
3: AUT
4: EXT
8.2.13
Libraries (continued)
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
Data
type
STRING
BOOL
I/O
Description
IN
IN
61 of 99
KUKA.PLC Multiprog
8.2.15
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.
8.2.16
Data
type
STRING
BOOL
DINT
I/O
Description
IN
IN
OUT
62 of 99
I/O
Description
MsgNr
Data
type
DINT
IN
Enable
BOOL
IN
8.2.17
Libraries (continued)
Data
type
BOOL
I/O
Description
IN
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
8.3.1
Libraries (continued)
Parameter
Index
Value
Result
Data
type
INT
BOOL
DINT
REAL
BOOL
I/O
Description
IN
OUT
OUT
OUT
OUT
TRUE: error
FALSE: OK
65 of 99
KUKA.PLC Multiprog
8.3.2
Parameter
Index
Value
Result
66 of 99
Data
type
INT
BOOL
DINT
REAL
BOOL
I/O
Description
IN
OUT
OUT
OUT
OUT
TRUE: error
FALSE: OK
8.3.3
Libraries (continued)
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
67 of 99
KUKA.PLC Multiprog
8.3.4
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
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
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
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)
Libraries (continued)
Values
1 for COM 1
2 for COM 2
Baudrate
Options
MaxMsgLen
2400
4800
9600 (default value)
19200
---
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.
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
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
8.4.2
Libraries (continued)
I/O
Description
Enable
Data
type
BOOL
IN
Port
INT
IN
Result
INT
OUT
73 of 99
KUKA.PLC Multiprog
8.4.3
Description
Enable
Data
type
BOOL
IN
Port
INT
IN
Timeout
INT
IN
Data
ANY
OUT
Size
Result
INT
INT
IN
OUT
RcvSize
INT
OUT
Parameter
74 of 99
8.4.4
Libraries (continued)
Description
Enable
Data
type
BOOL
IN
Port
INT
IN
Data
ANY
IN
Size
Result
INT
INT
IN
OUT
Parameter
75 of 99
KUKA.PLC Multiprog
8.4.5
76 of 99
I/O
Description
Enable
Data
type
BOOL
IN
Port
INT
IN
Command
UINT
IN
Param
INT
IN
Result
INT
OUT
8.4.6
Libraries (continued)
I/O
Description
Port
Data
type
INT
IN
Info
SerInfo
IN
Result
INT
OUT
SerialGetInfo *)
:
:
:
:
BOOL;
BOOL;
UINT;
UINT;
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
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
8.5.1
Libraries (continued)
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).
:
:
:
:
:
:
:
:
:
:
:
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
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
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
81 of 99
KUKA.PLC Multiprog
8.5.2
82 of 99
I/O
Description
Enable
Data
type
BOOL
IN
Port
INT
IN
Result
INT
OUT
8.5.3
Libraries (continued)
Description
Port
Data
type
INT
IN
Result
INT
OUT
Data
ANY
OUT
Size
INT
OUT
Parameter
83 of 99
KUKA.PLC Multiprog
8.5.4
Description
Enable
Data
type
BOOL
IN
Port
INT
IN
Data
ANY
IN
Size
Result
INT
INT
IN
OUT
Parameter
84 of 99
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
85 of 99
KUKA.PLC Multiprog
8.6.1
8.6.2
Data
type
DINT
INT
I/O
Description
IN
OUT
86 of 99
I/O
Description
bStop
Data
type
BOOL
OUT
bStartPlus
BOOL
OUT
bStartMinus
BOOL
OUT
8.6.3
Libraries (continued)
I/O
Description
byValidPictureNum
Data
type
BYTE
IN
bLeft1
BOOL
OUT
to ...
bLeft6
BOOL
OUT
87 of 99
KUKA.PLC Multiprog
8.6.4
88 of 99
I/O
Description
byValidPictureNum
Data
type
BYTE
IN
bTop1
BOOL
OUT
to ...
bTop8
BOOL
OUT
8.6.5
Libraries (continued)
I/O
Description
byValidPictureNum
Data
type
BYTE
IN
bRightMinus1
BOOL
OUT
to ...
bRightPlus6
BOOL
OUT
89 of 99
KUKA.PLC Multiprog
8.6.6
90 of 99
I/O
Description
byValidPictureNum
Data
type
BYTE
IN
bBottom1
BOOL
OUT
to ...
bBottom7
BOOL
OUT
8.6.7
Libraries (continued)
(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
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
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.
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
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.
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
95 of 99
KUKA.PLC Multiprog
Troubleshooting
9.1
Remedy
G
Ensure that the file name of the library is entered
as the value of the parameter LIBRARIES
(see Section 7.18).
9.2
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
9.3
Troubleshooting (continued)
--3
--4
--5
--6
--7
--8
--9
--10
--11
--12
--13
--14
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
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.
Troubleshooting (continued)
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
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