Sunteți pe pagina 1din 13

Contents

Point-to-Point (PTP)..................................................................................................... 2
Positions in Cartesian Coordinates (POS)....................................................................3
EXT Function............................................................................................................... 4
Interrupt..................................................................................................................... 5
Declaring Interrupts................................................................................................ 5
Activating Interrupts................................................................................................ 5
Brake.......................................................................................................................... 7
Loops.......................................................................................................................... 8
FOR Loop................................................................................................................. 8
WHILE Loop............................................................................................................. 8
REPEAT Loop............................................................................................................ 8
ENDLESS / INFINITE Loop......................................................................................... 9
Continue................................................................................................................... 10
Logic Commands...................................................................................................... 11

Point-to-Point (PTP)
Reference: Expert programming, p.58
DEF PTP_AXIS() ;the name of the program is PTP_AXIS
$VEL_AXIS[1]=100 ;definition of the axis velocities
$VEL_AXIS[2]=100
$VEL_AXIS[3]=100
$VEL_AXIS[4]=100
$VEL_AXIS[5]=100
$VEL_AXIS[6]=100
$ACC_AXIS[1]=100 ;definition of the axis accelerations
$ACC_AXIS[2]=100
$ACC_AXIS[3]=100
$ACC_AXIS[4]=100
$ACC_AXIS[5]=100
$ACC_AXIS[6]=100
PTP {AXIS: A1 0,A2 -90,A3 90,A4 0,A5 0,A6 0}
END
Changing one axis only
PTP {A3 45}
Robot position its axis in absolute values
Using relative motion
PTP_REL {A1 35, A4, 35}
Robot moves in relative motion (note that it is difficult for the robot to get the
correct position if relative type of motion is used)

Positions in Cartesian Coordinates (POS)


DEF PTP_POS()
$BASE = $WORLD ;setting of the base coordinate system
$TOOL = $NULLFRAME ;setting of the tool coordinate system
; ($NULLFRAME = {FRAME: X 0, Y 0, Z 0, A 0, B 0, C 0})
$VEL_AXIS[X]=100 ;definition of the axis velocities
$VEL_AXIS[2]=100
$VEL_AXIS[3]=100
$VEL_AXIS[4]=100
$VEL_AXIS[5]=100
$VEL_AXIS[6]=100
$ACC_AXIS[1]=100 ;definition of the axis accelerations
$ACC_AXIS[2]=100
$ACC_AXIS[3]=100
$ACC_AXIS[4]=100
$ACC_AXIS[5]=100
$ACC_AXIS[6]=100
PTP {POS:X 1025,Y 0,Z 1480,A 0,B 90,C 0,S B 010,T B 000010}
END
Similarly,
PTP {Z 1300, B 180}

PTP_REL {Z 180, B -90}

Modification of base:
$BASE = {X 100,Y -200,Z 1000,A 0, B 180,C 45)

Analgoues

Linear Motion (LIN)

EXT Function

Interrupt
Reference: Expert Programming, p.125

Declaring Interrupts

Description: Halts robot from current process, and resumes where it left off.
General Notes:
IR_STOPM.SRC = predefined emergency stop program
This is an instruction and not a declaration. Therefore it must not be included
in the declaration section
Interrupts in subprograms are not recognized. See GLOBAL INTERRUPT
Up to 32 interrupts may be declared
Interrupt:
INTERRUPT DECL <Priority No.> WHEN <Event> DO <Subprograms>
INTERRUPT DELC 4 WHEN $IN[3] == TRUE DO SP1()
Priority No.: 1 39, 81-128 (40-80 reserved)
1 highest priority
128 lowest priority
Event bool: bool constant, variable
Subprogram: to be executed when the event conditions are satisfied.
Global Interrupt:
GLOBAL INTERRUPT DECL <Priority> WHEN <Event> DO <Subprograms>
GLOBAL INTERRUPT DECL 4 WHEN $IN[3] DO SP(1)
Remains valid, even at different subprograms

Activating Interrupts
Switching on/off Interrupt
INTERRUPT ON <Priority No.>
INTERRUPT OFF <Priority No.>
INTERRUPT ON 4
INTERRUPT OFF 4
When interrupt is initially declared, it is switched off
Using a priority number switches on/off the corresponding priority
Switching on/off all interrupts
INTERRUPT ON
INTERRUPT OFF
Switches on all interrupts
Only 16 interrupts at a time can be switched on
Disable/enabling one/all interrupts
DISABLE 4
ENABLE 4
DISABLE
ENABLE
Protects certain sections of the program before being interrupted

Brake
Reference: Expert Programming, p.131
Description: Stops robot from current motion in the event of an interrupt
General Notes:
Can only be used in an interrupt, otherwise it would result in an error.
BRAKE
BRAKE F
BRAKE F = shorter braking distance
Robot will continue where it left off in the interrupted program

Loops
Reference: Expert programming, p. 95

FOR Loop
FOR <Counter> = <Start> TO <End> STEP <Increment>
INSTRUCTIONS
ENDFOR
FOR I = 1 TO 6 ; STEP = 1 by default
$VEL_AXIS[I] = 100
ENDFOR
FOR I=1 TO 9 STEP 2
FOR J=6 TO 1 STEP -1
ARRAY[I,J] = I*2 + J*J
ARRAY[I+1,J] = I*2 + I*J
ENDFOR
ENDFOR

WHILE Loop
Runs only of the condition is fulfilled
WHILE <Execution Condition>
INSTRUCTIONS
ENDWHILE
WHILE $IN[$] == TRUE
PTP PALLET
$OUT[2] = TRUE
PTP POS_2
$OUT[2] = FALSE
PTP HOME
ENDWHILE

REPEAT Loop

Runs at least once


REPEAT
INSTRUCTIONS
UNTIL <Termination Condition>
REPEAT
PTP PALLET
$OUT[2] = TRUE
PTP POS_2
$OUT[2] = FALSE
PTP HOME

UNTIL $IN[4] == TRUE

ENDLESS / INFINITE Loop


LOOP
Instructions
ENDLOOP
DEF EXIT_PRO()
PTP HOME
LOOP
Instructions
IF $IN[1] = TRUE THEN
EXIT ;
ENDIF
ENDLOOP
PTP HOME
END

Continue
Expert programming, p. 81

To prevent advance run stop, the command CONTINUE should be used


immediately before the relevant instruction.
The command is limited to the next line only, if the line is empty

Logic Commands
AND, OR, NOT

Wait
Expert programming, p. 99

WAIT For

Stops program execution until the event specified by the condition arises
WAIT FOR <Condition>
WAIT FOR $IN[5] ; wait until input output 5 is true
WAIT FOR $OUT[5] == FALSE ; wait until input output 5 is false
Can also be applied to
$IN[], $OUT[], $CYCFLAG[], $TIMER_FLAG[], $FLAG[]

WAIT SEC
WAIT SEC <time>
WAIT SEC 17.542

; seconds

Trigger
Expert programming p.135
TRIGGER WHEN DISTANCE = <Switching point> DELAY = Time DO Instruction
<PRIO=Priority>

S-ar putea să vă placă și