Beruflich Dokumente
Kultur Dokumente
Structured programming
1.1
Objectives for
consistent
programming
methodology
1.2
5 / 115
Robot Programming 2
DEF PALLETIZE()
;*****************************************************
;*This program palletizes 16 cubes on the table*
;*Author: I. M. Sample--------------------------------*
;*Date created: 09.08.2011---------------------------*
;*****************************************************
INI
...
;------------Calculation of positions----------------...
;------------Palletizing of the 16 cubes-------------...
;----------Depalletizing of the 16 cubes-------------...
END
Commenting out:
DEF Palletize()
INI
PICK_CUBE()
;CUBE_TO_TABLE()
CUBE_TO_MAGAZINE()
END
6 / 115
1 Structured programming
What examples
are there for the
use of folds?
DEF Main()
...
INI
SET_EA
SET_EA
Memory savings
7 / 115
Robot Programming 2
Using subprograms
DEF MAIN()
INI
LOOP
GET_PEN()
PAINT_PATH()
PEN_BACK()
GET_PLATE()
GLUE_PLATE()
PLATE_BACK()
IF $IN[1] THEN
EXIT
ENDIF
ENDLOOP
END
What is achieved
by indenting
command lines?
What is achieved
by the meaningful
identification of
data names?
1.3
DEF INSERT()
INT PART, COUNTER
INI
PTP HOME Vel=100% DEFAULT
LOOP
FOR COUNTER = 1 TO 20
PART = PART+1
;Inline forms cannot be indented!!!
PTP P1 CONT Vel=100% TOOL[2]:Gripper BASE[2]:Table
PTP XP5
ENDFOR
...
ENDLOOP
Point names
What is a
program
flowchart?
Program
flowchart
symbols
Fig. 1-1
Linking of statements and operations
8 / 115
1 Structured programming
Fig. 1-2
Branch
Fig. 1-3
General statements in the program code
Fig. 1-4
Subprogram call
Fig. 1-5
Input/output statement
Fig. 1-6
9 / 115
Robot Programming 2
Program
flowchart
example
Fig. 1-7
Creating a
program
flowchart
10 / 115