KUKA Subprograms and Functions

Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 12
At a glance
Powered by AI
The document describes various KRL functions related to robotics, motion control and variables. Key functions mentioned include INVERSE, PIDTOHD, SET_KRLMSG among others.

Functions for motion control like INVERSE, PIDTOHD, MD_CMD, motion comment functions, variable conversion functions, string functions etc are described.

Many functions take parameters like device name, variables, positions, axes etc. The INVERSE function for example takes a position and start axis as parameters.

Global Path Type

function Yes Built-in REAL


function Yes Built-in REAL
function Yes Built-in REAL
function Yes Built-in RET_C_PSYNC_E
Yes Built-in
function RW_MAM_FILE
function Yes Built-in INT
function Yes Built-in INT
function Yes Built-in BOOL
Yes Built-in
Yes Built-in
Yes Built-in
function RW_MAM_FILE
function RW_MAM_FILE
function Yes Built-in REAL
function FRAME
function FRAME
function Yes Built-in FRAME
function INT
function INT
function INT
function REAL
subprogram Yes Built-in
subprogram Yes Built-in
function Yes Built-in INT
function BOOL
function BOOL
function Yes Built-in E6POS
function CHAR[80]
function Yes Built-in INT
function Yes Built-in SIGINF
function Yes Built-in CHAR[470]
function BOOL
function Yes Built-in INT
function Yes Built-in E6POS
function Yes Built-in E6AXIS
function Yes Built-in INT
function Yes Built-in BOOL
function Yes Built-in BOOL
function FRAME
subprogram
function INT
function INT
function MD_STATE
subprogram
function Yes Built-in INT
function Yes Built-in INT

function Yes Built-in BOOL


function Yes Built-in CHAR[256]
function Yes Built-in INT
function BOOL
function Yes Built-in INT
function RW_MAM_FILE
function INT
function Yes Built-in REAL
function Yes Built-in REAL
function Yes Built-in INT
function Yes Built-in BOOL
function Yes Built-in BOOL
function Yes Built-in BOOL
function Yes Built-in INT
function Yes Built-in INT
function Yes Built-in INT
function Yes Built-in BOOL
function Yes Built-in BOOL
function Yes Built-in BOOL
function Yes Built-in BOOL
function Yes Built-in BOOL
function Yes Built-in BOOL
function Yes Built-in BOOL
function Yes Built-in BOOL
function Yes Built-in BOOL
function Yes Built-in BOOL
function Yes Built-in BOOL
Yes Built-in
function INT
subprogram
function Yes Built-in REAL
function BOOL
function Yes Built-in FRAME
function Yes Built-in VAR_STATE
function Yes Built-in VAR_TYPE
function Yes Built-in BOOL
function Yes Built-in BOOL
Declaration
ABS(REALX:IN)
ACOS(REALX:IN)
ATAN2(REALX:IN,REALY:IN)
CANCELPROGSYNC(CANCEL_PSYNC_ECMD:IN,CHARID_NAME[64]:IN)
CCLOSE(INTHANDLE,STATE_TSTATE)
CHECK_MAM_ON_RDC()
CHECKPIDONRDC()
CIOCTL(INTHANDLE:IN,INTREQUEST:IN,INTARGUMENT:IN,CHARPARAM[128]:IN,INTRETVAL:OUT
CLEAR_KRLMSG(INTNHANDLE:IN)
COPEN(:CHANNEL_NAME,INTHANDLE)
CREAD(INTHANDLE,STATE_TSTATE,MODUS_TMODE,INTTIMEOUT,REALOFFSET,CHARFORMAT,VAR
CWRITE(INTHANDLE,STATE_TSTATE,MODUS_TMODE,INTTIMEOUT,REALOFFSET,CHARFORMAT,VA
COPY_MAM_HD_TO_RDC()
COPY_MAM_RDC_TO_HD()
COS(REALX:IN)
EB(FRAMEROOT:IN,CHARDEVNAME[39]:IN,FRAMEOFFSET:IN,INTSHIFTFRAME:IN)
EB_TEST(FRAMEROOT:IN,CHARDEVICE_NAME[39]:IN,FRAMEOFFSET:IN,INTFRAME_NR:IN,BOOLV
EK(FRAMETKRWE:IN,ESYSEXKIN:IN,FRAMETBAFL:IN)
EMI_ENDPOS(CHARDEV_NAME[39]:IN,CHARFILE_NAME[32]:IN,E6POSEND_POS:OUT,E6AXISEND_A
EMI_RECSTATE(CHARDEV_NAME[39]:IN,CHARFILE_NAME[32]:IN)
EMI_STARTPOS(CHARDEV_NAME[39]:IN,CHARFILE_NAME[32]:IN,E6POSSTART_POS:OUT,E6AXISST
EO(CHARDEVICE_NAME[39]:IN,REALOFFSET:IN)
ERR_CLEAR(ERROR_TPERR:OUT)
ERR_RAISE(ERROR_TPERR:OUT)
EXECFUNC(CHARFNAME[16]:OUT,INTIPAR[32]:OUT,REALRPAR[32]:OUT,CHARMSG[80]:OUT)
EXISTS_KRLDLG(INTNHANDLE:IN,INTANSWER:OUT)
EXISTS_KRLMSG(INTNHANDLE:IN)
FORWARD(E6AXISAXVAL:IN,INTSTATUS:OUT)
GET_DECL_PLACE(CHARVARNAME[80]:IN)
GET_MSGBUFFER(MSGBUF_TMSGBUF[100]:OUT)
GET_SIG_INF(CHARSIGNAME[24]:IN)
GETCYCDEF(INTINDEX:IN)
GETSYSSTATE(CHARCMD[64]:IN,INTIPAR:OUT,REALRPAR:OUT)
GETVARSIZE(SYS_VARSMESSAGENO:IN)
INV_POS(E6POSPOS_VALUES:IN)
INVERSE(E6POSTOOLPOS:IN,E6AXISSTART_AXIS:IN,INTSTATUS:OUT)
IOCTL(INTDRVID:IN,INTREQUEST:IN,INTARGUMENT:IN)
IS_KEY_PRESSED(INTKEY:IN)
ISMESSAGESET(INTMESSAGENO:IN)
LK(FRAMEROOT:IN,CHARIP_ADDR[15]:IN,FRAMEOFFSET:IN,ESYSEXKIN:IN)
M_COMMENT(CHARM_TXT[128]:IN)
MBX_REC(INTMBX_ID:IN,STOPMESSMESS:OUT)
MD_CMD(CHARDEV_NAME[39]:IN,CHARCMD_STRING[64]:IN,INTINT_PARAM[16]:OUT,REALREAL_P
MD_GETSTATE(CHARDEVNAME[39]:IN)
MD_SETSTATE(CHARDEVNAME[39]:IN,MD_STATESTATE:IN)
PIDTOHD(INTABSACCURFLAG:IN)
PIDTORDC(CHARSTRVAR[470]:IN)
PULSE(INTSIGNAL,BOOLSTATE,REALTIME)
REMOTECMD(CHARIP_ADDR[15]:IN,CHARCMD[128]:IN)
REMOTEREAD(CHARIP_ADDR[15]:IN,CHARVARIABLE[128]:IN,INTERROR:OUT)
SET_KRLDLG(KRLMSG_TMSG:OUT,KRLMSGPAR_TPAR[3]:OUT,KRLMSGDLGSK_TSK[7]:OUT,KRLMSGO
SET_KRLDLGANSWER(INTNHANDLE:IN,INTANSWERSK:IN)
SET_KRLMSG(EKRLMSGTYPETYPE:IN,KRLMSG_TMSG:OUT,KRLMSGPAR_TPAR[3]:OUT,KRLMSGOPT_
SET_MAM_ON_HD(E6AXISVALUES:IN)
SET_OPT_FILTER(E6POSTARGETPOS:IN)
SIN(REALX:IN)
SQRT(REALX:IN)
STRADD(CHARSTRDEST[470]:OUT,CHARSTRTOADD[470]:IN)
STRCLEAR(CHARSTRVAR[470]:OUT)
STRCOMP(CHARSTRCOMP[470]:IN,CHARSTRCOMP2[470]:IN,CASE_SENSE_TCASE_MODE:IN)
STRCOPY(CHARSTRDEST[470]:OUT,CHARSTRSOURCE[470]:IN)
STRDECLLEN(CHARSTRVAR[470]:OUT)
STRFIND(INTSTARTAT:IN,CHARSTRVAR[470]:IN,CHARSTRFIND[470]:IN,CASE_SENSE_TCASE_MODE:IN
STRLEN(CHARSTRVAR[470]:IN)
STRTOAXIS(CHARSTRVAR[256]:IN,AXISRETVAL:OUT)
STRTOBOOL(CHARSTRVAR[256]:IN,BOOLRETVAL:OUT)
STRTOE3AXIS(CHARSTRVAR[256]:IN,E3AXISRETVAL:OUT)
STRTOE3POS(CHARSTRVAR[256]:IN,E3POSRETVAL:OUT)
STRTOE6AXIS(CHARSTRVAR[256]:IN,E6AXISRETVAL:OUT)
STRTOE6POS(CHARSTRVAR[256]:IN,E6POSRETVAL:OUT)
STRTOFRAME(CHARSTRVAR[256]:IN,FRAMERETVAL:OUT)
STRTOINT(CHARSTRVAR[256]:IN,INTRETVAL:OUT)
STRTOPOS(CHARSTRVAR[256]:IN,POSRETVAL:OUT)
STRTOREAL(CHARSTRVAR[256]:IN,REALRETVAL:OUT)
STRTOSTRING(CHARSTRVAR[256]:IN,CHARRETVAL[256]:OUT)
SWRITE(CHARSTRING,STATE_TSTATE,INTOFFSET,CHARFORMAT,VAR)
SYNC()
SYNCCMD(SYNCTYPESYNC_T:IN,CHARID_NAME[64]:IN,INTCOOP_LIST:IN)
TAN(REALX:IN)
TIMER_LIMIT(REALSECONDS:IN)
TOOL_ADJ(FRAMEX)
VARSTATE(CHARVAR_STR[80]:IN)
VARTYPE(CHARVAR_STR[80]:IN)
WSPACEGIVE(INTSPACEID:IN)
WSPACETAKE(INTSPACEID:IN,INTADVANCE:IN)
Example
Description in English
;Returns the absolut-value of a real
;ACosinus
;Tangens 2
;Cancel progsync, CANCEL_ALL to cancel all NoWait ProgSyncs, CANCEL_ID to cancel only the NoWait ProgSync named
;Closing of channels

;Check if Pid file is on RDC


;I/O control function for channels
;Delete a message (KSS 5.5 and higher) TRUE: Message deleted, FALSE: Message could not be deleted
;Opening an input/output channel
;Reading of data from channels
;Writing data to channels

;Cosinus
;Activate motion driver base
;Get motion driver base
;EK Assignment
;Get end position as POS- or AXIS-data from an EMI-Device (External Motion Interface)
;Get internal state of an EMI Record
;Get start position as POS- or AXIS-data from an EMI-Device (External Motion Interface)
;Aktivierung eines Nullpunkt-Achstreibers
;Reset an Error (see ON_ERROR_PROCEED)
;Raise an Error (see ON_ERROR_PROCEED)
;Execute funtion
;Check state of a dialog message (KSS 5.5 and higher) TRUE: Message still in buffer, FALSE: Message not in buffer (ackno
;Check state of a message (not notify msg) (KSS 5.5 and higher) TRUE: Message still in buffer, FALSE Message not in buffe
;Get cartesian position from AXIS-values

;Returns the number of messages in buffer (up 100) and writes the message in the buffer to OUT parameter MSGBUF[]
;Returns information for the SIGNAL with name SIGNAME
;Get Cycleflag description

;Returns the size of a system variable


;Get inverse position
;Get AXIS-values from Cartesian position
;I/O control function
;TRUE if corresponding key on KCP is pressed
;Returns TRUE if a message with MESSAGENO is in BUFFER
;Linked Kinematic
;Motion Comment

;Execute motion driver command


;Returns state of motion driver device
;Sets state of motion driver device
;Save Pid-file from RDC to HDD
;Save Pid-file on RDC
;Execute a pulse
;Remote CMD
;Reading variable values on a remote controller
;Set a Dialog message (KSS 5.5 and higher) MSG: basic message information, PAR[]: Parameters of a message (using %1)

;Set a Message (KSS 5.5 and higher) TYPE: kind of message (#NOTIFY...) MSG: basic message information, PAR[]: Param

;Sinus
;Returns the square-root of a real
;Add string to string
;Clear string
;Compare two strings
;Copy string
;Redeclare length of a string
;Find string
;Get length of string
;Convert STRING to AXIS
;Convert STRING to BOOL
;Convert STRING to E3AXIS
;Convert STRING to E3POS
;Convert STRING to E6AXIS
;Convert STRING to E6POS
;Convert STRING to FRAME
;Convert STRING to INT
;Convert STRING to POS
;Convert STRING to REAL
;Convert a KRL-string in a string into a string
;Writing of data to a variable

;Tangens

;Free a workspace
;Block a workspace
Description in German

;Pruefe individuelle MAMES-Offsets auf RDW


;Befindet sich ein Pid File auf der RDW
;ioCtl fuer Kanaele
;Loescht eine KRL-Anwendermeldung

;Kopiere mam-File von HD auf RDW


;Kopiere mam-File von RDW auf HD

;Kinematikzuweisung

;Loescht KRL-$Err-Variable
;Verursacht einen definierten Interpreter-Laufzeitfehler

;Lesen der Dialogantwort in KRL


;Meldungs handle auf Existenz pruefen

;Funktion liefert den Deklarationsort


;Lesen des gesamten Meldungspuffers

;Funktion gibt den Status des Systems zurck

;TRUE, wenn entsprechende Taste auf KCP gedrueckt ist

;Gelinkte Kinematik
;Pid File von RDW auf Festplatte (IR_SPEC Verzeichnis) speichern
;Pid File auf RDW abspeichern

;Lesen eines Variablenwertes auf einer externen Steuerung


;Setzt einen KRL-Dialog
;Setzen der Dialogantwort durch HMI
;Setzen einer KRL-Meldung
;Individuelle MAMES-Werte auf HD speichern

;Konvertierung STRING nach AXIS


;Konvertierung STRING nach BOOL
;Konvertierung STRING nach E3AXIS
;Konvertierung STRING nach E3POS
;Konvertierung STRING nach E6AXIS
;Konvertierung STRING in E6POS
;Konvertierung STRING nach FRAME
;Konvertierung STRING nach INT
;Konvertierung STRING nach POS
;Konvertierung STRING nach REAL
;Konvertierung KRL-String im String in einen String
The system function INVERSE() calculate the axial specific position.
The first parameters are the cartesian position of the robot and the start axial specific position of the ex
The second parameter is an error status

System internal function declaration:


EXTFCTP E6AXIS INVERSE (E6POS POSITION: IN, E6AXIS START_AXIS: IN, INT STATUS: OUT)

DECL E6POS CartPos


DECL E6AXIS AxisPos
INT Status

AxisPos=$Pos_Act
CartPos=$Pos_Act
CartPos.X= CartPos.X+10.0 ;x direction plus 10 mm

AxisValue=Inverse(CartPos, AxisPos, Status)

If (Status <> 0) then


halt ; ERROR
endif

The last parameter is the error status, value equal 0 calculation is o.k.

Following error codes exist:

INVERSE(): -1: not all robot angle or external


-2: ERR_STATUS besitzt noch keinen gl
-3: $BASE (advance) invalid.
-4: $TOOL (advance) invalid.

0 no error, calculation is o.k.


### SW-end switch at defined she
### Error of the r math. trafo funct

Eternal axis both in form of a robroot kinematic and as a base kinematic correctly are considere
ic position of the external axis.

NT STATUS: OUT)

ot angle or external axis angle are defined.


sitzt noch keinen gltigen Wert.

witch at defined shear angles injured. (Only possible if ERR_STATUS was at selection time Bit 0 = 0.)
he r math. trafo function

rrectly are considered.


n time Bit 0 = 0.)

You might also like