DIN Program Structure
A program consists of a program number, a number of blocks, and the end of program. Beginning of program and end of program represent the minimum contents of a program. A program may contain any number of blocks. The only limitation to the program size is the total memory size available. In addition to the (optional) block number, a block consists of a statement. A statement contains the elements:
-
preparatory function G
-
auxiliary function M, S, T
-
high-speed outputs Q
-
parameter assignments
-
arithmetic instruction
-
comment
Points to remember:
-
Each element (G or M code) must be programmed only once in a block. High-speed outputs and parameter assignment are an exception.
-
A block must have max. 256 characters. A block may also contain comments.
-
Within a program, block numbers must be assigned in ascending order.
-
A comment must be at the end of the block or stands on its own in a block and is delimited by parenthesis or, in case of arithmetic instructions, by braces.
