18-14
18-7. Sample program of TW seek
Flow of the program:
1. A handling robot clamps a work and transfers the work to
above the work inserting hole.
2. Then the robot stops and rotates the TW axis.
3. While rotating the TW axis, the sensor detect the
work-and-hole matching position and send the detect
signal to the robot.
4. After receiving the detect signal, the robot stops the TW
axis rotation and then insert the work into the hole.
[Structure of the program]
Program name Contents
TWTEST.prg
Main program. No mechanism.
TWTEST1.prg
Transfer the work to the loading point.
Rotate the TW axis.
TWTEST2.prg
Move back to the shunting point.
TWTEST3.prg
Insert the work.
Sensor
TWTEST.prg (main program)
Program Description
[C] PARACALL TWTEST1.prg ON
Transfer the work to above the inserting position.
Parallel processing of the TW axis rotation.
WAIT_IP i1#(40:I1#040) ON T=0.00 s
Wait for input signal from the sensor.
Go on to the next step when the signal is received.
[C] PARACALL TWTEST1.prg OFF End the program to rotate the TW axis.
DELAY 0.50 s
[C] CALL TWTEST3.prg Execute the work insertion program.
[C] CALL TWTEST2.prg Execute the program to move to the shunting point.
TWTEST1.prg (TW rotation)
Program Description
TOOL = 1:TOOL01
●
MOVEL P1 3.00 m/min
●
MOVEP P2 3.00 m/min Work inserting point.
OUT o1#(40:o1#040) = ON Notify the sensor to start sensing.
●
MOVEP P3 25.00 % Rotate TW axis
●
MOVEP P4 25.00 % Rotate TW axis
HOLD NoSignal Error due to no signal from the sensor.
TWTEST3.prg (Work insertion)
Program Description
TOOL = 1:TOOL01
GETPOS P#(P1) Get the current position and orientation to “P1”.
CNVSET LR#(1:LR001) = P.Z#(P1)
ADD LR#(1:LR001) -100.00
CNVSET P.Z#(P1) = LR#(1:LR001)
Add “-100” to the Z direction value of “P1”.
●
MOVEL P1 1.00 m/min Move to the new P1 position.
OUT o1#(39:o1#039) = ON Release the work.
DELAY 3.0s Wait for time.
CNVSET LR#(1:LR001) = P.Z#(P1)
ADD LR#(1:LR001) 100.00
CNVSET P.Z#(P1) = LR#(1:LR001)
●
MOVEL P1 1.00 m/min
TWTEST3.prg (Move to the shunting point)
Program Description
TOOL = 1:TOOL01
●
MOVEL P1 3.00 m/min Move to the shunting point.