|
|
|
9. Functions
㻌
Example
Variable #pos is expressed by joint displacement values and is an one-dimensional array from㻌
#pos[0] to #pos[100]. The dimension number is omitted.
ret= MAXINDEX (“#pos”)
The value for variable ret is 100.
Variable #place is expressed by joint displacement values and is a two-dimensional array from
#place[1,1] to #place[1,5].
ret=MAXINDEX (“#place”, 2)
The value for variable ret is 5.
Variable #place is expressed by joint displacement values and is a three-dimensional array from
#place[2,1,10] to #place[2,1,20].
ret=MAXINDEX (“#place”, 3)
The value for variable ret is 20.
This program displays transformation values for variable pos. pos is an one-dimensional array.
.PROGRAM index()
max = MAXINDEX("pos",1)
min = MININDEX("pos",1)
FOR j = min TO max
$val = "pos"+"["+$ENCODE(/I2,j)+"]"
ret = EXISTTRANS($val)
IF ret==FALSE THEN
GOTO continue
END
DECOMPOSE x[0] = pos[j]
TYPE "pos[",j,"] =",/F8.3,x[0],/X3,/F8.3,x[1],/X3,/F8.3,x[2]
continue:
END
.END
9-17
9. Functions
MINXINDEX (string variable, dimension number )
Function
Returns the value of the smallest element in the specified dimension number of an array.
Parameter
String variable
Specifies the name of the array variable.
Dimension number
Specifies the dimension number. (1-3)
If the value is not specified between one and three, an error occurs. If not specified, 1 is
assumed.
㻌
Explanation
Returns the value of the smallest element in the specified dimension number of the array if the
array has been already defined.
Returns -1 if the variable is not arrays.
Returns -2 if the variable has not been defined.
㻌
Example
Variable #pos is expressed by joint displacement values and is an one-dimensional array from
#pos[0] to #pos[100].
ret=MININDEX(“#pos”䠈1)
The value for variable ret is 0.
Variable
#place is expressed by joint displacement values and is a two-dimensional array from
#place[1,1] to #place[1,5].
ret=MININDEX(“#place”䠈2)
The value for variable ret is 1.
Variable #place is expressed by joint displacement values and is a three-dimensional array from
#place[2,1,10] to #place[2,1,20].
ret=MININDEX(“#place”䠈3)
The value for variable ret is 10.
9-18
9. Functions
㻌
SWITCH (switch name)
㻌
Function㻌
Returns the current condition of the specified system switch.
Explanation㻌
1 is returned if the switch is ON, 0 is returned if it is OFF.
WHICHTASK program name
㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌 㻌㻌㻌
Function㻌
Returns the task number selected by the specified program (subroutine).
Parameter㻌
Program name
Specifies the name of the program or subroutine in form of string variable. The variable name
should start with $.
Explanation㻌
Returns the task number in real values.
1: Robot program (Robot 1)
2: Robot program (Robot 2)
1001: PC program 1
1004: PC program 4
1002: PC program 2
1005: PC program 5
1003: PC program 3
-1: Executed task does not exist.
Example㻌
task_no=WHICHTASK($pg_name)
Stores the tasks number in variable if the task
selected by program $pg_name exists. If it does
not exists, task_no= -1.
9-19
9. Functions
㻌
TASK㻌 (task number)㻌
㻌
Function㻌
Returns the execution status of the program specified by the task number.
Parameter㻌
Task number
1: Robot 1
2: Robot 2
1001: PC program 1
1004: PC program 4
1002: PC program 2
1005: PC program 5
1003: PC program 3
Explanation㻌
This function returns execution status of a program. For example, this function can be used to
monitor the execution status of a PC program from a robot control program. Then the condition
of robot operation can be set according to the status of the PC program.
The values returned by this function are:
0
Not in execution
1
Program running.
2
Program execution held.
Execution of the stepper completed; waiting for the
3
completion of robot motion.
9-20
9. Functions
㻌
ERROR
㻌
Function㻌
Returns the error code of the current error.
Explanation㻌
Returns the error code when an error is currently occurring. The value 0 is returned when no
error is occurring.
Reread the error number as below:
-4xxxx: Dxxxx
-3xxxx: Exxxx
-2xxxx: Wxxxx
-1xxxx: Pxxxx
When -41500 is returned, error D1500 “Encoder misread error. JtXX” is displayed.
Example㻌
type $ERROR (ERROR)
TYPE instruction displays the error message of the error code
returned by the function ERROR.
PRIORITY
Function㻌
Returns the priority number of the current robot program.
Explanation㻌
Returns the priority number (in real value) of robot program currently selected on the stack.
There is no priority setting among PC programs.
The default value for robot program priority is 0. The priority number can be changed via
LOCK instruction.
9-21
9. Functions
UTIMER (@ timer variable)㻌
Function㻌
Returns the current value of the @timer variable set by UTIMER instruction.
Parameter㻌
@timer variable
Specifies the name of the variable set by UTIMER instruction. An @ sign is added to the
beginning of the variable name so that a whole number variable can be specified.
㻌
㻌
㻌
㻌
㻌
㻌
㻌
㻌
㻌
MSPEED
MSPEED2
Function㻌
Returns the current monitor speed (0 to 100 %).
MSPEED is for Robot 1 and MSPEED2, for Robot 2.
9-22
9. Functions
㻌
INRANGE (pose variable 1, joint displacement value variable)㻌
Function㻌
Checks if a pose is within the robot’s motion range and returns a value depending on the result of
this check (see the table below).
Parameter㻌
Pose variable 1
Specifies which pose to check.
(Joint displacement values, transformation values, or compound
transformation values).
Joint displacement value variable
Specify a pose defined by joint displacement values. This parameter is entered only when the
specified pose variable 1 is defined by transformation values or compound transformation values.
The robot configuration is calculated by the pose variable 2 defined by joint displacement values.
If not specified, the current configuration is used.
Explanation㻌
The values returned by this function are as follows:
0
Out of motion range.
1
JT1 is out of motion range.
2
JT2 is out of motion range.
4
JT3 is out of motion range.
8
JT4 is out of motion range.
16
JT5 is out of motion range.
32
JT6 is out of motion range.
16384
Beyond the collision check range.
32768
Out of reach of robot arm.
㻌
[ NOTE ]
㻌
This function checks if the pose is in the motion range but does not check
㻌
if the path to that pose is within the motion range.
㻌
Example㻌
IF INRANGE(pos1, #p) GOTO ERR STOP
:
ERR_STOP:
Jumps to label ERR_STOP if pose pos1 is out
TYPE "pose pos1is out of motion range.”
of motion range, displays the message, and
PAUSE
stops.
9-23
9. Functions
SYSDATA
(keyword, opt1, opt2)㻌
Function㻌
Returns specified parameters in the AS system according to the given keyword.
Parameter㻌
Keyword, opt1, opt2
M.SPEED
Returns monitor speed (in percentage). If no motion step is being executed, 1 is returned.
Opt 1: Robot number (1 to number of robots). If not entered, 1 is assumed.
Opt 2: Not used.
MSTEP
Returns the step number of the motion step in execution or the last executed motion step in the
program in execution. If no such step exists, 1 is returned.
Opt 1: Robot number (1 to number of robot). If not entered, 1 is assumed.
Opt 2: Not used.
STEP
Returns the step number of the motion step in execution or the last executed motion step in the
program in execution. If no such step exists, 1 is returned.
Opt 1: Robot number (1 to number of robot) or PC task number (1001 to number of PC
programs). If not entered, 1 is assumed.
Opt 2: Not used.
P.SPEED
Returns the motion speed (in percentage) of the current motion or the next motion executed. If
the speed is set in seconds, 1 is returned.
Opt 1: Robot number (1 to number of robot). If not entered, 1 is assumed.
Opt 2: Not used.
P.SPEED.M
Returns the motion speed (in MM/S) of the current motion or the next motion executed. If the
speed is set in seconds, 1 is returned.
Opt 1: Robot number (1 to number of robot). If not entered, 1 is assumed.
Opt 2: Not used.
9-24
9. Functions
P.ACCEL
Returns the acceleration (in percentage) of the motion step in execution or the last executed
motion step in the program in execution. If the motion speed is set in time (unit: S), 1 is
returned.
Opt 1: Robot number (1 to number of robots). If not entered, 1 is assumed.
Opt 2: Not used.
P.DECEL
Returns the deceleration (in percentage) of the motion step in execution or the last executed
motion step in the program in execution. If the motion speed is set in time (unit: S), 1 is
returned.
Opt 1: Robot number (1 to number of robots). If not entered, 1 is assumed.
Opt 2: Not used.
MTR.RPM
Returns the rpm value for the motor speed (actual value) of the specified axis.
Opt 1: Robot number (1 to number of robots). If not entered, 1 is assumed.
Opt 2: Axis number. JT 1 is selected when omitted.
MTR.RPM.CMD
Returns the rpm value for the motor speed (command value) of the specified axis.
Opt 1: Robot number (1 to number of robots). If not entered, 1 is assumed.
Opt 2: Axis number. JT 1 is selected when omitted.
TOOL.VEL.CMD
Returns the mm/s value for the tool center point speed (command value) of the specified axis.
Opt 1: Robot number (1 to number of robots). If not entered, 1 is assumed.
Opt 2: Not used.
JT.VEL.CMD
Returns the deg/s value for rotation axis or mm/s value for linear axis for the speed (command
value) of the specified axis.
Opt 1: Robot number (1 to number of robots). If not entered, 1 is assumed.
Opt 2: Axis number. JT 1 is selected when omitted.
NUMROBOT
Returns the number of robots connected.
Opt1: Not used.
Opt2: Not used.
9-25
9. Functions
ZROB.MGFNO
Returns the robot number.
opt1䈈Robot number (1 to number of robot). If not entered, 1 is assumed.
opt2: Not used.
ZROB.NOWAXIS
Returns the number of axis of the robot.
Opt1䈈Robot number (1 to number of robot).
If not entered, 1 is assumed.
Opt2: Not used.
SIG.DO
Returns the number of external output signal.
Opt1: Not used.
Opt2: Not used.
SIG.DI
Returns the number of external input signal.
Opt1: Not used.
Opt2: Not used.
SIG.INT
Returns the number of internal signal.
Opt1: Not used.
Opt2: Not used.
LANGUAGE
Returns the number of the language selected for display. The language numbers are as follows.
Japanese
1
English
2
Italian
3
Finnish
4
German
5
Chinese
6
Korean
7
Russian
8
Polish
9
Spanish
10
Dutch
11
Opt1: Not used.
Opt2: Not used.
MEM.FREE
Returns the size of the memory currently available in percentage.
Opt1: Not used.
Opt2: Not used.
9-26
9. Functions
EXISTJOINT (“name of joint displacement value variable” )
Function
Checks if the specified pose variable exists as variable defined by joint displacement values.
Parameter㻌
“Name of joint displacement value variable”
Specifies the name of joint displacement value variable in form of character string. The variable
name should be enclosed in quotations. Start the name with #.
㻌
Explanation㻌
If the variable exists, returns -1. If it does not exist, returns 0.
[ NOTE ]
㻌
㻌
There are restrictions as described below when specifying array variables.
1. Specify the area of array elements. This cannot be omitted.
2. The minimum value is written to the left of the colon “:”㻌 and the largest values is
written to the right.
㻌
㻌
For example, if real variable r is a three-dimensional array and elements r[1,1,1],
㻌
r[1,1,2], and r[1,1,3] exist,
㻌
Check will result OK
r[1,1,1:3]
Check will result NG
r[1,1,1:]
䠗Area not specified
㻌
r[1,1,*]
䠗Area not specified
㻌
r[1,1,3:1]
䠗Area specified in wrong order
㻌
(from largest to smallest)
㻌
㻌
Example
ret=EXISTJOINT(“#pos”)
If joint displacement value variable #pos exists, ret= -1.
If
not, ret=0.
The following shows a case where joint displacement value variable #place is a two-dimensional
array from #place[1,1] to #place[1,5].
ret=EXISTJOINT(“#place”)
ret will equal -1.
ret=EXISTJOINT(“#place[1,1]”)
#place[1,1]exists, so ret=-1.
ret=EXISTJOINT(“#place[1,1:5]”)
#place[1,1] to #place[1,5] exists, so ret=-1.
ret=EXISTJOINT(“#place[1,1:6]”)㻌
#place[1,6]㻌 does not exist, so ret = 0.
9-27
9. Functions
EXISTTRANS
(“name of transformation value variable”)
Function
Checks if the specified pose variable exists as variable defined by transformation values.
Parameter㻌
“Name of transformation value variable”
Specifies the name of transformation value variable in form of character string. The variable
name should be enclosed in quotations.
㻌
Explanation㻌
If the variable exists, returns -1. If it does not exist, returns 0.
See EXISTJOINT for restrictions and examples for specifying array variable.㻌
㻌
Example㻌
ret=EXISTTRANS(“pos1”)
If transformation value variable pos1 defined by transformation
values exists, ret=-1. If not, ret=0.
EXISTREAL
(“real variable name”)
Function㻌
Checks if the specified variable exists as real variable.
Parameter㻌
“Real variable name”
Specifies the name of real variable in form of character string. The variable name should be
enclosed in quotations.
㻌
Explanation㻌
If the variable name exists, returns -1. If it does not exist, returns 0.
See EXISTJOINT for restrictions and examples for specifying array variable.㻌
㻌
Example㻌
ret=EXISTREAL(“pp”)
If real variable pp exists, ret=-1. If not, ret=0.
9-28
9. Functions
EXISTCHAR㻌 㻌 (“string variable name”)
Function㻌
Checks if the specified variable exists as string variable.
Parameter㻌
“String variable name”
Specifies the name of string variable in form of character string. The variable name should be
enclosed in quotations. Start the name with $.
Explanation㻌
If the string variable exists, returns -1. If it does not exist, returns 0.
See EXISTJOINT for restrictions and examples for specifying array variable.㻌
㻌
Example㻌
ret=EXISTCHAR(“$val”)
If string variable $val exists, ret=-1.
If not, ret=0.
EXISTINTEGER
(“integer variable name”)
Function㻌
Checks if the specified variable exists as integer variable.
Parameter㻌
“Integer variable name”
Specifies the name of integer variable in form of character string. The variable name should be
enclosed in quotations. Start the name with @.
㻌
Explanation㻌
If the integer variable exists, returns -1. If it does not exist, returns 0.
See EXISTJOINT for restrictions and examples for specifying array variable.㻌
㻌
Example㻌
ret=EXISTINTEGER(“@abc”)
If integer variable @abc exists, ret=-1. If not, ret=0.
9-29
9. Functions
㻌
EXISTPGM
(“program name”)
Function
Checks if the specified program exists or not.
Parameter
“Program name”
Specifies program (or subroutine) name in form of string variable.
Explanation
If the specified program or subroutine exists, returns -1. If it does not exist, returns 0 (zero).
㻌
Example
ret=EXISTPGM(“pg1”)
If program pg1 exists, ret=-1. If not, ret=0.
EXISTLOCALJOINT㻌(“name of local joint displacement value variable” )㻌
Function
Checks if the specified local pose variable exists as variable defined by joint displacement values.
Parameter㻌
“Name of local joint displacement value variable”
Specifies the name of local joint displacement value variable in form of character string. The
variable name should be enclosed in quotations. Start the name with #. Error occurs if
variable other than local joint displacement value variable is specified.
Explanation㻌
If the variable exists, returns -1. If it does not exist, returns 0.
9-30
9. Functions
[ NOTE ]
㻌 㻌
There are restrictions as described below when specifying array variables.
1. Specify the area of array elements. This cannot be omitted.
2. The minimum value is written to the left of the colon “:”㻌 and the largest values
is written to the right.
For example, if real variable r is a three-dimensional array and elements r[1,1,1],
r[1,1,2], and r[1,1,3] exist,
Check will result OK
r[1,1,1:3]
Check will result NG
r[1,1,1:]
䠗Area not specified
r[1,1,*]
䠗Area not specified
r[1,1,3:1]
䠗Area specified in wrong order
(from largest to smallest)
Example
ret=EXISTLOCALJOINT(“.#pos”)
If local joint displacement value variable #pos
exists, ret= -1. If not, ret=0.
The following shows a case where local joint displacement value variable #place is a
two-dimensional array from #place[1,1] to #place[1,5].
ret=EXISTLOCALJOINT(“.#place”)
.#place does not exist, so ret = 0.
ret=EXISTLOCALJOINT(“.#place[1,1]”)
.#place[1,1] exists, so ret=-1.
ret=EXISTLOCALJOINT(“.#place[1,1:5]”)
.#place[1,1] to .#place[1,5] exist, so ret=-1.
ret = EXISTLOCALJOINT(“.#place[1,1:6]”)
.#place[1,6] does not exist, so ret = 0.
9-31
9. Functions
EXISTLOCALTRANS (“name of local transformation value variable”)㻌
Function
Checks if the specified pose variable exists as local variable defined by transformation values.
Parameter㻌
“Name of transformation value variable”
Specifies the name of local transformation value variable in form of character string. The
variable name should be enclosed in quotations. Error occurs if variable other than local
transformation value variable is specified.
Explanation㻌
If the variable exists, returns -1. If it does not exist, returns 0.
See EXISTLOCALJOINT for restrictions and examples for specifying array variable.㻌
Example㻌
ret=EXISTLOCALTRANS(“.pos1”) If local variable pos1 defined by transformation values
exists, ret=-1. If not, ret=0.
9-32
9. Functions
EXISTLOCALREAL㻌(“real variable name”)㻌
Function㻌
Checks if the specified variable exists as local real variable.
Parameter㻌
“Local real variable name”
Specifies the name of local real variable in form of character string. The variable name should
be enclosed in quotations. Error occurs if variable other than local real value variable is
specified.
Explanation㻌
If the variable exists, returns -1. If it does not exist, returns 0.
See EXISTLOCALJOINT for restrictions and examples for specifying array variable.㻌
Example㻌
ret=EXISTLOCALREAL(“.pp”)
If local real value variable .pp exists, ret=-1. If not,
ret=0.
㻌
9-33
9. Functions
EXISTLOCALCHAR㻌(“string variable name”)㻌
Function㻌
Checks if the specified local variable exists as string variable.
Parameter㻌
“Local string variable name”
Specifies the name of local string variable in form of character string. The variable name should
be enclosed in quotations. Start the name with $. Error occurs if variable other than local
string variable is specified.
Explanation㻌
If the string variable exists, returns -1. If it does not exist, returns 0.
See EXISTJOINT for restrictions and examples for specifying array variable.㻌
㻌
Example㻌
ret=EXISTLOCALCHAR(“.$val”)
If local string variable .$val exists, ret=-1.
If nt, ret=0.
9-34
9. Functions
EXISTLOCALINTEGER㻌(“local integer variable name”)㻌
Function㻌
Checks if the specified local variable exists as integer variable.
Parameter㻌
“Local integer variable name”
Specifies the name of local integer variable in form of character string. The variable name
should be enclosed in quotations. Start the name with @. Error occurs if variable other than
local integer variable is specified.
Explanation㻌
If the integer variable exists, returns -1. If it does not exist, returns 0.
See EXISTJOINT for restrictions and examples for specifying array variable.㻌
Example㻌
ret=EXISTLOCALINTEGER (“.@abc”) 㻌
If integer variable @abc exists, ret=-1.
If not, ret=0.
㻌
9-35
9. Functions
STRTOPOS (string variable)
Function㻌
Returns the value of the pose variable that is specified by the string variable.
Parameter
String variable
Specifies a character string variable to get the specified pose values. The string variable name
should start with $.
Explanation㻌
Returns the value of the pose variable if a pose variable has been already assigned to the string
variable. If a pose variable has not been assigned, an error occurs.
Example
HERE
#pos
$A = “#pos”
JMOVE STRTOPOS($A)
The string value “$A” specifies “#pos”. The robot moves to the
destination which was described by joint displacement values
“#pos”. If “#pos” has not been defined, an error occurs.
㻌
9-36
9. Functions
STRTOVAL (string variable)
Function
Returns the real value specified by the string variable.
㻌
Parameter
String variable
Specifies character string variable to get the specified real value. The string variable name
should start with $.
㻌
Explanation
Returns the real value if a real variable has been already assigned to the string variable. If a real
variable has not been assigned, an error occurs.
㻌
Example
VAR = 5
$VA = “VAR”
total = STRTOVAL($VA)+6
The string variable “$VA” specifies the real variable
“VAR”. The real variable “total” is eleven as “VAR” is
five. If the variable “VAR” has not been defined, an error
occurs.
9-37
9. Functions
㻌
ROUND (numeric value)㻌
㻌
Function
Returns the value rounded at the first decimal place.
Parameter
Numeric value
This value is rounded at the first decimal place.
Explanation
Returns the value rounded at the first decimal place of the value specified as the parameter. When
the specified value is a negative value, the value is rounded as an absolute value and then, the
negative sign is added. The sign of the numeric value specified as the parameter remains
unchanged unless the result is 0.
Example
ROUND (0.123)
Returns 0.
ROUND (10.8)
Returns 11.
ROUND (-5.462)
Returns -5.
ROUND (-5.662)
Returns -6.
9-38
9. Functions
㻌
IQARM (axis number)
㻌
Function
Returns the motor current value of the axis with the specified number.
Parameter
Axis number
Specify the number of the axis to acquire the motor current value. Acceptable range: 1- to the
number of axes set.
Explanation
Returns the motor current value for the axis with the number specified in the parameter. Unit is in
Arms.
Error occurs when used under the below condition:㻌
When axis number of Mitsubishi motor is specified, error “(E1145) Cannot use specified channel,
already in use.” occurs if this function is used when monitoring of the motor current value is
conducted by WHERE command, etc.
Example
a = IQARM(1)
Returns the motor current value of JT1 and substitutes it to a.
9-39
9. Functions
TRQNM (axis number)㻌
㻌
Function
Returns the torque value of the axis with the specified number.
Parameter
Axis number
Specify the number of the axis to acquire the torque value. Acceptable range: 1- to the number
of axes set. This function cannot be used for axis with Mitsubishi motor.
Explanation
Returns the torque value for the axis with the number specified in the parameter. Unit is in
N·m.
Example
a = TRQNM(1)
Returns the torque value of JT1 and substitutes it to a.
9-40
9. Functions
CURLIMM (axis number)
Function
Acquires the negative limit value for the motor current of the external axis.
Parameter
Axis number
Specify the number of the external axis. Acceptable range: 7- 18.
Explanation
Acquires the limit value for the negative current of the external axis motor set by CURLIM
instruction in form of percentage to the servo parameter current limit value. Unit is in %.
Range of acquisition: 0 - 100.
This function is valid only for external axis using KHI amplifier.
Refer to CURLIM instruction for setting of current limit value.
Example
CURLIM 7,10,20
Sets the current limit value for JT7.
curm7 = CURLIMM(7)
Acquires the negative value for the set current limit value
and stores it in the variable.
In this example, 20 is stored in “curm7”.
9-41
9. Functions
CURLIMP (axis number)
Function
Acquires the positive limit value for the motor current of the external axis.
Parameter
Axis number
Specify the number of the external axis. Acceptable range: 7-㻌 18.
Explanation
Acquires the limit value for the positive current of the external axis motor set by CURLIM
instruction in form of percentage to the servo parameter current limit value. Unit is in %. Range
of acquisition: 0 - 100.
This function is valid only for external axis using KHI amplifier.
Refer to CURLIM instruction for setting of current limit value.
Example
CURLIM 7,10,20
Sets the current limit value for JT7.
curp7 = CURLIMP(7)
Acquires the positive value for the set current limit value and
stores it in the variable.
In this example, 10 is stored in “curp7”.
9-42
9. Functions
ENVCHKRATE (axis number)
Function
Acquires the set value for the magnification ratio to the initial threshold value to detect the
deviation abnormality of the external axis.
Parameter
Axis number
Specify the number of the external axis. Acceptable range: 7- 18.
Explanation
Acquires the value set in ENVCHKRATE instruction for the magnification ratio to the initial
threshold value for detection of deviation abnormality in external axis.
This function is valid only for external axis using KHI amplifier.
Refer to ENVCHKRATE instruction for the setting of magnification ratio to the deviation error.
Example
ENVCHKRATE
7, 0.1
Sets the magnification ratio to the deviation error detection
threshold in JT7.
env7=ENVCHKRATE(7)
Stores the acquired magnification ratio to the variable.
In this example, 0.1 is stored in “env 7”.
9-43
9. Functions
㻌
GETENCTEMP (axis number)㻌
㻌
Function
Returns the temperature [°C] of the encoder of the axis of the specified number.
Parameter
Axis number
Specify the number of axis to acquire the encoder temperature. Acceptable range: 1- to the
number of axes set.
Explanation
Returns the encoder temperature [°C] of the specified axis.
㻌
If the specified axis is disconnected, 0 is returned.
When the axis number is omitted, the specified axis number does not exist,㻌 or if the specified
axis is an external axis not using KHI amplifier, error occurs and the program stops.
Example
The examples below acquire the encoder temperature for JT4 of Robot 1.
Example of monitor command
>x = GETENCTEMP(4)
>PRINT x
>55.75
Example of program
.PROGRAM enctemp.pc()
X = GETENCTEMP(4)
TYPE X
.END
9-44
9. Functions
9.2 POSE VALUE FUNCTIONS
DEST
Returns the destination pose as transformation values.
#DEST
Returns the destination pose as joint displacement values.
FRAME
Returns the transformation values for the frame coordinates.
NULL
Returns the null transformation values.
HERE
Returns the transformation values of the current pose.
#HERE
Returns the joint displacement values of the current pose.
TRANS
Returns the transformation values composed of the given
components.
RX, RY, RZ
Returns the transformation value expressing the rotation around an
axis.
#PPOINT
Returns the joint displacement values composed of the given
components.
SHIFT
Returns the transformation value generated by shifting the original
pose.
AVE_TRANS
Returns the average transformation values of two poses.
BASE
Returns the base transformation values.
TOOL
Returns the tool transformation values.
TRADD
Returns the value of the X component with the value of the
traverse axis added. (Option)
TRSUB
Returns the value of the X component with the value of the
traverse axis subtracted. (Option)
#HOME
Returns the joint displacement value of the home pose.
CCENTER
Returns the transformation values for the center of the circle
described by the given poses. (Option)
CSHIFT
Returns the transformation values of the pose shifted towards the
center of the circle described by the given poses. (Option)
9-45
9. Functions
DEST
#DEST
Function㻌
DEST: Returns the transformation values of the destination of current robot motion.
#DEST: Returns the joint displacement values of the destination of current robot motion.㻌
Explanation㻌
By using these functions, the robot destination can be found out after the robot motion is
interrupted for some reason. These functions can be used with all robot motions.
[ NOTE ]
The pose where the robot stops and the pose returned by DEST/ #DEST functions are not
always the same. For example, if the HOLD/RUN state is changed from RUN to HOLD,
the robot stops immediately, but the pose returned by DEST/ #DEST functions describes the
pose the robot was heading for at that moment.
㻌
Example㻌
DEST/ #DEST functions are convenient when resuming the motion interrupted by ONI...CALL
instruction. Include the following instructions as shown in the subroutine below so that the
robot can return to the path motion that it left.
POINT save=HERE
Stores the current pose as “save”.
POINT old=DEST
Stores the destination pose as “old”.
JDEPART 50.0
Backs 50 mm. (Joint interpolation)
:
:
JAPPRO save, 50.0
Approaches the pose “save” by 50 mm above the pose. (Joint
interpolation)
LMOVE save
Move to pose “save”. (Linear interpolation)
LMOVE old
Move to pose “old”. (Linear interpolation)
9-46
|
|