Detailed description
2.12 Block descriptions
Basic logic functions: PLC Basic program powerline (P3 pl)
Function Manual, 11/2006, 6FC5397-0BP10-2BA0
149
Call example
Program selection in channel 1 (main program and workpiece program)
Entry of PI for DB 16 and STR for DB 124 with the S7 SYMBOL editor:
Parameterization
Symbol Operand Data type
PI DB 16 DB 16
STR DB 124 DB 124
DATA_BLOCK DB 126
//Unassigned user DB, as instance for FB 4
FB 4
BEGIN
END_DATA_BLOCK
DATA_BLOCK DB 124
struct
PName: string[32]:= '_N_TEST_MPF
';
Path: string[32]:=
'/_N_MPF_DIR/';
//Main program
PName_WST: string[32]:= '_N_ABC_MPF';
Path_WST: string[32]:=
'/_N_WKS_DIR/_N_ZYL_WPD';
//Workpiece program
end_struct
BEGIN
END_DATA_BLOCK
Function FC "PICall" : VOID
U I 7.7; //Unassigned machine control panel key
S M 0.0; //Activate req.
U M 1.1; //Done completed message
R M 0.0; //Terminate job
U I 7.6; //Manual error acknowledgment
U M 1.0; //Error pending
R M 0.0; //Terminate job
CALL FB 4, DB 126 (
Req := M0.0,
PIService := PI.SELECT,
Unit := 1, // CHAN 1
Addr1 := STR.Path,
Addr2 := STR.PName, //Main-program selection
//Addr1:=STR.Path_WST,
//Addr2:=STR.PName_WST, //Workpiece-program
selection
FMNCNo := 1, //(in FMNC only)
Error := M1.0,
Done := M1.1,
State := MW2);