6-6
Primer: S7-300 Programmable Controller, Quick Start
C79000-G7076-C500-01
You do not need to fill in the
variable declaration table since the
FC1 used in the TLIGHT sample
program does not contain any
local variables!
In the code section, you enter the program for your block as STL statements
or as LAD and FBD elements in networks. The incremental STL, LAD, and
FBD editor executes a syntax check immediately after each statement or
element is entered and displays any errors in red italics. Any such syntax
errors must be corrected before saving the block.
In the TLIGHT sample program, the code section consists of several
networks, which in turn contain a list of statements or a circuit.
In the code section of a block, you can edit the block title, block comments,
network title, network comments, and STL statements or LAD/FBD elements
within individual networks, as shown in Figure 6-2:
FC1
I 0.0
I 0.1
M 0.0T 6 T 5
FC1: TLIGHT sample program
Control of traffic lights at a pedestrian crossing
Network 1: Detecting green request for pedestrians
Determine if I 0.0 or I 0.1 are set.
Network 2: green phase for vehicle traffic
If I 0.0 and I 0.1 are not set, green is free to be assigned to vehicles.
Block title
Block comments
Network title
Network comments
LAD elements
M 0.0
M 0.0 Q 0.7
Figure 6-2 Structure of the Code Section for a LAD Block
Variable
Declaration Table
Code Section
Components of the
Code Section
Programming Logic Blocks with STEP 7