Cyclic Calling Of Fc 45 (E.g. In Ob 1) - Siemens SIMATIC FC 45 Function Manual

Sensors
Table of Contents

Advertisement

6.3

Cyclic calling of FC 45 (e.g. in OB 1)

6.3
The following program is an example of how to call and scan FC 45 in an application. The
definition of the data structure is described in Section "Data structure definition". The
parameter settings for the MOBY command were set up during the definition of the "MOBY
DB".
Block: OB1 cycle execution
Network: 1
memory bit 1.0 is set: Start MOBY command for 1st SLG
memory bit 1.1 is set: Start MOBY command for 2nd SLG
memory bit 1.2 is set: Start init_run for 1st SLG
memory bit 1.3 is set: Start init_run for 2nd SLG
memory byte 2: OB1 used as edge triggered memory
x01:
x02:
FC 45
Function manual, Release 03/2006 , J31069-D0167-U001-A2-7618
call FC45
CALL "MOBY FC"
Params_DB :=45
Params_ADDR :=0
CALL "MOBY FC"
Params_DB :=45
Params_ADDR :=300
A M 1.2
FP M 2.2
S "MOBY DB".SLG[1].init_run
SPB x01
UN "MOBY DB".SLG[1].ready
SPB x01
U "MOBY DB".SLG[1].error
SPB x01
A M 1.0
FP M 2.0
S
"MOBY DB".SLG[1].command_start
A M 1.3
FP M 2.3
S "MOBY DB".SLG[2].init_run
SPB x02
UN "MOBY DB".SLG[2].ready
SP B x02
U "MOBY DB".SLG[2].error
SPB x02
U M 1.1
FP M 2.1
S
"MOBY DB".SLG[2].command_start
NOP 0
Examples/applications
6.3 Cyclic calling of FC 45 (e.g. in OB 1)
// Call FC 45 for each SLG in
each cycle
// memory bit init_run for
1st SLG
// memory bit command_start
for 1st SLG
// memory bit init_run for
2nd SLG
// memory bit command_start
for 2nd SLG
6-7

Advertisement

Table of Contents
loading

Table of Contents