
Contents
1 Introduction.............................................................................................. 5
1.1 Target group.......................................................................................................... 5
1.2 Industrial robot documentation.............................................................................. 5
1.3 Representation of warnings and notes................................................................. 5
1.4 Terms used............................................................................................................ 6
2 Description of functions......................................................................... 7
3 Safety......................................................................................................... 9
4 Communication channels....................................................................... 11
4.1 Communication via external modules................................................................... 11
4.2 Communication via the command channel $CMD............................................... 11
4.3 Communication via the command channel $FCT_CALL..................................... 12
5 Configuring the external modules......................................................... 15
6 Programming............................................................................................ 17
6.1 Programming overview.......................................................................................... 17
6.2 Symbols and fonts................................................................................................. 17
6.3 CHANNEL.............................................................................................................. 17
6.4 COPEN.................................................................................................................. 18
6.5 CREAD.................................................................................................................. 19
6.5.1 Read mode for CREAD........................................................................................ 20
6.6 CWRITE................................................................................................................. 21
6.6.1 Write mode for CWRITE....................................................................................... 23
6.7 CCLOSE................................................................................................................ 23
6.8 CIOCTL.................................................................................................................. 24
6.9 SREAD................................................................................................................... 25
6.10 SWRITE................................................................................................................. 26
6.11 CAST_TO.............................................................................................................. 27
6.12 CAST_FROM......................................................................................................... 29
6.13 Permissible data types in CAST statements........................................................ 30
6.14 "State" variable...................................................................................................... 30
6.14.1 Structure type STATE_T........................................................................................ 30
6.14.2 Return values for the variable “RET1”................................................................. 31
6.15 "Format" variable................................................................................................... 33
6.15.1 “Format” variable for CREAD/SREAD.................................................................. 33
6.15.2 “Format” variable for CWRITE/SWRITE............................................................... 33
6.15.3 Conversion characters........................................................................................... 35
6.15.4 Which format for which variable?......................................................................... 36
6.15.5 Conversion examples............................................................................................ 37
6.16 Functions for the command channel $FCT_CALL............................................... 39
6.16.1 krl_mount()............................................................................................................. 40
6.16.2 krl_unmount()......................................................................................................... 41
6.16.3 krl_fopen().............................................................................................................. 42
6.16.4 krl_fclose()............................................................................................................. 45
6.16.5 krl_fclose_all()........................................................................................................ 45
CREAD/CWRITE
KSS/VSS 8.2 to 8.7 CREAD CWRITE V1 | Issued: 02.08.2019 www.kuka.com | 3/76