Navigation

  • Page 1

  • Page 2

  • Page 3

  • Page 4

  • Page 5

  • Page 6

  • Page 7

  • Page 8

  • Page 9

  • Page 10

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 10 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002Table A.8. Items Table A.9. Statements User Interface ACT_SCREEN ADD_DICT ATT_WINDOW_D ATT_WINDOW_S CHECK_DICT CNC_DYN_DISB CNC_DYN_DISE CNC_DYN_DISI CNC_D...

  • Page 11

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 11 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002CANCEL FILE Statement CLOSE FILE Statement CLOSE HAND Statement CONDITION..ENDCONDITION Statement CONNECT TIMER Statement DELAY Statement DISABLE CONDITION...

  • Page 12

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 12 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002A.1. - A - KAREL LANGUAGE DESCRIPTION ABORT Action Purpose: Aborts execution of a running or paused task Syntax : ABORT <PROGRAM[n]> Details: If task...

  • Page 13

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 13 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002See Also: GET_TSK_INFO Built-in Chapter 6., CONDITION HANDLERSExample: Refer to Section B.6., "Path Variables and Condition Handlers Program (PTH_MOVE...

  • Page 14

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 14 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002Section B.6., "Path Variables and Condition Handlers Program" (PTH_MOVE.KL) Section B.12., "Displaying a List From a Dictionary File" (...

  • Page 15

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 15 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002status explains the status of the attempted operation. If not equal to 0, then an error occurred. See Also: CONT_TASK, RUN_TASK, PAUSE_TASK Built-In Proced...

  • Page 16

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 16 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002[in] x :REAL %ENVIRONMENT Group :SYSTEM Details: x must be between -1.0 and 1.0; otherwise the program will abort with an error. Returns the arccosine of x...

  • Page 17

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 17 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002%ENVIRONMENT Group :PBCORE Details: Causes the display device associated with the screen to be cleared and all windows attached to the screen to be display...

  • Page 18

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 18 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002[in] var_name :STRING [out] status :INTEGER %ENVIRONMENT Group :PC Details: dat_buffer - an array of up to 244 bytes. dat_index - the starting byte number ...

  • Page 19

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 19 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002Input/Output Parameters : [in] file_name :STRING [in] dict_name :STRING [in] lang_name :STRING [in] add_option :INTEGER [out] status :INTEGER %ENVIRONMENT ...

  • Page 20

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 20 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002Example: Refer to the following sections for detailed program examples: Section B.12., "Displaying a List From a Dictionary File" (DCLST_EX.KL) S...

  • Page 21

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 21 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002index = 1: 0 10 0 0 0 5 0 0 where: 0 10 = INTEGER variable type 0 0 0 5 = integer number 5 0 0 = end of data in the buffer On return from the built-in, ind...

  • Page 22

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 22 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002REAL data is added to the buffer as follows (buffer bytes are displayed in HEX): beginning index = dat_index 2 bytes - variable type 4 bytes - the number 2...

  • Page 23

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 23 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002dat_buffer - an array of up to 244 bytes. dat_index - the starting byte number to place the string value. item - the string value to place into the buffer....

  • Page 24

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 24 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002loaded. Syntax : %ALPHABETIZE Details: Static variables can be declared in any order in a KAREL program and %ALPHABETIZE will cause them to be displayed in...

  • Page 25

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 25 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002program example. APPEND_QUEUE Built-In Procedure Purpose: Appends an entry to a queue if the queue is not full Syntax : APPEND_QUEUE(value, queue, queue_da...

  • Page 26

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 26 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002[in] posn :POSITION %ENVIRONMENT Group :VECTR Details: Returns a VECTOR consisting of the approach vector (positive z-axis) of the argument posn. Example: ...

  • Page 27

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 27 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002size indicates the number of elements in an ARRAY variable. size must be in the range 1 through 32767 and must be specified in a normal ARRAY variable decl...

  • Page 28

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 28 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002ARRAY_LEN Built-In Function Purpose: Returns the number of elements contained in the specified array argument Syntax : ARRAY_LEN(ary_var) Function Return T...

  • Page 29

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 29 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002The second example causes the program to abort since the input value is less than -1 and not within the valid range. Example A.6. ASIN Built-In Function As...

  • Page 30

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 30 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002An exception is that an INTEGER expression can be assigned to a REAL. Any positional types can be assigned to each other. Only system variables with write ...

  • Page 31

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 31 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002expn must be of the same type as the variable or element of variable . An exception is that an INTEGER expression can be assigned to a REAL. Any positional...

  • Page 32

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 32 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002Example A.10. Assignment Statement AT NODE Condition Purpose: Condition is satisfied when a specified PATH node or position has been reached Syntax : AT NO...

  • Page 33

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 33 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002[in] x1 :REAL [in] y1 :REAL %ENVIRONMENT Group :SYSTEM Details: x1 and y1 specify the x and y coordinates of the point. If x1 and y1 are both zero, the int...

  • Page 34

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 34 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002See Also: RELEASE Statement, Chapter 8., MOTION , for more information on motion control, Appendix E., "Syntax Diagrams,'' for additional syntax infor...

  • Page 35

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 35 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002the window later. It is an error if the window is already attached to the screen. status explains the status of the attempted operation. If not equal to 0,...

  • Page 36

    A. KAREL LANGUAGE ALPHABETICAL DESCRIPTIONPage 36 of 36http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01.html4/16/2002Example: Refer to Section B.12., "Displaying a List From a Dictionary File" (DCLST_EX.KL), for a detailed program example. AVL_POS_NUM Built-In P...

  • Page 37

    A.2. - B - KAREL LANGUAGE DESCRIPTIONPage 1 of 6http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s02.html 4/16/2002A.2. - B - KAREL LANGUAGE DESCRIPTION BOOLEAN Data Type Purpose: Defines a variable, function return type, or routine parameter as a BOOLEAN data type Syntax ...

  • Page 38

    A.2. - B - KAREL LANGUAGE DESCRIPTIONPage 2 of 6http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s02.html 4/16/2002Only BOOLEAN expressions can be assigned to BOOLEAN variables, returned from BOOLEAN function routines, or passed as arguments to BOOLEAN parameters. Example:...

  • Page 39

    A.2. - B - KAREL LANGUAGE DESCRIPTIONPage 3 of 6http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s02.html 4/16/2002prog_name specifies the name of the program that contains the specified variable. If prog_name is equal to '' (double quotes), then the routine defaults to th...

  • Page 40

    A.2. - B - KAREL LANGUAGE DESCRIPTIONPage 4 of 6http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s02.html 4/16/2002BYTES_AHEAD Built-In Procedure Purpose: Returns the number of bytes of input data presently in the read-ahead buffer for a KAREL file. Allows KAREL programs t...

  • Page 41

    A.2. - B - KAREL LANGUAGE DESCRIPTIONPage 5 of 6http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s02.html 4/16/2002BYTES_LEFT Built-In Function Purpose: Returns the number of bytes remaining in the current input data record Syntax : BYTES_LEFT(file_id) Function Return Type...

  • Page 42

    A.2. - B - KAREL LANGUAGE DESCRIPTIONPage 6 of 6http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s02.html 4/16/2002See Also: Section 7.9.1. , "User Menu on the Teach Pendant," Section 7.9.2. , "User Menu on the CRT/KB" Example: The following example rea...

  • Page 43

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 1 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002A.3. - C - KAREL LANGUAGE DESCRIPTION CALL_PROG Built-In Procedure Purpose: Allows a KAREL program to call an external KAREL or teach pendant program. This m...

  • Page 44

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 2 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002[in] pause_entry :BOOLEAN %ENVIRONMENT Group :BYNAM Details: prog_name is the name of the program to be executed, in the current calling task. prog_line spec...

  • Page 45

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 3 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002Canceled motions are treated as completed and cannot be resumed. The CANCEL action in a global condition handler also cancels any pending motions. The CANCEL...

  • Page 46

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 4 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002with other groups, the motions for all groups are canceled. The robot and auxiliary axes decelerate smoothly to a stop. The remainder of the motion is cancel...

  • Page 47

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 5 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002where: file_var :a FILE variable Details: Used to cancel input or output on a specified file The built-in function IO_STATUS can be used to determine if a CA...

  • Page 48

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 6 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002Syntax : CHECK_DICT(dict_name, element_no, status) Input/Output Parameters : [in] dict_name :STRING [in] element_no :STRING [out] status :INTEGER %ENVIRONMEN...

  • Page 49

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 7 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002Details: eposn is the XYZWPREXT position to be checked. uframe specifies the uframe position to use with eposn. utool specifies the utool position to use wit...

  • Page 50

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 8 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002[in] code :INTEGER %ENVIRONMENT Group :SYSTEM Details: code represents the numeric code of the character for either the ASCII, Graphic, or Multinational char...

  • Page 51

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 9 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002status explains the status of the attempted operation. If not equal to 0, then an error occurred. Example: The following example clears a KAREL program, clea...

  • Page 52

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 10 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002where: file_var :a FILE variable Details: file_var must be a static variable that was used in the OPEN FILE statement. Any buffered data associated with the...

  • Page 53

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 11 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002Example A.19. CLOSE HAND Statement CLOSE_TPE Built-In Procedure Purpose: Closes the specified teach pendant program Syntax : CLOSE_TPE(open_id, status) Inpu...

  • Page 54

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 12 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002Causes the last operation result on file_id , which is returned by IO_STATUS, to be cleared to zero. See Also: I/O-STATUS Built-In Function Example: Refer t...

  • Page 55

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 13 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002[out] status :INTEGER %ENVIRONMENT Group :REGOPE Details: register_no specifies the register number whose data should be cleared. If group_no is zero, data ...

  • Page 56

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 14 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002CNC_DYN_DISB Built-In Procedure Purpose: Cancels the dynamic display based on the value of a BOOLEAN variable in a specified window. Syntax : CNC_DYN_DISB (...

  • Page 57

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 15 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002[in] window_name :STRING [out] status :INTEGER %ENVIRONMENT Group :UIF Details: e_var is the integer variable whose dynamic display is to be canceled. Refer...

  • Page 58

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 16 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002Section B.10., "Using Dynamic Display Built-ins" (DYN_DISP.KL) Section B.11., "Manipulating Values of Dynamically Displayed Variables" (...

  • Page 59

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 17 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002[in] window_name :STRING [out] status :INTEGER %ENVIRONMENT Group :UIF Details: real_var is the REAL variable whose dynamic display is to be canceled. Refer...

  • Page 60

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 18 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002Section B.10., "Using Dynamic Display Built-ins" (DYN_DISP.KL) Section B.11., "Manipulating Values of Dynamically Displayed Variables" (...

  • Page 61

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 19 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002CNV_CONF_STR Built-In Procedure Purpose: Converts the specified CONFIG into a STRING Syntax : CNV_CONF_STR(source, target) Input/Output Parameters : [in] so...

  • Page 62

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 20 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002[out] target :STRING expression %ENVIRONMENT Group :PBCORE Details: source is the INTEGER to be formatted into a STRING. length specifies the minimum length...

  • Page 63

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 21 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002real_array element number one, etc. Excess array elements will be ignored. The measurement of the real_array elements is in degrees. status explains the sta...

  • Page 64

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 22 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002Example: The following example converts the REAL number in cur_volts into a STRING and puts it into volt_string . The minimum length of cur_volts is specifi...

  • Page 65

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 23 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002Example: Refer to the following sections for detailed program examples: Section B.6., "Path Variables and Condition Handlers Program" (PTH_MOVE.KL...

  • Page 66

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 24 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002Syntax : CNV_STR_INT(source, target) Input/Output Parameters : [in] source :STRING [out] target :INTEGER %ENVIRONMENT Group :PBCORE Details: source is conve...

  • Page 67

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 25 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002Example: The following example converts the STRING str into a REAL and puts it into rate . Example A.25. CNV_STR_REAL Built-In Procedure CNV_STR_TIME Built-...

  • Page 68

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 26 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002CNV_TIME_STR Built-In Procedure Purpose: Converts an INTEGER representation of time to a STRING Syntax : CNV_TIME_STR(source, target) Input/Output Parameter...

  • Page 69

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 27 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002Section B.3.,"Saving Data to the Default Device" (SAVE_VR.KL) Section B.5.,"Using Register Built-ins" (REG_EX.KL) Section B.6., "Pa...

  • Page 70

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 28 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002parameter to a routine, but is always passed by value. See Also: Section 8.4.7. , "Path Motion," for default values, Section 2.1.6. , "Predef...

  • Page 71

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 29 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002The condition handler remains defined and can subsequently be reactivated by the ENABLE statement or action. The PURGE statement can be used to delete the d...

  • Page 72

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 30 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002Variables and fields declared as CONFIG can be Assigned to one another. Passed as parameters. Written to and read from unformatted files. Each subfield of a...

  • Page 73

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 31 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002running or paused and continues until the program disconnects the timer, ends, or aborts. For example, if $SCR.$COND_TIM E=32 then clock_var will be increme...

  • Page 74

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 32 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002The CONTINUE action can be followed by the clause PROGRAM[n], where n is the task number to be continued. Use GET_TSK_INFO to get a task number for a specif...

  • Page 75

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 33 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002CONT_TASK Built-In Procedure Purpose: Continues the specified task Syntax : CONT_TASK(task_name, status) Input/Output Parameters : [in] task_name :STRING [o...

  • Page 76

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 34 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002COPY_FILE Built-In Procedure Purpose: Copies the contents of one file to another with the overwrite option Syntax : COPY_FILE(from_file, to_file, overwrite_...

  • Page 77

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 35 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002If the device you are copying to becomes full during the copy, an error will be returned. status explains the status of the attempted operation. If not equa...

  • Page 78

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 36 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002returned. dest_path specifies the destination path to copy to. This path can be a standard path or a user defined path. However, the dest_path type must be ...

  • Page 79

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 37 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002COPY_QUEUE Built-In Procedure Purpose: Copies one or more consecutive entries from a queue into an array of integers. The entries are not removed but are co...

  • Page 80

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 38 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002(queue_to n_entries_skip ) if this is less than ARRAY_LEN(out_data) ARRAY_LEN(out_data) if this is less than or equal to queue.n_entries - n_skip status is ...

  • Page 81

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 39 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002[in] from_prog :STRING [in] to_prog :STRING [in] overwrite_sw :BOOLEAN [out] status :INTEGER %ENVIRONMENT Group :TPE Details: from_prog specifies the teach ...

  • Page 82

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 40 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002Path" (GEN_HEX.KL), for a detailed program example. CR Input/Output Item Purpose: Can be used as a data item in a READ or WRITE statement to specify a ...

  • Page 83

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 41 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002Purpose: Creates a teach pendant program of the specified name Syntax : CREATE_TPE(prog_name, prog_type, status) Input/Output Parameters : [in] prog_name :S...

  • Page 84

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 42 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002inner_dim, mid_dim, outer_dim, status, <mem_pool>) Input/Output Parameters : [in] var_prog_nam :STRING [in] var_nam :STRING [in] typ_prog_nam :STRING ...

  • Page 85

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 43 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002'COMMON_ASSOC' 'CONFIG' 'FILE' 'GROUP_ASSOC' 'INTEGER' 'JOINTPOS' 'JOINTPOS1' 'JOINTPOS2' 'JOINTPOS3' 'JOINTPOS4' 'JOINTPOS5' 'JOINTPOS6' 'JOINTPOS7' 'JOINT...

  • Page 86

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 44 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002inner_dim specifies the dimensions of the innermost array. For example, inner_dim = 30 for ARRAY[10,20,30] OF INTEGER. inner_dim should be set to 0 if the v...

  • Page 87

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 45 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002Function Return Type :JOINTPOS Input/Output Parameters : [out] axs_lim_mask :INTEGER [out] ovr_trv_mask :INTEGER [in] group_no :INTEGER %ENVIRONMENT Group :...

  • Page 88

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 46 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002CURPOS Built-In Function Purpose: Returns the current Cartesian position of the tool center point (TCP) for the specified group of axes even if one of the a...

  • Page 89

    A.3. - C - KAREL LANGUAGE DESCRIPTIONPage 47 of 47http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s03.html 4/16/2002See Also: Chapter 8., MOTIONExample: Refer to Section B.5. ,"Using Register Built-ins," for a detailed program example. Section B.5.,"Using R...

  • Page 90

  • Page 91

  • Page 92

  • Page 93

  • Page 94

  • Page 95

  • Page 96

  • Page 97

  • Page 98

  • Page 99

  • Page 100

  • Page 101

  • Page 102

  • Page 103

  • Page 104

  • Page 105

  • Page 106

  • Page 107

  • Page 108

  • Page 109

  • Page 110

  • Page 111

  • Page 112

  • Page 113

  • Page 114

  • Page 115

  • Page 116

  • Page 117

  • Page 118

  • Page 119

  • Page 120

  • Page 121

  • Page 122

  • Page 123

  • Page 124

  • Page 125

  • Page 126

  • Page 127

  • Page 128

  • Page 129

  • Page 130

  • Page 131

  • Page 132

  • Page 133

  • Page 134

  • Page 135

  • Page 136

  • Page 137

  • Page 138

  • Page 139

  • Page 140

    A.6. - F - KAREL LANGUAGE DESCRIPTIONPage 8 of 10http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s06.html4/16/2002status explains the status of the attempted operation. If not equal to 0, then an error occurred. See Also: MOUNT_DEV, DISMOUNT_DEV Built-In Procedures Exampl...

  • Page 141

    A.6. - F - KAREL LANGUAGE DESCRIPTIONPage 9 of 10http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s06.html4/16/2002The y-axis is perpendicular to the x-axis and in the xy-plane. The z-axis is through pos1 and perpendicular to the xy-plane. The positive direction is determi...

  • Page 142

    A.6. - F - KAREL LANGUAGE DESCRIPTIONPage 10 of 10http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s06.html4/16/2002The FROM clause can be part of a type, variable, or routine declaration. The type, variable, or routine belongs to the program specified by prog_name . In a ...

  • Page 143

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 1 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002A.7. - G - KAREL LANGUAGE DESCRIPTION GET_ATTR_PRG Built-In Procedure Purpose: Gets attribute data from the specified teach pendant or KAREL program Syntax : ...

  • Page 144

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 2 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002AT_SRC_VRSN : Source file versionA T_DEF_GROUP : Default motion groups (for task attribute) AT_PROTECT : Protection code; 1 :Protection OFF ; 2 :Protection ON...

  • Page 145

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 3 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002GET_FILE_POS Built-In Function Purpose: Returns the current file position (where the next READ or WRITE operation will take place) in the specified file Synta...

  • Page 146

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 4 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002GET_JPOS_REG Built-In Function Purpose: Gets a JOINTPOS value from the specified register Syntax : GET_JPOS_REG(register_no, status <,group_no>) Functio...

  • Page 147

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 5 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002program Syntax : GET_JPOS_TPE(open_id, position_no, status <, group_no>) Function Return Type :JOINTPOS Input/Output Parameters : [in] open_id :INTEGER ...

  • Page 148

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 6 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002Syntax : GET_PORT_ASG(log_port_type, log_port_no, rack_no, slot_no, phy_port_type, phy_port_no, n_ports, status) Input/Output Parameters : [in] log_port_type ...

  • Page 149

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 7 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002returned indicating whether the port is assigned to a DIN port. If the port is not assigned, a non-zero status is returned. Example A.57. GET_PORT_ASG Built-I...

  • Page 150

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 8 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002port_1 port_2 port_3 port_4 port_5 atr_type specifies the attribute whose current setting is to be returned. Use one of the following predefined constants: at...

  • Page 151

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 9 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002GET_PORT_CMT Built-In Procedure Purpose: Allows a KAREL program to determine the comment that is set for a specified logical port Syntax : GET_PORT_CMT(port_t...

  • Page 152

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 10 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002Codes are defined in FR:KLIOTYPS.KL. port_no specifies the port number whose comment is being set. comment_str is returned with the comment for the specified...

  • Page 153

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 11 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002The logical port is assigned to two physical ports whose values are complementary. In this case, port_no must be an odd number. If port n is set to TRUE, the...

  • Page 154

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 12 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002[in] port_type :INTEGER [in] port_no :INTEGER [out] simulated :INTEGER [out] status :INTEGER %ENVIRONMENT Group :IOSETUP Details: port_type specifies the cod...

  • Page 155

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 13 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002value is returned with the current value (status) of the specified port. For BOOLEAN port types, (i.e. DIN), this will be 0 = OFF, or 1 = ON. status is retur...

  • Page 156

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 14 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002status indicates the status of the attempted operation. If not equal to 0, then an error occurred. See Also: GET_POS_TYP, CHECK_EPOS. GET_POS_REG Built-In Fu...

  • Page 157

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 15 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002Syntax : GET_POS_TPE(open_id, position_no, status <, group_no>) Function Return Type :XYZWPREXT Input/Output Parameters: [in] open_id : INTEGER [in] po...

  • Page 158

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 16 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002Syntax : GET_POS_TYP(open_id, position_no, group_no, posn_typ, num_axs, status) Input/Output Parameters: [in] open_id :INTEGER [in] position_no :INTEGER [in]...

  • Page 159

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 17 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002Input/Output Parameters:[in] register_no: INTEGER[out] comment_string: STRING[out] status: INTEGER%ENVIORNMENT group: REGOPEDetails:Register_no specifies whi...

  • Page 160

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 18 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002See Also: MODIFY_QUEUE Built-In Procedure, Section 15.8. , "Using Queues for Task Communication Example: In the following example the routine get_nxt_er...

  • Page 161

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 19 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002register_no specifies the register to get. real_flag is set to TRUE and real_value to the register content if the specified register has a real value. Otherw...

  • Page 162

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 20 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002i holds the INTEGER representation of the current time stored in the KAREL system. This value is represented in 32-bit INTEGER format as follows: Table A.11....

  • Page 163

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 21 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002[in] open_id :INTEGER [in] pos_no :INTEGER [out] comment :STRING [out] status :INTEGER %ENVIRONMENT Group :TPE Details: open_id specifies the open_id returne...

  • Page 164

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 22 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002Details: param_no indicates the number of the parameter. There can be at most ten parameters. data_type indicates the data type for the parameter, as follows...

  • Page 165

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 23 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002GET_TSK_INFO Built-In Procedure Purpose: Get the value of the specified task attribute Syntax : GET_TSK_INFO(task_name, task_no, attribute, value_int, value_...

  • Page 166

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 24 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002%ENVIRONMENT Group :PBCORE Details: task_name is the name of the task of interest. task_name is used as input only if task_no is uninitialized or set to 0, o...

  • Page 167

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 25 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002TSK_TPMOTION : TP motion enable TSK_TRACE : Trace enable TSK_TRACELEN : Length of trace array TSK_STATUS is the task status: The return values are: PG_RUNACC...

  • Page 168

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 26 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002[out] status :INTEGER %ENVIRONMENT Group :SYSTEM Details: entry returns the entry number in the variable data table of var_name in the device directory where...

  • Page 169

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 27 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002Example A.62. GET_VAR Built-In Procedure GO TO Statement Purpose: Transfers control to a specified statement Syntax : || GO TO | GOTO || stmnt_label where: s...

  • Page 170

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 28 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002Label identifiers are followed by double colons (::). Executable statements may or may not follow on the same line. GOTO should only be used in special circu...

  • Page 171

    A.7. - G - KAREL LANGUAGE DESCRIPTIONPage 29 of 29http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s07.html4/16/2002Variables and fields declared GROUP_ASSOC can be: Passed as parameters. Written to and read from unformatted files. Assigned to one another. Each subfield of...

  • Page 172

    A.8. - H - KAREL LANGUAGE DESCRIPTIONPage 1 of 3http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s08.html4/16/2002A.8. - H - KAREL LANGUAGE DESCRIPTION HOLD Action Purpose: Causes the current motion to be held and prevents subsequent motions from starting Syntax : HOLD <...

  • Page 173

    A.8. - H - KAREL LANGUAGE DESCRIPTIONPage 2 of 3http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s08.html4/16/2002HOLD Statement Purpose: Causes the current motion to be held and prevents subsequent motions from starting Syntax : HOLD <GROUP[n{,n}]> Details: Any moti...

  • Page 174

    A.8. - H - KAREL LANGUAGE DESCRIPTIONPage 3 of 3http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s08.html4/16/2002Example: The following example initiates a move along the path pathvar but stops the motion until the F1 key TPIN[1] on the teach pendant is pressed. Example A...

  • Page 175

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 1 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002A.9. - I - KAREL LANGUAGE DESCRIPTION IF ... ENDIF Statement Purpose: Executes a sequence of statements if a BOOLEAN expression is TRUE; an alternate sequence...

  • Page 176

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 2 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002Section B.10., "Using Dynamic Display Built-ins" (DYN_DISP.KL) Section B.12., "Displaying a List From a Dictionary File" (DCLST_EX.KL) Sec...

  • Page 177

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 3 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002file_spec is the name of the file to include. It has the following details: The file name specified must be no longer than 12 characters. The file type defaul...

  • Page 178

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 4 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002STRING argument in another specified STRING argument. If the argument is not found, a 0 value is returned. Syntax : INDEX(main, find) Function Return Type :IN...

  • Page 179

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 5 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002[in] char_size :INTEGER [in] row :INTEGER [in] col :INTEGER [in] interval :INTEGER [in] strings :ARRAY OF STRING [out] status :INTEGER %ENVIRONMENT Group :UIF...

  • Page 180

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 6 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/20021 :Double-wide (Supported only on the CRT) 2 :Double-high, double-wide row and col specify the location in the window in which the data is to be displayed. in...

  • Page 181

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 7 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002%ENVIRONMENT Group :UIF Details: The dynamic display is initiated based on the value of e_var . If e_var has a value of n, strings[n+1] is displayed; if e_var...

  • Page 182

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 8 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002%ENVIRONMENT Group :UIF Details: i_var is the integer whose dynamic display is to be initiated. If field_width is non-zero, the display is extended with blank...

  • Page 183

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 9 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002Refer to the INI_DYN_DISB built-in procedure for a description of the other parameters listed above. See Also: CNC_DYN_DISI, DEF_WINDOW Built-In Procedure Exa...

  • Page 184

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 10 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002[out] status :INTEGER Details: port_type specifies the type of port to be displayed. Codes are defined in FROM: KLIOTYPS.KL. If the port_type is a BOOLEAN po...

  • Page 185

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 11 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002[in] buffer_size :INTEGER [in] format :STRING [out] status :INTEGER %ENVIRONMENT Group :UIF Details: r_var is the REAL variable whose dynamic display is to b...

  • Page 186

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 12 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002[in] buffer_size :INTEGER [in] format :STRING [out] status :INTEGER %ENVIRONMENT Group :UIF Details: s_var is the STRING variable whose dynamic display is to...

  • Page 187

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 13 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002INIT_TBL Built-In Procedure Purpose: Initializes a table on the teach pendant Syntax : INIT_TBL(dict_name, ele_number, num_rows, num_columns, col_data, inact...

  • Page 188

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 14 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002dict_name is the four-character name of the dictionary containing the table header. ele_number is the element number of the table header. num_rows is the num...

  • Page 189

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 15 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002A single dictionary element defines all of the label values. Each value must be put on a separate line using &new_line. The values are assigned to the fu...

  • Page 190

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 16 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002enum_dict : Dictionary name used to display data types TPX_FKY_ITEM, TPX_SUB_ITEM, TPX_KBL_ITEM, or TPX_PBL_ITEM format_spec : Format string is used to print...

  • Page 191

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 17 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002Example: "%d" or "%-10s" The format specifiers which can be used with the data types specified in the item_type field in col_data are as ...

  • Page 192

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 18 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002entering characters and 0 causes it not to be cleared. lower_case : If data type is TPX_KST_ITEM, 1 allows the characters to be input to the string in upper ...

  • Page 193

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 19 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002TPX_SUB_ITEM: ARRAY OF INTEGER with values referring to items in the dictionary element specified in the enum_ele field in col_data . There can be at most 28...

  • Page 194

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 20 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002----------------------------------------------TPXTABEG.TX----------------------------------------------$title&reverse "DATA Test Schedule" &...

  • Page 195

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 21 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002value_array: ARRAY[5] OF STRING[26]vptr_array: ARRAY[4,5] OF INTEGERtable_data: XWORK_Tstatus: INTEGERaction: INTEGERdef_item: INTEGERterm_char: INTEGERattac...

  • Page 196

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 22 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002col_data[2].field_width = 5col_data[2].format_spec = '%s'col_data[2].enum_ele = 3-- enum1 element numbercol_data[2].enum_dict = 'XTAB'col_data[3].item_type =...

  • Page 197

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 23 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002IN_RANGE Built-In Function WRITE TPERROR ('F1 pressed')CASE (ky_f2):-- Perform F2SET_CURSOR(TPERROR, 1, 1, status)WRITE TPERROR ('F2 pressed')CASE (ky_f3):--...

  • Page 198

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 24 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002Purpose: Returns a BOOLEAN value indicating whether or not the specified position argument can be reached by a group of axes Syntax : IN_RANGE(posn) Function...

  • Page 199

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 25 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002%ENVIRONMENT Group :PATHOP Details: node_num specifies the index number of the path node before which the new uninitialized node is to be inserted. The new n...

  • Page 200

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 26 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002[out] status :INTEGER %ENVIRONMENT Group :PBQMGR Details: value specifies the value to be inserted into the queue, queue_t. sequence_no specifies the sequenc...

  • Page 201

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 27 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002Syntax : INTEGER Details: An INTEGER variable or parameter can assume whole number values in the range -2147483648 through +2147483646. INTEGER literals cons...

  • Page 202

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 28 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002%ENVIRONMENT Group :SYSTEM Details: The returned value is the inverse of the pos argument. The configuration of the returned POSITION will be that of the pos...

  • Page 203

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 29 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002position of the board in the SLC-2 chain. mod_type is the module type. 6 A16B-2202-4707 A16B-2202-4728 A16B-2202-480status is returned with zero if the param...

  • Page 204

    A.9. - I - KAREL LANGUAGE DESCRIPTIONPage 30 of 30http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s09.html4/16/2002successful or one of the errors listed in the FANUC Robotics SYSTEM R-J3iB Controller HandlingTool Setup and Operations Manual . Some of the common errors ar...

  • Page 205

    A.10. - J - KAREL LANGUAGE DESCRIPTIONPage 1 of 3http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s10.html4/16/2002A.10. - J - KAREL LANGUAGE DESCRIPTION J_IN_RANGE Built-In Function Purpose: Returns a BOOLEAN value indicating whether or not the specified joint position ar...

  • Page 206

    A.10. - J - KAREL LANGUAGE DESCRIPTIONPage 2 of 3http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s10.html4/16/2002Example: Refer to the following sections for detailed program examples: Section B.5.,"Using Register Built-ins" (REG_EX.KL) Section B.6., "Path...

  • Page 207

    A.10. - J - KAREL LANGUAGE DESCRIPTIONPage 3 of 3http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s10.html4/16/2002and the values can be added as required. One example includes: config_ref = HALF_SOLN + CONFIG_TCP. 0 :(FULL_SOLN) = Default 1 : (HALF_SOLN) = Wrist joint (xy...

  • Page 208

    A.11. - K - KAREL LANGUAGE DESCRIPTIONPage 1 of 3http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s11.html4/16/2002A.11. - K - KAREL LANGUAGE DESCRIPTION KCL Built-In Procedure Purpose: Sends the KCL command specified by the STRING argument to KCL for execution. Syntax : K...

  • Page 209

    A.11. - K - KAREL LANGUAGE DESCRIPTIONPage 2 of 3http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s11.html4/16/2002Example: Refer to Example 10.7. for another example. KCL_NO_WAIT Built-In Procedure Purpose: Sends the KCL command specified by the STRING argument to KCL for...

  • Page 210

    A.11. - K - KAREL LANGUAGE DESCRIPTIONPage 3 of 3http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s11.html4/16/2002Syntax : KCL_STATUS Function Return Type :INTEGER %ENVIRONMENT Group :kclop Details: Returns the status of the last executed command from the KCL or KCL_NO_WA...

  • Page 211

    A.12. - L - KAREL LANGUAGE DESCRIPTIONPage 1 of 6http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s12.html4/16/2002A.12. - L - KAREL LANGUAGE DESCRIPTION LN Built-In Function Purpose: Returns the natural logarithm of a specified REAL argument Syntax : LN(x) Function Return...

  • Page 212

    A.12. - L - KAREL LANGUAGE DESCRIPTIONPage 2 of 6http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s12.html4/16/2002file_spec specifies the device, name, and type of the file to load. The following types are valid: .TP Teach pendant program.PC KAREL program.VR KAREL variabl...

  • Page 213

    A.12. - L - KAREL LANGUAGE DESCRIPTIONPage 3 of 6http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s12.html4/16/2002[out] initialized :BOOLEAN %ENVIRONMENT Group :PBCORE Details: prog_name must be a program and cannot be a routine. loaded returns a value of TRUE if prog_nam...

  • Page 214

    A.12. - L - KAREL LANGUAGE DESCRIPTIONPage 4 of 6http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s12.html4/16/2002To specify multiple groups select the decimal values, shown in Table A.16., which correspond to the desired groups. Then connect them together using the OR op...

  • Page 215

    A.12. - L - KAREL LANGUAGE DESCRIPTIONPage 5 of 6http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s12.html4/16/2002%LOCKGROUP Translator Directive Purpose: Specifies the motion group(s) to be locked when calling this program or a routine from this program. Syntax : %LOCKGR...

  • Page 216

    A.12. - L - KAREL LANGUAGE DESCRIPTIONPage 6 of 6http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s12.html4/16/2002See Also: %NOLOCKGROUP Directive, LOCK_GROUP, UNLOCK_GROUP Built-In Procedures damage equipment.

  • Page 217

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 1 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002A.13. - M - KAREL LANGUAGE DESCRIPTION MIRROR Built-In Function Purpose: Determines the mirror image of a specified position variable. Syntax : MIRROR (old_p...

  • Page 218

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 2 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002MODIFY_QUEUE Built-In Procedure Purpose: Replaces the value of an entry of a queue. Syntax : MODIFY_QUEUE(value, sequence_no, queue_t, queue_data, status) In...

  • Page 219

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 3 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002[in] value :INTEGER [in] sequence_no :INTEGER [in,out] queue_t :QUEUE_TYPE [in,out] queue_data :ARRAY OF INTEGER [out] status :INTEGER %ENVIRONMENT Group :PB...

  • Page 220

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 4 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002MOTION_CTL Built-In Function Purpose: Determines whether the KAREL program has motion control for the specified group of axes Syntax : MOTION_CTL<(group_m...

  • Page 221

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 5 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002Returns TRUE if the KAREL program has motion control for the specified group of axes. MOUNT_DEV Built-In Procedure Purpose: Mounts the specified device Synta...

  • Page 222

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 6 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002vect : VECTOR expressionangle :a REAL expression NOWAIT : Described under ``NOWAIT clause'' cond_handler : a local condition handler Details: angle is measur...

  • Page 223

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 7 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002MOVE ALONG Statement Purpose: Moves the TCP (and, optionally, auxiliary axes) continuously along the nodes of a PATH. Syntax : < WITH clause > MOVE ALO...

  • Page 224

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 8 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002reached. If a range of nodes is specified with start_node...end _node , the TCP (and, optionally, auxiliary axes) moves to the specified start_node , then to...

  • Page 225

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 9 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002{ cond_handler } ENDMOVE > where: WITH_clause : Described under ``WITH Clause'' distance : a REAL expression NOWAIT : Described under ``NOWAIT Clause'' co...

  • Page 226

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 10 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002Example A.81. MOVE AWAY Statement MOVE AXIS Statement Purpose: Moves a specified robot or auxiliary axis a distance specified in degrees or millimeters Synt...

  • Page 227

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 11 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002If an emergency stop occurs during a MOVE AXIS motion, a new destination is computed using the current position at the time the motion is resumed. The origi...

  • Page 228

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 12 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002Details: file_spec specifies the device, name, and type of the file to be moved. The file should exist on the FROM or RAM disks. If file_spec is a file on t...

  • Page 229

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 13 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002WITH_clause : Described under ``WITH Clause'' posn : a POSITION variable distance : a REAL expression NOWAIT : Described under ``NOWAIT Clause'' cond_handle...

  • Page 230

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 14 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002< NOWAIT ><, cond_handler { cond_handler } ENDMOVE > where: WITH_clause : Described under ``WITH Clause'' distance : a VECTOR or POSITION expres...

  • Page 231

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 15 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002start_pos by the value of direction. Example A.84. MOVE RELATIVE Statement MOVE TO Statement Purpose: Initiates motion of the robot TCP to a specified POSIT...

  • Page 232

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 16 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002A positional expression can be a POSITION, XYZWPR, XYZWPREXT or JOINTPOS. See Also: Local condition handlers, composed of WHEN and UNTIL Clauses, Chapter 6....

  • Page 233

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 17 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002Example A.85. MSG_CONNECT Built-In Procedure MSG_DISCO Built-In Procedure Purpose: Disconnect a client or server port from another computer. PROGRAM tcpserv...

  • Page 234

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 18 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002Syntax : MSG_DISCO (tag, status) Input/Output Parameters : [in] tag :STRING [out] status :INTEGER %ENVIRONMENT Group :FLBT Details: Tag is the name of a cli...

  • Page 235

    A.13. - M - KAREL LANGUAGE DESCRIPTIONPage 19 of 19http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s13.html4/16/2002Example A.86. MSG_PING Built-In Procedure PROGRAM pingtestVARTmp_int: INTEGERStatus: integerBEGINWRITE('pinging..',cr)MSG_PING('fido',status)WRITE('ping Sta...

  • Page 236

    A.14. - N - KAREL LANGUAGE DESCRIPTIONPage 1 of 7http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s14.html4/16/2002A.14. - N - KAREL LANGUAGE DESCRIPTION NOABORT Action Purpose: Prevents program execution from aborting when an external error occurs Details: The NOABORT act...

  • Page 237

    A.14. - N - KAREL LANGUAGE DESCRIPTIONPage 2 of 7http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s14.html4/16/2002time error), the %NOABORT directive will be ignored and program execution will be aborted. This directive is only effective for programs with %NOLOCKGROUP. If...

  • Page 238

    A.14. - N - KAREL LANGUAGE DESCRIPTIONPage 3 of 7http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s14.html4/16/2002%NOLOCKGROUP Translator Directive Purpose: Specifies that motion groups do not need to be locked when calling this program, or a routine defined in this progr...

  • Page 239

    A.14. - N - KAREL LANGUAGE DESCRIPTIONPage 4 of 7http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s14.html4/16/2002If the task contains executing or stopped motion, then task execution is held until the motion is completed. Stopped motion must be resumed and completed or c...

  • Page 240

    A.14. - N - KAREL LANGUAGE DESCRIPTIONPage 5 of 7http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s14.html4/16/2002See Also: %LOCKGROUP Translator Directive, LOCK_GROUP, UNLOCK_GROUP Built-In Procedures Example: Refer to the following sections for detailed program examples...

  • Page 241

    A.14. - N - KAREL LANGUAGE DESCRIPTIONPage 6 of 7http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s14.html4/16/2002execution will be paused. Example: The following example uses a global condition handler to test for error number 12311. If this error occurs, the NOPAUSE act...

  • Page 242

    A.14. - N - KAREL LANGUAGE DESCRIPTIONPage 7 of 7http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s14.html4/16/2002Syntax : %NOPAUSESHFT Details: This attribute can be set during task execution by the SET_TSK_ATTR built-in routine. NOWAIT Clause Purpose: Allows program exe...

  • Page 243

    A.15. - O - KAREL LANGUAGE DESCRIPTIONPage 1 of 5http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s15.html4/16/2002A.15. - O - KAREL LANGUAGE DESCRIPTION OPEN FILE Statement Purpose: Associates a data file or communication port with a file variable Syntax : OPEN FILE file_...

  • Page 244

    A.15. - O - KAREL LANGUAGE DESCRIPTIONPage 2 of 5http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s15.html4/16/2002OPEN HAND Statement Purpose: Opens a hand on the robot Syntax : OPEN HAND hand_num where: hand_num : an INTEGER expression Details: The actual effect of the s...

  • Page 245

    A.15. - O - KAREL LANGUAGE DESCRIPTIONPage 3 of 5http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s15.html4/16/2002[out] open_id :INTEGER [out] status :INTEGER %ENVIRONMENT Group :PBCORE Details: prog_name specifies the name of the teach pendant program to be opened. prog_...

  • Page 246

    A.15. - O - KAREL LANGUAGE DESCRIPTIONPage 4 of 5http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s15.html4/16/2002ORD Built-In Function Purpose: Returns the numeric ASCII code corresponding to the character in the STRING argument that is referenced by the index argument S...

  • Page 247

    A.15. - O - KAREL LANGUAGE DESCRIPTIONPage 5 of 5http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s15.html4/16/2002Instead of using this built-in, you can directly access the Orient Vector of a POSITION. The returned value is the orient vector of posn. The orient vector is...

  • Page 248

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 1 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002A.16. - P - KAREL LANGUAGE DESCRIPTION PATH Data Type Purpose: Defines a variable or routine parameter as PATH data type Syntax : PATH Details: A PATH is a v...

  • Page 249

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 2 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002An element of the PATHHEADER structure can be referenced with the syntax path_var_name.header_field_name. An element of a NODEDATA structure can be reference...

  • Page 250

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 3 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002The following example shows how an element of a NODEDATA structure can be referenced. Example A.95. PATH Data Type Example: Refer to the following sections f...

  • Page 251

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 4 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002Details: The returned value corresponds to the number of nodes in the PATH variable argument. Calling PATH_LEN with an uninitialized PATH returns a value of ...

  • Page 252

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 5 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002Purpose: Monitors the pausing of program execution Syntax : PAUSE < PROGRAM [n] > Details: The PAUSE condition is satisfied when a program is paused, f...

  • Page 253

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 6 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002All PULSE statements in execution continue execution. Sensing of conditions specified in condition handlers continues. Any actions, except routine call actio...

  • Page 254

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 7 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002task_name is the name of the task to be paused. If task name is '*ALL*', all executing tasks are paused except the tasks that have the ``ignore pause request...

  • Page 255

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 8 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002%ENVIRONMENT Group :MULTI Details: PEND_SEMA decrements the value of the semaphore. semaphore_no specifies the semaphore number to use. semaphore_no must be ...

  • Page 256

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 9 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002pipe_name is the name of the pipe file. If the file does not exist it will be created with this operation. CMOS_flag if set to TRUE will put the pipe data in...

  • Page 257

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 10 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002pop_id is returned from PUSH_KEY_RD and should be used to re-activate the read requests. status explains the status of the attempted operation. If not equal...

  • Page 258

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 11 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002OPERATIONS , Relational Conditions, Appendix A, ``KAREL Language Alphabetical Description'' Example: Refer to Section B.1., "Setting Up Digital Output ...

  • Page 259

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 12 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002[in] c :CONFIG %ENVIRONMENT Group :SYStem Details: c must be a valid configuration for the robot attached to the controller. CNV_STR_CONF can be used to con...

  • Page 260

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 13 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002[in] wjnt_cfg :CONFIG [in] ext_ang :ARRAY OF REAL [out] out_jnt :JOINTPOS [out] status :INTEGER %ENVIRONMENT Group :MOTN Details: The input ref_jnt are the ...

  • Page 261

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 14 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002The output status explains the status of the attempted operation. If it is not equal to 0, then an error has occurred. POS_REG_TYPE Built-In Procedure Purpo...

  • Page 262

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 15 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002See Also: GET_POS_REG, GET_JPOS_REG, SET_POS_REG, SET_JPOS_REG Built-in Procedures Example: The following example determines the position type in the regist...

  • Page 263

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 16 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002A POSITION consists of a matrix defining the normal, orient, approach, and location vectors and a component specifying a configuration string, for a total o...

  • Page 264

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 17 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002Input/Output Parameters: [in] error_code :INTEGER [in] parameter :STRING [in] cause_code :INTEGER [in] severity :INTEGER %ENVIRONMENT Group :PBCORE Details:...

  • Page 265

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 18 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002Syntax : POST_SEMA(semaphore_no) Input/Output Parameters: [in] semaphore_ no : INTEGER %ENVIRONMENT Group : MULTI Details: The semaphore indicated by semaph...

  • Page 266

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 19 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002status explains the status of the attempted operation. If not equal to 0, then an error occurred. %PRIORITY Translator Directive Purpose: Specifies task pri...

  • Page 267

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 20 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002[in] n_skip :INTEGER [in] format :INTEGER [out] ary_name :ARRAY of string [out] n_progs :INTEGER [out] status :INTEGER [in,out] f_index :INTEGER %ENVIRONMEN...

  • Page 268

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 21 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002total length = 15 charactersprog_name = 12 characters followed by a spaceprog_type = 2 characters ary_name is an ARRAY of STRING used to store the program n...

  • Page 269

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 22 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002The program name can be used to call the program as a procedure routine from within a program in the same way routine names are used to call procedure routi...

  • Page 270

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 23 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002OPERATIONSExample: Refer to Section B.1., "Setting Up Digital Output Ports for Monitoring" (DOUT_EX.KL) for a detailed program example. PULSE Stat...

  • Page 271

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 24 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002Example: In the following example a digital output is pulsed, followed by the pulsing of a second digital output. Because NOWAIT is specified, DOUT[start_ai...

  • Page 272

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 25 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002Purpose: Purges the specified memory file device by freeing any used blocks that are no longer needed Syntax : PURGE_DEV (device, status) Input/Output Param...

  • Page 273

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 26 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002[in] key_mask :INTEGER [out] pop_index :INTEGER [out] status :INTEGER %ENVIRONMENT Group :PBCORE Details: Suspends all read requests on the specified keyboa...

  • Page 274

    A.16. - P - KAREL LANGUAGE DESCRIPTIONPage 27 of 27http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s16.html4/16/2002Example: Refer to the READ_KB Built-In Procedure for an example.

  • Page 275

    A.17. - Q - KAREL LANGUAGE DESCRIPTIONPage 1 of 1http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s17.html4/16/2002A.17. - Q - KAREL LANGUAGE DESCRIPTION QUEUE_TYPE Data Type Purpose: Defines the data type for use in QUEUE built-in routines Syntax : queue_type = STRUCTURE ...

  • Page 276

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 1 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002A.18. - R - KAREL LANGUAGE DESCRIPTION READ Statement Purpose: Reads data from a serial I/O device or file Syntax : READ < file_var > (data_item {,data...

  • Page 277

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 2 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002the invalid data item and to reenter all subsequent items. Use IO_STATUS (file_var) to determine if the read operation was successful. See Also: Chapter 7., ...

  • Page 278

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 3 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002element_no specifies the element number to read. This element number is designated with a $ in the dictionary file. ksta is a KAREL STRING ARRAY used to stor...

  • Page 279

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 4 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002dict_name specifies the name of the dictionary from which to read. element_no specifies the element number to read. This number is designated with a $ in the...

  • Page 280

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 5 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002READ_KB Built-In Procedure Purpose: Read from a keyboard device and wait for completion Syntax : READ_KB(file_var, buffer, buffer_size, accept_mask, term_mas...

  • Page 281

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 6 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002file_var must be open to a keyboard-device. If file_var is also associated with a window, the characters are echoed to the window. The characters are stored ...

  • Page 282

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 7 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002kc_enter_key :Enter and Return keys kc_delete :Delete and Backspace keys kc_lr_arw :Left and Right Arrow keys kc_ud_arw :Up and Down Arrow keys kc_other :Oth...

  • Page 283

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 8 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002Example: Refer to Section B.2., "Copying Path Variables" (CPY_PTH.KL), for a detailed program example. The following example suspends any teach pen...

  • Page 284

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 9 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002REAL Data Type Purpose: Defines a variable, function return type, or routine parameter as a REAL data type with a numeric value that includes a decimal point...

  • Page 285

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 10 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002Example: Refer to the following sections for detailed program examples: Section B.5.,"Using Register Built-ins" (REG_EX.KL) Section B.8., "Ge...

  • Page 286

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 11 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002=< :less than or equal > :greater than >= :greater than or equal Both operands must be of the same data type and can only be of type INTEGER, REAL,...

  • Page 287

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 12 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002Example: In the following example, the robot hand, specified by gripper , is relaxed using the RELAX HAND statement. The robot then moves to the POSITION ps...

  • Page 288

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 13 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002[in] dict_name : STRING [in] lang_name : STRING [out] status : INTEGER %ENVIRONMENT Group :UIF Details: dict_name specifies the name of the dictionary to re...

  • Page 289

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 14 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002[in] nowait_sw : BOOLEAN [out] status : INTEGER %ENVIRONMENT Group :FDEV Details: old_file specifies the device, name, and type of the file to rename. new_f...

  • Page 290

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 15 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002old_nam is the current name of the variable. new_nam is the new name of the variable. status explains the status of the attempted operation. If not equal to...

  • Page 291

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 16 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002statement : a valid KAREL executable statement boolean_exp : a BOOLEAN expression Details: boolean_exp is evaluated after execution of the statements in the...

  • Page 292

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 17 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002%ENVIRONMENT Group :MOTN Details: successful will be TRUE even if conditions exist which prevent resetting the controller. To determine whether the reset op...

  • Page 293

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 18 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002Motion cannot be resumed for a different task. Example: Refer to Section B.1., "Setting Up Digital Output Ports for Monitoring" (DOUT_EX.KL) for a...

  • Page 294

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 19 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002RETURN Statement Purpose: Returns control from a routine/program to the calling routine/program, optionally returning a result Syntax : RETURN < (value) ...

  • Page 295

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 20 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002by the following rules: If x >= 0, let n be a positive INTEGER such that n <= x <= n + 1 If x >= n + 0.5, then n + 1 is returned; otherwise, n i...

  • Page 296

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 21 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002used to associate arguments passed in with references to parameters within the routine body. When a routine is from another program, the names in the parame...

  • Page 297

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 22 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002[in] lock_mask : INTEGER [out] status : INTEGER %ENVIRONMENT Group :MULTI Details: task_name is the name of the task to be run. This creates a child task. T...

  • Page 298

    A.18. - R - KAREL LANGUAGE DESCRIPTIONPage 23 of 23http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s18.html4/16/2002status explains the status of the attempted operation. If not equal to 0, then an error occurred. See Also: CONT_TASK, PAUSE_TASK, ABORT_TASK Built-In Proce...

  • Page 299

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 1 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002A.19. - S - KAREL LANGUAGE DESCRIPTION SAVE Built-In Procedure Purpose: Saves the program or variables into the specified file Syntax : SAVE (prog_nam, file_...

  • Page 300

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 2 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Purpose:Saves the RAM variable content to FlashROM.Syntax:SAVE_DRAM (prog_nam, status)Input/Output Parameters:[in] prog_nam: STRING[out] status: INTEGER%ENVI...

  • Page 301

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 3 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002statement : a valid KAREL executable statement Details: case_val is compared with each of the values following the CASE in each clause. If it is equal to any...

  • Page 302

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 4 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002that will be executed if the CYCLE START button is pressed or the teach pendant FWD key is pressed. status explains the status of the attempted operation. If...

  • Page 303

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 5 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002semaphore_no specifies the semaphore number to use. semaphore_no must be in the range of 1 to the number of semaphores defined on the controller. When the va...

  • Page 304

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 6 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002SEND_EVENTPC Built-In Procedure Purpose: To send an event message to the PC. Syntax : SEND_EVENTPC(event_no, status) Input/Output Parameters : [in] event_no ...

  • Page 305

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 7 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002SET_ATTR_PRG Built-In Procedure Purpose: Sets attribute data of the specified teach pendant or KAREL program Syntax : SET_ATTR_PRG(program_name, attr_number,...

  • Page 306

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 8 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002AT_DEF_GROUP : Default motion groups (for task attribute) AT_PROTECT : Protection code; 1 :protection OFF; 2 : protection ON AT_STK_SIZE : Stack size (for ta...

  • Page 307

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 9 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002%ENVIRONMENT Group :PBCORE Details: Sets the current cursor of the specified file that is open to a window so subsequent writes will start in the specified p...

  • Page 308

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 10 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002status explains the status of the attempted operation. If it is not equal to 0, then an error occurred. If group_no is omitted, the default group for the pr...

  • Page 309

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 11 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002%ENVIRONMENT Group :PBCORE Details: open_id specifies the opened teach pendant program. A program must be opened before calling this built-in. position_no s...

  • Page 310

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 12 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002See Also: SET_PORT_ATR Built-In Function, Section 7.2.1., ``Setting File Attributes". Example: Refer to the following sections for detailed program exa...

  • Page 311

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 13 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002directory, reads the positions from the file, and stores the positions in the PATH, my_path . Example A.112. SET_FILE_POS Built-In Procedure SET_INT_REG Bui...

  • Page 312

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 14 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002[in] register_no : INTEGER [in] jpos : JOINTPOS [out] status :INTEGER [in] group_no :INTEGER %ENVIRONMENT Group :REGOPE Details: register_no specifies the p...

  • Page 313

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 15 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002[in] group_no :INTEGER %ENVIRONMENT Group :PBCORE Details: open_id specifies the opened teach pendant program. Before calling this built-in, a program must ...

  • Page 314

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 16 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002dp_english dp_japanese dp_french dp_german dp_spanish The read-only system variable $LANGUAGE indicates which language is currently in use. status explains ...

  • Page 315

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 17 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002indx specifies the element number to be set in the $REFPOS1 array. The group of axes is implied from the specified position, jpos . If JOINTPOS is not in gr...

  • Page 316

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 18 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002[in] rack_no : INTEGER [in] slot_no : INTEGER [in] phy_port_type : INTEGER [in] phy_port_no : INTEGER [in] n_ports : INTEGER [out] status : INTEGER %ENVIRON...

  • Page 317

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 19 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Example: Refer to Section B.1., "Setting Up Digital Output Ports for Monitoring" (DOUT_EX.KL) for a detailed program example. SET_PORT_ATR Built-I...

  • Page 318

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 20 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002atr_dbits :Data length atr_xonoff :XON/XOFF atr_eol :End of line atr_modem :Modem line atr_value specifies the value for the attribute type. See Table A.20....

  • Page 319

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 21 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002A returned integer is the status of this action to port. See Also: SET_FILE_ATR Built-In Procedure, Section 7.2.1., ``Setting File and Port Attributes,'' fo...

  • Page 320

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 22 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002status is returned with zero if the parameters are valid and the specified mode can be set for the specified port. See Also: SET_PORT_VALUE, SET_PORT_MOD, G...

  • Page 321

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 23 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002status is returned with zero if the parameters are valid and the specified mode can be set for the specified port. Example: Refer to Section B.1., "Set...

  • Page 322

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 24 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002specified logical port Syntax : SET_PORT_VAL(port_type, port_no, value, status) Input/Output Parameters : [in] port_type : INTEGER [in] port_no : INTEGER [i...

  • Page 323

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 25 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002SET_POS_REG Built-In Procedure Purpose: Stores an XYZWPR value in the specified position register Syntax : SET_POS_REG(register_no, posn, status<, group_...

  • Page 324

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 26 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Input/Output Parameters : [in] open_id : INTEGER [in] position_no : INTEGER [in] posn : XYZWPR [out] status : INTEGER [in] group_no : INTEGER %ENVIRONMENT G...

  • Page 325

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 27 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002[in] comment_string: STRING[out] status: INTEGER%ENVIRONMENT group: REGOPESET_REAL_REG Built-In Procedure Purpose: Stores a REAL value in the specified regi...

  • Page 326

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 28 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Details:Register_no specifies which register to retrieve the comments from. The comment_string represents the data which is to be used to set the comment of...

  • Page 327

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 29 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002This value can be determined using the GET_TIME and CNV_STR_TIME Built-In procedures. If i is 0, the time on the system will not be changed. INTEGER values ...

  • Page 328

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 30 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002comment is the comment to be associated with the specified position. A zero length string can be used to ensure that a position has no comment. If the strin...

  • Page 329

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 31 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Input/Output Parameters : [in] task_name : STRING [in] attribute : INTEGER [in] value : INTEGER [out] status : INTEGER %ENVIRONMENT Group :PBCORE Details: t...

  • Page 330

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 32 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002status explains the status of the attempted operation. If not equal to 0, then an error occurred. See Also: GET_TSK_INFO Built-in Procedure Example: See exa...

  • Page 331

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 33 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002[in] var_name : STRING [in] value : Any valid KAREL data type except PATH, VIS_PROCESS, and MODEL [out] status : INTEGER %ENVIRONMENT Group :SYSTEM Details:...

  • Page 332

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 34 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002SHORT Data Type Purpose: Defines a variable as a SHORT data type Syntax : SHORT Details: SHORT, is defined as 2 bytes with the range of (-32768 <= n >...

  • Page 333

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 35 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Syntax : SIGNAL EVENT [event_no] where: event_no : an INTEGER Details: You can use the SIGNAL EVENT statement to indicate a user -defined event has occurred...

  • Page 334

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 36 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Function Return Type :REAL Input/Output Parameters : [in] angle : REAL %ENVIRONMENT Group :SYSTEM Details: angle specifies an angle in degrees. angle must b...

  • Page 335

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 37 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Purpose: Specifies stack size in long words. Syntax : %STACKSIZE = n Details: n is the stack size. The default value of n is 300 (1200 bytes). See Also: Sec...

  • Page 336

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 38 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002The stacked motion set can be removed from the stack and restarted with either a RESUME statement or action or by issuing RESUME from the operator interface...

  • Page 337

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 39 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002If the group clause is not present, all groups for which the task has control will be stopped. If the motion that is stopped, resumed, canceled, or held is ...

  • Page 338

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 40 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002declaration. A length value is not used when declaring STRING routine parameters; a STRING of any length can be passed to a STRING parameter. Attempting to ...

  • Page 339

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 41 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Purpose: Returns the current length of the specified STRING argument Syntax : STR_LEN(str) Function Return Type :INTEGER Input/Output Parameters : [in] str ...

  • Page 340

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 42 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002FILE types Vision types Variable length arrays The data structure itself, or any type that includes it, either directly or indirectly A variable may not be ...

  • Page 341

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 43 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Example: Refer to the following sections for detailed program examples: Section B.2., "Copying Path Variables" (CPY_PTH.KL) Section B.7., "Li...

  • Page 342

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 1 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002A.19. - S - KAREL LANGUAGE DESCRIPTION SAVE Built-In Procedure Purpose: Saves the program or variables into the specified file Syntax : SAVE (prog_nam, file_...

  • Page 343

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 2 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Purpose:Saves the RAM variable content to FlashROM.Syntax:SAVE_DRAM (prog_nam, status)Input/Output Parameters:[in] prog_nam: STRING[out] status: INTEGER%ENVI...

  • Page 344

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 3 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002statement : a valid KAREL executable statement Details: case_val is compared with each of the values following the CASE in each clause. If it is equal to any...

  • Page 345

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 4 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002that will be executed if the CYCLE START button is pressed or the teach pendant FWD key is pressed. status explains the status of the attempted operation. If...

  • Page 346

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 5 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002semaphore_no specifies the semaphore number to use. semaphore_no must be in the range of 1 to the number of semaphores defined on the controller. When the va...

  • Page 347

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 6 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002SEND_EVENTPC Built-In Procedure Purpose: To send an event message to the PC. Syntax : SEND_EVENTPC(event_no, status) Input/Output Parameters : [in] event_no ...

  • Page 348

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 7 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002SET_ATTR_PRG Built-In Procedure Purpose: Sets attribute data of the specified teach pendant or KAREL program Syntax : SET_ATTR_PRG(program_name, attr_number,...

  • Page 349

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 8 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002AT_DEF_GROUP : Default motion groups (for task attribute) AT_PROTECT : Protection code; 1 :protection OFF; 2 : protection ON AT_STK_SIZE : Stack size (for ta...

  • Page 350

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 9 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002%ENVIRONMENT Group :PBCORE Details: Sets the current cursor of the specified file that is open to a window so subsequent writes will start in the specified p...

  • Page 351

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 10 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002status explains the status of the attempted operation. If it is not equal to 0, then an error occurred. If group_no is omitted, the default group for the pr...

  • Page 352

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 11 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002%ENVIRONMENT Group :PBCORE Details: open_id specifies the opened teach pendant program. A program must be opened before calling this built-in. position_no s...

  • Page 353

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 12 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002See Also: SET_PORT_ATR Built-In Function, Section 7.2.1., ``Setting File Attributes". Example: Refer to the following sections for detailed program exa...

  • Page 354

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 13 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002directory, reads the positions from the file, and stores the positions in the PATH, my_path . Example A.112. SET_FILE_POS Built-In Procedure SET_INT_REG Bui...

  • Page 355

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 14 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002[in] register_no : INTEGER [in] jpos : JOINTPOS [out] status :INTEGER [in] group_no :INTEGER %ENVIRONMENT Group :REGOPE Details: register_no specifies the p...

  • Page 356

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 15 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002[in] group_no :INTEGER %ENVIRONMENT Group :PBCORE Details: open_id specifies the opened teach pendant program. Before calling this built-in, a program must ...

  • Page 357

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 16 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002dp_english dp_japanese dp_french dp_german dp_spanish The read-only system variable $LANGUAGE indicates which language is currently in use. status explains ...

  • Page 358

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 17 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002indx specifies the element number to be set in the $REFPOS1 array. The group of axes is implied from the specified position, jpos . If JOINTPOS is not in gr...

  • Page 359

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 18 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002[in] rack_no : INTEGER [in] slot_no : INTEGER [in] phy_port_type : INTEGER [in] phy_port_no : INTEGER [in] n_ports : INTEGER [out] status : INTEGER %ENVIRON...

  • Page 360

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 19 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Example: Refer to Section B.1., "Setting Up Digital Output Ports for Monitoring" (DOUT_EX.KL) for a detailed program example. SET_PORT_ATR Built-I...

  • Page 361

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 20 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002atr_dbits :Data length atr_xonoff :XON/XOFF atr_eol :End of line atr_modem :Modem line atr_value specifies the value for the attribute type. See Table A.20....

  • Page 362

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 21 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002A returned integer is the status of this action to port. See Also: SET_FILE_ATR Built-In Procedure, Section 7.2.1., ``Setting File and Port Attributes,'' fo...

  • Page 363

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 22 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002status is returned with zero if the parameters are valid and the specified mode can be set for the specified port. See Also: SET_PORT_VALUE, SET_PORT_MOD, G...

  • Page 364

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 23 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002status is returned with zero if the parameters are valid and the specified mode can be set for the specified port. Example: Refer to Section B.1., "Set...

  • Page 365

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 24 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002specified logical port Syntax : SET_PORT_VAL(port_type, port_no, value, status) Input/Output Parameters : [in] port_type : INTEGER [in] port_no : INTEGER [i...

  • Page 366

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 25 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002SET_POS_REG Built-In Procedure Purpose: Stores an XYZWPR value in the specified position register Syntax : SET_POS_REG(register_no, posn, status<, group_...

  • Page 367

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 26 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Input/Output Parameters : [in] open_id : INTEGER [in] position_no : INTEGER [in] posn : XYZWPR [out] status : INTEGER [in] group_no : INTEGER %ENVIRONMENT G...

  • Page 368

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 27 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002[in] comment_string: STRING[out] status: INTEGER%ENVIRONMENT group: REGOPESET_REAL_REG Built-In Procedure Purpose: Stores a REAL value in the specified regi...

  • Page 369

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 28 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Details:Register_no specifies which register to retrieve the comments from. The comment_string represents the data which is to be used to set the comment of...

  • Page 370

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 29 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002This value can be determined using the GET_TIME and CNV_STR_TIME Built-In procedures. If i is 0, the time on the system will not be changed. INTEGER values ...

  • Page 371

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 30 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002comment is the comment to be associated with the specified position. A zero length string can be used to ensure that a position has no comment. If the strin...

  • Page 372

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 31 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Input/Output Parameters : [in] task_name : STRING [in] attribute : INTEGER [in] value : INTEGER [out] status : INTEGER %ENVIRONMENT Group :PBCORE Details: t...

  • Page 373

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 32 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002status explains the status of the attempted operation. If not equal to 0, then an error occurred. See Also: GET_TSK_INFO Built-in Procedure Example: See exa...

  • Page 374

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 33 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002[in] var_name : STRING [in] value : Any valid KAREL data type except PATH, VIS_PROCESS, and MODEL [out] status : INTEGER %ENVIRONMENT Group :SYSTEM Details:...

  • Page 375

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 34 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002SHORT Data Type Purpose: Defines a variable as a SHORT data type Syntax : SHORT Details: SHORT, is defined as 2 bytes with the range of (-32768 <= n >...

  • Page 376

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 35 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Syntax : SIGNAL EVENT [event_no] where: event_no : an INTEGER Details: You can use the SIGNAL EVENT statement to indicate a user -defined event has occurred...

  • Page 377

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 36 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Function Return Type :REAL Input/Output Parameters : [in] angle : REAL %ENVIRONMENT Group :SYSTEM Details: angle specifies an angle in degrees. angle must b...

  • Page 378

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 37 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Purpose: Specifies stack size in long words. Syntax : %STACKSIZE = n Details: n is the stack size. The default value of n is 300 (1200 bytes). See Also: Sec...

  • Page 379

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 38 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002The stacked motion set can be removed from the stack and restarted with either a RESUME statement or action or by issuing RESUME from the operator interface...

  • Page 380

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 39 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002If the group clause is not present, all groups for which the task has control will be stopped. If the motion that is stopped, resumed, canceled, or held is ...

  • Page 381

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 40 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002declaration. A length value is not used when declaring STRING routine parameters; a STRING of any length can be passed to a STRING parameter. Attempting to ...

  • Page 382

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 41 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Purpose: Returns the current length of the specified STRING argument Syntax : STR_LEN(str) Function Return Type :INTEGER Input/Output Parameters : [in] str ...

  • Page 383

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 42 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002FILE types Vision types Variable length arrays The data structure itself, or any type that includes it, either directly or indirectly A variable may not be ...

  • Page 384

    A.19. - S - KAREL LANGUAGE DESCRIPTIONPage 43 of 43http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s19.html4/16/2002Example: Refer to the following sections for detailed program examples: Section B.2., "Copying Path Variables" (CPY_PTH.KL) Section B.7., "Li...

  • Page 385

    A.20. - T - KAREL LANGUAGE DESCRIPTIONPage 1 of 5http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s20.html4/16/2002A.20. - T - KAREL LANGUAGE DESCRIPTION TAN Built-In Function Purpose: Returns a REAL value that is the tangent of the specified REAL argument Syntax : TAN(ang...

  • Page 386

    A.20. - T - KAREL LANGUAGE DESCRIPTIONPage 2 of 5http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s20.html4/16/2002t indicates the time interval in milliseconds BEFORE or AFTER NODE[ n ]. The maximum value for t is 500. NODE[ n ] indicates the node BEFORE which or AFTER wh...

  • Page 387

    A.20. - T - KAREL LANGUAGE DESCRIPTIONPage 3 of 5http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s20.html4/16/2002Purpose: Specifies that task motion is enabled when the teach pendant is on Syntax : %TPMOTION Details: This attribute can be set during task execution by the...

  • Page 388

    A.20. - T - KAREL LANGUAGE DESCRIPTIONPage 4 of 5http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s20.html4/16/20020 Translation was successful268 Translator option is not installed35084 File cannot be opened or created.KL file cannot be found or default device is not the ...

  • Page 389

    A.20. - T - KAREL LANGUAGE DESCRIPTIONPage 5 of 5http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s20.html4/16/2002aborted with an error. ROUND and TRUNC can both be used to convert a REAL expression to an INTEGER expression. See Also: ROUND Built-In Function Example: The ...

  • Page 390

    A.21. - U - KAREL LANGUAGE DESCRIPTIONPage 1 of 7http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s21.html4/16/2002A.21. - U - KAREL LANGUAGE DESCRIPTION UNHOLD Action Purpose: Releases a HOLD of motion Syntax : UNHOLD <GROUP [n{,n}]> Details: Any motion that was in ...

  • Page 391

    A.21. - U - KAREL LANGUAGE DESCRIPTIONPage 2 of 7http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s21.html4/16/2002If motions are not held, the statement has no effect. Held motions are canceled if a RELEASE statement is executed. If the group clause is not present, all gr...

  • Page 392

    A.21. - U - KAREL LANGUAGE DESCRIPTIONPage 3 of 7http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s21.html4/16/2002Purpose: Unlocks motion control for the specified group of axes Syntax : UNLOCK_GROUP(group_mask, status) Input/Output Parameters: [in] group_mask :INTEGER [o...

  • Page 393

    A.21. - U - KAREL LANGUAGE DESCRIPTIONPage 4 of 7http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s21.html4/16/2002Example A.123. KAREL Motion Initialization status explains the status of the attempted operation. If not equal to 0, then an error occurred. See Also: LOCK_GR...

  • Page 394

    A.21. - U - KAREL LANGUAGE DESCRIPTIONPage 5 of 7http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s21.html4/16/2002Syntax : UNPAUSE Details: If a routine is called as an action, but program execution is paused, execution is resumed only for the duration of the routine and ...

  • Page 395

    A.21. - U - KAREL LANGUAGE DESCRIPTIONPage 6 of 7http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s21.html4/16/2002argument. Example A.125. UNPOS Built-In Procedure UNTIL Clause Purpose: Used in a MOVE statement to specify a local condition handler Syntax : UNTIL cond_list...

  • Page 396

    A.21. - U - KAREL LANGUAGE DESCRIPTIONPage 7 of 7http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s21.html4/16/2002Purpose: Defines a range of executable statements in which fields of a variable of a STRUCTURE type can be accessed without repeating the name of the variable...

  • Page 397

    A.22. - V - KAREL LANGUAGE DESCRIPTIONPage 1 of 8http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s22.html4/16/2002A.22. - V - KAREL LANGUAGE DESCRIPTION VAR_INFO Built-In Procedure Purpose: Allows a KAREL program to determine data type and numerical information regarding ...

  • Page 398

    A.22. - V - KAREL LANGUAGE DESCRIPTIONPage 2 of 8http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s22.html4/16/2002dims returns the dimensions of the array, if any. The size of the dims array should be 3. dims[1] = 0 if not an array dims[2] = 0 if not a two-dimensional arr...

  • Page 399

    A.22. - V - KAREL LANGUAGE DESCRIPTIONPage 3 of 8http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s22.html4/16/2002status explains the status of the attempted operation. If not equal to 0, then an error occurred. Example: The following example retrieves information regardi...

  • Page 400

    A.22. - V - KAREL LANGUAGE DESCRIPTIONPage 4 of 8http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s22.html4/16/2002[out] ary_nam : ARRAY of STRING [out] n_vars : INTEGER [out] status : INTEGER %ENVIRONMENT Group :BYNAM Details: prog_name specifies the name of the program t...

  • Page 401

    A.22. - V - KAREL LANGUAGE DESCRIPTIONPage 5 of 8http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s22.html4/16/2002n_skip is used when more variables exist than the declared length of ary_nam . Set n_skip to 0 the first time you use VAR_LIST. If ary_nam is completely fille...

  • Page 402

    A.22. - V - KAREL LANGUAGE DESCRIPTIONPage 6 of 8http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s22.html4/16/2002Only VECTOR expressions can be assigned to VECTOR variables, returned from VECTOR function routines, or passed as arguments to VECTOR parameters. Valid VECTOR...

  • Page 403

    A.22. - V - KAREL LANGUAGE DESCRIPTIONPage 7 of 8http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s22.html4/16/2002Details: VIA clauses are required and permitted only in moves using circular interpolation ($MOTYPE=CIRCULAR). VIA clauses are permitted only in MOVE TO state...

  • Page 404

    A.22. - V - KAREL LANGUAGE DESCRIPTIONPage 8 of 8http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s22.html4/16/2002TPP: The area of system memory where teach pendant programs are stored. PERM: The area of permanent CMOS RAM memory where system variables and selected KAREL ...

  • Page 405

    A.24. - X - KAREL LANGUAGE DESCRIPTIONPage 1 of 2http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s24.html4/16/2002A.24. - X - KAREL LANGUAGE DESCRIPTION XYZWPR Data Type Purpose: Defines a variable, function return type, or routine parameter as XYZWPR data type Syntax : X...

  • Page 406

    A.24. - X - KAREL LANGUAGE DESCRIPTIONPage 2 of 2http://www.frc.com/edoc/latest/latest_software/MCXXIBK6209011E_Rev_A/ap01s24.html4/16/2002XYZWPREXT Data Type Purpose: Defines a variable, function return type, or routine parameter as an XYZWPREXT Syntax : XYZWPREXT <IN GROUP [n]> Details: A...

x