
Chapter 7 PAC Language Configuration Elements
7-7
[ 2 ] Local Variable
The following variable types can be used for local variables in the same
manner as global variables.
• Type I: integer type (range: - 2147483648 ~ + 2147483647)
• Type F: single precision real type (-3.402823E + 38 ~ 3.402823E + 38)
• Type D: double precision real type
(- 1.79769313486231D + 308 ~ 1.79769313486231D + 308)
• Type S: character string type (maximum 247 characters)
• Type V: vector type (X, Y, Z)
• Type P: position type (X, Y, Z, RX, RY, RZ, FIG) (6 axes )
• Type J: joint type (J1, J2, J3, J4, J5, J6) (6 axes )
• Type T: homogeneous transformation type
(Px, Py, Pz, Ox, Oy, Oz, Ax, Ay, Az, FIG)
• Type IO: I/O type
Local variables can be used after type declaration is executed using type
declaration commands.
Type declaration can also be executed using the type declaration characters
for numeric value type and character string type local variables. For type
declaration commands and type declaration characters, refer to “8.6
Declaration Statement.”
Note (1): If a variable is used without type declaration, it functions as
a single precision real type variable. However, if a variable
without type declaration is used, it may cause a
programming error. Therefore, type declaration should be
executed if possible.
Note (2): In the default setting of the personal computer teaching
system WINCAPSII, “Explicit type declaration is always
required” is set. If this is set and type declaration is
ignored, an error will occur when compiling is carried out. If
there are no special considerations, use the system with
this setting.
Note (3): If local variables other than the I/O type are referred to in the
program, a certain value must be assigned to the local
variable (initialization of variable) before referring to it. If a
variable is referred to without this local variable
initialization, an error will occur in execution. Variables can
be initialized by describing an assignment statement for the
variable in the program beforehand or by using DEFINT A =
1, for example, to describe it in the variable declaration
section of the program for variables other than array
variables.
Note (4): If you restart the program when a program having local
variables is called using CALL and it is being executed or in
the wait or hold status, the system should have two tasks :
one is created by the first call and the other is created at
restart. Although they are different tasks the same program
cannot secure independence of the local variables and thus
the robot may perform some unexpected or incorrect action.
To avoid this, do not start the program independently when
the program is called using the CALL command.
Note (5): Types V, P, J, and T are not available with vision equipment
µ
µµ
µVision-21.
Comentários a estes Manuais