Technical data

Appendix
27.6 Sample Programs
Programming with STEP 7
648 Manual, 05/2010, A5E02789666-01
27.6.2.5 Creating OB1
OB1 decides the structure of the sample program. OB1 also contains the parameters that are
transferred to the various functions, for example:
The STL networks for the feed pumps and the agitator motor supply the FB for the motor with
the input parameters for starting ("Start"), stopping ("Stop"), for the response ("Response"), and
for resetting the maintenance display ("Reset_Maint"). The FB for the motor is processed in
every cycle of the PLC.
If the FB for the motor is processed, the inputs Timer_No and Response_Time inform the
function of the timer being used and which time must be measured.
The FC for the valves and the FB for the motors are processed in every program cycle of the
programmable controller because they are called in OB1.
The program uses the FB for the motor with different instance DBs to handle the tasks for
controlling the feed pumps and the agitator motor.
Declaring Variables for OB1
The variable declaration table for OB1 is shown below. The first 20 bytes contain the start
information of OB1 and must not be modified.
Address Declaration Name Type
0.0 TEMP OB1_EV_CLASS BYTE
1.0 TEMP OB1_SCAN1 BYTE
2.0 TEMP OB1_PRIORITY BYTE
3.0 TEMP OB1_OB_NUMBR BYTE
4.0 TEMP OB1_RESERVED_1 BYTE
5.0 TEMP OB1_RESERVED_2 BYTE
6.0 TEMP OB1_PREV_CYCLE INT
8.0 TEMP OB1_MIN_CYCLE INT
10.0 TEMP OB1_MAX_CYCLE INT
12.0 TEMP OB1_DATE_TIME DATE_AND_TIME
20.0 TEMP Enable_motor BOOL
20.1 TEMP Enable_valve BOOL
20.2 TEMP Start_fulfilled BOOL
20.3 TEMP Stop_fulfilled BOOL
20.4 TEMP Inlet_valve_A_open BOOL
20.5 TEMP Inlet_valve_A_closed BOOL
20.6 TEMP Feed_valve_A_open BOOL
20.7 TEMP Feed_valve_A_closed BOOL
21.0 TEMP Inlet_valve_B_open BOOL
21.1 TEMP Inlet_valve_B_closed BOOL
21.2 TEMP Feed_valve_B_open BOOL
21.3 TEMP Feed_valve_B_closed BOOL
21.4 TEMP Open_drain BOOL
21.5 TEMP Close_drain BOOL
21.6 TEMP Valve_closed_fulfilled BOOL