DENSO Robotics Advanced Training Manual - olympusftp.com Training Manual - 9-1-09... · 2015. 7....
Transcript of DENSO Robotics Advanced Training Manual - olympusftp.com Training Manual - 9-1-09... · 2015. 7....
DENSO Robotics
Advanced Training Manual
Page 1
DENSO Robotics
Section 1
Palletizing
Page 2
Chapter 2 Program Flow
2.5.2 Palletizing LibraryThere is no special instruction for palletizing in the PAC language. Butpalletizing operation can be realized using a program prepared as a library.A library can be added for palletizing to a project by using the program bank.When the system executes “New system project,” if [1-palletizing] is selected inthe column [EQuipment type] of the dialog box [New project], a library programis automatically registered in the program project from the beginning of thelibrary.
Fig. 2-11 [New Project] Dialog Box
2.5.2.1 Palletizing
Palletizing is used to place parts on a pallet or pick them up in order from apallet with partitions as shown in Fig. 2-12.A library program for palletizing is created so that the robot executes palletizingoperation only when the number of partitions and positions of the 4 corners aretaught.The palletizing program changes the pick-up position on the pallet every timethe program is called.
Fig. 2-12 Pallet with Partitions
Select [1-palletizing].
Page 3
[ 1 ] Palletizing Parameter
Figs. 2-13 to 2-15 and Table 2-3 show the required parameters for palletizing.
The PAC language stores these parameters as the values of variables.
Fig. 2-13 Top View of Pallet
Fig. 2-14 Side View of Pallet
Fig. 2-15 Pallet Layer Drawings
P4P3
P2P1
N pcs.
M pcs.
Robot
H3mm
APR H1 DEP H2
Robot motion path
H1 orH2mm
K layers
Page 4
Chapter 2 Program Flow
Table 2-3 Parameters Required for Palletizing
Symbol Name Meaning Unit
Palletizingnumber
Palletizing index number None(Integer)
N Number ofside partitions
Number of partitions in the directionfrom P1 to P3
Pc (Integer)
M Number oflengthwisepartitions
Number of partitions in the directionfrom P1 to P2
Pc (Integer)
K Number oflayers
Number of pallet layers Pc (Integer)
H1 Approachlength
Approach length when the robotgets access to a pallet.
mm (Singleprecision real)
H2 Depart length Depart length when the robot leavesthe pallet.
Mm (Singleprecision real)
H3 Pallet height Height of one pallet layer Mm (Singleprecision real)
However, H1 and H2 must satisfy the following conditions.
H1 > [H3 × (K-1)] + 5
H2 > [H3 × (K-1)] + 5
P1
P2
P3
P4
The relative position of the 4 corner points on the pallet shown in Fig. 2-13 cannot be exchanged.
The robot figure taught at position P1 is maintained at all points.
N Number of side partitionsShows the number of partitions in the pallet side direction.Fig. 2-13 shows 3 partitions.
M Number of lengthwise partitionsShows the number of partitions in the pallet lengthwise direction.Fig. 2-14 shows 5 partitions.
K Number of layersShows the number of pallet layers.Fig. 2-15 shows 3 layers.
H1 Approach lengthShows the approach length when the robot gets access to a pallet.Every time the palletizing program is called, the same approach length is used.
H2 Depart lengthShows the depart length when the robot leaves a pallet.Every time the palletizing program is called, the same depart length is used.
H3 Pallet heightShows the 1 pallet layer height.If the number of layers increases, enter a positive value.If the number of layers decreases due to removal of pallets, enter a negativevalue.If the number of layers does not change, enter 0.
Page 5
Note: H1 and H2 must satisfy the following conditions.
H1 > {H3 ×××× (K-1)} + 5
H2 > {H3×(K-1)} + 5
If these conditions are not satisfied, an error occurs during
initialization. These are provided so that the robot does not
collide with a pallet. They are used to set an approach point and a
depart point that are 5 mm higher than the maximum number of
layers. Even if the number of layers increases or decreases, the
approach and depart points are the same as shown in Fig. 2-16.
Fig. 2-16 Change of Layer Number and the Approach and Depart Points.
Points P1, P2, P3, and P4 at the 4 corners of the pallet show the positions ofparts. Fig. 2-17 shows each point and the respective execution sequence.
Fig. 2-17 Palletizing Sequence
Approach and depart points Approach and depart points Approach and depart points
H1 or H2
H3
N pcs.
M pcs.
P1 P2
P3 P4
Executes in the sequenceof (1) ~ (15)
Page 6
Chapter 2 Program Flow
[ 2 ] Parameter Value Setting
Set the parameter values such as the numbers of side and lengthwisepartitions and the layers in palletizing by calling “pltInitialize” from the programlibrary.If you select [1-palletizing] in [Equipment type] in the [New project] dialog boxwhen “New system project” is executed, the program “PRO2” titled “palletizinginitialization template 1” is automatically registered in the library. Since thisprogram is called “pltInitialize”, change the values of the arguments in theCALL statement to the proper ones before using.
'!TITLE ”palletizing Initialization template 1”
#DEFINE pltIndex 0
PROGRAM PRO2
CALL pltInitialize(pltIndex, 4,3,1,50,50,50,52,53,54,55) 'Initializes palletizing
'number 0.
END
Fig. 2-18 Library Program “Palletizing Initialization Template 1”
CALL pltInitialize(pltIndex, 3, 5, 3, 50, 50, 10, 52, 53, 54, 55) in parameterdescription
1st Palletizing program No. (pltIndex)
2nd Number of side partitions (3)
3rd Number of lengthwise partitions (5)
4th Number of layers (3)
5th Approach length (50mm)
6th Depart length (50mm)
7th Pallet height (10mm)
8th P1 position (P52)
9th P2 position (P53)
10th P3 position (P54)
11th P4 position (P55)
Fig. 2-19 Description of Parameter “pltInitialize”
The meaning of this parameter can be seen with the tool “Command builder” inthe PAC manager of WINCAPSII.
Designate only a number for type P variable.}
Page 7
[ 3 ] Palletizing Counter
In palletizing the robot counts the number of partitions and stores the countvalues as variables.There are 4 types of counters; side direction (N), lengthwise direction (M),height direction (K) and total (cnt).These counters are defined in “pltKernl” which is the nucleus program forcontrolling palletizing operation.The library program “pltMove” adds a value of 1 to the total counter every timeone operation is finished and adjusts the values of the other counters.The library program “pltDecCnt” subtracts 1 from the total counter value everytime calling is made, and each counter value is adjusted by subtraction.Up to 30 palletizing programs can be created as the initial setting.Therefore, there are 31 sets of palletizing counters. To change the number ofpalletizing programs, refer to “2.5.2.2.1 Palletizing Program Customization.”
Count Rule
The palletizing counter adds a value of 1 to the total counter every time“pltMove” is executed and adjusts the values of the other counters. As a resultof this the next pallet position is ensured.If 1 is added to the total counter, the position of the lengthwise counter (M)moves to the next. If the lengthwise counter (M) reaches the end and itbecomes the maximum value, then the side direction counter (N) moves to thenext and the lengthwise counter (M) becomes its minimum value. If theposition of the widthwise counter (N) reaches the end and becomes themaximum value, the position of the vertical direction counter (K) moves to thenext and the widthwise counter (N) becomes the set minimum value.If a palletizing program is stopped during processing and is then restarted, therobot moves to the next position because the value of the counter variable iscounted up.The contents of the palletizing counter are stored even if the power is turnedoff. If the system is not initialized after being rebooted, the robot proceeds withpalletizing from the previous counter value.
Note: If an execution program is loaded after compiling, the valuesof variables are initialized.
Page 8
Chapter 2 Program Flow
When N=3, m=5, and K=3,Point a is N=1, m=1, K=1Point b is N=2, m=2, K=2Point c is N=3, m=4, K=3
Fig. 2-20 Relation between Palletizing Position and Counter
Counter Initialization
When pallets are replaced or all partitions are not used the counters need to beinitialized.In the initialization of the counters all palletizing counters are set to “1.”All the palletizing counters can be initialized at once by using “pltResetAll” ofthe library program.For example, if all counters of pallet number 1 are initialized, describe asfollows.
CALL pltResetAll(1)
If each palletizing counter is independently initialized, use “pltLetN1,”“pltLetM1,” “pltLetK1” and “pltLetCnt.”For example, if the N counter of pallet number 1 is initialized, describe asfollows.
CALL pltLetN1(1, 1)
Note: The variables are inifialized after compiling by loading theexecution program.
End Signal of Palletizing Program
The palletizing program sets a one layer finish flag or all layer finish flag if onelayer or all layers are finished.To obtain the one layer finish flag status, use the library program“pltGetPLT1END.” To obtain the all layer finish flag status, use the libraryprogram “pltGetPLTEND.”To reset (0) the 1 layer finish flag, use the library program “pltResetPLT1END.”To reset (0) the all layer finish flag, use the library program “pltResetPLTEND.”
P3 P4
P1 P2
c
b
a
c
b
a
M
N
K
Page 9
2.5.2.2 Palletizing Program
A practical palletizing program varies in special situations depending on theapplication. However, the standard procedure for assembling the program bythe use of the library is prepared in the program “PRO1” of the title “PalletizingTemplate 2.”Use this “Palletizing Template 2” as a model and add the required items for theapplication to make full use of program development.Fig. 3-21 shows the program “PRO1” of the title “Palletizing Template 2.”This example is based on the following assumptions.
• The points of palletizing are P50-P55.• In the prepared program, the robot moves to fixed position P50 and
executes the palletizing program 0. Then it moves to assemblingposition P51 to unchuck. It checks the layer finish and if the finish signalis output, it changes the pallet accordingly. If there is no workpiece thenit terminates the motion.
“Palletizing Template 2” with the program name “PRO1” and “Palletizinginitialization template” with the program name “PRO2” are automaticallyregistered if “Palletizing” is selected in the item “Equipment type” of the “Newproject” dialog box when a new project is created with WINCAPSII. Refer top.2-14 “2.5.2 Palletizing library.”
' !TITLE "Palletizing Template 2"
' !AUTHOR "Denso Robot Engineering Dept.
#DEFINE pltIndex 0 ' Palletizing program No.
' Any numeric value from 0 to 30 is available forselection. #DEFINE ChuckNG 40 ' Number of pick up inspections IO.
' Any numeric value is available for selection.
PROGRAM PRO1 ' Change the name to the proper one.
MOVE P, P50 ' Moves to fixed position P50.
' Moves to palletized P50.
IF IO[ChuckNG] = ON THEN ' Pick up inspection for the previous time.
CALL pltDecCnt(pltIndex) ' Subtract 1 from the total counter.
END IF
CALL pltMove(pltIndex) ' Executes palletizing number 0.
MOVE P, P51 ' Moves to assembling position P51.
' Moves to palletized P51.
'<--- Insertion such as unchuck motion --->
CALL pltGetPLT1END(pltIndex,0) ' Obtains a finish signal for the 1st layer in I[0].
' The second argument "0" is an array number of "I"
' that is decided on the next line.
IF I[0] THEN ' When this is ON (e.g. when <>0)
'<--- Insertion of pallet change motion --->
CALL pltResetPLT1END(pltIndex) ' Clears the finish signal for the 1st layer.
END IF
END
Fig. 2-21 Program Name “PRO1” and “Palletizing Template 2”
Page 10
Chapter 2 Program Flow
[ 1 ] Palletizing Program Customization
Q. How do you change a palletizing program to execute to 1?A. Change the value of “pltIndex” in “PRO1” and “PRO2” to “1.”
Q. How do you change the menber of palletizing partitions to 5 for side and 3 for lengthwise?
A. Change “3” and “5” of the second and third parameters of “pltInitialize” to“5” and “3” respectively. * CALL pltInitialize (pltIndex, 5, 3, 3, 50, 50, 10, 52, 53, 54, 55)
Q. How do you change the number of palletizing programs available?A. Change “31” of “#DEFINE mcPaltMax 31” the in “pltKernel” program to any
number you like and the number of palletizing programs can be set.
Q. How do you set a palletizing dodge point?A. If you add a dodge point of X = 10, Y = 10, Z = -10 to the approachdirection, add a command to move a point with parallel deviation “(10, 10, -10)H” added to a point P[mcNextPos] in the file “paltmove1. pac”.
* MOVE P, P[mcNextPos] + (10, 10, -10)H 'Moves to the dodge point of'X=10, Y=10, Z=-10.
Q. How do you obtain N1, M1 and K1?A. Add the program libraries “pltGetK1”, “pltGetM1”, and “pltGetN1.” * call pltGetK1(Index, iValue) * call pltGetM1(Index, iValue) * call pltGetN1(Index, iValue) 'Index . . . Palletizing program No. 'iValue. . . Number of type I variable to which K1, M1, and N1
values are returned.
Example) #define pltIndex 0 'Palletizing program No.
Program Exmp
DefInt Index, iValue
Index = pltIndex 'Inserts a palletizing program'number into Index register.
call pltGetK1(Index, iValue) 'Returns the value of
'K1 to the type I
'variable
'designated with
'iValue.
call pltGetM1(Index, iValue) 'Returns the value of
'M1 to the type I
'variable
'designated with
'iValue.
call pltGetN1(Index, iValue) 'Returns the value of
'N1 to the type I
'variable
'designated with
'iValue.
End
Page 11
Q. How do you chAnge N1, M1 and K1?A. Add the program libraries “pltLetK1”, “pltLetM1”, “pltLetN1”.
* call pltLetK1(Index, iValue)
* call pltLetM1(Index, iValue)
* call pltLetN1(Index, iValue)
'Index . . . Palletizing program No.
'iValue. . . Enter this value into K1, M1, and N1.
Example) #define pltIndex 0 'Palletizing program No.
Program Exmp
DefInt Index, iValue
Index = pltIndex 'Inserts the palletizing
'program number
'into the Index register.
iValue = 10 'Enters values in K1, M1, and
'N1.
call pltLetK1(Index, iValue)
'Enters the value of iValue
'into K1.
call pltLetM1(Index, iValue)
'Enters the value of iValue
'into M1.
call pltLetN1(Index, iValue)
'Enters the value of iValue
'into N1.
End
Q. How do you obtain the total counter?
A. Add the program library ”pltGetCnt.”
*call pltGetCnt(Index, iValue)
'Index ....Palletizing program No.
'iValue ...Number of type I variable to which the value
of the total counter is returned.
Example) #define pltIndex 0 'Palletizing program No.
Program Exmp
DefInt Index, iValue
Index = pltIndex 'Inserts the palletizing
'program number into Index
'register.
call pltGetCnt(Index, iValue)
'Returns the value of the
'total counter to the type
'I variable specified with
'iValue.
End
Page 12
Chapter 2 Program Flow
Q. How do you change the total counter?
A. Add the program library “pltIncCnt.”
* callpltLetCnt(Index, iValue)
'Index . . . Palletizing program No.
'iValue. . . This value is entered in the total counter.
Example) #define pltIndex 0 'Palletizing program No.
Program Exmp
DefInt Index, iValue
Index = pltIndex 'Inserts the palletizing
'program No.
'into the Index register.
iValue = 0 'Enters a value into the
'total counter.
call pltLetCnt(Index, iValue)
'The value of iValue is
'entered into the total
'counter.
End
Q. With what timing does the total counter count?
A. It counts up when “pltKernel (Index, -15, mcNextPos, ndErr)” is executed.Therefore, if the program library “pltGetNextPos,” “pltMove” and
“pltMove0”are executed, the total counter will count up.
* call pltMove(Index)
* call pltMove0
* call pltGetNextPos(Index, NextPos)
'Index . . . . Palletizing program No.
'NextPos . . . Type P variable number where
the position of the next
position is entered
Page 13
4 PalletizingDescribes the libraries for palletizing functions.
pltDecCnt (Library)
Function
Decreases the count of the total palletizing counter.
Format
pltDecCnt (<Palletizing number>)
Explanation
The total palletizing counter, designated with a palletizing number, decreasesby one (-1).By editing the palletizing counter, you can palletize a hounds tooth pattern oran arbitrary step pattern.
Related Terms
pltGetCnt, pltIncCnt, pltKernel, pltLetCnt
Example
CALL pltDecCnt(1) 'Decreases total palletizing counter No. 1 by'one (-1).
pltGetCnt (Library)
Function
Obtains the total palletizing counter.
Format
pltGetCnt (<Palletizing number>, <Cnt save integer variable number>)
Explanation
Obtains the total palletizing counter of a designated palletizing number.
Related Terms
pltDecCnt, pltIncCnt, pltKernel, pltLetCnt
Example
CALL pltGetCnt(1, 0) 'Assigns the current counter to I[0].
CALL pltLetCnt(1, I[0] - 1) 'Decreases the counter by 1.
Page 14
pltGetK (Library)
Function
Obtains palletizing set value K.
Format
pltGetK (<Palletizing number>, <K save integer variable number>)
Explanation
This statement obtains palletizing set value K of a designated palletizingnumber.
Related Terms
pltGetK1, pltLetK, pltKernel
Example
CALL pltGetK(1,10) 'Assigns palletizing value K of palletizing No. 1
'to integer variable 10.
pltGetK1 (Library)
Function
Obtains palletizing counter K1.
Format
pltGetK1 (<Palletizing number>, <K1 save integer variable number>)
Explanation
This statement obtains palletizing counter K1 of a designated palletizingnumber.
Related Terms
pltGetK, pltLetK1, pltKernel
Example
CALL pltGetK1(1,10) 'Assigns palletizing counter K1 of palletizing
'No. 1 to integer variable 10.
Page 15
pltGetM (Library)
Function
Obtains palletizing set value M.
Format
pltGetM (<Palletizing number>, <M save integer variable number>)
Explanation
This statement obtains palletizing set value M of a designated palletizingnumber.
Related Terms
pltGetM1, pltLetM, pltKernel
Example
CALL pltGetM(1,10) 'Assigns palletizing value M of palletizing No. 1
'to integer variable 10.
pltGetM1 (Library)
Function
Obtains palletizing counter M1.
Format
pltGetM1 (<Palletizing number>, <M1 save integer variable number>)
Explanation
This statement obtains palletizing counter M1 of a designated palletizingnumber.
Related Terms
pltGetM, pltLetM1, pltKernel
Example
CALL pltGetM1(1,10) 'Assigns palletizing counter M1 of palletizing
'No. 1 to integer variable 10.
Page 16
pltGetN (Library)
Function
Obtains palletizing set value N.
Format
pltGetN (<Palletizing number>, <N save integer variable number>)
Explanation
This statement obtains palletizing set value N of a designated palletizingnumber.
Related Terms
pltGetN1, pltLetN, pltKernel
Example
CALL pltGetN(1,10) 'Assigns palletizing value N of palletizing No. 1
'to integer variable 10.
pltGetN1 (Library)
Function
Obtains palletizing counter N1.
Format
pltGetN1 (<Palletizing number>, <N1 save integer variable number>)
Explanation
Obtains palletizing counter N1 of a designated palletizing number.
Related Terms
pltGetN, pltLetN1, pltKernel
Example
CALL pltGetN1(1,10) 'Assigns palletizing counter N1 of palletizing
'No. 1 to integer variable 10.
Page 17
pltGetNextPos (Library)
Function
Obtains the next position.
Format
pltGetNextPos (<Palletizing number>, <Next position obtaining position typevariable>)
Explanation
This statement obtains the next position. When this library is executed, thepalletizing counter increases.Therefore, when you obtain the next position but do not execute it, you mustdecrease the pltDecCnt and so on.
Related Terms
pltMove, pltKernel
Example
CALL pltGetNextPos(1,10) 'Assigns a position immediately following
'palletizing No. 1 to integer variable 10.
pltGetPLT1END (Library)
Function
Obtains a palletizing 1-row completion flag.
Format
pltGetPLT1END (<Palletizing number>, <1-row completion flag save integernumber>)
Explanation
Stores a palletizing 1-row completion flag into I[<1-row completion flag saveinteger number>].
Related Terms
pltGetPLTEND, pltResetPLT1END, pltKernel
Example
CALL pltGetPLT1END(1,10) 'Assigns a 1-row completion flag of palletizing
'No. 1 to integer variable 10.
Page 18
pltGetPLTEND (Library)
Function
Obtains a palletizing all-row completion flag.
Format
pltGetPLTEND (<Palletizing number>, <All row-completion flag save integernumber>)
Explanation
This statement stores a palletizing all row completion flag into I[<All-rowcompletion flag save integer number>].
Related Terms
pltGetPLT1END, pltResetPLTEND, pltKernel
Example
CALL pltGetPLTEND(1,10) 'Assigns an all-row completion flag of palletizing
'No. 1 to integer variable 10.
pltIncCnt (Library)
Function
Increases the total palletizing counter.
Format
pltIncCnt (<Palletizing number>)
Explanation
This statement increases the total palletizing counter of a designatedpalletizing number by +1 from the current value.By editing the palletizing counter, you can palletize a hounds tooth pattern orarbitrary step pattern.
Related Terms
pltDecCnt, pltGetCnt, pltKernel, pltLetCnt
Example
CALL pltIncCnt(1) 'Increases the total palletizing counter of
'palletizing No. 1 by one (+1).
Page 19
pltInit1 (Library)
Function
Palletizing initialization template 1.
Format
pltInit1
Explanation
This is an example of pltInitialize.
For the meanings of arguments, refer to the arguments used with thepltInitialize commands.
Related Terms
pltInitialize
Page 20
pltInitialize (Library)
Function
Palletizing initialization
Format
pltInitialize (<Palletizing number>, <Lateral partition number>, <Longitudinalpartition number>, <Pile number>, <Approach length>, <Depart length>,<Pallet height>, <Pallet 4-corner type 1P variable number>, <Pallet 4-cornertype 2P variable number>, <Pallet 4-corner type 3P variable number>, <Pallet4-corner type 4P variable number>)
Explanation
This statement is an initialization program for defining palletizing motion.It is more effective to use this program rather than the pltResetAll Library, if youinitialize only the palletizing counter.
Note: Without execution of pltInitialize, no palletizing motion will beexecuted.
Macro Definition
mcApprVal : F type variable number to assign the approach length.McDepVal : F type variable number to assign the depart length.McPltH : A type F variable number to assign the pallet height.
Note: If these definitions compete with the user’s variable number,define the macro again.
Related Terms
pltKernel
Example
CALL pltInitialize(0,4,3,1,50,50,50,52,53,54,55)
'Initializes palletizing parameters; Palletizing number:0,'Lateral partition number:4, Longitudinal partition number:3'Pile number:1, Approach length:50 mm, Depart length:50 mm,'Pallet height:50 mm, Pallet 4-corner type 1P:52, 2P:53,'3P:54, 4P:55.
Page 21
pltKernel (Library)
Function
Palletizing motion (kernel)
Format
pltKernel (<Palletizing number>, <Action number>, <Action argument>, <Errornumber>)
Explanation
This statement is a kernel program for palletizing motion. This library isrequired to use all other palletizing libraries.
Note: This program is not automatically executed by multitaskingoperation. If you execute this by multitasking, you need to changethis for synchronization using a semaphore.
Macro Definition
mcPaltMax: Maximum pallet numberYou can easily increase pallets in number by defining this macro again.
Note: If you increase the number of pallets, the system consumes thelocal variable area.
Related Terms
pltInitialize
Remarks
• Only other libraries call this library. The user does not directly call this.• For directly using this, you should fully understand the contents of the
program.
Page 22
pltLetCnt (Library)
Function
Sets the total palletizing counter.
Format
pltLetCnt (<Palletizing number>, <All counter setting values>)
Explanation
This statement can set the total palletizing counter of a designated palletizingnumber.By editing the palletizing counter, you can palletize a hounds tooth pattern orarbitrary step pattern.
Related Terms
pltDecCnt, pltGetCnt, pltIncCnt, pltKernel
Example
CALL pltLetCnt(1,12) 'Sets the total palletizing counter of palletizing
'No. 1 to 12.
pltLetK1 (Library)
Function
Sets the palletizing counter K1.
Format
pltLetK1 (<Palletizing number>, <K1 setting value>)
Explanation
This statement can set the counter K1 of a designated palletizing number.By editing the palletizing counter, you can palletize a hounds tooth pattern orarbitrary step pattern.
Related Terms
pltGetK1, pltKernel
Example
CALL pltLetK1(1,1) 'Sets palletizing counter K1 of palletizing No. 1 to 1.
Page 23
pltLetM1 (Library)
Function
Sets the palletizing counter M1.
Format
pltLetM1 (<Palletizing number>, <M1 setting value>)
Explanation
This statement can set the counter M1 of a designated palletizing number.By editing the palletizing counter, you can palletize a hounds tooth pattern orarbitrary step pattern.
Related Terms
pltGetM1, pltKernel
Example
CALL pltLetM1(1,4) 'Sets palletizing counter M1 of palletizing No. 1 to 4.
pltLetN1 (Library)
Function
Sets the palletizing counter N1.
Format
pltLetN1 (<Palletizing number>, <N1 setting value>)
Explanation
This statement can set the counter N1 of a designated palletizing number.By editing the palletizing counter, you can palletize a hounds tooth pattern orarbitrary step pattern.
Related Terms
pltGetN1, pltKernel
Example
CALL pltLetN1(1,3) 'Sets palletizing counter N1 of palletizing
'No. 1 to 3.
Page 24
pltMain1 (Library)
Function
Palletizing template 1
Format
pltMain1
Explanation
This statement is the basic work statement to pick up a part and move it to theassembling position.
Macro Definition
pltIndex palletizing number
Related Terms
pltMain2
Remarks
You may modify the template to meet your needs.
pltMain2 (Library)
Function
Palletizing template 2
Format
pltMain2
Explanation
This statement is the basic work statement to pick up a part and move it to theassembling position. Before picking up a part, the robot checks that theprevious pick-up was correctly done.
Macro Definition
pltIndex : palletizing numberChuckNG : pick-up NG signal (DIO number)
Related Terms
pltMain1
Remarks
You may modify the template to meet your needs.
Page 25
pltMove (Library)
Function
Standard palletizing template 1
Format
pltMove (<Palletizing number>)
Explanation
This statement executes standard palletizing, as defined with pltInitialize.You can insert a bypass point according to comments.
For Controller System Version 1.2* or earlier, use ndVcom contained in theversion 1.2 compatible class. If in Version 1.2* or earlier ndVcom not in theversion 1.2 compatible class but in classes 1 to 6 is used, a compilation errorwill result.
To check the controller software version, refer to the SETTING-UP MANUAL,Chapter 5, Section 5.7, [F6 Set]–[F6 Maint.]–[F2 Version].
Macro Definition
mcNextPos : A type P variable number to store the next positionmcApprLen : A type F variable number to store the approach lengthmcDepLen : A type F variable number to store the depart length
Note: If these definitions compete with the user’s variable number,define the macro again.
Related Terms
pltInitialize, pltMove0, pltKernel
Remarks
The palletizing counter counts when the system obtains the next position.Therefore, when the system obtains but does not operate, you need to usepltDecCnt to decrease the counter.
Example
CALL pltMove(1) 'Carries out palletizing motion of palletizing No. 1.
Page 26
pltMove0 (Library)
Function
Standard palletizing motion 1
Format
pltMove0
Explanation
This statement is a specialized program to Index=0 of pltMove (Index).
If you change the motion of each pallet, add this program to change the line of#DEFINE pltIndex 0 to the pallet number and then change the program name.
For Controller System Version 1.2* or earlier, use ndVcom contained in theversion 1.2 compatible class. If in Version 1.2* or earlier ndVcom not in theversion 1.2 compatible class but in classes 1 to 6 is used, a compilation errorwill result.
To check the controller software version, refer to the SETTING-UP MANUAL,Chapter 5, Section 5.7, [F6 Set]–[F6 Maint.]–[F2 Version].
Macro Definition
mcNextPos : A type P variable number to store the next positionmcApprLen : A type F variable number to store the approach lengthmcDepLen : A type F variable number to store the depart length
Note: If these definitions compete with the user’s variable number,define the macro again.
PltIndex : pallet number
Related Terms
pltInitialize, pltMove, pltKernel
Remarks
The palletizing counter counts when the system obtains the next position.Therefore, when the system obtains but does not operate, you need to usepltDecCnt to decrease the counter.
Example
CALL pltMove0 'Carries out palletizing motion of palletizing No. 0.
Page 27
pltResetAll (Library)
Function
Resets all palletizing counters.
Format
pltResetAll (<Palletizing number>)
Explanation
This statement resets all palletizing counters.This has almost the same meaning as pltLetCnt (<Palletizing number>, 0).However, this library also resets the row completion flag.When redefinition of palletizing motion is not required and only a counter isreset, use this library. Do not use pltInitialize.
Related Terms
pltInitialize, pltResetPLTEND, pltKernel
Example
CALL pltResetAll(1) 'Resets all palletizing counters of palletizing No. 1.
pltResetPLT1END (Library)
Function
Resets a palletizing 1-row completion flag.
Format
pltResetPLT1END (<Palletizing number>)
Explanation
This statement resets a palletizing 1-row completion flag.
Related Terms
pltGetPLT1END, pltResetPLTEND, pltKernel
Example
CALL pltResetPLT1END(1) 'Resets a palletizing 1-row completion flag of
'palletizing No. 1.
Page 28
pltResetPLTEND1 (Library)
Function
Resets a palletizing all-row completion flag.
Format
pltResetPLTEND1 (<Palletizing number>)
Explanation
This statement resets a palletizing all-row completion flag.
Related Terms
pltGetPLTEND, pltResetPLT1END, pltKernel
Example
CALL pltResetPLT1END1(1) 'Resets a palletizing all-row completion flag of
'palletizing No. 1.
Page 29
Lesson 16 Palletizing
16.1 What is palletizing?
Palletizing refers to placing parts in/removing parts from a partitioned pallet(shown below) in programmed order.
You can easily use library programs for palletizing. To use these programs you
have to only know the number of partitions provided in the pallet and the
positions of each of the 4 corners of the pallet, and teach this information to therobot.
The palletizing programs update the partition information as each position is
called to enable the robot to know which partition it should place the next partin/remove the next part from.
Figure 16-1 Partitioned pallet
Page 30
Palletizing Program "PRO1"
Using the library, you can find a typical procedure to build a program in program
"PRO1" under the title "Palletizing template 2," although there would actually be
many different possible programs for palletizing depending on the applicationsand the circumstances in which they are being used.
Use this "palletizing template 2" effectively as your template by adding/deletingthe items necessary for your applications.
Listed below is a sample template program named "PRO1."
This sample template assumes that
• the palletizing points should be at P50 to P55, and
• the program to be built would control the robot to move to the position P50
which is the work pick-up position, to run the palletizing program "0", to
move to the position P51 which is the work piece mount position, to
unchuck the work piece, to check end of the pallet, to replace the pallet if
end of work signal detected and if needed, and to end the program if nowork piece remains.
When you create "New Project" by selecting "Palletizing" in "Device Type," the
system manager will automatically register the "Palletizing template 2" with
program name "PRO1" and the "Palletizing initialization template 1" withprogram name "PRO2."
' !TITLE "Palletizing template 2"
' !AUTHOR "DENSO CORPORTION"
#DEFINE pltIndex 0
#DEFINE ChuckNG 40
PROGRAM PRO1 ' Rename PRO1 as desired.
TAKEARM ' Obtains the arm semaphore.
MOVE P, P50 ' Move to the position P50.
' Move to the palletizing position P50.
IF IO[ChuckNG] = ON THEN ' Check status of previous picking-up.
CALL pltDecCnt(pltIndex) ' Subtract by 1 for the total counter.
END IF
CALL pltMove(pltIndex) ' Execute palletizing 0.
MOVE P, P51 ' Move to the mount position P51.
' Move to the palletizing position P51.
'<--- Insert unchucking or other operations here --->
CALL pltGetPLT1END(pltIndex,0) ' Acquires the end of 1st pallet signal on I[0].
IF I[0] THEN ' If ON (that is when <>0),
'<--- Insert pallet replacing or other operations here --->
CALL pltResetPLT1END(pltIndex) ' Clears the end of 1st pallet signal.
END IF
GIVEARM ' Releases the arm semaphore.
END
Figure 16-2 Program [PRO1], "Palletizing template 2"
Page 31
Palletizing parameters
Figure 16-3, 16-4, 16-5 and Table 16-1 show the parameters needed forpalletizing.
PAC language retains these parameters as value sets of variables.
Figure 16-3 Upper view of pallet
Figure 16-4 Side view of pallet
Figure 16-5 Stacked pallets
P4P3
P2P1
N
M
Robot
H3mm
H1 or H2 mm
Kth
APR H1·DEP H2
Path of robot motion
Page 32
Table 16-1 Parameters needed for palletizing
Symbol Name Description Unit
Palletizing number Index of palletizing None (Integer)
N No. of row parts Number of partitions from P1 to P3 Count (Integer)
M No. of column parts Number of partitions from P1 to P2 Count (Integer)
KNo. of stackedpallets
Number of stacked pallets Count (Integer)
H1 Approach clearanceApproach clearance where the robot approachesa pallet
mm (Singleprecision FPT)
H2 Depart clearanceDeparture clearance where the robot departsfrom a pallet
mm (Singleprecision FPT)
H3 Height of a pallet Height of a palletmm (Singleprecision FPT)
Where H1 and H2 satisfy the conditions below.
H1 > {H3 x K-1)}+5
H2 > {H3 x K-1)}+5
P1P2P3P4
Positions of the 4 corners of the pallet as shown in Figure 16-3.
It is not possible to exchange the relative positioning of any of the corners.
The robot maintains its orientation from where the position P1 was taught previously, for allpoints in the program.
N Number of partitions in row
Expresses the number of partitions in each row of the pallet.
If this is 3, it reflects 3 rows as in the example in Figure 16-3.
M Number of partitions in column
This expresses the number of partitions in each column of the pallet.
If this is 5, it reflects 5 rows as in the example in Figure 16-4.
K Number of stacked pallets
This expresses the number of pallets in the pallet stack.
If this is 3, it reflects 3 stacked pallets as in the example on Figure 16-5.
H1 Approach clearance
Expresses the length of the approach path as the robot approaches the pallets.
A program applies the single approach path length at every call of the same
palletizing program.
H2 Departure path clearance
Expresses the length of the departure path as the robot departs from the pallets.
A program applies the single departure path length at every call of the same
palletizing program.
H3 Pallet unit heights
Expresses height of each pallet.
For every pallet added to a stack, a plus unit value is added.
For every pallet removed from a stack, a minus unit value is added.
If the stack is not changed, 0 is added.
Page 33
Caution: H1 and H2 shall satisfy the conditions below.
H1 > {H3 x (K-1)} + 5H2 > {H3 x (K-1)} + 5
If not, an error will occur during initializing. These restrictions ensure the robot
does not crush the pallet in operation by ensuring the robot approaches or
departs from the stacked pallets at 5 mm higher than the topmost pallet in astack.
As shown in Figure 16-6, changing stack height does not affect theapproach/departure points of the robot in same palletizing program.
Figure 16-6 Relationship between the stack height and approach/departure points
Four corner points P1, P2, P3 and P4
These points represent the parts position for each of the 4 corner partitions ofthe pallet. Figure 16-7 depicts in what order the robot palletizes these parts.
Figure 16-7 Palletizing order
Approach/Departure point Approach/Departure point Approach/Departure point
H1 or H2
H3
Done in order ➀- 15 .N
M
P P2
P3 P4
Page 34
Setting palletizing parameters
To set the parameter values such as the number of row and column partitionsand the number of pallets in a stack, first call the “pltInitialize” module from theprogram library.
If you select [1-palletizing] in [Device type] in the [New project] dialog box whenyou want to create "New system project," the System Manager will automaticallyregister the program “PRO2” titled “Palletizing initialization template 1” in thelibrary. Since this program is to call “pltInitialize” module, modify the values ofthe indexes in the CALL statement to the ones you want to use.
'!TITLE “Palletizing initialization template 1”
' !AUTHOR "DENSO CORPORTION"
PROGRAM PRO2
CALL pltInitialize(0,4,3,1,50,50,50,52,53,54,55) 'Initializing palletizing No. 0.END
Figure 16-8 Library program "Palletizing initialization template 1"
Descriptions on parameters of CALL pltInitialize (0, 3, 5, 3, 50, 50, 10, 52, 53, 54, 55) 1st . . . Palletizing program number (0)
2nd . . . Number of row partitions (3) 3rd . . . Number of column partitions (5)
4th . . . Number of stacked pallets (3)
5th . . . Approach clearance (50mm) 6th . . . Departure clearance (50mm)
7th . . . Pallet height (10mm)
8th . . . P1 position (P52) 9th . . . P2 position (P53)
10th . . . P3 position (P54) 11th . . . P4 position (P55)
Figure 16-9 Parameters of "pltInitialize"
You can also find descriptions on the above parameters in the "Command
builder" tool provided in the PAC Manager of WINCAPSII.
Designate only the indexes of the positionvariables.
Page 35
Palletizing Counter
In palletizing, the robot counts the number of partitions as they change andretains the counts in the variables.
There are four types of counters; number of partitions in the row (N), number ofpartitions in the column (M), number of stacked pallets (K) and total (cnt).
These counters are defined in “pltKernl” which is the kernel program forcontrolling palletizing operation.
The library program “pltMove” adds 1 to the total counter every time a palletizingoperation is completed and aligns the values of the other counters.
The library program “pltDecCnt” subtracts 1 from the total counter every time it iscalled and aligns each counter.
You can create up to 30 palletizing programs as the initial setting. Therefore, thesystem may provide 31 sets of the palletizing counters.
Count Rules
The palletizing counter adds 1 to the total counter every time “pltMove” is run
and aligns the counts of the other counters so as to ensure the next palletposition.
If adding 1 to the total counter, the position of the pallet column indicated by the
column counter (M) moves to the next column. If the pallet column position
indicated by the column counter (M) reaches the end and becomes the
maximum count, then the row counter (N) counts up by 1 to indicate the next
row of the pallet and the column counter (M) becomes its minimum value. If the
position of the row counter (N) reaches the end of the pallet row partition and
becomes the maximum value, the stacked pallet counter (K) counts up by 1 andthe row counter (N) becomes the set minimum value.
If you halt a palletizing program during operation and restart it, the robot movesto the next partition because the value of the counter variable is added to.
The system retains the contents of the palletizing counter even if the power is
turned off. Unless you initialize the system after restarting, the robot will proceedto palletize from the previous counter value.
Caution: When you compile a new task program and load its run time modulethe system will automatically initialize the values of all variables.
Page 36
If counts are N=3, M=5 and K=3,
position a is at (N=1, M=1 and K=1)
position b is at (N=2, M=2 and K=2)
position c is at (N=3, M=4 and K=3)
Figure 16-10 Relationship between palletizing position and counters
Initializing the Counters
When you replace any pallets or do not want to use any partitions, you need toinitialize all of the counters.
The systems substitute 1 into all of the counters to initialize them.
If you use the library program "pltResetAll" you can initialize all the palletizingcounters at once.
For example, if you want to initialize all counters for pallet number 1, write asfollows.
CALL pltResetAll(1)
If you want to initialize each palletizing counter independently, use the libraryprograms “pltLetN1,” “pltLetM1,” “pltLetK1” and “pltLetCnt.”
For example, if want to initialize the N counter for pallet number 1, write asfollows.
CALL pltLetN1(1,1)
Caution: The second argument is the value to substitute into the N counter.You can also choose any number instead of 1.
Ending palletizing program process
Upon finishing the palletizing for one of the stacked pallets or for the whole pallet
stack, the palletizing program sets a stacked pallet end flag or whole pallet stackend flag, respectively.
To obtain the one stacked pallet finish flag status, use the library program
“pltGetPLT1END.” To obtain the whole pallet stack finish flag status, use thelibrary program “pltGetPLTEND.”
To reset the one stacked pallet finish flag to (0), use the library program
“pltResetPLT1END.” To reset the whole pallet stack finish flag to (0), use thelibrary program “pltResetPLTEND.”
P3 P4
P1 P2
c
b
a
c
b
a
M
N
K
Page 37
16.2 Simplified Palletizing
Palletizing is explained in the “16.1 What is palletizing?”. For simpler
palletizing, this section provides you with a simplified palletizing template using
a palletizing library.
Simplified Palletizing Program "PRO1"
(1) Program name
‘!TITLE “Simplified palletizing program sample”
‘
‘Approach clearance 50mm, Depart clearance 50mm
‘Palletizing target position variable P[40]
‘Palletizing counter I[10]
‘Stacked-pallets counter I[11]
‘N= 3 M= 5 K=20mm
‘ M
‘ N P[54]---------P[55]
‘ / / |
‘+ P[52]-------P[53]|
‘K | | /
‘- -------------/
'
PROGRAM PRO1
TAKEARM
‘------- Get palletizing positions from P[40] -------
‘Order of parameters N,M,Stacked pallet height mm,P1,P2,P3,P4,Palletizing points numbers,
‘Palletizing counter, Stacked-pallets counter
CALL xdGetPalt(3, 5, 20,P[52],P[53],P[54],P[55],P[40],I[10],I[11])
‘-------------- Palletizing ----------------
APPROACH P,P[40],@0 50 ‘Approaching P[40] 50mm upwards
MOVE L,@0 P[40] ‘Move down to P[40]
DEPART L,50 ‘Move up by 50mm
‘-------------- Count up counters ------------
I[10] = I[10] + 1 ‘Increment palletizing counter by one
if I[10] > (3 * 5) then ‘If palletizing a layer of pallets (3 rows x 5 columns) finishes
I[10] = 1 ‘then reset palletizing counter to initial value
I[11] = I[11] + 1 ‘Increment stacked-pallets counter by one
IF I[11] >= 5 THEN ‘If palletizing 5 layers of pallets finishes
I[10] = 1 ‘then reset stacked-pallets counter to initial value
END IF
END IF
‘------------------
END
(2) Call library
(3) Approaching
(4) Down-movement
(5) Up-movement
(6) Count up palletizing counter
(7) Check completion of
palletizing of a layer
of pallets
(8) Reset palletizing counter
(9) Count up stacked-pallets counter
(10) Check completion of palletizing
of 5 stacks
(11) Reset stacked-pallets counter
Page 38
Simplified palletizing program "PRO1"
In palletizing explained in the “16.1 What is palletizing?”, you need to executethe pltInitialize library before starting palletizing.
This simplified palletizing program requires no execution of that library. Justexecuting PRO1 will start palletizing operation.
In simplified palletizing, you need to specify addition and resetting of thepalletizing counter and stacked-pallets counter, while in conventional palletizingthose counters are automatically controlled inside libraries.
Variables used in PRO1
Palletizing target position variable (Position variable, P40 in this example)
Palletizing counter variable (Integer variable, I10 in this example)
Stacked-pallets counter (Integer variable, I11 in this example)
Corner partition variables (Position variables, P52 to P55 in this example)
What to do before execution of PRO1
Before start of PRO1, you need to:
- Assign the initial value "1" to each of the palletizing counter I10 and stacked-pallets counter I11 and
- Teach the positions of four corner partitions in the pallet to corner partitionvariables P1 to P4.
On the following pages are detailed explanation of each part of the program
PO1.
Page 39
Setting the following parameters to the called library will assign the target
position to the palletizing target position variable specified by the 8th
parameter.
1st parameter No. of rows, which should be 1 or greater.
(3 rows in this example)
2nd parameter No. of columns, which should be 1 or greater.
(5 columns in this example)
3rd parameter Height of stacked pallets in mm.
Specify a positive value when increasing the layers of pallets;
a negative value when decreasing them.
(20 mm specified in this example)
4th to 7th parameters Position variables to which four corner partition
positions of the pallet are assigned.
(P52 to P55 in this example)
8th parameter Palletizing target position variable to which the target position
will be assigned. This position may be calculated from the
current counter values.
(P40 in this example)
9th parameter Palletizing counter, which should be 1 or greater and M*N or
less. According to this value, the corner partition positions
may be specified.
10th parameter Stacked-pallets counter, which should be 1 or greater.
According to this value, the layer number may be specified.
(1) Program name
(2) Call library
‘
PROGRAM PRO1
TAKEARM
‘------- Get palletizing positions from P[40] --------
‘Order of parameters N,M,Stacked pallet height mm,P1,P2,P3,P4,Palletizing points numbers
‘Palletizing counter, Stacked-pallets counter
CALL xdGetPalt (3, 5, 20,P[52],P[53],P[54],P[55],P[40],I[10],I[11])
Change the program name
Page 40
As a result of execution of "(2) Call library," the palletizing target position is
assigned to P40. Then some operations should be carried out to P40.
Usually, during those operation, chuck and unchuck processes will be inserted.
(3) Approaching
(4) Down-movement
(5) Up-movement
‘------- Palletizing -------------------------
APPROACH P,P[40],@0 50 ‘Approaching P[40] 50mm upwards
MOVE L,@0 P[40] ‘Move down to P[40]
DEPART L,50 ‘Move up by 50mm
Page 41
This part of the PRO1 counts up the palletizing counter and stacked-pallets
counter and checks the completion of palletizing operation for a layer of pallets.
Unlike usual palletizing programs, the simplified palletizing program uses
integer variables (I10 and I11 in this example) as a palletizing counter and
stacked-pallets counter.
According to the values assigned to I10 and I11, the "(2) Call library" calculates
the palletizing target position and assigns it to P40.
(6) Count up palletizing counter
(7) Check completion of palletizing of a layer of pallets
(8) Reset palletizing counter
(9) Count up stacked-pallets counter
(10) Check completion of palletizing of 5 layers of pallets
(11) Reset stacked-pallets counter
‘------- Count up counters-----------------
I[10] = I[10] + 1 ‘Increment palletizing counter by one
if I[10] > (3 * 5) then ‘If palletizing a layer of pallets (3 rows x 5 columns) finishes
I[10] = 1 ‘then reset palletizing counter to initial value
I[11] = I[11] + 1 ‘Increment stacked-pallets counter by one
IF I[11] >= 5 THEN ‘If palletizing 5 layers of pallets finishes
I[10] = 1 ‘then reset stacked-pallets counter to initial value
END IF
END IF
1 2 3
6 7 8 9 10
11 12 13 14 15
4 5
1 2 3
6 7 8 9 10
11 12 13 14 15
4 5
1 2 3
6 7 8 9 10
11 12 13 14 15
4 5
M columns
N rows
Palletizing counter value
(I10 in this example)
Stacked-pallets
counter value
(I11 in this example)
I11=1
I11=2
I11=3
Page 42
For a single layer of pallet, you may simplify the program further as shown below.
Relationship between the palletizing positions and countervalues in the simplified palletizing program
If each pallet consists of 3 rows x 5 columns (N=3, M=5), palletizing counter isI10 and stacked-pallets counter is I11, then
Position : I10=1, I11=1
Position : I10=7, I11=4
Position : I10=14, I11=5
Delete these lines for a single layer of pallet.
‘------- Count up counters-----------------
I[10] = I[10] + 1 ‘Increment palletizing counter by one
if I[10] > (3 * 5) then ‘If palletizing a layer of pallets (3 rows x 5 columns) finishes
I[10] = 1 ‘then reset palletizing counter to initial value
I[11] = I[11] + 1 ‘Increment stacked-pallets counter by one
IF I[11] >= 5 THEN ‘If palletizing 5 layers of pallets finishes
I[10] = 1 ‘then reset stacked-pallets counter to initial value
END IF
END IF
Page 43
Applications of the simplified palletizing program
--- Special-purpose palletizing examples ---
(1) Alternate checker-pattern palletizing
Alternate checker-pattern palletizing refers to palletizing to every other
partitions as illustrated below. Programming for this is very easy.
1 3
7 9
11 13 15
5
M columns
N rows
2
6 8 10
12 14
4
M columns
N rows
‘----------- Count up counters -----------------
I[10] = I[10] + 1 ‘Increment palletizing counter by one
(6) Count up palletizing counter
‘--------- Count up counters -----------------
I[10] = I[10] + 2 ‘Increment palletizing counter by 2
‘------ Count up counters -------------
I[10] = I[10] + 1 ‘Increment palletizing counter by one
if I[10] > (3 * 5) then ‘If palletizing a layer of pallets (3 rows x 5 columns) finishes
I[10] = 1 ‘then reset palletizing counter to initial value
(6) Count up palletizing counter
‘------Count up counters -----------
I[10] = I[10] + 2 ‘Increment palletizing counter by 2
if I[10] > (3 * 5) then ‘If palletizing a layer of pallets (3 rows x 5 columns) finishes
I[10] = 2 ‘then reset palletizing counter to second value
You need to assign "1" topalletizing counter I[10]with the teach pendantbeforehand.
You need to assign "2" topalletizing counter I[10]with the teach pendantbeforehand.
Page 44
(2) Skipped palletizing
Skipped palletizing skips arbitrary partitions in palletizing.
The above palletizing operation seems complicated, but you may easily
program such palletizing just by changing the palletizing counter value that will
pass to the library.
PROGRAM PRO1
TAKEARM
‘------- Get palletizing positions from P[40] ------
‘Order of parameters N,M,Stacked pallet height mm,P1,P2,P3,P4,Palletizing points numbers
‘Palletizing counter, Stacked-pallets counter
CALL xdGetPalt(3, 5, 20,P[52],P[53],P[54],P[55],P[40],I[10],I[11])
PROGRAM PRO1
TAKEARM
SELECT CASE I[10]
CASE 2 ‘If palletizing counter I[10]=2
I[10] = 3 ‘then set the counter to 3
CASE 8,9 ‘If palletizing counter I[10]=8 or 9
I[10] = 10 ‘then set the counter to 10
CASE 11 ‘If palletizing counter I[10]=11
I[10] = 12 ‘then set the counter to
END SELECT
‘------- Get palletizing positions from P[40] ------
‘Order of parameters N,M,Stacked pallet height mm,P1,P2,P3,P4,Palletizing points numbers
‘Palletizing counter, Stacked-pallets counter
CALL xdGetPalt(3, 5, 20,P[52],P[53],P[54],P[55],P[40],I[10],I[11])
1 2 3
6 7 8 9 10
11 12 13 14 15
4 5
M columns
N rows No palletizing to 2nd, 8th, 9th or 11th partition.
Page 45
DENSO Robotics
Section 2
Tool Coordinate System
Page 46
[ 2 ] Tool Coordinates
A 6-axis robot has tool coordinates that make it easy to express the position and
moving path of an end-effector mounted on the robot flange.
The tool coordinates are defined based on the mechanical interface coordinates. This
section begins with an explanation of the mechanical interface coordinates.
[2.1] Mechanical interface coordinates
The mechanical interface coordinates refers to 3-dimensional Cartesian coordinates
whose origin is at the center of the flange surface as shown in Figure 4-3. X, Y, and Z
axes in mechanical coordinates are expressed as Xm, Ym, and Zm as shown in Figure
4-5.
The Xm, Ym, and Zm are identical with X, Y, and Z in Tool mode explained in Section
3.2.1, "Running the Robot Manually," [ 3 ] Tool Mode."
Xm: Normal axis on the center of the flange surface
Ym: Axis passing through the flange center and orientation key hole
Zm: Axis passing through the flange center and crossing Zm and Ym at right angles
Figure 4-5. Definition of Mechanical Interface Coordinates
Unlike the work coordinates or base coordinates, the mechanical interface coordinates
rotate as the robot flange rotates.
Figure 4-6. Rotation of Mechanical Interface Coordinates Following the Flange Rotation
Flangesurface
Center of the flange
Page 47
Chapter 4 General Introduction to Coordinates and Figures
[2.2] Difference in robot motion when driven in mechanical interface
coordinates and base coordinates
In Manual mode, if you choose Tool mode and TOOL0 (Flange) on the teach pendant,
the robot will run in mechanical interface coordinates. If you choose X-Y mode,
WORK0 (Base) will be automatically selected so that the robot will run in base
coordinates.
For details about TOOL0, refer to [2.5] in this section.
Figures 4-7 and 4-8 show the differences in robot motion when the robot is driven in
mechanical interface coordinates and base coordinates, by using the X, Y, and Z keys
and by using the RX, RY, and RZ keys, respectively.
X-Y mode (in base coordinates) Tool mode (in mechanical interface coordinates)
Figure 4-7. Robot Motion Manually Driven by X, Y, and Z Keys
Page 48
X-Y mode (in base coordinates) Tool mode (in mechanical interface coordinates)
NOTE: The + rotation is for clockwise and the -direction for counterclockwise with respect to the vector.
Figure 4-8. Robot Motion Manually Driven by RX, RY, and RZ Keys Page 49
Chapter 4 General Introduction to Coordinates and Figures
[2.3] Tool coordinates
Based on mechanical interface coordinates, you may define tool coordinates by
specifying the origin offset distance from the mechanical interface coordinates and the
yaw/pitch/roll angles.
You may define up to 63 tool coordinates (TOOL1 to TOOL63). TOOL0 is defined by
system for mechanical interface coordinates.
The X, Y, and Z axes in tool coordinates are expressed by Xt, Yt, and Zt, respectively,
as shown below.
Figure 4-9. Mechanical Interface Coordinates and Tool Coordinates
Flangesurface
(Orientation direction)
Tool
Tool coordinates
Page 50
[2.4] Creating tool coordinates
You may create tool coordinates by entering necessary data from the teach pendant or
by writing TOOL command in your program.
The figure below shows the necessary data to be set for creating tool coordinates.
X=
Y= Offset distance components (in mm)
Z=
RX=
RY= Axis rotation angles (in degree)
RZ=
Figure 4-10. Definition Data for Tool Coordinates
The offset distance and the rotation angles should be specified, based on the
mechanical interface coordinates. The rotation order should be RZ, RY, and RX.
RZ=90 deg, RY=90 deg, RX=90 deg
Figure 4-11. Example: Creating Tool Coordinates
Offset
Toolcoordinates
Mechanicalinterfacecoordinates
(1) Turn the RZ.
(3) Turn the RX.
(2) Turn the RY.
Page 51
Chapter 4 General Introduction to Coordinates and Figures
[2.5] TOOL0 (Mechanical interface coordinates)
TOOL0 is reserved for mechanical interface coordinates defined by the system. You
cannot define these coordinates.
If expressed in the same way as shown in Figure 4-10, TOOL0 may be defined as
shown in Figure 4-12.
Default settings for TOOL1 to TOOL63 are the same as TOOL0.
NOTE: If you specify undefined tool coordinates, the robot will run in TOOL0
coordinates and no error will occur in the V*-D SERIES, unlike other DENSO robots.
X = 0
Y = 0 Offset distance components (in mm)
Z = 0
RX = 0
RY = 0 Axis rotation angles (in degree)
RZ = 0
Figure 4-12. Definition Data for TOOL0
Page 52
[2.6] Advantages of tool coordinates
This section describes what advantages you may have by using tool coordinates.
In manual operation or in teaching
When running the robot in tool coordinates, you can directly handle the end-effector
mounted on the flange, making teaching easier.
The figure below shows the comparison of robot moving paths between in mechanical
interface coordinates and in tool coordinates.
In mechanical interface coordinates (TOOL0) In tool coordinates (TOOLn where n is any of 1 to 63)
If X- key is pressed: If Z- key is pressed:
Enables you to move the end-effector to your object point in teaching.
If RX+ key is pressed: If RZ+ is pressed:
Enables you to rotate the end-effector around the Zt axis.
Figure 4-13. Example of Manual Robot Running in Tool Coordinates
Page 53
Chapter 4 General Introduction to Coordinates and Figures
In programmed running
(1) Using APPROACH or DEPART command
APPROACH or DEPART command controls the robot movement on the Z axis of the
tool coordinates. You can arbitrarily define the Z-axis orientation in the tool coordinates,
allowing you to easily control the end-effector. The figure below shows an example of
the tool coordinates definition.
For details about APPROACH and DEPART commands, refer to the
PROGRAMMER'S MANUAL, Section 12.1, "Motion Control."
TOOL0 (mechanical interface coordinates) Changing the Z-axis orientation by tool coordinates definition
Figure 4-14. Example of APPROACH (DEPART) Execution in Tool Coordinates
Approach vector
Approach vector
Page 54
(2) Using ROTATEH command
ROTATEH command controls rotation around the Z axis of the tool coordinates. You
can arbitrarily define the Z-axis orientation in the tool coordinates, allowing you to
easily control the end-effector. Figure 4-15 shows an example of the tool coordinates
definition.
For details about ROTATEH command, refer to the PROGRAMMER'S MANUAL,
Section 12.1, "Motion Control."
TOOL0 (mechanical interface coordinates) Changing the vector orientation and offsetting the coordinate origin by tool definition
Figure 4-15. Example of ROTATEH Execution in Tool Coordinates
Approach vector
Approach vector
Page 55
Chapter 4 General Introduction to Coordinates and Figures
[2.7] Tool definition
Tool definition refers to defining arbitrary tool coordinates by specifying the
components listed in the table given below.
The offset distances (X, Y, and Z) are values in mm from the origin of the mechanical
interface coordinates. The rotation angles (RX, RY, and RZ) are values in degree
around the X, Y, and Z axes of the tool coordinates.
Table 4-1. Components Required for Tool Coordinates Definition
Components Description Unit
X Offset distance on the X axis of the mechanical
interface coordinates
mm
Y Offset distance on the Y axis of the mechanical
interface coordinates
mm
Z Offset distance on the Z axis of the mechanical
interface coordinates
mm
RX Rotation angle around the X axis of the tool
coordinates
degree
RY Rotation angle around the Y axis of the tool
coordinates
degree
RZ Rotation angle around the Z axis of the tool
coordinates
degree
Page 56
Operating procedure for tool definition
According to the procedure below, you may define arbitrary tool coordinates from the
teach pendant. In this example, TOOL1 is defined. The same procedure would apply to
TOOL2 through TOOL63.
With this procedure, you may also display or modify the current tool coordinates.
From the teach pendant
Step 1 On the top screen of the teach pendant, press [F2 arm].
F2
The Current Robot Position window will appear as shown below.
Step 2 Press [F6 Aux.].
F6
The Auxiliary Functions (Arm) window will appear as shown in Step 3.
Page 57
Chapter 4 General Introduction to Coordinates and Figures
Step 3 Press [F4 Tool.].
F4
The Define Tool Coordinates window will appear as shown below.
Step 4 Select the X area of TOOL1 by using the cursor keys or jog dial.
The X area of TOOL1 will become highlighted.
Then press [F5 Change.].
F5
The numeric keypad will appear as shown in Step 5.
Page 58
Step 5 In the numeric keypad shown below, enter the desired offset distance on the X axis
with the numerical buttons
Step 6 Check the new entry (offset distance on the X axis), and then press the OK button.
The new entry will be entered into the X area of TOOL1 as shown below.
Numerickeypad
Page 59
Chapter 4 General Introduction to Coordinates and Figures
Step 7 Repeat Steps 4 through 6 to enter offset values to the Y, Z, RX, RY, and RZ areas of
TOOL1.
Step 8 Press the OK button to finish the procedure of the tool coordinates definition.
Precautions when defining tool coordinates
(1) The CHANGETOOL statement will take effect only in a program that has gotten
robot control by successful execution of the TAKEARM statement.
Execution of the TAKEARM statement will initialize the tool coordinates definition
to TOOL0 (default that is the same as settings for the mechanical interface
coordinates).
(2) From the step where CHANGETOOL statement is written in the programs, the
defined tool coordinates will take effect. The definition will remain valid up to the
step immediately preceding the step where new CHANGETOOL statement is
written.
(3) If no CHANGETOOL statement is written in a program, TOOL0 (mechanical
interface coordinates) will apply.
(4) Once you select tool coordinates on the Select Operation Mode window called up
by the M-MOD key on the teach pendant, it will take effect in Tool mode until it will
be changed.
(5) If TOOL number used for running the robot to the object point and attitude differs
from TOOL number previously used in writing the current point and attitude, the
resulting position and attitude of the robot flange will become different from the
previous ones.
For example, when programming, if you have written the object point and attitude
using the APPROACH command in TOOL0 and you insert TOOLn (n is any of 1
through 63) in any step preceding the APPROACH command, then executing the
program brings the center of the robot flange to a different point and attitude than
those defined in TOOL0, depending upon the contents of those different tool
definitions.
(6) The tool coordinates definitions made in program execution and in manual running
are saved in the same memory location.
If you switch the operation mode from Auto mode to Manual mode, the tool
coordinates definition made in programming will remain in effect.
(7) You may at anytime check the current TOOL number in the status bar on the teach
pendant. Refer to p. 4-27.
For details about commands and tool definitions, refer to the PROGRAMMER'S
MANUAL, Section 12.1, "Motion Control, APPROACH" and Section 9.5, "Tool
Coordinates, TOOL." Also refer to Section 4.1.1, [2.7] Tool coordinates definition in
this chapter. Page 60
Sample program for switching defined tool coordinates
Execution of CHANGETOOL 0 will cancel the current tool coordinates definition and
restore the default TOOL0 (mechanical interface coordinates).
TAKEARM statement automatically involves CHANGETOOL 0.
The figure below shows a sample program that switches the defined tool coordinates
from TOOL1 to TOOL2. End-effector 1 and End-effector 2 used in this program are
illustrated in Figures 4-17 and 4-18, respectively. The positional relationship between
the robot unit, End-effector 1, and End-effector 2 is assumed as shown in Figure 4-19.
End-effector 1 is placed at P1 and End-effector 2 is at P2.
PROGRAM TOOL Sample
Tool 1, (0, -49.7, 79.2, 45, 0, 0) 'Defines TOOL1.
Tool 2, (0, -65, 37.5, 90, 0, 0) 'Defines TOOL2.
TakeArm 'Executes CHANGETOOL0 automatically.
'Setting End-effector 1
Approach P, P1, 200
Move L, P1 See Figure 4-19.
Set IO[104] 'Sets End-effector 1.
Depart P, 200
ChangeTool 1 'Switches to TOOL1.
: :
'Releasing End-effector 1
ChangeTool 0 'Restores the default TOOL0.
Approach P, P1, 200 See Figure 4-20.
Move L, P1
Reset IO[104] 'Releases End-effector 1.
Depart P, 200
'Setting End-effector 2
Approach P, P2, 200
Move L, P2 See Figure 4-21.
Set IO[105] 'Sets End-effector 2.
Depart P, 200
ChangeTool 2 'Switches to TOOL2.
: :
Figure 4-16. Switching the Defined Tool Coordinates
Page 61
Chapter 4 General Introduction to Coordinates and Figures
Figure 4-17. End-effector 1 Figure 4-18. End-effector 2
In the sample program shown in Figure 4-16, End-effector 1 and End-effector 2 are
defined as TOOL1 and TOOL2, respectively.
Execution of TAKEARM automatically specifies TOOL0, so the robot will move to P1
(where End-effector 1 is placed) on the flange surface basis. As illustrated in Figure
4-19, End-effector 1 will be mounted by "Set IO [104]." "Depart P,200" will make the
robot apart from P1 and CHANGETOOL 1 switches the tool coordinates from TOOL0
to TOOL1.
Figure 4-19. Moving Path for Setting End-effector 1
Page 62
To replace End-effector 1 with End-effector 2, first release End-effector 1 as follows.
"CHANGETOOL 0" will switch the current tool coordinates from TOOL1 to TOOL0. As shown in Figure 4-20, the robot will move to P1 on the flange surface basis and release End-effector 1 at P1.
Figure 4-20. Moving Path for Releasing End-effector 1
As shown in Figure 4-21, in mechanical interface coordinates, the robot will move to P2 where End-effector 2 will be mounted. "Depart P,200" will make the robot apart from P2. Then TOOL0 will be switched to TOOL2.
Figure 4-21. Moving Path for Setting End-effector 2
Page 63
Chapter 4 General Introduction to Coordinates and Figures
Displaying the current tool coordinates
The current tool coordinates are always shown in the status line of the screen on the
teach pendant, independent of the operation modes (Auto, Manual, and Teach check
modes).
Denotes TOOL0
Page 64
[2.8] End-effector samples and their tool coordinates definitions
The figure below shows end-effector samples (chuck and other tools). Figure 4-23 shows their tool coordinate definitions.
Figure 4-22. End-effector Types and Their Coordinate Origins
Page 65
Chapter 4 General Introduction to Coordinates and Figures
The chuck is mounted in parallel A with the orientation vector of the flange.
The chuck is mounted in parallel B with the orientation vector of the flange.
The chuck is mounted at an angle of 45 C to the orientation vector of the flange.
The chuck is mounted at right angles D to the orientation vector of the flange.
E F
Figure 4-23. Tool Coordinates Definition Examples
Page 66
DENSO Robotics
Section 3
Work Coordinate System
Page 67
Chapter 4 General Introduction to Coordinates and Figures
4.1 Coordinates, Interference Check Area, and Figures in V*-D/-E Series
4.1.1 Coordinates
This section describes the coordinates required for correct handling of the robot.
[ 1 ] Base coordinates
[1.1] Base (world) coordinates and work coordinates
The base coordinates are so-called world coordinates which refer to 3-dimensional Cartesian coordinates whose origin is at the center of the robot basement. It has components Xb, Yb, and Zb which are identical with X, Y, and Z in X-Y mode explained in section 3.2.1, "Running the Robot Manually,"[ 2 ] X-Y mode."
The work coordinates are defined relatively in base coordinates. The origin of the work coordinates should be laid at a corner of the cubic envelope of an object piece. It has components Xw, Yw, and Zw. You may define the work coordinates by the number of objects you want to handle in the same timeframe on the single robot.
Work coordinates are 3-dimensional Cartesian coordinates defined for each operation space of work. The origin can be anywhere. Work coordinates are expressed by the coordinate origin (X, Y, Z) corresponding to the base coordinates and the angles of rotation (Rx, Ry, Rz) around X axis, Y axis and Z axis of base coordinates. If work coordinates are not defined, base coordinates go into effect.
Figure 4-1. Base Coordinates and Work Coordinates
Workcoordinates 2
Base coordinates
Workcoordinates 1
Work coordinates 3
Page 68
[1.2] Position data
Position data refers to a set of data which includes seven components of base
coordinates. Of these seven components, three are robot flange center coordinates
(the end-effector tip coordinates if an end-effector is defined) and four are current robot
attitude components, as shown below.
Position data allows you to represent the current position of the robot flange center and
object points.
Position data:
X
Y Coordinate values (in mm) Defines the position of the robot flange center or the Z end-effector center.
RX Yaw angle: Rotation angle around X axis (in degrees)
RY Pitch angle: Rotation angle around Y axis (in degrees) Defines the robot attitude.
RZ Roll angle: Rotation angle around Z axis (in degrees)
FIG Figure (Value: 0 to 31)
Figure 4-2. Components of Position Data
A set of X, Y, and Z coordinate values represents the position of the robot flange center
(or tip of the end-effector if defined) expressed in base coordinates (Xb, Yb, and Zb) in
units of mm.
As shown in Figure 4-3, the yaw, pitch, and roll angles, which are expressed by RX, RY,
and RZ, refer to rotation angles around the respective axis of Xm, Ym, and Zm defined
in mechanical interface coordinates (refer to Section 4.1.1, [2.1]) whose origin is at the
center of the flange surface. These angles are expressed in units of degree.
With respect to the positive (+) direction on axes of the base coordinates, clockwise
rotation is treated as positive (+).
You should always preserve the rotation order of RZ, RY, and RX. Changing it will
cause the robot to take a different attitude in spite of the same rotation angle defined.
Figure represented by FIG value refers to a figure of robot arm joints. It is explained in
Section 4.1.3, "Figures of the Shoulder, Elbow, and Wrist."
Page 69
Chapter 4 General Introduction to Coordinates and Figures
Figure 4-3. Roll, Pitch and Yaw Angles
Pitch angle (RY)
Yaw angle (RX)
Roll angle (RZ)
+Xm
+Ym
+Zm
Page 70
(Rx, Ry, Rz) = Attitude of (180, 90, 90)
Figure 4-4. Examples of roll, pitch and yaw angle rotation
Attitude: (Rx, Ry, Rz) = (0, 0, 0) (Rx, Ry, Rz) = (180, 90, 90)
(RX, RY, RZ) = (180, 90, 90)
Xm
YmZm
(RX, RY, RZ) = (0, 0, 0)
Xm
Ym
Zm
(RX, RY, RZ) = (0, 90, 90)
Xm
YmZm
(RX, RY, RZ) = (0, 0, 90)
XmYm
Zm
Roll angle Yaw angle
Pitch angle
Rotate 90 degreesaround Z axis
Rotate 180 degrees around X axis
Rotate 90 degreesaround Y axis
Page 71
Chapter 4 General Introduction to Coordinates and Figures
[1.3] Defining work coordinates
Two procedures, 3-point teaching and direct value entry, are available for defining work
coordinates.
Defining work coordinates by 3-point teaching
[F2 Arm]—[F6 Aux.]—[F5 Work]—[F4 AutoCalc]
In this method coordinates are created by teaching three points, namely, the origin of
work coordinates, a point on X-axis and a point on X-Y plane.
Defining work coordinates by direct value entry
[F2 Arm]—[F6 Aux.]—[F5 Work]—[F5 Change.]
Enter the coordinate origin (X, Y, Z) corresponding to the base coordinates and rotation
angles (Rx, Ry, Rz) around the X-axis, Y-axis and Z-axis of base coordinates.
Hand of robot
Work coordinate origin
Point on X-Y plane Point on X axis
Page 72
Defining work coordinates by 3-point teaching
Step 1 On the top screen of the teach pendent, press [F2 Arm].
Step 2 Press [F6 Aux.] in the Current Robot Position window.
Step 3 Press [F5 Work] in the Auxiliary Functions (Arm) window.
The Define Work Coordinates window appears as shown below.
F4
Select the coordinates by using the cursor or jog dial, and then press [F4
AutoCalc].
Step 4 The Work coordinate automatic calculation window appears.
F5
To set a desired position variable name to each of the "Origin of work," "Point on X
axis of work," and "Point on X-Y plane of work," first choose the "Origin of work" row
and press [F5 Change.]. Page 73
Chapter 4 General Introduction to Coordinates and Figures
Step 5 The numeric keypad will appear as shown below. Enter a desired position variable
name for the "Origin of work" and press the OK button. The same way, set desired
position variable names to the "Point on X axis of work" and "Point on X-Y plane of
work."
Step 6 Call up the Position Variables assignment window ([F2 Arm]—[F4 Var.]—[F4
Position.]) shown below.
In the Position Variables assignment window, assign the value of the robot arm
position to be taught to each of the three position variables you have set in Step 5.
(1) Place the cursor on the position variable to which you want to assign the robot
arm position value.
(2) In Manual mode, move the tool end of the robot arm to the teaching point.
(3) Press [F6 Get Pos.] in order to read in the current position of the tool end to the
selected position variable.
(4) Carry out Steps (1) through (3) above for each of the "Origin of work," "Point on
X axis of work," and "Point on X-Y plane of work."
NOTE • Teach the "Origin of work" and "Point on X axis of work" precisely.
• Define work coordinates after establishing the tool definition. Page 74
Step 7 Press the Cancel button twice to return to the Work coordinate automatic calculation
window.
Step 8 At the bottom of the Work coordinate automatic calculation window, the defined work
coordinates are displayed. If they are satisfactory, press the OK button; if not, press
the Cancel button.
Step 9 If you press the OK button in Step 8, the defined work coordinates will be entered
into the target work number.
Page 75
Chapter 4 General Introduction to Coordinates and Figures
Defining work coordinates by direct value entry
Step 1 On the top screen of the teach pendant, press [F2 Arm].
Step 2 Press [F6 Aux.] in Current Robot Position window.
Step 3 Press [F5 Work.] in Auxiliary Functions (Arm) window.
The Define Work Coordinates window appears.
Select the work coordinates to be defined using the cursor or jog dial.
Step 4 Press [F5 Change.] in the Define Work Coordinates window.
The numeric keypad will appear as shown below.
Step 5 Using the numeric keypad, enter the desired numerical values. After checking the
entered values, press the OK button.
Page 76
DENSO Robotics
Section 4
Interference Areas
Page 77
Chapter 4 General Introduction to Coordinates and Figures
[ 8 ] Interpreting a detected area interference as an error
In earlier versions of the main system software, only when the origin of the tool
coordinates invades the interference check area, the system interprets it as an error.
In Version 1.8 or later, the system may detect also when the origin exits from the
interference check area. You may choose either "invading the interference check
area" or "exiting from it." This feature allows you to use the AREA statement for
setting the motion area.
Interpreting a detected area interference as an error
The moment the origin of the tool coordinates interferes with the active interference
area, the system may detect it as an error and cut the motor power off to prevent the
arm from proceeding into the area further.
In Version 1.8 or later, you may choose any of the following items on the Error
Display on Area Interference window.
ItemsThe system will
detect it as an errorwhen:
Error signal output
0: Disable (inside) No
1: Enable (inside) Yes
2: Enable+ManMv (inside)
The robot arminvades the definedarea.
Yes (You may switch toManual mode and operate therobot manually for recovery.)
3: Disable (outside) No
4: Enable (outside) Yes
5: Enable+ManMv (outside)
The robot arm exitsfrom the definedarea.
Yes (You may switch toManual mode and operate therobot manually for recovery.)
Access: [F2 Arm]—[F6 Aux.]—[F6 Area.]
Page 78
[ 3 ] Defining an interference check area by 2-point teaching
Step 1 On the top screen of the teach pendant, press [F2 Arm].
Step 2 Press [F6 Aux.] in the Current Robot Position window.
Step 3 In the Auxiliary Functions (Arm) window, press [F6 Area], and the Define Area
window appears as shown below.
F4
Select the desired work coordinates using the cursor or jog dial, and then press
[F4 AutoCalc].
Step 4 The Interference area automatic generation window appears as shown below.
To set the reference work coordinates number (to be used for defining an
interference check area) and unassigned position variable names to be used for
farthest and nearest vertexes, select "Work coordinate," "Interference area vertex
1," or "Interference area vertex 2," respectively, by using the cursor keys or jog dial
and then press [F5 Change.].Page 79
Chapter 4 General Introduction to Coordinates and Figures
Step 5 The numeric keypad will appear as shown below. Enter the desired number and
two position variable names to the "Work coordinate," "Interference area vertex 1,"
and "Interference area vertex 2," respectively.
NOTE: For base coordinates, enter 0 to the "Work coordinate."
Step 6 Call up the Position Variables assignment window ([F2 Arm]—[F4 Var.]—[F4
Position]) shown below.
In the Position Variables assignment window, assign the value of the robot arm
position to be taught to each of the two position variables you have entered for
vertexes farthest and nearest to the origin of the base coordinates in Step 5.
(1) Place the cursor on the position variables set for 2-point teaching.
(2) In Manual mode, move the tool end of the robot arm to the teaching point.
(3) Press [F6 Get Pos.] in order to read in the current position of the tool end to
the selected position variable.
(4) Carry out (1) through (3) above for each of the farthest and nearest vertexes.
NOTE • Define an interface check area after defining tool coordinates and work
coordinates.
• Before teaching the nearest and farthest vertexes, set the Manual mode
in the work coordinates of the reference work coordinated number.
Page 80
Step 7 Press the Cancel button twice to return to the Interference area automatic
generation window.
Step 8 At the bottom of the Interference area automatic generation window, the defined
interference check area is displayed. If its values are satisfactory, press the OK
button; if not, press the Cancel button.
NOTE: The center of the interference check area is always based on the base
coordinates (Work0). Therefore, the calculated center of position is not the center
of the specified work coordinates.
Step 9 If you press the OK button in Step 8, the defined interference check area values
will be entered into the target interference check area.
Page 81
The following procedure specifies whether or not to detect the invasion to the
interference check area(s) as an error.
Operating procedure for area interference error detection
Step 1 On the top screen of the teach pendant, press [F2 Arm].
Step 2 Press [F6 Aux.] in the Current Robot Position window.
Step 3 Press [F6 Area.] in the Auxiliary Functions (Arm) window.
Step 4 Call up the defined interference check area to be modified with the cursor keys or jog
dial.
Step 5 In the Define Area window, select an entry field in the rightmost column of the bottom
line.
F5
Then press [F5 Change.]. The error detection disable/enable screen will appear as
shown on the next page.
Page 82
Chapter 4 General Introduction to Coordinates and Figures
Step 6 Select Enable (or Disable), and then press the OK button.
Step 7 The new setting will appear in the selected entry field. Press the OK button.
Page 83
[ 9 ] Defining an interference check area in WINCAPSII
Operating procedure
From the operating panel
Step 1 Start WINCAPSII at programmer level and run Arm Manager.
Step 2 On the Tool menu, select Options. Then select the Area tab.
Page 84
Chapter 4 General Introduction to Coordinates and Figures
Step 3 In the Area table, modify the interference check area related parameters.
X, Y, Z: Origin of the interference check area
RX, RY, and RZ: Rotation angles of the interference check area
DX, DY, and DZ: Vectors of the interference check area
IO: I/O signal numbers which will turn on if the tip of the end-effector enters the
interference check area.
POS: Name of a position variable (global variable) to which the position value
of the tip of the end-effector will be assigned when the tip of the end-effector
enters the area.
ERR: Determines whether a detected area interference will be interpreted as
an error. (0: Not interpreted as an error, 1: Interpreted as an error)
ENABLE: Determines whether an area interference will be detected or not.
(0: Not Detected, 1: Detected)
Step 4 After making necessary settings, press the OK button.
Step 5 Connect Arm Manager. On the File menu, select Transfer.
Step 6 Select <Area> and press Transmit>. Immediately after the transmission, the new
parameters will take effect.
Page 85
[ 10 ] Escaping from the interference check area
[Ver. 1.4 or later]
In Ver. 1.3 or earlier, the robot needs to be manually moved out of the interference
check area whenever the robot enters any of prohibited areas 0 to 7. Entering
prohibited areas will result in error (ERROR2490 to 2497).
In Ver. 1.4 or later, if you set [2: Enable +ManMv] in the interference check area setting,
then you may move the robot out of the interference check area from the teach
pendant or the operating panel in the cases marked with "Available" in the table below.
OperationMode
Motor ON Manual key Variable shift Motor lock Direct
Manual Available Available N/A Available N/A
Teach check N/A - N/A N/A -
Internal auto N/A - - N/A -
External auto N/A - - N/A -
Setting [2:Enable + ManMv]
Step 1 On the top screen of the teach pendant, press [F2 Arm].
Step 2 Press [F6 Aux.] in the Current Robot Position window.
Step 3 In the Auxiliary Functions (Arm) window, press [F6 Area].
Step 4 Using the cursor keys or jog dial, select the area you want to change.
Page 86
Chapter 4 General Introduction to Coordinates and Figures
Step 5 Select the rightmost column of the table. Press [F5 Change.].
F5
Step 6 Select [2: Enable+ManMv] and press OK.
Step 7 You can change all the settings in the window for values you want. If you change any
of them, confirm them and press OK.
Page 87
9.2 Interference Area Coordinates
AREA (Statement) Interference Area Coordinates
Declare an interference check area.
Syntax AREA <area number>,<position>,<vector>,<I/O number>,<position variable
number for interference position>[,<error output>]
Description This statement declares an area where an interference check should be performed.
<area number> has a range of 0 to 7. Up to eight areas can be declared.
<position> is the center position and angle of an interference check area.
<vector> is an interference check area zone whose side length is twice as long as
each component of <vector>.
<I/O number> is the number of an I/O line that is turned ON by a SET command when
an area interference occurs. The I/O status is maintained until a RESETAREA or RESET is
executed.
In Version 1.8 or later, <I/O number> can be expressed in two forms, e.g., IO104 and
IO[104]. Also, specifying -1 to <I/O number> prohibits output to the I/O line.
<position variable number for interference position> is the number of a
position variable that saves the coordinates where an area interference occurs. If an
area interference is detected (that is, when a SET statement turns the I/O signal ON),
the system will store the origin of the current tool coordinates in work coordinates into
this parameter. Usually, the origin of the tool coordinates lies on the surface of the
cube; however, if the origin lies inside the cube at execution of SETAREA, the system
stores that position into this parameter.
In Version 1.8 or later, <position variable number for interference position>
can be expressed in two forms, e.g., P55 or P[55]. Also, specifying -1 to this parameter
prohibits assignment to the position variable.
<error output> is interference check conditions to be applied when an area
interference is detected.
<Erroroutput>
The system will detect it as an error when:
Error signal output
0 No
1 Yes
2
The robot arm invades the
defined area. Yes (You can switch to Manual mode and operate the robot manually for recovery.)
3 No
4 Yes
5
The robot arm exits from the
defined area. Yes (You can switch to Manual mode and operate the robot manually for recovery.)
To check interference, the system compares the cube defined as an interference check
area with the origin of the currently active tool coordinates. If the origin of the tool
coordinates is inside the interference check area, then the system determines it as an
area interference.
The interference area can be specified either in WINCAPSII or from the teach pendant. Page 88
Chapter 9 Declaration Statements
Notes The center position of an area is always based on the base coordinates (WORK0).
Even if work coordinates are changed, the interference check area does not change.
Interference check area
X axis
Position
Vector
Y axis
Z component
Y component X component
Z axis
Related Terms SETAREA, RESETAREA, AREAPOS, AREASIZE
Example
6-/4-axis AREA 2, P50, V10, 104, 55
'Define an area specified by P50 and V10 as #2
SETAREA 2 'Make #2 interference area detection active
RESETAREA 2 'Make #2 interference area detection inactive
6-axis AREA 2, P50+(100, 100, 0, 10, 0, 0), V10, 104, 55
'Define an area specified by P50+
'(100, 100, 0, 10, 0, 0) and V50 as #2
SETAREA 2 'Make #2 interference area detection active
RESETAREA 2 'Make #2 interference area detection inactive
4-axis AREA 2, P50+(100, 100, 0, 10), V10, 104, 55
'Define an area specified by P50+
'(100, 100, 0, 10) and V50 as #2
SETAREA 2 'Make #2 interference area detection active
RESETAREA 2 'Make #2 interference area detection inactive
Interference check area
Tool coordinate origin of WORK0. Tool coordinate origin of WORK1
X axis
Z axis
Vector
Interference check area
X component Y component
Z component
Position
Y axis
Page 89
DENSO Robotics
Section 5
Current Limiting
Page 90
Lesson 19 Current Limiting
Current limiting restricts the normal operation current of the servomotor to below the set value. As
the torque of the servomotor is proportional to the applied current, its torque may also be restricted by the limiting of the motor current.
The output thrust of robots can be restricted on the direct drive axis such as the Z-axis (vertical axis)
of the horizontal articulated robot. The ON/OFF or the set value of the current limit can be freely defined by the program.
If the current limit is applied to the vertical axis (Z-axis), damage to the workpiece through insertion
failure and robot overcurrent error can be avoided as shown in the figures below without using the
conventional shock absorbing spring mechanism.
Current Limiting
Conventional
Limits Z-axis output thrust
Current limiting = Limiting of the motor driving current
Shock reduction mechanism needed
Shock absorbing spring
Approx. 30N minimal Approx. 100N maximal
Output thrust
Current limit control parameter setting (CIMT)
Current Limiting
Limits the driving current of Z axis motor (up/down motion)
Z axis has a virtual spring mechanism.
Deletes the need fora conventional
shock absorbing spring mechanism
↓
Page 91
Current limit commands
Current limit commands are included in the PAC libraries and are roughly grouped
into two libraries; the current limit function library and the deviation allowance value setting library. For details, refer to the Programmer’s Manual.
Shown below are these libraries and the examples of application programs.
� Current limit function library
SetCurlmt Set current limit
ResetCurlmt Reset current limit
SetForce_HM Set current limit for the output torque definition for
Z-axis of HM/HS robots
SetForce_HC Set current limit for the output torque definition for HC
robots
� Deviation allowance value setting library
SetEralw Set deviation allowance value
ResetEralw Reset deviation allowance value
Program examples for setting the current limit
TAKEARM Acquire robot arm semaphore
CALL SetEralw (3, 50) Set deviation allowance value of Z
(3)-axis to 50mm
CALL SetCurLmt (3, 30) Set current limit of Z(3)-axis to 30%
(CALL SetForce_HM (50.0)) Set force of Z-axis of HM robot to 50N
Program examples for resetting the current limit
TAKEARM Acquire robot arm semaphore
CALL ResetEralw (3) Reset deviation allowance value of Z(3)-axis to the initial value
CALL ResetCurLmt (3) Reset current limit of Z(3)-axis (the deviation is also eliminated)
Note: Remember at all times that the set value of the current limit for the robot
output definition in the above examples is only for reference and not a guaranteed value.
Page 92
SetGravity (Library) (Version1.2 or later)
Function
Compensates for the static load (gravity torque) applied to each joint and attains balance with gravity torque.
Format
SetGravity
Explanation
Each joint of the robot undergoes downward static load (gravity torque) due to earth gravity. The effects of the gravity torque will vary depending upon the mass of payload (end-effector and workpiece), the payload center of gravity, and robot figures.
If you limit the motor output torque by setting its drive current limit so that the limited torque becomes lower than the gravity torque, then the robot will move down towards the earth. To prevent it, this statement compensates the limited torque for the gravity torque, keeping the balance of torque.
Macro Definition
Requires <pacman.h> file.
Related Terms
SetCurLmt, ResetGravity, SetGrvOffset
Notes
(1) Write this command in a TAKEARMed task that has obtained arm-semaphore. If this command is executed without arm-semaphore obtained, Error 21F7 will result.
(2) Set the mass of payload and the payload center of gravity accurately. Otherwise, the robot may move down due to gravity if you set a low current limit value (e.g., less than 30). For the entry procedure of the mass of payload and the payload center of gravity, refer to p.4-15, " 4.7 Setting the Master Control Parameters in User Preferences."
(3) If you do not know the accurate mass of payload or its center of gravity or if the robot moves down in spite of accurate settings, then use the gravity offset function (SetGrvOffset) that compensates for the gravity compensation value.
(4) If you set the gravity offset setting to "1" on the teach pendant, the gravity offset function becomes enabled. The setting made on the teach pendant will take effect immediately following the completion of calibration after the robot controller is powered on.
Example
CALL SetGravity 'Enables gravity compensation function.
Delay 100 'Waits for gravity compensation to take effect.
CALL SetCurLmt (2,30) 'Sets the current limit value of the 2nd axis to 30%.
Page 93
4
ResetGravity (Library) (Version 1.2 or later)
Function
Disables the balance setting between the limited motor torque and gravity torque, which is made with SetGravity.
Format
ResetGravity
Explanation
This command disables the balance setting between the motor torque limited by the current limit function and gravity torque.
Macro Definition
Requires <pacman.h> file.
Related Terms
ResetCurLmt, SetEralw
Notes
(1) Write this command in a TAKEARMed task that has obtained arm-semaphore. If this command is executed without arm-semaphore obtained, Error 21F7 will result.
(2) If this command is executed when the current limit function is enabled, Error 665b will result. Disable the current limit function and then try it again.
(3) If you set the gravity offset setting to "0" on the teach pendant, the gravity offset function becomes disabled. If you do it when the current limit function is enabled, Error 665b will result, as in step (2).
Example
CALL ResetGravity
Page 94
4
SetGrvOffset (Library) (Version1.2 or later)
Function
Compensates the torque of each joint programmed with SetGravity for gravity torque.
Format
SetGrvOffset
Explanation
Each joint of the robot undergoes downward static load (gravity torque) due to earth gravity. Although gravity compensation command SetGravity allows you to adjust the balance between the limited torque and gravity torque, the balance may be off-balance due to the difference between the mass of payload you set and the actual one.
This offset function presumes the gravity torque when the robot is on halt and calculates the gravity offset value.
Macro Definition
Requires <pacman.h> file.
Related Terms
SetCurLmt, SetGravity, ResetGrvOffset
Notes
(1) Write this command in a TAKEARMed task that has obtained arm-semaphore. If this command is executed without arm-semaphore obtained, Error 21F7 will result.
(2) This command should be executed when the motor power is on and the robot is on halt. If it is executed when the motor power is off, Error 6006 will result. If it is executed when the robot is in motion, Error 600B will result.
(3) If the robot attitude is greatly changed after execution of this command, execute this command again.
(4) If the current limit reset value in User Preferences is set to any value other than “1”, “3”, “5”, or “7”, the compensation value will be reset to “0” when you turn on the motor power.
Example
CALL SetGrvOffset
Page 95
4
ResetGrvOffset (Library) (Version 1.2 or later)
Function
Disables the gravity offset function.
Format
ResetGrvOffset
Explanation
Disables the gravity offset function which has been enabled with SetGrvOffset.
Macro Definition
Requires <pacman.h> file.
Related Terms
SetGrvOffset
Notes
(1) Write this command in a TAKEARMed task that has obtained arm-semaphore. If this command is executed without arm-semaphore obtained, Error 21F7 will result.
(2) This command should be executed when the robot is on halt. If it is executed when the robot is in motion, Error 600B will result. This command is executable even when the motor power is off.
Example
CALL ResetGrvOffset
Page 96
4
SetCurLmt (Library) (Version 1.2 or later)
Function
Sets the limit of motor current to be applied to the specified axis.
Format
SetCurLmt (<AxisNumber>, <Value>)
Explanation
Limits the value of motor current (torque) to be applied to the axis specified by <AxisNumber> to the value specified by <Value>. This command is useful when you want to limit torque that a workpiece will undergo during insertion or butting jobs.
The maximum value of <Value> is 100 which refers to the motor rating current. If any value exceeding the allowable limit for each axis is specified, the value will be automatically limited to that allowable limit.
Set a value of 1 or above. If 0 or a negative number is set, Error 6003 will result.
Macro Definition
Requires <pacman.h> file.
Related Terms
ResetCurLmt, SetGravity, SetGrvOffset, SetEralw
Page 97
4
Notes
(1) When the motor current is limited with SetCurLmt, the robot cannot move at the maximum speed or acceleration. Use SetCurLmt only at steps that need the current limit. When using SetCurLmt, decrease the acceleration.
(2) If a workpiece bumps against something at high speed even if the driving force is controlled by limiting the motor current, the impact is considerable due to the inertia of the workpiece, end-effector and axis. Set the current limit just before the workpiece comes into contact with the object and reduce the speed.
(3) Set the current limit when the robot is on halt. If it is set during a pass motion, an error is likely to occur.
(4) Write this command in a TAKEARMed task that has obtained arm-semaphore. If this command is executed without arm-semaphore obtained, Error 21F7 will result.
(5) When setting the current limit, be sure to enable the gravity compensation function. If the current limit is set when the gravity compensation function is disabled, Error 665a will result. For the gravity compensation function, refer to SetGravity.
6-axis (6) If the current limit reset value in User Preferences is set to any value other than"1," the current limit will be reset when you turn on the motor power. To make the current limit function effective immediately after switching on the motor power, set the current limit reset value to "1."
6-axis (7) Set the mass of payload and the payload center of gravity accurately. Otherwise, the robot may move down due to gravity if you set a low current limit value (e.g., less than 30). For the entry procedure of the mass of payload and the payload center of gravity, refer to PART 1, Section 5.7, "Setting the Master Control Parameters in User Preferences."
6-axis (8) If the current limit reset value is set to "1," the robot might move down due to gravity the moment you turn on the motor power. Reset the current limit by executing ResetCurLmt when the motor power is off and then switch on the motor power.
6-axis (9) If you do not know the accurate mass of payload or its center of gravity or if the robot moves down in spite of accurate settings, then use the gravity offset function (SetGrvOffset) that compensates for the gravity compensation value.
Example
6-axis CALL SetGravity 'Enables the gravity offset
CALL SetGrvOffset 'Compensates the gravity offset value
CALL SetEralw (2, 20) 'Sets the allowable deviation of the 2nd axis to
'20 degree
CALL SetCurLmt (2, 30) 'Sets the current limit of the 2nd axis to 30%
4-axis CALL SetEralw (2, 20) 'Sets the allowable deviation of the 2nd axis
'to 20 degree
CALL SetCurLmt (2, 30) 'Sets the current limit of the 2nd axis to 30%
Page 98
5
ResetCurLmt (Library) (Version 1.2 or later)
Function
Resets the motor current limit of the specified axis.
Format
ResetCurLmt (<AxisNumber>)
Explanation
ResetCurLmt releases the drive current limit set for the motor of a joint specified by <JntNumber>. The motor drive current limit and positioning error allowances will revert to the defaults.
[For Ver. 1.4 or earlier] If you set "0" to <JntNumber>, the drive current limit set for all joints will revert to the default.
[For Ver. 1.5 or later] If you set "0" to <JntNumber>, the drive current limit set for all joints involved in an arm group semaphore held by the current task running ResetCurLmt, will revert to the default.
Macro Definition
Requires <pacman.h> file.
Related Terms
SetCurLmt, ResetEralw
Notes
(1) When resetting the current limit, this command carries out deviation elimination process. If there is angle deviation due to external force, the time required for deviation elimination process will vary depending upon the set speed and acceleration. To shorten the time, set higher speed and acceleration.
(2) The command can be executed even when the motor power is off. For resetting the current limit when motor power is off, run the following program after finishing the task that is obtaining arm-semaphore.
PRO999
TAKEARM
CALL ResetCurLmt(0)
END
(3) [For Ver. 1.4 or earlier] Write this library in a TAKEARMed task that has got robot arm semaphore. If you specify any joints not in the arm semaphore to <JntNumber>, then error [21F7 Cannot take arm semaphore] will result.
[For Ver. 1.5 or later] Write this library in a TAKEARMed task that has got an arm group. If you specify any joints not included in the arm group to <JntNumber>, then error [27D* Cannot take J* semaphore] will result.
Example
CALL ResetCurLmt(0) 'Resets the current limit of all the axes.
Page 99
5
SetEralw (Library) (Version 1.2 or later)
Function
Modifies the allowable deviation of the specified axis.
Format
SetEralw (<AxisNumber>, <Value>)
Explanation
Sets the allowable deviation of the axis specified by <AxisNumber>. Use this command if angle deviation occurs due to external force when the current limit function is enabled.
The <Value> is the arm joint angle and specified in degrees.
"Allowable deviation value" refers to the allowable range of the "Error 611*J* Excessive deviation" which will occur for safety if the servo deviation exceeds the specified value.
During assembling operation with the current limit enabled, if servo deviation occurs due to external force, the above error may occur. To avoid this, you may use this command temporarily to increase the allowable deviation value.
This command can also be used to reduce the allowable deviation value for helping quick detection of the downward movement of the robot due to gravity when the current limit function is enabled.
Macro Definition
Requires <pacman.h> file.
Related Terms
SetCurLmt, ResetEralw
Notes
(1) Run this command in a TAKEARMed task which has obtained arm-semaphore. If the command is executed without arm-semaphore obtained, Error 21F7 will result.
Example
CALL SetEralw(2,20) 'Sets the permissible deviation of the 2nd axis
'to 20 degrees.
Page 100
5
ResetEralw (Library) (Version 1.2 or later)
Function
Resets the allowable deviation value of the specified axis to the initial value.
Format
ResetEralw(<AxisNumber>)
Explanation
Resets the allowable deviation value of the axis specified by <AxisNumber> to the initial value. If <AxisNumber> is specified to "0," the allowable deviation values of all the axes will be reset.
[For Ver. 1.4 or earlier] If you set "0" to <JntNumber>, the positioning error allowance set for all joints will revert to the default.
[For Ver.1.5 or later] If you set "0" to <JntNumber>, the positioning error allowance set for all joints involved in an arm group semaphore held by the current task running ResetEralw, will revert to the default.
Macro Definition
Requires <pacman.h> file.
Related Terms
ResetCurLmt, SetEralw
Notes
(1) [For Ver. 1.4 or earlier] Write this library in a TAKEARMed task that has got robot arm semaphore. If you specify any joints not in the arm semaphore to <JntNumber>, then error [21F7 Cannot take arm semaphore] will result.
[For Ver. 1.5 or later] Write this library in a TAKEARMed task that has got an arm group. If you specify any joints not included in the arm group to <JntNumber>, then error [27D* Cannot take J* semaphore] will result.
(2) Run this command in a TAKEARMed task that has obtained arm-semaphore. If this command is executed without arm-semaphore obtained, Error 21F7 will result.
(3) Like this command, execution of ResetCurLmt will also reset the allowable deviation values to the initial values.
Example
CALL ResetEralw(0) Returns the allowable deviation values of all axes
to initial values.
Page 101
DENSO Robotics
Section 6
Compliance
Page 102
Lesson 20 Compliance Control (For 6-axis robot only)
Compliance control provides compliance for robots by software. This feature may absorb
misalignment errors encountered when parts are mated during assembly operations or loaded into fixture and prevent robots or workpieces from undergoing excessive force.
Two types of compliance control are available: one is a current limit function that sets compliance to
individual joints, and the other is a tip compliance function that sets compliance to individual
elements of the coordinates formed at the end of the robot flange (the mechanical interface coordinates).
NOTE: The current limit function is available for Ver. 1.2 or later. The tip compliance function is
available for the V*-D/-E/-F/-G series, Ver. 1.4 or later.
20.1 Current limit function for individual axes
This function provides compliance for individual axes by limiting the drive torque (current) of each
axis motor. It prevents excessive force from applying to robots or workpieces or avoids robot stops
caused by an overload or overcurrent error.
� Enabling/disabling the current limit function
You may enable or disable the current limit function by executing the current limit library, SetCurLmt
or ResetCurLmt, respectively. For details, refer to the PROGRAMMER'S MANUAL.
Absorbing misalignment errors in handling parts
Concept of current limit function
Page 103
20.2 Tip compliance function
This function sets compliance to the individual elements of coordinates at the end of the robot
flange (tip) by controlling the drive torque (current) of each axis motor based on the force limit at the
tip. You can select the base coordinates, tool coordinates, or work coordinates to be applied. This
function is used to make the robot follow an external force in a specified direction(s) or to make the
robot touch an object for height check.
� Making the tip compliance function active from the teach pendant
This is one of the extended functions. You need to make extended functions active from the teach
pendant. Once made active, the setting will be retained after the controller power is turned off. For
details, refer to the PROGRAMMER'S MANUAL.
� Enabling/disabling the tip compliance function
You may enable or disable the tip compliance function by executing the compliance control library,
SetCompControl or ResetCompControl, respectively. For details, refer to the PROGRAMMER'S
MANUAL.
Following an external force or touching an object for height check
Concept of tip compliance control
Page 104
6
SetCompControl (Library) (Version 1.4 or later)
Function
Enables the compliance function (dedicated command for 6-axis).
Format
SetCompControl
Explanation
Enables the compliance function. Enables the compliance conditions set by SetFrcLimit, SetCompRate, and SetFrcCoord.
Macro Definition
<pacman.h> is required.
Related Terms
SetFrcLimit, SetCompRate, SetFrcCoord, ResetCompControl, SetCompFControl
Notes
(1) You will receive an error "60f5 Cannot execute compliance control", when this library is executed while the gravity offset is disabled and the current limiting is enabled. Execute again after you enable the gravity offset and disable the current limiting. See ResetCurLmt and SetGravity for disabling the current limiting and enabling the gravity offset respectively.
(2) The compliance control will not be enabled while motors are off. The compliance control will be disabled when you turned off motors under the compliance control.
(3) Execute this command in a task holding robot control conditions (TAKEARM). If robot control conditions are not held, an error message "21F7 Arm semaphore cannot be fetched." is reported.
(4) Execute while your robot is stopping. Executing this library in a path motion will cause an execution after stop. When you receive an error "600b Robot is in motion" after you execute this library while your robot is in motion, wait until your robot stops after issuing a command such as Delay.
(5) When your robot moves due to an external force, you may receive an error "611* Excessive deviation". If this is the case, change the allowable deviation. Use SetEralw to change the allowable deviation.
(6) Do not execute this library when a force such as a contact force is applied to your robot. Use SetCompControl to enable the compliance control function while a force is applied to your robot.
(7) When a robot posture changes largely after you execute SetCompControl, an error may be generated in the compensation value for the gravity offset and your robot may move toward the direction of gravity. If the posture changes largely in the course of the compliance control, use ResetCompControl to disable the compliance control and execute SetCompControl again to enable the compliance control.
Example
CALL SetFrcCoord (1) 'Sets the force limiting coordinate system
CALL SetFrcLimit (100, 0, 100, 100, 100, 100)
'Sets the force limiting rate
CALL SetCompControl 'Enables the compliance control function
CALL SetEralw (1, 90)'Sets the allowable deviation
Page 105
6
SetCompFControl (Library) (Version 1.4 or later)
Function
Enables the compliance control function (dedicated command for 6-axis).
Format
SetCompFControl
Explanation
Enables the compliance control function as SetCompControl. However, the gravity offset compensation is not executed as SetCompControl.
Macro Definition
<pacman.h> is required
Related Terms
SetCompControl
Notes
(1) You will receive an error "60f5 Cannot execute compliance control", when this library is executed while the gravity offset is disabled and the current limiting is enabled. Execute again after you enable the gravity offset and disable the current limiting.
(2) The compliance control will not be enabled while motors are off. The compliance control will be disabled when you turned off motors under the compliance control.
(3) Execute this command in a task holding robot control conditions (TAKEARM). If robot control conditions are not held, an error message "21F7 Arm semaphore cannot be fetched." is reported.
(4) Execute while your robot is stopping. Executing this library in a path motion will cause an execution after stop. When you receive an error "600b Robot is in motion" after you execute this library while your robot is in motion, wait until your robot stops after issuing a command such as Delay.
(5) Set the tip load exactly. Your robot may fall in the direction of gravity when the tip load setting and the actual tip load differ. You can execute SetGrvOffset to prevent a fall due to gravity.
Example
CALL SetGrvOffset 'Calculates the gravity offset compensation value
CALL SetFrcCoord (1) 'Sets the force limiting coordinate
CALL SetFrcLimit (100, 0, 100, 100, 100, 100)
'Sets the force limiting rate
CALL SetCompFControl 'Enables the compliance control function
Page 106
6
ResetCompControl (Library) (Version 1.4 or later)
Function
Disables the compliance control function (dedicated command for 6-axis).
Format
ResetCompContrl
Explanation
Disables the compliance control function.
Macro Definition
<pacman.h> is required.
Related Terms
SetCompControl
Notes
(1) Execute this command in a task holding robot control conditions (TAKEARM). If robot control conditions are not held, an error message "21F7 Arm semaphore cannot be fetched." is reported.
(2) Execute while your robot is stopping. Executing this library in a path motion will cause an execution after stop. When your robot stops suddenly, and you receive an error "612* Over current" after you execute this library while your robot is in motion, Set 1 to <Set value> or wait until your robot stops after issuing a command such as Delay.
(3) You will receive an error "60f9 Abnormal operation in disabling compliance control", if you execute a step back or a program reset after a momentary stop during executing this library.
(4) When you use SetEralw to change the allowable deviation values while the compliance control is enabled, the allowable deviation values will return to their initial values. The allowable deviation values may not be reset to the initial values when an error occurs while executing ResetCompControl. If this is the case, use ResetEralw to initialize the allowable deviation values after disabling the compliance control.
(5) You may receive an error "608* J* Directed speed limit was exceeded". If this is the case, use aspChange to change the optimal load capacity mode to 2 or 3 before you execute ResetCompControl and resume the optimal load capacity mode to the previous value after the execution.
Example
CALL ResetCompControl 'Disables the compliance control function
CALL ResetEralw 'Initializes the allowable deviation values
Page 107
6
SetFrcCoord (Library) (Version 1.4 or later)
Function
Selects a force limiting coordinate system (dedicated command for 6-axis).
Format
SetFrcCoord(<Set value>)
Explanation
Selects a coordinate system for force limiting values specified by SetFrcLimit and SetCompRate. You can use a set value 0 for the base coordinate system, a set value 1 for the tool coordinate system, and a set value 2 for the work coordinate system of your robot.
Macro Definition
<pacman.h> is required.
Related Terms
SetFrcLimit, SetCompRate, SetFrcCoord, ResetCompControl
Notes
(1) Execute this command in a task holding robot control conditions (TAKEARM). If robot control conditions are not held, an error message "21F7 Arm semaphore cannot be fetched." is reported.
(2) This library is not available while the compliance control is enabled. When you execute this library under the compliance control, you will receive an error "60fa Compliance control is enabled".
(3) When you specify 1 for <Set value> to select the tool coordinate system, the tool coordinate will be the tool coordinate for enabling the compliance control (executing SetCompControl). When you use the changetool command to change the tool coordinate while the compliance control is enabled, the force limiting coordinate will not be changed.
(4) When you specify 2 for <Set value> to select the work coordinate system, the work coordinate will be the work coordinate for enabling the compliance control (executing SetCompControl). When you use the changetool command to change the work coordinate while the compliance control is enabled, the force limiting coordinate will not be changed.
(5) The set value will be initialized to 0 (the base coordinate system) after the controller is turned on.
Example
CALL SetFrcCoord (1) 'Sets the force limiting coordinate system to the tool
'coordinate
Changetool 2 'Sets the tool coordinate to tool2
CALL SetFrcLimit (100, 0, 100, 100, 100, 100)
'Sets the force limiting rate
CALL SetCompControl 'Sets the force limiting rate in Y direction of the tool 2
'coordinate system to 0% and enables the compliance control
Page 108
SetFrcLimit (Library) (Version 1.4 or later)
FunctionSets the force limiting rates (dedicated command for 6-axis).
Format SetFrcLimit (<Limiting rate along X>, <Limiting rate along Y>, <Limiting rate along Z>, <Limiting rate about X>, <Limiting rate about Y>, <Limiting rate about Z>) Setting ranges from 0 to 100. Up to two decimal places are valid.
Explanation Sets the force limiting rates along and about X, Y, and Z axes of a coordinate system specified by SetFrcCoord.
Macro Definition <pacman.h> is required.
Related Terms ResetFrcLimit, SetFrcCoord, SetCompControl
Notes (1) Execute this command in a task holding robot control conditions
(TAKEARM). If robot control conditions are not held, an error message "21F7 Arm semaphore cannot be fetched." is reported.
(2) This library is not available while the compliance control is enabled. When you execute this library under the compliance control, you will receive an error "60fa Compliance control is enabled".
(3) All the set values for along and around the X, Y and Z axes will be initialized to 100 after the controller is turned on.
Example CALL SetFrcCoord (1) 'Sets the force limiting coordinate system to the tool 'coordinate CALL SetFrcLimit (100, 0, 100, 100, 100, 100) 'Sets the force limiting rates CALL SetCompControl 'Sets the force limiting rate in Y direction of the tool 'coordinate system to 0% and enables the compliance control
PAGE 109
6
ResetFrcLimit (Library) (Version 1.4 or later)
Function
Initializes the force limiting rates (dedicated command for 6-axis).
Format
ResetFrcLimit
Explanation
Initializes the force limiting rates. All rates along and about X, Y, and Z axes are set to 100%.
Macro Definition
<pacman.h> is required.
Related Terms
SetFrcLimit
Notes
(1) Execute this command in a task holding robot control conditions (TAKEARM). If robot control conditions are not held, an error message "21F7 Arm semaphore cannot be fetched." is reported.
(2) This library is not available while the compliance control is enabled. When you execute this library under the compliance control, you will receive an error "60fa Compliance control is enabled".
Example
CALL ResetCompControl 'Disables compliance control
CALL ResetFrcLimit 'Initializes the force limiting rates
Page 110
7
SetCompRate (Library) (Version 1.4 or later)
Function
Sets the compliance rates under the compliance control (dedicated command for 6-axis).
Format
SetCompRate (<Compliance along X>, <Compliance along Y>, <Compliance along Z>, <Compliance about X>, <Compliance about Y>, <Compliance about Z>)
Explanation
Sets the compliance rates along and about X, Y, and Z axes of a coordinate system specified by SetFrcCoord. Setting ranges from 0 to 100 and 0 gives the maximum compliance. Up to two decimal places are valid.
Macro Definition
<pacman.h> is required.
Related Terms
ResetCompRate, SetFrcCoord, SetCompControl
Notes
(1) Execute this command in a task holding robot control conditions (TAKEARM). If robot control conditions are not held, an error message "21F7 Arm semaphore cannot be fetched." is reported.
(2) This library is not available while the compliance control is enabled. When you execute this library under the compliance control, you will receive an error "60fa Compliance control is enabled".
(3) All the set values for along and around the X, Y and Z axes will be initialized to 100 after the controller is turned on.
Example
CALL SetFrcCoord (1) 'Sets the force limiting coordinate system to the tool
'coordinate
CALL SetCompRate (100, 0, 100, 100, 100, 100)
'Sets the compliance rate
CALL SetCompControl 'Sets the compliance rate in Y direction of the tool
'coordinate system to 0% and enables the compliance control
Page 111
7
ResetCompRate (Library) (Version 1.4 or later)
Function
Initializes the compliance rates (dedicated command for 6-axis).
Format
ResetCompRate
Explanation
Initializes the compliance rates along and about X, Y, and Z axes to 100%.
Macro Definition
<pacman.h> is required.
Related Terms
SetCompRate
Notes
(1) Execute this command in a task holding robot control conditions (TAKEARM). If robot control conditions are not held, an error message "21F7 Arm semaphore cannot be fetched." is reported.
(2) This library is not available while the compliance control is enabled. When you execute this library under the compliance control, you will receive an error "60fa Compliance control is enabled".
Example
CALL ResetCompControl 'Disables the compliance control
CALL ResetCompRate 'Initializes the compliance rates
Page 112
Denso Robotics
Section 7
Motion Skip
Page 113
Chapter 7 Arm Movement
MotionSkip (Library) [Version 1.5 or later]
FunctionAborts running motion commands.
SyntaxMotionSkip
DescriptionMotionSkip aborts motion commands running in the task in which the MotionSkip executes.
Related TermsGetJntData, GetSrvData
Notes• Execute this command in a TAKEARMed task that holds an arm semaphore. If not in a TAKEARMed task,
the error "Not executable" will result.• Executing MotionSkip in a robot motion task will abort robot joint motion commands. Executing it in an ex-
tended-joint motion task will abort extended-joint motion commands.If MotionSkip executes in a motion task holding an arm group involving both robot joints and extended-joints, then both the robot and extended-joint motions will be aborted.
Exampledefjnt lj1defsng lf1
move p,P1,nextlj1=GetSrvState(2) 'Get errors of each joint rotation angle.lf1=ABS(JOINT(2,lj1)) 'Select rotation error of J2.
if lf1 > 10000 thenCALL MotionSkip 'If the rotation error of J2 exceeds 10000
'(in pulses), then abort motion commands.endif
Page 114
Chapter 7 Arm Movement
MotionComp (Library) [Version 1.5 or later]
FunctionJudges whether execution of running motion commands is complete.
SyntaxMotionComp(<MotionCommandComplete>)
DescriptionIf MotionComp judges that execution of running motion commands is complete, then it returns "1" in <Motion-CommandComplete>.This command checks motion commands running in the task in which the MotionComp executes. It is not ap-plicable to motion commands in any other tasks.If a motion command has an encoder value check option, then MotionComp will interpret the moment when theencoder count is converged within the positioning error allowance as completion of the motion command. Forother operations, if motion control to the servo loop disappears, then MotionComp will judge that the commandis complete.
Related TermsGetJntData, GetSrvData, MotionSkip
Notes• Execute this command in a TAKEARMed task that holds an arm semaphore. If not in a TAKEARMed task,
the error "Not executable" will result.• Executing MotionComp in a robot motion task will judge whether robot motion commands are complete.
Executing it in an extended-joint motion task will judge whether extended-joint motion commands are com-plete.If MotionComp executes in a motion task holding an arm group involving both robot joints and extended-joints, then completion of both the robot and extended-joint motions will be judged.
• When the motion is on Halt, MotionComp will interpret it as operation being in progress.• If you use a local variable for <MotionCommandComplete>, the local variable must be reset to "0" before-
hand.
Exampledefint comp=0 'Initialize motion command completion status.
defjnt lj1defsng lf1move p,P1,next
DOlj1=GetSrvState(2) 'Get error of each joint rotation.lf1=ABS(JOINT(2,lj1)) 'Select the rotation error of J2.
if lf1 > 10000 thenCALL MotionSkip 'If the rotation error of J2 exceeds 10000 (in pulses),
'then abort motion commands and end the loop.EXIT DO
endifCALL MotionComp(comp)
LOOP UNTIL comp=1 'Loop until the end of motion commands.
Page 115
DENSO Robotics
Section 8
Panel Design Software
Page 116
ROBOT RC7 CONTROLLER
Teach Pendant Panel Editor
Panel Designer
USER'S MANUAL
Page 117
Chapter 1 Panel Designer Overview
As of version 2.2*, WINCAPSII includes the Panel Designer, a teach pendant panel
editor for creating teach pendant (TP) panel screen software by simply arranging parts
on the computer screen and then specifying action source code for the events
associated with them.
This chapter outlines the procedures involved.
Creating TP Panel Screens
Page 118
1.1 Overview of Procedures for Creating TP Panel Data
The procedure for creating TP panel data consists of the following five basic steps.
(1) Load editor
1) Open WINCAPSII PAC manager.
2) Open the Layout window, the editor's simulation of the teach pendant's screen with
the PAC Manager menu command Program|New|Panel.
Note: Also available is the File|Open menu command for opening existing TP panel
data.
PAC Manager Window
Panel Designer Window for New Panel Layout
Page 119
(2) Create panel layout
Select the necessary parts from the Parts tool bar and arrange them in the Layout
window to create the TP panel screen.
For further details, see Chapter 2 "Creating TP Panels."
(3) Edit action source code
1) Click the Display source code icon in the Layout window to display the Source
Code Edit window.
2) Add to the Source Code Edit window the action source code for when the part is
pressed.
For further details, see Section 2.2.2 "Specifying Action Source Code for Parts."
Parts tool bar Layout window
Display source code icon Source Code Edit window
Page 120
(4) Compile
Compile the action source code just written to check for syntax, typing, or other errors.
Progress and other messages from the compiler appear in a pane near the bottom of
the main editor window.
(5) Send data to the controller
Send the new TP panel file, together with any other WINCAPSII programs, to the
controller. Note that using the teach pendant as an operating panel requires
reconfiguring the teach pendant.
1.2 Editor Screen Functional Description
The following figure gives the editor screen layout. The following pages describe the
individual components.
Panel Designer Screen Layout
Tool bars(Section 1.2.1)
Parts tree pane (Section 1.2.2)
Properties pane (Section 1.2.3)
Layout window(Section 1.2.4)
Source code edit window(Section 1.2.5)
Compiler messages pane(Section 1.2.6)
Page 121
1.2.1 Tool Bars
The editor provides the following handy tool bars for creating TP panel data.
(1) Main tool bar
This provides the following buttons.
Name Description
New Create a new TP panel file.
Open... Open an existing TP panel file.
Save Save the current file to disk, overwriting any older version
there.
Cut Move the contents of the selected range to the system
clipboard.
Copy Copy the contents of the selected range to the system
clipboard.
Paste Insert the clipboard contents at the current cursor position.
Undo Reverse the effects of the last operation.
Redo Undo the last undo operation--in other words, repeat the
last operation.
Print Print the current screen.
About Display the About screen indicating the editor's version
number, etc.
(2) Zoom grid tool bar
These buttons change the Layout window magnification, toggle the grid display on and
off, etc.
Name Description
Zoom Change the magnification ratio for the selected region.
Cancel Zoom Cancel zooming and return the Layout window to the
standard (100%) magnification.
Pan Shift the display screen in the specified direction.
Grid Toggle the grid display on and off.
Snap Toggle automatic grid positioning on and off.
Page 122
(3) Layout tool bar
These buttons assign uniform positioning, spacing, or size to the selected parts.
Name Description
Align Top Align along the upper edge.
Align Middle Align vertical centers.
Align Bottom Align along the lower edge.
Align Left Align along the left edge.
Align Center Align horizontal centers.
Align Right Align along the right edge.
Space across Standardize horizontal spacing.
Space down Standardize vertical spacing.
Same width Standardize width.
Same height Standardize height.
Same size Standardize size.
(4) Parts tool bar
Most of these buttons select a part to add to the panel layout in the Layout window.
Name Description
New panel Create a new panel layout.
Select parts Select a part pointed with this cursor.
Label Add part: label.
Text box Add part: text box.
Numerical
value input
box
Add part: numerical input box.
Group box Add part: group box.
Radio button Add part: radio buttons.
Check box Add part: check box.
Push button Add part: push button.
Illuminated
push button
Add part: illuminated push button.
Pilot lamp Add part: pilot lamp.
Line Add part: line.
Rectangle Add part: rectangle.
Oval Add part: oval.
Function key Add part: function key.
Timer Add part: timer.
Compile Translate the corresponding TP panel file into executable
format.
Page 123
(5) Move tool bar
These buttons move parts around the panel layout and within the file's part hierarchy.
Name Description
Front Move to the top layer.
Back Move to the bottom layer.
Forward Move forward one layer.
Backward Move backward one layer.
Nudge up Move up.
Simultaneously holding down the Shift key moves 5 pixels
each time.
Nudge down Move down.
Nudge left Move left.
Nudge right Move right.
Page 124
1.2.2 Parts Tree Pane
This displays the current file's panels and parts in tree format.
(1) Parts Tree pane
The following figure shows a sample Parts Tree pane.
Double-clicking on a part displays its panel layout.
(2) Parts tool bar
This provides the following buttons.
Name Description
Layout form Specify the Layout window as target.
Source form Specify the Source Code Edit window as target.
Layout window Display the target window specified above.
Erase panel Delete a panel layout from the TP panel data.
Page 125
1.2.3 Properties Pane
This accesses the position, size, and other properties for a part.
The list of properties depends on the part type. For further details, see Section 1.5.1
"Property Lists."
Properties Pane
1.2.4 Layout Window
This window is for designing teach pendant TP panel screen software by placing parts
on this screen and then adjusting their positions and sizes with the cursor keys or
rubber band drag operations.
Clicking on the Display source code icon displays the corresponding Source Code Edit
window.
Display source code icon
Layout Window
Layout window (client area)
Page 126
1.2.5 Source Code Edit Window
This window is for assigning action source code to events associated with the parts on
the current panel layout.
Source Code Edit Window
(1) Source Code Edit window tool bar
Name Description
Layout window Display the corresponding panel layout.
Indent Shift the selected lines one tab position to the
right.
Outdent Shift the selected lines one tab position to the
left.
Comment out Comment out the selected lines.
Undo comment block Cancel commenting out for the selected lines.
Bookmark Toggle bookmark on the current source code
line.
Next bookmark Move the cursor to the next bookmark.
Previous bookmark Move the cursor to the previous bookmark.
Clear bookmarks Cancel all bookmark definitions.
Find and replace Find the specified string and optionally
replace it.
Note: Setting a bookmark on a code line displays a square marker ( ) to its left.
(1) Source Code Edit window tool bar
(2) Part list box (3) Event list box
(4) Action source code block
Page 127
(2) Part list box
Select the part for which to assign action source code.
(3) Event list box
This lists the events available for the selected part. Selecting one automatically
generates the corresponding skeleton action source code block on the editor screen.
Example: Skeleton action source code block for pressing Button1
DEF Button1_CLICKED()
END
(4) Action source code block
Flesh out the skeleton with action source code.
Example: Action source code block for pressing Button1
DEF Button1_CLICKED()
Set IO[128] ' turn I/O variable #128 ON
Run PRO100 ' run PRO100
END
1.2.6 Compiler Messages Pane
This displays progress and other messages from the compiler as it compiles the TP
panel data.
Double-clicking on an error message line displays the corresponding source code in a
Source Code Edit window.
Compiler Messages Pane
Page 128
1.2.7 Menus
This section lists the editor's menus and menu commands.
(1) File
Menu Command Description
New Create new TP panel file.
Open… Open an existing TP panel file.
Close Close the current file, first displaying the dialog box for
saving if current file edits have not been saved.
Save Save the current file to disk, displaying the dialog box for
saving if the file is new.
Save As… Save the current file to disk under a new name.
Print… Print the contents of the current window: Layout or Source
Code Edit.
Print Preview… Display a print image on the screen instead of sending
data to the printer.
Printer Setting Display the dialog box for specifying printer settings.
Import... Read panel layouts from another TP panel file.
Most recently
used files
This section lists the last few TP panel files saved.
Exit Close the editor.
(2) Edit
Menu Command Description
Undo Reverse the effects of the last operation.
Redo Undo the last undo operation--in other words, repeat the
last operation.
Cut Move the contents of the selected range to the system
clipboard.
Copy Copy the selected parts or string to the system clipboard.
Paste Insert the clipboard contents at the current cursor position.
Delete Delete the selected parts or string.
Find Display the dialog box for finding (and optionally
replacing) the specified string.
(3) View
Menu Command Description
Tool bar Toggle display of tool bars.
Status bar Toggle display of status bar.
Tree bar
(Parts tree)
Toggle display of the Parts Tree pane.
Property bar
(Property)
Toggle display of the Properties pane.
Panel layout Display the corresponding panel layout.
Grid Toggle the grid display on and off.
Snap to grid Toggle automatic grid positioning on and off.
Page 129
Menu Command Description
Zoom Normal Cancel zooming and return the Layout window to the
standard (100%) magnification.
Zoom Percent Change the magnification ratio for the Layout window
(50%, 75%, 100%, 200%).
(4) Tool
Menu Command Description
Options… Specify the compiler output version.
Compile Translate the corresponding TP panel file into executable
format.
(5) Window
Menu Command Description
Close Close the currently selected window.
Close all
windows
Close all open editor windows.
Cascade Display all open windows with the same size and
overlapped with only their title bars visible.
Tile Display all open windows as individual rectangles dividing
up the screen.
Arrange Icons Align the icons for minimized windows in the lower left
corner of the main editor window.
List windows Display a list of all windows.
(6) Help
Menu Command Description
Help Display the editor's help file.
About Panel
Designer
Display the About screen indicating the editor's version
number, etc.
Page 130
1.3 Creating and Modifying Panel Layouts
1.3.1 Adding Parts
Adding parts to a panel is a three-step procedure.
(1) Open the Layout window
To create a new panel, choose the File|New menu command or press the tool bar
button New panel.
To modify an existing panel layout, select the Layout form button on the Parts tool bar
and double-click on the corresponding Layout window icon or press the Display panel
button.
(2) Select a part
Selecting a part from the Parts tool bar displays the part mark at the current cursor
position in the Layout window.
(3) Add the part
Clicking in the Layout window adds the part with the default size at that location.
Note: Dragging the part at this point then adjusts the size.
1.3.2 Modifying Panel Layouts
The following methods are available for modifying part positions and sizes in Layout
windows.
(1) Moving parts
1) Drag the part with the mouse (whenever the move cursor is visible)
2) Use a cursor key
3) Use the Move tool bar
4) Modify the position properties x and y
(2) Changing size
1) Drag part frame's rubber band
2) Modify the properties width and height
3) If multiple parts are currently selected, use the Layout tool bar buttons for
standardizing spacing and size
(3) Aligning
If multiple parts are currently selected, use the Layout tool bar buttons for centering
parts or aligning them along the specified edge.
Note: For function keys, the property Index automatically determines the position and
size.
(4) Changing layers
Select the part to reorder and either choose Move on the right-click menu or press a
button in the tool bar's Order section.
Note: Changing the part order automatically updates the Parts Tree pane accordingly.
Page 131
1.3.3 Changing Part Properties
The Properties pane provides facilities for modifying the parts name, color, and other
properties.
1.3.4 Deleting Panel Layouts
Select the panel layouts to delete on the Parts Tree pane and press the Delete panel
button.
1.3.5 Importing Panel Layouts from Another TP Panel File
Use the following procedure to import panels from another TP panel file, with
extension .pnl.
(1) Use the File|Import menu command to specify the source TP panel file.
(2) Select the panel layouts to import from the list for the file and press the Import
button to add them to the Parts Tree pane.
Page 132
1.4 Adding Action Source Code
A Source Code Edit window is for specifying the events to take in response to a
CLICKED, RELEASED, or other state change event associated with the corresponding
part on the panel layout.
1.4.1 Writing Action Source Code
(1) Open the Source Code Edit window
Use one of the following methods to open the Source Code Edit window for the part.
1) Double-click on the part in the Layout window.
2) Select the part in the Layout window and press the Display layout button.
3) Select the panel layout on the Parts Tree pane, make sure that the Source form
button is pressed, and press the Display panel button.
(2) Select the part
Check whether the part appears in the Part list box at the top of the Source Code Edit
window. If it does not, select it with the list box.
(3) Select the event
The Event list box gives the events available for the selected part. Selecting one
automatically generates the corresponding 3-line action source code block skeleton on
the editor screen.
Example: Skeleton action source code block for pressing Button1
DEF Button1_CLICKED()
END
(4) Add action source code
Flesh out the skeleton with action source code.
Example: Action source code block for pressing Button1
Example: Action source code block for pressing Button1
DEF Button1_CLICKED()
Set IO[128] ' turn I/O variable #128 ON
Run PRO100 ' run PRO100
Run PRO200 ' run PRO200
END
1.4.2 Checking (Compiling) Action Source Code
Compile the action source code just written to check for syntax, typing, or other errors.
Progress and other messages from the compiler appear in a pane near the bottom of
the main editor window. Double-clicking on an error message displays the corresponding source code in a Source Code Edit window.
Page 133
1.5 Miscellaneous
1.5.1 Property Lists
The following table lists the position, size, and other properties that can appear in the
Properties pane.
Note: The list displayed in the Properties pane depends on the part type.
Name Description Notes
name Name Unique identifier for the part
type Part type This is fixed for each part.
x x-coordinate
y y-coordinate
Reference position relative to the x- and y-axes within the teach
pendant screen's drawing range
width Width
height Height
Width in pixels relative to the reference corner (x, y)
fg Foreground color
bg Background color
Specify these colors with the list box.
group Group number Group number to which the part belongs
active Active/inactive setting Select with the list box.
style Display style Select with the list box.
caption Display string String to display on part surface
Note: Use the Ctrl+Enter key combination to insert a line break in
multiline text.
fsize Font size 0: Super small, 1: Small, 2: Medium, 3: Large
justify Caption positioning 0: Center, 1: Right-justified, 2: Left-justified
thickness Line width Line thickness in pixels
Note: The 0 setting produces flood fill.
myGroup Group number Unique to a particular group box
state State Select ON, OFF, or other state with the list box.
value Input value Unique to numerical input boxes
text Input text Unique to text boxes
index Function number Unique to function keys
interval Interval Unique to timers
timeout Timeout limit Applicable when no button, line or any other parts are selected.
(A single timeout property per TP panel file can be defined.)
release-mode RELEASED event
execution condition
Applicable when no button, line or any other parts are selected.
(A single release-mode property per TP panel file can be defined.)
[Version 2.32 or later]
1.5.2 Event List
The Event list box is for selecting a CLICKED, RELEASED, or other state change
event associated with the part.
Note: The events available depend on the part type.
Event Description
CLICKED Button pressed
RELEASED Button released
TIMER Interval elapsed
REFRESH Screen refreshed
INITIALIZE Initializable TP panel opened [Version 2.32 or later]
DONE OK button pressed [Version 2.32 or later]
Page 134
1.5.3 Action Source Code Syntax
Action source code blocks consist of two kinds of statements:
(1) TP panel control commands
Chapter 4 gives TP panel control language syntax; Section 5.1 "List of TP Panel
Control Commands."
(2) Read/write access to part properties
Note: The properties available depend on the part type.
Such accesses use the standard dot notation: part_name.property.
Example 1: Reading the current state for radio button RadioBtn
DEFINT iState
IState = RadioBtn.State
Example 2: Setting button width to 200
Button.Width = 200
1.5.4 Sending Data to Controller
Sending a PAC program to the controller with WINCAPSII automatically sends the TP
panel data specified in the WINCAPSII project.
Note: First save any data modifications made with the editor. WINCAPSII compiles the
last saved version, not the version currently in memory.
1.5.5 Important Note on Radio Buttons
Makes sure that only one, the default, has ON in its state property. The editor does not
check sets of radio buttons for multiple ON settings. Sending such data to the controller
produces a TP panel screen with multiple ON settings exactly as specified.
Page 135
Chapter 2 Creating TP Panels
Chapter 1 "Panel Designer Overview" gave an overview of the procedures for
arranging objects (parts) on panel layouts using mouse operations on the personal
computer screen, assigning action source code, and adjusting their size, position, color,
and other properties.
This chapter gives the detailed procedures for creating TP panels. The teach pendant
provides a clean slate on which to display such user-specified panel layouts. A folder
can have only one TP panel file specifying a series of such panel layouts.
2.1 Configuring Teach Pendant
2.1.1 Enabling TP Panel Operation
Add support for TP panel operation to the teach pendant with the following procedure.
Step 1 From the teach pendant top screen, press [F6 Set]—[F7 Options.]—[F8 Extnsion]
—[F5 Input ID] to display the following screen.
Page 136
Step 2 Type the password "1453" and press the OK button to display the list of additional
functionality available.
Step 3 Press the OK button to return to the top screen and confirm that the F5 label now
reads Panel.
Press [F5 Panel] to start the TP panel screen software.
Note: Enabling TP panel operation disables the RC5-compatible TP panel operation
assigned to F9.
Page 137
2.1.2 Specifying the Start Mode of TP Panel Screen Software
[Version 2.32 or later]
Note: For Version 2.31 or earlier, see Section 2.1.3 "Automatically Displaying TP Panel
Screens."
The teach pendant provides the following setting for specifying the start mode of TP
panel screen software.
The four choices of the start mode parameters are available by the combination of
"what starts TP panel screen software--booting the controller or pressing [F5 Panel]"
and "which TP panel screen appears first" as listed below.
Start Mode of TP Panel Screen Software
Start mode
parameter
"0: Panel Start
Setting"
Path of TP panel
screen that
should appear
first
"1: Start-Panel
Path"
a) "What starts TP panel screen software"
b) "Which TP panel screen appears at the start" Remarks
0 -- a) Pressing [F5 Panel]
b) Current directory* of the Program List
1 To be specified a) Booting the controller
b) TP panel screen specified by "Start-Panel
Path"
or
a) Pressing [F5 Panel]
b) Current directory* of the Program List
Select this parameter
to run TP panel
screen software
when the controller
boots.
2 To be specified a) Pressing [F5 Panel]
b) TP panel screen specified by "Start-Panel
Path"
Select this parameter
to display the TP
panel screen
predetermined
without changing the
current directory.
3 To be specified a) Booting the controller or Pressing [F5 Panel]
b) TP panel screen specified by "Start-Panel
Path"
*The "Current directory of the Program List" refers to the following.
The current directory is displayed here.
Page 138
Step 1 Press [F6 Set]—[F7 Options.]—[F9 Panel] to display the following screen.
Step 2 Set the "0: Panel Start Setting" parameter to any of 0 to 3 (defined on the previous
page).
Step 3 If the "0: Panel Start Setting" parameter is any of 1 to 3, specify the directory where
the desired TP panel screen is located, to the "1: Start-Panel Path" parameter.
Example: TEST
As shown above, delimit the path with backslash " ". This example calls up the TP
panel screen located in the "TEST" folder.
If the "1: Start-Panel Path" parameter is not specified, the root directory (folder at the
top of the directory tree structure) applies.
Note 1: The "1: Start-Panel Path" parameter can only specify a path. If more than one TP panel screen is
defined, the one that is located at the top when complied with Panel Designer will be displayed at the start of
TP panel screen software.
Note 2: After the teach pendant panel screen is switched to a different one located in the Start-Panel Path
(or in the current directory of the Program List) with the PAGE_CHANGE command, exiting from the TP
panel screen software and restarting it calls up the last TP panel screen.
However, after the teach pendant panel screen is switched to a different one located in the path other than
the Start-Panel Path (and the current directory of the Program List), doing the same calls up the TP panel
screen located in the Start-Panel Path (or in the current directory of the Program List) just as when the
controller boots.
Parameters relating to the startmode of TP panel screen software
The TP panel at the top of the directory tree structure appears when the controllerboots.
Pressing this changes the order of TP panels.
Page 139
2.1.3 Automatically Displaying TP Panel Screens [Version 2.31 or earlier]
Note: For Version 2.32 or later, see Section 2.1.2 "Specifying the Start Mode of TP
Panel Screen Software."
The teach pendant provides the following setting for automatically displaying TP panel
screen software when the controller boots.
Step 1 Press [F6 Set]—[F7 Options.]—[F9 Panel] to display the following screen.
Step 2 Set the first setting to 1 to enable automatic loading and the second (path) to the
folder containing the TP panel screen software.
Step 3 Test by rebooting the controller.
Note: An error message on the teach pendant screen blocks automatic display.
Page 140
2.1.4 Specifying the Close Mode of TP Panel Screen Software
[Version 2.32 or later]
The teach pendant provides the following setting for exiting the TP panel screen
software.
Close mode parameter
"2: Operation Panel Close Mode" Close mode
0 SHIFT + CANCEL (default)
Pressing the Cancel key with the Shift key held down exits the TP panel screen software.
1 SHIFT + CANCEL + Password
Pressing the Cancel key with the Shift key held down and entering the password exits the TP panel screen software.
The password should be specified with the password entry parameter "3: Mode1: Password."
2 CANCEL
Pressing the Cancel key exits the TP panel screen software.
Step 1 Press [F6 Set]—[F7 Options.]—[F9 Panel] to display the following screen.
Step 2 Set the "2: Operation Panel Close Mode" parameter to any of 0 to 2.
0: SHIFT + CANCEL
1: SHIFT + CANCEL + Password (Proceed to Step 3.)
2: CANCEL
Step 3 If the "Operation Panel Close Mode" parameter is set to 1, enter an arbitrary
password to the "3: Mode1: Password" parameter.
Note: The password entry range is from -2147483648 to 2147483647.
When you attempt to exit the TP panel screen software by pressing the Cancel key
with the Shift key held down, the password entry window appears as shown below.
You need to enter the password and press the OK button. If the password entered
here matches the one preset to the "3: Mode1: Password" parameter, the TP panel
screen software exits.
Tip: If you forget the password, enter 273958314 to exit the TP panel screen
software.
Specify the close mode of TP panel screen software.
Page 141
2.2 Using Parts
2.2.1 Parts and Their Functions
The following table lists the 14 part types available for building TP panel screen
software.
Parts
Part Function Refer to:
(1) Button Functions as a push button. Section 2.2.6 [ 1 ]
(2) Label Displays text. [ 2 ]
(3) Pilot lamp Indicates on/off setting. [ 3 ]
(4) Numerical input
box
Accepts a numerical value from the ten-key pad. [ 4 ]
(5) Text box Accepts text from the keyboard. [ 5 ]
(6) Check box Turns setting on and off. [ 6 ]
(7) Radio button Selects from a group of mutually exclusive choices. [ 7 ]
(8) Group Provides mutually exclusive operation for a group of
radio buttons.
[ 8 ]
(9) Function key Configures a teach pendant function key (F1 to F12)
for use as a push button.
[ 9 ]
(10) Timer
(not shown below)
Triggers action source code at a fixed interval. [ 10 ]
(11) Line Displays a straight line. [ 11 ]
(12) Oval Displays a circle or oval. [ 12 ]
(13) Rectangle Displays a square or rectangle. [ 13 ]
(14) Illuminated push
button
(not shown below)
Combines push button and pilot lamp operation. [ 14 ]
Sample TP Panel Screens
(3) Pilot lamp
(1) Button
(5) Text box
(2) Label
(8) Group (7) Radio buttons (6) Check boxes
(9) Function keys
(4) Numerical input box
(13) Rectangle
(12) Oval (11) Line
Page 142
2.2.2 Specifying Action Source Code for Parts
A part on a TP panel screen responds to button presses and other events by executing
action source code that reads or modifies part properties and performs other
operations.
Action Source Code Syntax
An action source code block has the following structure.
DEF object_event
desired operations
END
Selecting an object and an event in the editor automatically generates a skeleton
consisting of the first (DEF) and last (END) lines. The developer needs only supply the
source code specifying the desired response.
The table below lists the possibilities.
Note: The events available depend on the part type.
Event Description
CLICKED Button pressed
RELEASED Button released (See Section 2.2.3.)
TIMER Interval elapsed
REFRESH Screen refreshed
INITIALIZE [Version 2.32 or later] Initializable TP panel opened
DONE [Version 2.32 or later] OK button pressed
Action Source Code Statements
Action source code blocks consist of two kinds of statements: TP panel control
commands and read/write accesses to part properties. Accesses use the standard dot
notation: part_name.property.
For a list of part properties and possible values, see Section 3.3.4 "Object Properties."
Action source code blocks can use global variables of type integer, float, double, or
string, local variables, and folder variables.
Page 143
2.2.3 Specifying the RELEASED Event Execution Condition [Version 2.32 or later]
2.2.3.1 Release-mode property added
The release-mode property is added to the property screen, making it possible to
specify the RELEASED event execution condition. The property provides the following
setting.
Release-mode parameter The RELEASED event executes: Remarks
0 - Post EventEven if a press on the part is released outside
the part.
Default in Version 2.32
or later
1 - No EventOnly when a press on the part is released
within the part.
Fixed to this setting in
Version 2.31 or earlier
Specifying the RELEASED event execution condition
Note: The release-mode parameter can be contained, one per panel file. Changing the parameter applies
to all parts containing the RELEASED event.
Release the press on the part within the part. (1 - No Event)
Release the press on the part outside the part by sliding your finger on the screen surface. (0 - Post Event)
Release-mode property
Page 144
2.2.3.2 Notes on using the RELEASED event
The RELEASED event cannot be executed if any other screen appears on the current
TP panel screen. The following example using the push-button shows the detail.
What blocks the execution of the RELEASED event
If any of the following conditions arises when the push-button is being pressed, the
RELEASE event cannot be executed.
(1) When an error occurs.
(2) When the PRINTMSG command displays the message.
(3) When the PAGE_CHANGE command switches TP panel screens, using the timer.
If blocking the execution of the RELEASED event with the above conditions raises a
problem, use a workaround in your program as shown on the next page.
Push-button being pressedIf any of the following conditions arises, releasing the
push-button does not execute the RELEASED event:
(1) When an error occurs.
(2) When the PRINTMSG command displays the message.
(3) When the PAGE_CHANGE command switches TP
panel screens, using the timer.
Page 145
Program example requiring a workaround
The program example given below turns I/O [128] on only when the push-button is
being pressed, so it requires a workaround. (While I/O [128] is on, the external
equipment operates.)
Only when the push-button is being pressed, I/O [128] is on. Program example
DEF PB1_CLICKED() set IO[128] ENDDEF PB1_RELEASED()reset IO[128] END
Workarounds to the occurrence of errors
(1) Workaround 1
With the supervisory task mode or its extension being enabled, run the following
supervisory task that causes a fail-safe operation (that is, turn I/O [128] off) if an error
occurs. (Refer to the SETTING-UP MANUAL, Chapter 3, Sections 3.4.10 and 3.4.11.)
Program TSR1
DEFINT ERRCODE
INITWAITERR 'Initialize WAITERROR data.
WHILE 1
ERRCODE WAITERROR 'Wait until an error occurs.
IF GETERRLVL(ERRCODE)>1 'If Level 2 or higher error occurs,
RESET IO[128] 'turn I/O[128] off as fail-safe operation.
INITWAITERR 'Initialize WAITERROR data.
ENDIF
WEND
END
(2) Workaround 2
Use a supervisory task that monitors the deadman switch (Enable switch) state and
add such a process that turns I/O [128] on or off when the deadman switch is pressed
or released, respectively. Accordingly, if an error occurs, releasing the deadman switch
causes a fail-safe operation (turn I/O [128] off).
(3) Workaround 3
Modify the program to turn I/O [128] on for the specified time length when the
push-button is pressed and to cause no change when the push-button is released. This
produces inching-like motion.
Also change the PRINTMSG and PAGE_CHANGE commands to turn I/O [128] on or
off when the switch is pressed or released, respectively.
Page 146
2.2.4 INITIALIZE Event [Version 2.32 or later]
The INITIALIZE event can be added to each panel. It is used to initialize the TP panel
layout.
The INITIALIZE event will be called when any of the following conditions arises.
(1) When pressing [F5 Panel] starts the TP panel screen software.
(2) When booting the controller starts the TP panel screen software.
(3) When the PAGE_CHANGE command switches the TP panel screen.
Step 1 Select a TP panel file, and the INITIALIZE event only becomes available.
Selecting the INITIALIZE event automatically generates a skeleton consisting of the
first (DEF) and last (END) lines as shown below.
DEF Panel_INITIALIZE()
END
Step 2 Flesh out the skeleton with action source code.
Note: The PAGE_CHANGE command cannot be used for this source code.
Select a TP panel file.
Select INITIALIZE event.
Action source code block
Page 147
2.2.5 DONE Event [Version 2.32 or later]
The DONE event is added to the "Numerical input box" and "Text box." Pressing the
OK button on the numerical input box or the text box executes the DONE event.
Example: Numerical input box
Step 1 Select one of the numerical input boxes and select the DONE event.
The action source code block in the following skeleton will be executed.
DEF NB1_DONE()
END
DONE event example: "IO=NB1.Value"
In this example, pressing the OK button sets the property value of the selected part
to a global variable.
Pressing OK executes the DONE event.
Pressing CANCEL produces nothing.
Select one of the numerical input boxes.
Select DONE event.
The action sourcecode block executes.
Page 148
2.2.6 Part Descriptions
[ 1 ] Button
This part has two events: CLICKED and RELEASED.
Button Example
The following example illustrates the procedure for creating two buttons: one (labeled
"I/O operation") that turns I/O variable #24 on as long as it is pressed and another
(labeled "Program_run") that runs a program (Sample pro).
Step 1 Create a panel layout with two buttons.
The buttons can go anywhere within the boundaries of the teach pendant screen.
All parts, not just buttons, have a unique name providing read/write accesses to part
properties from the part itself as well as other parts on the same TP panel. The editor
uses as its default Button plus a number, but the developer is free to change names.
The following example simply uses the default names: "Button1" and "Button2."
Page 149
Step 2 Label the buttons by changing their caption properties.
Step 3 Adding action source code
A button has separate action source code blocks for the events CLICKED and
RELEASED. The following example shows how to add action source code for these
two events.
Double-clicking the button labeled "I/O operation" opens an empty Source Code Edit
window.
Page 150
Step 4 Start by adding action source code to turn I/O variable #24 on when the button is
pressed. Selecting the combination Button1 and CLICKED from the Part and Event
list boxes at the top of the Source Code Edit window automatically generates the
corresponding 3-line action source code block skeleton on the editor screen.
Step 5 Flesh out the skeleton with action source code.
Page 151
Step 6 Similarly add action source code to turn I/O variable #24 off when Button1 is
released (RELEASED) and to run a program (Sample pro) when Button2 is pressed
(CLICKED).
Step 7 When the panel layout is complete, save it to disk, and compile the file to check for
syntax, typing, or other errors.
Page 152
Step 8 If the compile operation is successful, download the results to the controller with
PAC Manager.
Step 9 Changing button properties
Color, position, and other button properties support read/write access from the part
itself as well as other parts on the same TP panel using the standard dot notation:
part_name.property.
For a list of part properties and possible values, see Section 3.3.4 "Object
Properties."
The following example changes the foreground color (.fg), background color (.bg),
display text (.caption), horizontal position (.x), and vertical position (.y).
Start by loading the editor, adding a button, and opening the corresponding Source
Code Edit window as above.
Page 153
Step 10 Type in the source code as shown below.
Step 11 Save the edits, compile the file, and download the results to the controller as before.
TP Panel Screen with Button Pressed
Page 154
[ 2 ] Label
This part simply displays text. It supports no events, so does not accept action source
code.
Label Example
The following example shows how pressing a button on the same screen can change
label properties.
Step 1 Load the editor and place a label and a button on the panel layout.
Page 155
Step 2 Changing label properties
The label properties for display text, color, font size, and character position support
read/write access using the standard dot notation: part_name.property.
Changing the display text for the part named Label1 to "Off" requires the following
line.
Label1.caption="Off"
Changing the foreground color to yellow, the background color to brown, the font
size to big, and the character position to left-justified requires the following lines.
Label1.fg=yellow Foreground color: Yellow
Label1.bg =brown Background color: Brown
Label1.fsize=2 Font size: Big
Label1.justify=2 Character position: Left-justified
Add the above to the skeleton created in the Source Code Edit window for pressing
Button1.
Page 156
Step 3 Compiling this panel layout and downloading it to the controller produces the
following display when the button is pressed.
Before pressing button
After pressing button
Page 157
[ 3 ] Pilot Lamp
This part has two display states (ON and OFF) and generates REFRESH events at
regularly scheduled intervals to allow visual monitoring of some state.
Lamp Example
The following example uses a lamp to monitor an I/O state.
Step 1 Load the editor and place a lamp on the panel layout.
Page 158
Step 2 Adding action source code
This part generates REFRESH events at regularly scheduled intervals. Use these to
visually monitor I/O variable #25 by turning the lamp ON and OFF as appropriate. In
the Source Code Edit window, select the lamp's REFRESH event and add the
following line to the skeleton automatically created.
This statement means update the lamp state from the IO[25] state.
Page 159
Step 3 Compiling this panel layout and downloading it to the controller produces the
following displays.
Lamp on
Lamp off
Step 4 Changing lamp properties
The procedures for accessing properties are the same as for all other parts.
Page 160
[ 4 ] Numerical Input Box
This part is a button that displays a numerical value. Pressing this button switches the
pendant operation screen to ten-key pad input for directly updating that value.
This part has CLICKED and RELEASED events similar to those for buttons.
Note: In Version 2.32 or later, the DONE event is added to this part. For details, see
Section 2.2.5 "DONE Event."
Numerical Input Box Example
Step 1 Load the editor and place a numerical input box on the panel layout.
(Optional) Specify an initial value.
Step 2 Adding action source code
The procedures for adding action source code are the same as for buttons.
Page 161
Step 3 Changing numerical input box properties
In addition to the color, position, and other properties that this part shares with
buttons, it has the unique properties of a floating-point value (.value) and display
format, decimal or hexadecimal (.style).
This example uses a button press on the same screen to read global string variable
#10 into a text box and store that value in global string variable #11.
Load the editor and place a numerical input box and button on the panel layout.
Open the Source Code Edit window, select Button1 and CLICKED to create the
action source code skeleton, and add the following lines.
The procedures for accessing properties are the same as for all other parts.
Page 162
[ 5 ] Text Box
This part is a button that displays a string. Pressing this button switches the pendant
operation screen to keyboard input for directly updating that string.
This part has CLICKED and RELEASED events similar to those for buttons.
Note: In Version 2.32 or later, the DONE event is added to this part. For details, see
Section 2.2.5 "DONE Event."
Text Box Example
Step 1 Load the editor and place a text box on the panel layout.
(Optional) Specify an initial value.
Step 2 Add action source code
This part has CLICKED and RELEASED events similar to those for buttons.
Step 3 Changing text box properties
In addition to the color, position, and other properties that this part shares with
buttons, this part it has the unique property of a display string (.text).
This example uses a button press on the same screen to read global string variable
#10 into a text box and store that value in global string variable #11.
Load the editor and place a text box and button on the panel layout.
Open the Source Code Edit window, select Button1 and CLICKED to create the
action source code skeleton, and add the following lines.
The procedures for accessing properties are the same as for all other parts.
Textbox1.text=S[10]
S[11]=Textbox1.text
Page 163
[ 6 ] Check Box
This part toggles a setting between on and off. Access to this setting is via the property
state.
This part has other properties similar to buttons and labels.
Check Box Example
Step 1 Load the editor and place a check box on the panel layout.
Step 2 Adding action source code
This part has CLICKED and RELEASED events similar to those for buttons.
Page 164
Step 3 Read/write access to check box properties
This example shows how pressing a button on the same screen can update IO[24]
to IO[26] from a set of check boxes.
Add a button to the panel layout.
Page 165
Step 4 Open the Source Code Edit window, select Button1 and CLICKED to create the
action source code skeleton, and add the following lines for reading the check box
properties (.state).
IO[24] = checkbox1.state
IO[25] = checkbox2.state
IO[26] = checkbox3.state
Compile this panel layout, download it to the controller, and test.
Page 166
[ 7 ] Radio Button
A group (described below) of these parts provides a set of mutually exclusive settings.
These parts have ON/OFF properties (.state) similar to those for lamps and check
boxes.
Radio Button Example
The following example uses radio buttons for three mutually exclusive settings.
Step 1 Load the editor and place a group with three radio buttons on the panel layout.
Page 167
Step 2 Set the property group for all radio buttons to the group number for the group to
ensure mutually exclusive operation of the radio buttons within the group. This
example uses group number 0.
Step 3 Adding action source code
This part has CLICKED and RELEASED events similar to those for buttons.
Page 168
Step 4 Changing radio button properties
Radio buttons have properties similar to those for buttons and labels.
This example shows how pressing a button (Button1) on the same screen can
update both the corresponding output (IO[24] to IO[26]) and a numerical input box
from the corresponding global float variable (F[10] to F[12]) based on the current
states of the radio buttons (RadioButton1 to RadioButton3).
Add the button and numerical input box to the panel layout.
Page 169
Step 5 Open the Source Code Edit window, select Button1 and CLICKED to create the
action source code skeleton, and add the following IF statement branching on the
radio button properties (.state).
If radiobutton1.state=1 then
Io[24] = 1
Numeric1.value = F[10]
Elseif radiobutton2.state=1 then
Io[25] = 1
Numeric2.value = F[11]
Elseif radiobutton3.state=1 then
Io[26] = 1
Numeric1.value = F[12]
End if
Compile this panel layout, download it to the controller, and test.
Page 170
[ 8 ] Group
This part provides mutually exclusive operation for a set of radio buttons.
Group Example
The following example demonstrates mutually exclusive operation with two sets of
radio buttons.
Step 1 Place two groups with three and four radio buttons respectively on the panel layout.
Page 171
Step 2 Assign group number 0 to Group1 and 1 to Group2.
Step 3 Set the property group for all radio buttons to the group number for the group to
which they belong to ensure mutually exclusive operation within the group.
Page 172
[ 9 ] Function Key
This part resembles buttons in assigning captions to pendant function keys and action
source code to function key presses, but it lacks the position properties of other parts
because the pendant function keys have fixed positions, specified by number (.index).
Note: In Version 2.32 or later, the RELEASED event is added to this part.
Function Key Example
Step 1 Load the editor and place the function key anywhere on the panel layout in the
Layout window. Note, however, that the final result will not appear at this position,
but on the corresponding function key on the teach pendant screen.
Specify "Next panel" as the display text (.caption) for the function key.
Page 173
Step 2 Specify the desired function key number (0 to 9). This example uses #2.
Step 3 Adding action source code
This part differs from buttons and other parts in supporting only a single event,
CLICKED.
This example responds to the key press by switching to a different panel, Panel2.
Step 4 Changing function key properties
This part differs from other parts in offering only a single property, caption. Access is
the same as for other parts.
Page 174
[ 10 ] Timer
This part automatically triggers action source code for the TIMER event at the interval
specified by the property interval.
Timer Example
Step 1 Load the editor and place a timer anywhere on the panel layout in the Layout
window. Note, however, that the final result will not appear on the teach pendant
screen.
Step 2 Changing timer properties
The main properties here are active, which controls (and indicates) timer status, and
interval, which controls event frequency.
This example uses buttons to enable and disable a timer which alternately switches
a pilot lamp on and off.
Load the editor and place a timer, two buttons, and a pilot lamp on the panel layout in
the Layout window.
Page 175
Step 3 Adding action source code
Open the Source Code Edit window, select Timer1 and TIMER, create the action
source code skeleton, and add the following line to switch the lamp ON and OFF.
If Lightbutton1.state = 1 then
Lightbutton1.state = 0
Else
Lightbutton1.state = 1
End if
Add the following lines so that the CLICKED events for Button1 ("Start") and Button2
("Stop") respectively enable and disable the timer.
Timer1.active = 1
Timer1.active = 0
Page 176
[ 11 ] Line
This part draws a straight line with the specified pattern on the panel layout.
The parts line, oval, and rectangle are for drawing only. They support no events.
Nevertheless, other parts on the same screen can still change their properties.
Line Example
Step 1 Load the editor and place a line on the panel layout.
Step 2 Changing line properties
Like all drawing parts, the main properties here are line type (.style) and line
thickness (.thickness).
The following example uses a button press to change line thickness and style.
Add a second line and a button to the panel layout.
Page 177
Step 3 Open the Source Code Edit window and add the following action source code for
changing the line 1 thickness to 5 pixels and the line 2 style to dotted line when the
button is pressed.
Step 4 Compiling this panel layout and downloading it to the controller produces the
following displays.
Before button press
After button press
Page 178
[ 12 ] Oval
This part draws an oval with the specified pattern on the panel layout.
The parts line, oval, and rectangle are for drawing only. They support no events.
Nevertheless, other parts on the same screen can still change their properties.
Oval Example
Step 1 Load the editor and place an oval on the panel layout.
Step 2 Changing oval properties
Like all drawing parts, the main properties here are line type (.style) and line
thickness (.thickness).
The procedures for accessing properties are the same as for all other parts.
[ 13 ] Rectangle
This part draws a rectangle with the specified pattern on the panel layout.
The parts line, oval, and rectangle are for drawing only. They support no events.
Nevertheless, other parts on the same screen can still change their properties.
Rectangle Example
Step 1 Load the editor and place a rectangle on the panel layout.
Step 2 Changing rectangle properties
Like all drawing parts, the main properties here are line type (.style) and line
thickness (.thickness).
The procedures for accessing properties are the same as for all other parts.
Page 179
[ 14 ] Illuminated Push Button
An illuminated push button combines button and lamp operation. It therefore supports
CLICKED, RELEASED, and REFRESH events for adding action source code.
The property state gives the lamp's current state just as it does for lamps and check
boxes.
Illuminated Push Button Example
Step 1 Load the editor and place the button just as you would with a regular button.
Step 2 Changing illuminated push button properties
The following example uses illuminated push buttons to run a program and display
an I/O state. Pressing this button runs a program in the same folder. (This program
waits two seconds and then turns IO[24] on.) The lamp in the button tracks IO[24].
Add the necessary parts to the panel layout.
Page 180
Step 3 Adding action source code
This part supports three events for adding action source code: CLICKED,
RELEASED, and REFRESH. This example uses only two.
lbutton1.state = io[24] ' copy IO[24] state into Lightbutton1
Step 4 Write the program to run using PAC manager.
Compile this and the panel layout, download them to the controller, and test.
Page 181
2.3 Interfaces with PAC Language and System
Data exchange between the PAC language and the TP panel is via global and folder
variables.
The interface with the system uses the SYSSTATE command and I/O variables.
2.3.1 Reading and Displaying PAC Variables
A TP panel can access PAC global and folder variables, but not local ones. Folder
variables require EXTERN declarations; global ones do not.
The following examples display such variables on TP panels.
Example Displaying Global Variables
Accessing a global variable uses array notation with the array name indicating the
type: I for integer, F for float, D for double, and S for string. Global integer variable #10,
for example, is I[10].
The following example displays a global variable of each type in a numerical input box
(or text box for the string) when a button is pressed.
Step 1 Load the editor and place a button, three numerical input boxes for displaying the
three numerical variables, and a text box for displaying the string variable on the
panel layout.
Page 182
Step 2 Open the Source Code Edit window and add the following action source code for
when this button is pressed. This example copies global integer variable #10, float
variable #11, and double variable #12 to numerical input boxes and global string
variable #13 to a text box.
Numeric1.value = I[10]
Numeric2.value = F[11]
Numeric3.value = D[12]
Textbox1.text = S[13]
Step 3 Compiling this panel layout and downloading it to the controller produces a display
similar to the following when the button is pressed.
Page 183
Example Displaying Folder Variables
Accessing folder variables in action source code for a button or other part requires first
declaring them with EXTERN plus a reserved word (DEFINT, DEFSNG, DEFDBL, or
DEFSTR) indicating the type. To access folder integer variable itest, for example, the
action source code must first declare it with the following statement.
EXTERN DEFINT itest
The following example displays a folder variable of each type in a numerical input box
(or text box for the string) when a button is pressed.
Step 1 Load the editor and place a button, three numerical input boxes for displaying the
three numerical variables, and a text box for displaying the string variable on the
panel layout.
Note that the layout is identical to that for the global variable example above.
Step 2 Open the Source Code Edit window and add the following action source code for
when this button is pressed. This example copies integer ITEST, float FTEST, and
double DTEST to numerical input boxes and string STEST to a text box.
EXTERN DEFINT ITEST
EXTERN DEFSNG FTEST
EXTERN DEFDBL DTEST
EXTERN DEFSTR STEST
Numeric1.value = ITEST
Numeric2.value = FTEST
Numeric3.value = DTEST
Textbox1.text = STEST
Page 184
2.3.2 Modifying PAC Variables
Modifying PAC variables is simply the write access counterpart of the read access
described in the preceding section.
Example Modifying Global Variables
The following example updates a global variable of each type from the corresponding
numerical input box (or text box for the string) when a button is pressed.
Step 1 Load the editor and place a button, three numerical input boxes for specifying the
three numerical values, and a text box for specifying the string on the panel layout.
Page 185
Step 2 Open the Source Code Edit window and add the following action source code for
when this button is pressed. This example copies the three numerical values to
global integer variable #20, float variable #21, and double variable #22 and the
string to global string variable #23.
I[20]=Numeric1.value
F[21]=Numeric2.value
D[22]=Numeric3.value
S[23]=Textbox1.text
Page 186
Example Modifying Folder Variables
Accessing folder variables in action source code for a button or other part requires first
declaring them with EXTERN plus a reserved word (DEFINT, DEFSNG, DEFDBL, or
DEFSNG) indicating the type.
The following example updates a folder variable of each type from the corresponding
numerical input box (or text box for the string) when a button is pressed.
Step 1 Load the editor and place a button, three numerical input boxes for specifying the
three numerical values, and a text box for specifying the string on the panel layout.
Note that the layout is identical to that for the global variable example above.
Step 2 Open the Source Code Edit window and add the following action source code for
when this button is pressed. This example copies integer ITEST, float FTEST, and
double DTEST to numerical input boxes and string STEST to a text box.
EXTERN DEFINT ITEST
EXTERN DEFSNG FTEST
EXTERN DEFDBL DTEST
EXTERN DEFSTR STEST
ITEST=Numeric1.value
FTEST=Numeric2.value
DTEST=Numeric3.value
STEST=Textbox1.text
Page 187
2.3.3 Reading I/O States
A TP panel can read robot controller I/O states via global I/O variables or local I/O
variables declared with DEFIO. We postpone discussion of the latter to the local
variable description below.
Example Using Global I/O Variables
Accessing a global I/O variable uses array notation with the array name IO.
This example monitors global I/O variables #24 to #27 with lamps updated at regularly
scheduled intervals.
Step 1 Load the editor and place four lamps on the panel layout.
Page 188
Step 2 In the Source Code Edit window, select the REFRESH event for one lamp (This
example uses LightButton1.) and add the following action source code for copying
the I/O states to the lamps at regularly scheduled intervals to the skeleton
automatically created.
LightButton1.state = IO[24] ' copy I/O variable #24 state into LightButton1
LightButton2.state = IO[25] ' copy I/O variable #25 state into LightButton2
LightButton3.state = IO[26] ' copy I/O variable #26 state into LightButton3
LightButton4.state = IO[27] ' copy I/O variable #27 state into LightButton4
Page 189
2.3.4 Modifying I/O States
Use the SET and RESET commands to modify system I/O states.
ON: SET IO[I/O number]
OFF: RESET IO[I/O number]
Example Modifying I/O States
The following example updates I/O variables #28 to #31 from the corresponding check
boxes when a button is pressed.
Step 1 Load the editor and place four check boxes and a button on the panel layout.
Page 190
Step 2 Open the Source Code Edit window and add the following action source code for
updating the outputs from the check boxes.
IO[28]=Checkbox1.state ' update I/O variable #28 from Checkbox1
IO[29]=Checkbox2.state ' update I/O variable #29 from Checkbox2
IO[30]=Checkbox3.state ' update I/O variable #30 from Checkbox3
IO[31]=Checkbox4.state ' update I/O variable #31 from Checkbox4
Page 191
2.3.5 Reading System Status
The SYSSTATE command reads the system status.
For further details on this and other commands, see Chapter 5 "Command Reference."
Example Reading System Status
The following example lights a lamp when the controller is in automatic mode.
Step 1 Load the editor and place a lamp on the panel layout.
Page 192
Step 2 In the Source Code Edit window, select the lamp's REFRESH event and add the
following action source code for updating the lamp based on the mode data read
from the controller at regularly scheduled intervals to the skeleton automatically
created. (This example uses the default name LightButton1.)
DEFINT STAT, AUTOSTAT
STAT=SYSSTATE
AUTOSTAT = &H0010 AND STAT
IF AUTOSTAT = 0 THEN
LIGHTBUTTON1.state = 0
ELSE
LIGHTBUTTON1.STATE = 1
END IF
Page 193
2.4 Switching TP Panels
The PAGE_CHANGE command switches the teach pendant screen to a different TP
panel in the same folder or even one in a different folder. It has the following syntax.
Same folder: PAGE_CHANGE panel_name
Different folder: PAGE_CHANGE path_name.panel_name
Root folder: PAGE_CHANGE \panel_name
2.4.1 Example Switching in Same Folder
The following example has three panel layouts in the same folder with two buttons on
each for freely moving between them.
Step 1 Load the editor, create three panel layouts with two buttons on each, and label the
buttons for the two other panel layouts.
Page 194
Step 2 Open Source Code Edit windows for the panel layouts and add the appropriated line
from the following action source code to each button's CLICKED event.
PAGE_CHANGE PANEL1 ' switch screen to PANEL1
PAGE_CHANGE PANEL2 ' switch screen to PANEL2
PAGE_CHANGE PANEL3 ' switch screen to PANEL3
Compile the panel layouts, download them to the controller, and test.
Page 195
2.4.2 Example Switching Between Folders
The following example has three panel layouts all in different folders in a 3-level
hierarchy with two buttons on each for freely moving between them.
Step 1 Create the 3-level hierarchy with PAC Manager.
Load the editor, create three panel layouts, one at each level, with two buttons on
each, and label the buttons for the two other panel layouts.
Step 2 Open Source Code Edit windows for the panel layouts and add the appropriated line
from the following action source code to each button's CLICKED event.
PAGE_CHANGE FOLDER1.PANEL1 ' switch screen to PANEL1 in FOLDER1
relative to the current folder
PAGE_CHANGE FOLDER2.PANEL1 ' switch screen to PANEL1 in FOLDER2
relative to the current folder
PAGE_CHANGE FOLDER1.FOLDER2.PANEL1
' switch screen to PANEL1 in
FOLDER1.FOLDER2 relative to the current
folder
PAGE_CHANGE \PANEL3 ' switch screen to PANEL1 in the root folder
using absolute folder reference
Page 196
Step 2 (continued)
Compile the panel layouts, download them to the controller, and test.
Page 197
2.5 Flow Control
The TP panel control language has three types of flow control statements: conditional
branches IF... END IF and IF... THEN... ELSE..., SELECT... CASE, and iteration FOR...
NEXT.
The following sections give examples.
2.5.1 Conditional Branching
Example Using IF... END IF
The following IF statement example reads a global variable into a numerical input box if
an I/O condition is met.
Step 1 Load the editor and place a numerical input box and a button to trigger the test on
the panel layout.
Step 2 Open the Source Code Edit window and add action source code updating the
numerical input box from global integer variable #10 only if I/O variable #24 is 1
when this button is pressed.
Compile the panel layout, download it to the controller, and test.
Page 198
Example Using SELECT... CASE
The following SELECT... CASE example runs a different program according to the
value in a numerical input box when a button is pushed.
Step 1 Load the editor and place a button and a numerical input box on the panel layout.
Step 2 Open the Source Code Edit window and add the following action source code for the
button's CLICKED event.
DEFINT TYPE
TYPE = Numeric1.value
SELECT CASE TYPE
CASE 0
RUN PRO0
CASE 1
RUN PRO1
CASE 2
RUN PRO2
CASE ELSE
RUN PRO10
END SELECT
Compile the panel layout, download it to the controller, and test.
Page 199
2.5.2 Iteration
Example Using FOR...NEXT
The following FOR... NEXT example counts the number of zero values in global integer
variables #0 to #99 when a button is pushed and displays the result in a numerical
input box.
Step 1 Load the editor and place a button and a numerical input box on the panel layout.
Step 2 Open the Source Code Edit window and add the following action source code for the
button's CLICKED event.
DEFINT COUNT,ZEROCOUNT=0
FOR COUNT = 0 TO 99
IF I[COUNT] = 0 THEN
ZEROCOUNT = ZEROCOUNT + 1
END IF
NEXT
NUMERIC1.VALUE = ZEROCOUNT
Compile the panel layout, download it to the controller, and test.
Page 200
2.6 Local Variables
The TP panel control language supports local variables of type integer, float, double,
string, and I/O.
Declaring a variable inside an action source code block makes it local--that is,
accessible only that block.
DEF Button1_CLICKED()
Valid range for COUNT and ZEROCOUNT
DEF Button1_CLICKED() DEFINT COUNT,ZEROCOUNT=0
FOR COUNT = 0 TO 99 IF I[COUNT] = 0 THEN ZEROCOUNT = ZEROCOUNT + 1 END IF NEXT NUMERIC1.VALUE = ZEROCOUNT
END
Example Using Local Variables
The following example copies global variables into local ones when a button is pressed,
manipulates the local variables, and copies the results back to the original global
variables.
Step 1 Load the editor and place a button on the panel layout.
Page 201
Step 2 Open the Source Code Edit window and add the following action source code for
* reading global integer variable #10 into a local integer variable, multiplying it by 10,
and writing the result back
* reading global float variable #10 into a local float variable, multiplying it by 20, and
writing the result back
* reading global double variable #10 into a local double variable, multiplying it by 10,
and writing the result back
* reading global string variable #10 into a local string variable, adding "end," and
writing the result back
DEFINT ITEST
DEFSNG FTEST
DEFDBL DTEST
DEFSTR STEST
ITEST = I[10]
FTEST = F[10]
DTEST = D[10]
STEST = S[10]
ITEST = ITEST * 10
FTEST = FTEST * 20
DTEST = DTEST * 10
STEST = STEST + “END”
I[10] = ITEST
F[10] = FTEST
D[10] = DTEST
S[10] = STEST
Compile the panel layout, download it to the controller, and test.
Page 202
Denso Robotics
Section 9
Client/Server Devices
Page 203
Chapter 2 Configuration of the Robot System
2.1 Configurators
The figure below shows configurators of the typical robot system.
Configurators of the Robot System
(1) Robot unit
(4) Robot controlcable
PLC(prepared bycustomer)
I/O cable(option)
RS-232C cable(prepared bycustomer)
Floppy disk drive(option)
Printer(prepared bycustomer)
(11) Powerconnectorfor I/O
(9) Pendantlessconnector (Note 2)
(3) Power cable
µVision board(option)
Note 1: Items (1) to (15) are the standard components listed on page 1.
Note 2: The pendantless connector is attached to the robot controller connector when no teach pendant is connected.
Note 3: The components illustrated above are typical models or parts.
(6) NetwoRCCD
(8) Initializationfloppy disk
WINCAPSII(CD-ROM or FD)(option)
Optional boards
(2) Robotcontroller
Printer cable(prepared bycustomer)
(5) Manuals(12) Direction
indicatorlabel
(13) Warning label
(7) Spare fuses for robotcontroller
(14) Spare output I/Ofor robot controller
(10) Connector set for handcontrol signals
Teach pendant(option)
Personalcomputer(prepared bycustomer)
Controllerprotective box(option)
Monitor(option)
Vision camera(option)
(15) Dowel pins
Mini-pendant(option)
Operating panel(option)
Page 204
2.3 Names of the Robot Controller Components
The figure below shows the names of the robot controller components.
Connectors for the VM-G series (Encoders connected via bus)
Connector No. Marking Name
CN1 RS-232C Serial Communication connector
CN2 USB USB connector (2 lines)
CN3 PENDANT Connector for teach pendant
CN4 LAN Connector for Ethenet
CN5 Mini I/O Connector for I/O
CN6 INPUT AC Power supply connector
CN7 MOTOR Connector for motor / encoder
CN9 HAND I/O Connector for HAND I/O
CN10 SAFETY I/O Connector for SAFETY I/O
(Only for global type)
Names of Robot Controller Components
Rear panel (Air exhaust side)
Front panel Air intake filter
Page 205
13.2 Command for RS232C and Ethernet(Server/Client) Port
INPUT (Statement)[Conforms to SLIM]
Function
Obtains data from the RS232C or Ethernet port.
Format
INPUT [#<Circuit number>,]<Variable name>[,<Variable name>…]
Explanation
This statement stores data received via the RS232C or Ethernet port into thevariable designated by <Variable name>.Designate a circuit number to use for <Circuit number>. If <Circuit number> isignored the default value of ch2 is set. Ch1 cannot be designated because it isused for the pendant. (Refer to Section 2.4.1, “ Circuit Number”.)If plural information is received for the same number of variables add a comma(,) between each variable.Designate the baud rate using a system parameter.
Note (1): Execute a FLUSH command to clear the data remaining inthe input buffer of the received data prior to receiving data.
Note (2): If input data exceeds the maximum value of the variable typeto which it has been assigned, the result is the maximumvalue of that type.
Related Terms
FLUSH, PRINT, WRITE
Example
DIM li1 As Integer
DEFSTR ls1, ls2, ls3, ls4
INPUT #1, ls1 'Writes data from ch2 to ls1.
INPUT #1, li1, ls2, ls3 'Writes data from ch2 to li1, ls2, and ls3.
INPUT ls4 'Writes data from ch2 to ls4.
Page 206
Chapter 13 Input/Output Control Statements
LINEINPUT (Statement)
Function
Reads data to a delimiter through the RS232C or Ethernet port and assigns itto a character string type variable.
Format
LINEINPUT [#<Circuit number>,] <Character string type variable name>
Explanation
All characters, from the data received via the RS232C or Ethernet port to adelimiter (CR or CR + LF), are stored into the variable designated by<Character string type variable name >. Delimiter is not stored into anyvariable.
For <Circuit number>, designate the circuit number of the RS232C or Ethernetport to be used. If <Circuit number> is ignored, the default value of ch2 is set.Ch1 cannot be designated since it is used for the pendant. (Refer to Section2.4.1, “ Circuit Number”.)
Designate the name of the character string type variable for <Character stringvariable name>.
Related Terms
Example
DEFSTR ls1,ls2,ls3
LINEINPUT #0, ls1 'Receives a character string from port 1 and assigns it to ls1.
LINEINPUT #1, ls2 'Receives a character string from port 2 and assigns it to ls2.
LINEINPUT ls3 'Receives a character string from port 2 and assigns it to ls3.
Page 207
PRINT (Statement)[Conforms to SLIM]
Function
Outputs data from the RS232C or Ethernet port.
Format
PRINT [#<Circuit number>,] <Message> [<Separator> <Message>…][<Separator>]
Explanation
This statement outputs the value of <Message> from the RS232C or Ethernetport to an external device.
For <Circuit number>, designate the circuit number of the RS232C or Ethernetport to be used. If <Circuit number> is ignored, the default value of ch2 is set.Ch1 cannot be designated since it is used for the pendant. (Refer to Section6.1, "Circuit Number.")
A comma (,) or semicolon (;) can be used for <Separator>.
In the case of a comma (,), insert a blank character between the <Message>and <Message>.
If a comma (,) is designated after <Message> but no <Message> is found, adelimiter (CR or CR+LF) is transferred after the final <Message> once output isfinished.
In the case of a semicolon (;), no blank character should be inserted betweenthe semicolon and <Message>.
If a semicolon (;) is designated after <Message> but no <Message> is found, adelimiter (CR or CR+LF) is transferred after the final <Message> and output isfinished.
If pose type data is output, each element is separated for output using a blankcharacter.
Related Terms
WRITE
Example
DEFINT li1, li2
DEFSTR ls1, ls2
PRINT #1, li1, ls1; ls2 'Outputs the values of li1, ls1, and ls2 from ch2.
'(A blank is made between li1 and ls1, and no blankis made between ls1 and ls2.)
PRINT li2 'Outputs the value of li2 from ch2.
Page 208
Chapter 13 Input/Output Control Statements
WRITE (Statement)
Function
Outputs data from the RS232C or Ethernet port.
Format
WRITE [#<Circuit number>,]<Message>[,<Message>…]
Explanation
This statement outputs the value of <Message> from the RS232C or Ethernetport to an external device.
For <Circuit number>, designate the circuit number of the RS232C or Ethernetport to be used. If <Circuit number> is ignored, the default value of ch2 is set.Ch1 cannot be designated since it is used for the pendant. (Refer to Section6.1, "Circuit Number.")
If plural messages are written, a comma (,) must be used to separate themessages.
The following are the points that differ from the PRINT statement.
(1) Character string data is output in double quotation marks (").
(2) At the end of output information, a delimiter (CR or CR+LF) is added.
(3) Commas (,) separating messages are output as they are.
(4) If pose type data is output, each element is separated for output usinga comma (,).
Related Terms
Example
DEFINT li1, li2
DEFSTR ls1, ls2
WRITE #1, li1, ls1, ls2 'Outputs the values of li1, ls1, ls2 from ch2.
WRITE li2 'Outputs the value of li2 from ch2.
Page 209
FLUSH (Statement)
Function
Clears the input buffer.
Format
FLUSH [#<Circuit number>]
Explanation
This statement clears the input buffer of the RS232C or Ethernet port.Designate a circuit number to clear the input buffer for <Circuit number>.If <Circuit number> is ignored, the default value of ch2 is set. Ch1 cannot bedesignated since it is used for the pendant. (Refer to Section 2.4.1, “CircuitNumber.”)Execute a FLUSH command to clear the data remaining in the input buffer priorto receiving data.
Related Terms
INPUT
Example
FLUSH #1 'Clears the input buffer of the ch2 circuit.
FLUSH 'Clears the input buffer of the ch2 circuit.
Page 210
Denso Robotics
Section 10
Supervisory Task
Page 211
Supervisory Task (Software PLC) [Ver. 1.7 or later] Outline of Supervisory Task
System software version 1.7 newly supports a supervisory task (programmable logic control software (software PLC)). This enables the robot controller to centralize control of an entire facility.
If defined as a supervisory task, a task program written in PAC can keep running independently of normal task programs and operation modes. You may define ten supervisory tasks (TSR0.PAC to TSR9.PAC) and operate them with the system software version 1.7 or later. It is useful to define programs described below as supervisory tasks.
For safety, names of supervisory tasks are restricted to TSR0.PAC to TSR9.PAC and any motion-control programs are prohibited in supervisory tasks.
Note: [Ver. 2.2 or later] Enhancement by the folder feature added (1) The folder feature newly added enables supervisory tasks having the same
name to coexist in a robot controller, as long as those tasks are located in individual folders.
The function and operation of supervisory tasks are the same as those in the previous system version, except that the number of supervisory tasks allowed is changed from 10 to 32 (TSR0 to TSR31).
(2) Up to 32 supervisory tasks can run simultaneously independent of normal task programs. If more than 32 supervisory tasks are made active simultaneously, the error "7799: The maximum number of TSR was exceeded." occurs, terminating all programs including supervisory tasks.
Use the following as supervisory tasks: (1) Customizing operation screens on the teach pendant, which can contain up to 500
buttons and 50 screens (Refer to the PROGRAMMER'S MANUAL I, Section 13.5 "Customizing TP Operation Screens.")
(2) Writing programs for automatic recovery process to be followed if an error occurs in facilities or robots
(3) Controlling facilities (As an alternative of sequencer for facility scale of 200 I/O points and approx. 100 steps in a rudder command)
Supervisory tasks feature: (1) Written in PAC language. (Up to 10 programs may be defined and their names. are
fixed to TSR0.PAC to TSR9.PAC.) (2) Arithmetic/logical operation commands, I/O get commands, program control
commands only executable. (3) Highest priority (101) over all other normal task programs (whose priority will be
automatically changed to 102 or more) (4) Limited occupation time frame (Uses 2 ms every 8 ms).
Page 212
General Introduction to Operation Modes and Additional Functions
Supervisory task start condition parameters (1) Supervisory task enable/disable parameter "Not Use Supervisor TASK" or "Use Supervisor TASK" in the Supervisor TASK
Setting window
(2) INIT run mode parameter, whether or not to involve motor on and CAL "INIT:(not [MOTOR ON + CAL])" or "INIT:(MOTOR ON + CAL)" in the INIT Setting
window
(3) External speed parameter (10 or 100) for INIT run mode "INIT Set SPEED 10" or "INIT Set SPEED 100" in the INIT Setting (SPEED)
window
Starting supervisory tasks Supervisory tasks may be started by any of the following operations or events provided that:- the supervisory task mode has been enabled (by selecting the "Use Supervisor
TASK" in the Supervisory TASK Setting window) and - any supervisory task program (TSR0 to TSR9) exists.
(1) Turning the robot controller on (2) Switching the operation mode from Manual to Auto (3) Pressing the [F1 START] in the Supervisor TASK Setting window (4) Selecting and starting a supervisory task in the Program List window in Auto or
Teach Check mode
If a supervisory task is initiated, the supervisory task icon will appear in the task bar as shown below.
Supervisory task icon
Page 213
Terminating supervisory tasks Supervisory tasks will terminate if any of the following events occurs:
(1) Turning the robot controller off (2) Pressing the [F6 STOP] in the Supervisor TASK Setting window (3) Loading or compiling a project (4) Error in a supervisory task itself (5) Level 4 error or higher one (6) Reading or writing from/onto a floppy disk (7) Receiving a file from WINCAPSIII
(8) Making the supervisory task mode inactive to delete it from optional features
Supervisory task commands (1) INIT (Initialize the robot controller) This command may turn the motor power on and execute CAL depending upon the
INIT run mode setting. For details about INIT command, refer to the PROGRAMMER'S MANUAL I.
Page 214
General Introduction to Operation Modes and Additional Functions
Using Supervisory Tasks [ 1 ] Making the supervisory task mode active The supervisory task mode is an optional feature, so you need to make it active according to the procedure given below.
(1) Calling up the System Extension window Access: [F6 Set]—[F7 Options.]—[F8 Extnsion]—[F5 Input ID] from the top screen
of the teach pendant
(2) Adding a supervisory task mode Enter "1111" from the numeric keypad.
Page 215
Press the OK button. The supervisory task mode will be added.
(3) Restarting the robot controller Turn the controller off and then on. The supervisory task mode becomes active
and you may make supervisory task settings. On the top screen, press the SHIFT key and check that the S-TASK is displayed in
F8 of the menu bar.
F8 Press [F8 S-TASK]. The Supervisor TASK Setting window appears as shown
below.
Page 216
General Introduction to Operation Modes and Additional Functions
[ 2 ] Setting supervisory task parameters (1) Supervisory task enable/disable parameter This parameter enables or disables the supervisory task mode. Access: [F8 S-TASK]—[F7 USE] from the top screen of the teach pendant In the Supervisor TASK Setting window shown below, choose the desired setting
and press the OK. To make no change, press the Cancel.
(2) INIT execution mode parameter This parameter specifies whether or not the execution of the INIT command will
involve turning on motors and performing CAL. Access: [F8 S-TASK]—[F8 Mode] from the top screen of the teach pendant In the INIT Setting (MOTOR ON + CAL) window shown below, choose the desired
setting and press the OK. To make no change, press the Cancel.
Page 217
(3) INIT external speed parameter This parameter determines whether the external speed will be 10 or 100 at
execution of INIT command. Access: [F8 S-TASK]—[F9 Speed] from the top screen of the teach pendant In the INIT Setting (SPEED) window shown below, choose the desired setting and
press the OK. To make no change, press the Cancel.
Page 218
General Introduction to Operation Modes and Additional Functions
[ 3 ] Starting supervisory tasks Turn the robot controller on. Supervisory tasks will start automatically provided that: - the supervisory task mode has been enabled by selecting the "Use Supervisor
TASK" in the Supervisory TASK Setting window and - any supervisory task program (TSR0 to TSR9) exists.
NOTE: Under the above conditions, supervisory tasks will be started even in Manual or Teach Check mode.
To start no supervisory task, turn the controller on while holding down the deadman switch.
Switch the operation mode from Manual to Auto from the teach pendant or an external I/O. Supervisory tasks will start automatically provided that: - the supervisory task mode has been enabled by selecting the "Use Supervisor
TASK" in the Supervisory TASK Setting window and - any supervisory task program (TSR0 to TSR9) exists.
Switching the operation mode from an external I/O when the controller is placed in the external mode will also start supervisory tasks. Before doing this, make sure that no normal programs are running. NOTE: Switching to Auto mode by using Enable Auto signal and Robot Error Clear signal will also start supervisory tasks.
Press the START button in the Supervisor TASK Setting window. From the top screen of the teach pendant, choose [F8 S-TASK]—[F1 START] under the following conditions: - the supervisory task mode has been enabled by selecting the "Use Supervisor
TASK" in the Supervisory TASK Setting window and - any supervisory task program (TSR0 to TSR9) exists.
Select and start a supervisory task in the Program List window in Auto or Teach Check mode. From the Program List window, choose a desired supervisory task program(s) (TSR0 to TSR9) and start it, provided that any supervisory task program(s) exists.
Page 219
[ 4 ] Terminating supervisory tasks If any of the following operations takes place or any of the following errors occurs when a supervisory task program is running, then the supervisory task will terminate.
Turn the robot controller off
Press the STOP button in the Supervisor TASK Setting window Access: [F8 S-TASK]—[F6 STOP] from the top screen of the teach pendant
Load or compile a project Access: [F6 Set]—[F1 Load!] from the top screen of the teach pendant orAccess: [F1 Program]—[F6 Aux.]—[F12 Compile] from the top screen of the teach pendant in Manual mode
Error in a supervisory task itself If any error occurs in a supervisory task itself, the supervisory task currently running will terminate.
Level 4 error or higher one If an error at level 4 or above occurs in supervisory tasks, normal tasks, or robot controller system, then the supervisory task currently running will terminate.
Read or write from/onto a floppy disk Reading data stored in a floppy disk to the robot controller or writing data stored in the robot controller to a floppy disk will terminate the currently running supervisory task.
Access: [F6 Set]—[F3 FD.]—[F1 Read.] from the top screen of the teach pendant Access: [F6 Set]—[F3 FD.]—[F2 Write.] from the top screen of the teach pendant
Page 220
Chapter 3 General Introduction to Operation Modes and Additional Functions
Receive a file from WINCAPSIII Receiving an execution file or parameters from WINCAPSIII terminates the supervisory task currently running.
Make the supervisory task mode inactive to delete it from optional featuresAccess: [F6 Set]—[F7 Options.]—[F8 Extnsion]—[F4 Remove] from the top screen of the teach pendant Note that the supervisory task setting remains enabled.
Page 221
Restrictions on the Use of Supervisory Tasks The purpose of a supervisory task is to centralize control of an entire facility. It involves placing some restrictions on the use of it.
[ 1 ] Restrictions on the normal program operation (1) No motion commands or vision commands are executable in a supervisory task.
To execute those commands, make a user program containing them and run it as a supervisory task.
(2) A supervisory task may support robot stop and start commands, but not support Temporary stop, Instantaneous stop, Step stop, or Break point stop. It also ignores the SUSPEND command.
(3) If you want to start a supervisory task only when the robot controller is turned on, then use internal I/Os to bypass the overlapped initiation of the supervisory task.
(4) If a supervisory task is started by any other supervisory task, then no priority options or cycle options are supported. This means that these supervisory tasks may conflict with each other.
(5) A supervisory task is so designed that it cannot be self-started repeatedly. To repeat it, use loop commands.
(6) In Teach Check mode, releasing the deadman switch will not stop running supervisory tasks.
(7) A supervisory task does not support Step check or Step back. (8) A HOLD command for a supervisory task will be ignored. (9) A normal task cannot manage any supervisory task by using KILL or SUSPEND
command or other means. (10) During execution of a supervisory task, you may make vision board settings.
However, it may block the operation of the supervisory task. (11) If an error occurs or an emergency stop signal is inputted, a supervisory task
cannot run any normal task.
Page 222
General Introduction to Operation Modes and Additional Functions
[ 2 ] Rules for using a supervisory task (1) Avoid using the following commands in a loop to repeat them in a supervisory task.
Otherwise, the supervisory task itself may not terminate. This is because a supervisory task has higher priority over normal task programs.
INIT, RUN, KILL, SUSPEND commands (2) Avoid simultaneous execution of RUN and SUSPEND commands or that of RUN
and KILL commands to a same program in a supervisory task. Doing so may freeze the robot system, skip a Stop command, or cause any other failures. To recover from such states, you need to restart the robot controller.
(3) If a semaphore (priority order) is specified in a supervisory task, there is a possibility that a lower priority task may get a semaphore. This is because using a semaphore may cause a supervisory task to lose highest priority 101.
(4) If a supervisory task that repeats normal tasks runs, then mode switching from the external equipment may become no longer possible.
To recover from such states, stop the supervisory task from the teach pendant. To prevent such states,
- design programs so that they will conditionally start according to Auto mode or External mode, or
- design a supervisory task itself so that it will be terminated from external input. Starting a user program during switching to External mode may issue an alarm.
Correct the program so that it will conditionally start according to the mode, just as above.
[ 3 ] Rules for a supervisory task mode not in use When a supervisory task mode is not in use, programs named TSR0 to TSR9 execute as normal task programs. To debug supervisory task programs, therefore, disable a supervisory task mode and use Teach Check mode or Break Point function.
Page 223
Supervisory Task Extension [Ver. 1. 95 or later]
Conventional supervisory tasks supported by the main system software version 1.7 or later are designed to terminate if Level 4 error or higher one occurs.
Main system software version 1.95 newly supports the supervisory task extension that prevents supervisory tasks from terminating if Level 4 error occurs except memory errors (errors 7000s).
What is a supervisory task extension? On some occasions, e.g., when the robot controller is controlled by external equipment in RS232C communication, the robot controller is required to operate independently to some extent.
The solution is to use a supervisory task. However, current supervisory tasks will terminate if Level 4 error or higher one occurs so that the communication will stop and the external equipment will no longer monitor the controller status.
To prevent it, the supervisory task extension limits termination to essential occasions only. If the extension is enabled, supervisory tasks will no longer terminate even if Level 4 error such as a servo error, operation error, or I/O error occurs. They will terminate only if a memory error (error 7000s) occurs.
If Level 5 error occurs, supervisory tasks will terminate as they have been.
The table below lists whether supervisory tasks will terminate or not if the following level errors occur.
Error code 7*** 6*** 5*** 4*** 3*** 2*** 1***Level 5 T T T T T
Level 4 T T/R T/R T/R T/R Error level
Level 3 or lower
R R R R R R R
T: Terminate. T/R: Keep running if the supervisory task extension is enabled. R: Keep running. /: Not applicable.
Page 224
General Introduction to Operation Modes and Additional Functions
Enabling the supervisory task extension The supervisory task extension is optionally provided. You need to enable the extension from the top screen of the teach pendant according to the steps given below.
(1) Call up the System Extension window. Access: [F6 Set]—[F7 Options.]—[F8 Extnsion]
F5
(2) Press [F5 Input ID]. The numeric keypad will appear where you enter the necessary ID code--1111 for
conventional supervisory task or 1112 for supervisory task extension.
Page 225
(3) Press the OK button. Your selection will be saved.
(4) Reboot your robot controller to make the new setting go into effect.
Page 226
General Introduction to Operation Modes and Additional Functions
Modification of Processing Time Exclusively Occupied by Supervisory Tasks [RC7 Ver. 2.0 or later]
This new feature allows you to modify the processing time exclusively occupied by supervisory tasks in a processing cycle (8 ms) to be applied when the supervisory tasks and user tasks (PAC programs) run concurrently (multitasking).
With this feature, you can switch the priority levels between supervisory tasks and user tasks at the desired timing. This makes it possible to assign higher priority to processing of supervisory tasks during particular operation or vice versa.
What is the processing time exclusively occupied by supervisory tasks?
As shown below, the task processing cycle of the robot controller is 8 ms that is shared by supervisory tasks and user tasks.
When supervisory tasks and user tasks are running concurrently, the processing time exclusively occupied by supervisory tasks is 2 ms by default (because the supervisory tasks are given the highest priority "101" by default).
During the remaining 6 ms, user tasks have higher priority than supervisory tasks (because user tasks are given higher priority than supervisory tasks by default).
Processing Time Exclusively Occupied by Supervisory Tasks in the Processing Cycle (by default)
Page 227
Choice of processing time periods to be exclusively occupied by supervisory tasks
You can make a choice from the following five processing time periods: 0 ms, 2 ms, 4 ms, 6 ms and 8 ms in an 8 ms task processing cycle
Example: If you select "4 ms," the execution time required for supervisory tasks will be shorter and that for user tasks, longer than ones required by default (2 ms).
Note: If you select "0 ms," supervisory tasks will be processed only when no user tasks are being processed. If there is no free time, no supervisory tasks will be able to be processed.
Note: If you select "8 ms," no user tasks can be processed when any supervisory task is being processed. To process user tasks, you need to insert a process of DELAY or WAIT for getting an arm semaphore in the supervisory tasks.
Modifying the processing time exclusively occupied by supervisory tasks
You can modify the processing time to be exclusively occupied by supervisory tasks in PAC programs or with the teach pendant.
This modification can be made even if any supervisory task is executing and it will immediately take effect.
From the teach pendant
(1) Call up the processing time window (Occupation time setting). Access: [F8 S-TASK]—[F10 Occupy] (2) Select the desired processing time and press [OK].
In PAC programs
Use the SETOCCUPATIONTIME command. Refer to the PROGRAMMER’S MANUAL I.
Syntax SETOCCUPATIONTIME <Processing time>
Coding example SETOCCUPATIONTIME 4 'Set 4 ms/8 ms
Page 228
General Introduction to Operation Modes and Additional Functions
Supervisory Task Start Mode [RC7 Ver. 2.2 or later] In system software versions earlier than 2.2, any of the following events activates allsupervisory tasks in the robot controller.(1) Turning the controller power on (2) Switching the operation mode from Manual to Auto mode (3) Pressing [F8 S-TASK]–[F1 START] The supervisory task start mode newly added in version 2.2 or later provides the following three choices: "Start all supervisory tasks," "Start supervisory tasks in a root," and "Do not start supervisory tasks."
Access: [F8 S-TASK]—[F2 Setting]
The Supervisory Task Start Mode window appears.
Start S-TASKs in a route: Selecting this starts only supervisory tasks in the current route when any of the above three events occurs.
S-TASKs is not started: Selecting this starts no supervisory tasks when any of the above three events occurs.
Note: Independent of the current setting of the supervisory task start mode, supervisory tasks can start by selecting them on the Program List or by using a RUN command.
Page 229
Multitasking Control Statements
Supervisory Task
INIT [Version 1.7 or later] Arm Semaphore
Turns on motors, carrier out CAL, and sets the speed according to the preset supervisory task parameters.
Syntax INIT [,<INIT option>]
Description (1) If the supervisory task is disabled ("Not Use Supervisor TASK" parameter is selected), then the INIT command causes no operation.
(2) If the supervisory task is enabled ("Use Supervisor TASK" parameter is selected), then the INIT command causes the following:
When the INIT run mode is set to "without motor on and CAL":
If the INIT speed has been set to 10 or 100, this command sets the external speed of the robot controller to 10 or 100, respectively.
When the INIT run mode is set to "with motor on and CAL":
If the INIT speed has been set to 10 or 100, this command sets the external speed of the robot controller to 10 or 100, respectively, turns motors on and carries out CAL.
(3) If <INIT option> is "RESULT=variable," the supervisory task does not stop even if an internal error occurs during the execution of the INIT statement. It stores the error code in the variable specified by RESULT. [Ver. 2.6 or later]
Example'!TITLE "Initialization" PROGRAM TSR1 INTN, RESULT=l1 'Turn motors on, execute CAL, and set the speed. 'If INIT fails, store the error code in variable I1 'and proceed to the next line. END
Notes (1) Do not concurrently run robot operation programs and task programs which run only the INIT command in an infinite loop.
(2) During execution of an INIT command, the status display of running programs may show "On standby." Be careful with restart of those programs.
(3) Do not run INIT commands simultaneously in more than one supervisory task.
Page 230
SETOCCUPATIONTIME (Statement)[RC7 Version 2.0 or later]
Arm Semaphore
Reconfigures the processing time to be exclusively occupied by supervisory tasks.
Syntax SETOCCUPATIONTIME <ProcessingTime>
Description When the supervisory task mode is enabled, SETOCCUPATIONTIME reconfigures the processing time to be exclusively occupied by supervisory tasks to <Processing time>.
<Processing time> 0, 2, 4, 6 or 8 0: 0 ms/8 ms
2: 2 ms/8 ms 4: 4 ms/8 ms 6: 6 ms/8 ms 8: 8 ms/8 ms
This statement can be placed in the execution of supervisory tasks. It immediately takes effect. If it is disabled, this statement produces nothing.
Example The following coding example contains three programs--supervisory task TSR1 and user programs PRO1 and PRO2. In ordinary operations, PRO1 and PRO2 are given higher priority during 6 ms, but in robot motions TSR1 is given higher priority during 4 ms even it sacrifices execution of PRO2 to some degree.
PROGRAM TSR1 'Supervisory task TSR1 checks the robot motion range.
END
PROGRAM PRO1 TAKEARM SETOCCUPATIONTIME 4 'Set 4 ms for supervisory tasks. MOVE P,P0 'Move the robot. SETOCCUPATIONTIME 2 'Restore the processing time to be 'occupied by supervisory tasks to the 'default (2 ms). END PROGRAM PRO2 DO WHILE 1 LOOP END
Notes If you select "0 ms," supervisory tasks will be processed only when no user tasks are being processed. If there is no free time, no supervisory tasks will be able to be processed.
If you select "8 ms," no user tasks can be processed when any supervisory task is being processed. To process user tasks, you need to insert a process of DELAY or WAIT for getting an arm semaphore in the supervisory tasks.
Page 231
Multitasking Control Statements
INITWAITERR (Statement) [RC7 Version 2.2 or later]
Arm Semaphore
Initializes the storage of errors detected by WAITERROR. (Exclusive to supervisory tasks)
Syntax INITWAITERR
Description This statement clears errors that have been detected by WAITERROR. It should precede WAITERROR and CURERRSTATUS functions.
If the error storage is not cleared with this statement, the WAITERROR or CURERRSTATUS function may not detect errors normally.
Related Terms WAITERROR, CURERRSTATUS
Example PROGRAM TSR1
INITWAITERR 'Initialize WAITERROR data.
WHILE 1 'Start of loop
I1 = WAITERROR 'Detect an occurrence of error. I2 = CURERRSTATUS 'Get current error status.
WEND 'End of loop
END
Page 232
WAITERROR (Statement)[RC7 Version 2.2 or later]
Arm Semaphore
Detects errors. (Exclusive to supervisory tasks)
Syntax WAITERROR
Description This function waits for an error to occur in the robot controller and returns its error code.
It detects up to recent 32 errors in the order of occurrences.
If not preceded by the INITWAITERR statement to clear the error storage, this function may not detect errors normally.
Related Terms INITWAITERR, CURERRSTATUS
Example PROGRAM TSR1
INITWAITERR 'Initialize WAITERROR data.
WHILE 1 'Start of loop
I1 = WAITERROR 'Detect an occurrence of error. I2 = CURERRSTATUS 'Get current error status.
WEND 'End of loop
END
Page 233
Multitasking Control Statements
CURERRSTATUS (Statement)[RC7 Version 2.2 or later]
Arm Semaphore
Returns the current error status. (Exclusive to supervisory tasks)
Syntax CURERRSTATUS
Description This function returns whether an error is currently occurring (1) or not (0).
Related Terms INITWAITERR, WAITERROR
Example PROGRAM TSR1
INITWAITERR 'Initialize WAITERROR data.
WHILE 1 'Start of loop
I1 = WAITERROR 'Detect an occurrence of error. I2 = CURERRSTATUS 'Get current error status.
WEND 'End of loop
END
Page 234
Denso Robotics
Section 11
New functions on RC7M
Page 235
9
SetHighPathAccuracy / ResetHighPathAccuracy
(Library) [Ver. 2.61 or later]
Function
Enable (or disable) the high-accuracy path control that improves the accuracy of the robot motion path in CP motions (linear, arc, and free-curve).
Syntax
SetHighPathAccuracy ResetHighPathAccuracy
Description
(1) This function improves the accuracy of the robot motion path.
(2) This function becomes enabled for a motion command immediately following SetHighPathAccuracy and canceled with ResetHighPathAccuracy.
Macro Definition
Requires a <pacman.h> file.
Example
PROGRAM PRO1
TAKEARM 'Obtain the control priority of the arm group.
MOVE P, @E P1 'Move to P1 in the PTP motion.
CALL SetHighPathAccuracy 'Enable the high-accuracy path control.
MOVE S, 5 'Move the robot arm along path #5
'in free-curve motion under high-accuracy
'path control.
CALL ResetHighPathAccuracy 'Disable the high-accuracy path control.
MOVE P, @0 P5 'Move from P4 to P5 in the PTP motion.
END 'End the program.
Notes
(1) This control should be enabled only for motions requiring high-accuracy path.
(2) Depending on motions or load conditions, some robot motions involve vibration. If it happens, lower the speed or acceleration or disable this control.
(3) Turning the controller or motor power OFF disables this control.
(4) This control does not apply to the extended joints (7th- and 8th-axis).
(5) This control cannot be enabled when the compliance control is enabled. Trying to do so causes an error.
(6) This control cannot be enabled when a motion such as a pass motion is in progress.
(7) The master control parameters (e.g., mass of payload and payload center of gravity) should be accurately specified. Failure to do so may hinder this control.
Page 236
9
SetSingularAvoid (Library) [Ver. 2.61 or later]
Function
Enable or disable the singular point avoiding function. (for 6-axis robots)
Format
SetSingularAvoid(<ON OFF>)
Description
If <ON OFF> is 1, the singular point avoiding function becomes enabled; if it is 0, the function becomes disabled. Enabling the function suppresses a large 4-axis rotation that is caused when the 5 axis passes through the vicinity of 0 degree in linear, arc or free-curve motion under CP interpolation control.
Macro Definition
Requires a <pacman.h> file.
Example
PROGRAM PRO1
TakeArm 'Obtain the control priority.
MOVE P, P1 'Move to P1 in PTP motion.
CALL SetSingularAvoid (1) 'Enable singular point avoiding function.
MOVE L, P2 'Move to P2 under linear interpolation
'control.
CALL SetSingularAvoid (0) 'Disable singular point avoiding function.
:
:
END
Notes
(1) This function does not take effect in 4- and 5-axis robots.
(2) This function does not take effect under PTP interpolation control.
(3) When this function is enabled, the robot arm may greatly go out of the original path depending on the motion conditions.
Page 237
9
SetCollisionJnt [Ver. 2.61 or later]
Function
Enable the collision detection for the specified joint.
Format
SetCollisionJnt(<joint#>)
Description
This library enables the collision detection for the joint specified by <joint#>.
Macro Definition
Requires file <pacman.h>
Related Terms
ResetCollisionJnt
Notes
(1) <joint#> should be a robot joint number. If it is a joint other than robot ones, the error message "Excess in effective joint value range" ("Specified joint out of range") appears.
(2) This library cannot be executed when the compliance control is enabled.
Example
TAKEARM 'Get robot control priority
CALL SetCollisionJnt(2) 'Enable collision detection for joint 2
MOVE P, P1, P2 'With collision detection enabled, move
'from point P1 to P2 in PTP motion
CALL ResetCollisionJnt(2) 'Disable collision detection for joint 2
MOVE P, P2, P3 'With collision detection disabled, move
'from point P2 to P3 in PTP motion
Page 238
9
ResetCollisionJnt [Ver. 2.61 or later]
Function
Disable the collision detection for the specified joint.
Format
SetCollisionJnt(<joint#>)
Description
This library disables the collision detection for the joint specified by <joint#>.
Macro Definition
Requires file <pacman.h>
Related Terms
SetCollisionJnt
Notes
(1) <joint#> should be a robot joint number. If it is a joint other than robot ones, the error message "Excess in effective joint value range" ("Specified joint out of range") appears.
Example
TAKEARM 'Get robot control priority
CALL SetCollisionJnt(2) 'Enable collision detection for joint 2
MOVE P, P1, P2 'With collision detection enabled, move
'from point P1 to P2 in PTP motion
CALL ResetCollisionJnt(2)'Disable collision detection for joint 2
MOVE P, P2, P3 'With collision detection disabled, move
'from point P2 to P3 in PTP motion
Page 239
9
GetCollisionForce [Ver. 2.61 or later]
Function
Get the maximum external force.
Syntax
GetCollisionForce(<joint variable>)
Description
This library assigns the maximum external force detected to a joint variable specified by <joint variable>.
Related Terms
ClearCollisionForce
Notes
(1) The maximum external force can be calculated only for joints whose collision detection is enabled when the corresponding motors are ON, in each of Manual and Auto modes.
(2) In Auto mode, this library assigns the maximum external force calculated in Auto mode; in Manual or Teach check mode, it assigns the one calculated in Manual mode.
Example
TAKEARM 'Get robot control priority
CALL ClearCollisionForce 'Initialize maximum external force
stored
CALL SetCollisionJnt(2) 'Enable collision detection for joint 2
MOVE P, P1, P2 'Move from point P1 to P2 in PTP motion
CALL GetCollisionForce(J1) 'Assign maximum external force
calculated
'during move from P1 to P2 to variable J1
CALL ClearCollisionForce 'Initialize maximum external force
stored
MOVE P, P2, P3 'Move from point P2 to P3 in PTP motion
CALL GetCollisionForce(J2) 'Assign maximum external force
calculated
'during move from P2 to P3 to variable J2
Page 240
1
ClearCollisionForce [Ver. 2.61 or later]
Function
Clear the maximum external force.
Syntax
ClearCollisionForce
Description
This library initializes the maximum external force stored in a joint variable to "0" (default).
Related Terms
GetCollisionForce
Notes
(1) This library initializes the maximum external forces calculated both in Manual and Auto modes.
Example
TAKEARM 'Get robot control priority
CALL SetCollisionJnt(2) 'Enable collision detection for joint 2
MOVE P, P1, P2 'Move from point P1 to P2 in PTP motion
CALL ClearCollisionForce 'Initialize maximum external force
stored
MOVE P, P2, P3 'Move from point P2 to P3 in PTP motion
CALL GetCollisionForce(J2) 'Assign maximum external force
calculated
'during move from P2 to P3 to variable J2
Page 241
1
SetCollisionLevel [Ver. 2.61 or later]
Function
Specify the collision detection sensitivity level for the specified joint.
Syntax
SetCollisionLevel(<joint#, level>)
Description
This library defines the collision detection sensitivity level specified by <level>for the joint specified by <joint#>. The typical detection sensitivity level is 100. Decreasing the level increases the collision detection sensitivity; increasing it decreases the sensitivity.
Macro Definition
Requires file <pacman.h>
Related Terms
SetCollisionJnt, ResetCollisionJnt
Notes
(1) <joint#> should be a robot joint number. If it is a joint other than robot ones, the error message "Excess in effective joint value range" ("Specified joint out of range") appears.
(2) This library cannot be executed when the compliance control is enabled.
(3) If the robot detects a false collision, increase the detection sensitivity level to decrease the detection sensitivity.
Example
TAKEARM 'Get robot control priority
CALL SetCollisionJnt(3) 'Enable collision detection for joint
3
CALL SetCollisionLevel(3,80) 'Set collision detection sensitivity
'level for joint 3 to 80
MOVE P, P1, P2 'With higher detection sensitivity for
'joint 3, move from point P1 to P2 in
PTP motion
CALL SetCollisionLevel(3,120) 'Set collision detection sensitivity
'level for joint 3 to 120
MOVE P, P2, P3 'With lower detection sensitivity for
'joint 3, move from point P2 to P3 in
PTP motion
Page 242
1
SetExtForceDetect [Ver. 2.61 or later]
Function
Enable/disable detection of external force.
Syntax
SetExtForceDetect(<value>)
Description
This library enables or disables detection of external force if <value> is "1" (default) or "0," respectively.
Macro Definition
Requires file <pacman.h>
Related Terms
SetCollisionJnt, GetCollisionForce
Notes
(1) <value> should be "0" or "1." Any other value results in an error.
(2) The default of <value> is "1" (Enable). Even if <value> is set to "0" (Disable), it will revert to "1" by switching between Manual and Auto modes or by restarting the robot controller.
(3) Unlike SetCollisionJoint or ResetCollisionJoint, this library does not enable or disable collision detection. Disabling detection of external force with this library does not update maximum external forces stored even if the robot detects greater external force than the one stored. Use this library when checking the maximum external force in a particular zone.
Example
TAKEARM 'Get robot control priority
CALL SetExtForceDetect(0) 'Disable detection of external forces
CALL ClearCollisionForce 'Initialize the maximum external force
CALL SetCollisionJnt(3) 'Enable collision detection for joint 3
MOVE P, P1, P2 'Move from point P1 to P2 in PTP motion
CALL SetExtForceDetect(1) 'Enable detection of external forces
MOVE P, P2, P3 'Move from point P2 to P3 in PTP motion
CALL GetCollisionForce(J2) 'Assign maximum external force
calculated
'during move from P2 to P3 to variable J2
Page 243