Technical data
Creating STL Source Files
13.7 Examples of STL Source Files
Programming with STEP 7
300 Manual, 05/2010, A5E02789666-01
ORGANIZATION_BLOCK OB1
TITLE = Example for OB1 with different block calls
//The 3 networks show block calls
//with and without parameters
{S7_pdiag := 'true'} //System attribute for blocks
AUTHOR Siemens
FAMILY Example
NAME Test_OB
VERSION 1.1
VAR_TEMP
Interim value : INT; // Buffer
END_VAR
BEGIN
NETWORK
TITLE = Function call transferring parameters
// Parameter transfer in one line
CALL FC1 (param1 :=I0.0,param2 :=I0.1);
NETWORK
TITLE = Function block call
// transferring parameters
// Parameter transfer in more than one line
CALL Traffic light control , DB6 ( // Name of FB, instance data block
dur_g_p := S5T#10S, // Assign actual values to parameters
del_r_p := S5T#30S,
starter := TRUE,
t_dur_y_car := T 2,
t_dur_g_ped := T 3,
t_delay_y_car := T 4,
t_dur_r_car := T 5,
t_next_red_car := T 6,
r_car := "re_main", // Quotation marks show symbolic
y_car := "ye_main", // names entered in symbol table
g_car := "gr_main",
r_ped := "re_int",
g_ped := "gr_int");
NETWORK
TITLE = Function block call
// transferring parameters
// Parameter transfer in one line
CALL FB10, DB100 (para1 :=I0.0,para2 :=I0.1);
END_ORGANIZATION_BLOCK