04/99 Program Generation
Getting Started with C7-621-AS-i 27
In the SIMATIC Manager go to your offline project and insert another
function
in the
Blocks
folder. Give it the internal ID
FC2
, select
STL
again as the generation language, and open the block.
Insert the following program lines in the individual networks:
FC2 : Eject conditions
Network 1 : Count
A DB1.DBX1.0 // Position switch
A DB1.DBX4.0 // Belt ON
A DB1.DBX0.1 // Inductive Bero
FP M30.0 // Rising edge
CV C1 // Count forward
L C1 // Transfer count to MW 22
TMW22
AN C1 // Count = 0
A DB1.DBX4.0 // Belt ON
L C#0 // Write preset count
S C1 // Initialize counter
L MW22 // If the value in MW 22 is greater than
L 10 // the maximum value set, the counter
>I
R C1 // is reset
Network 2 : Parcel sequence
A DB1.DBX4.0 // Belt_ON
A DB1.DBX0.0 // Opto_Bero: parcel
FN M30.1 // Edge formation
L S5T#10S // Parcel interval at least 10 seconds
SE T5 // Pulse extension
A T5 // Parcel interval too small
A DB1.DBX0.0 // Opto_Bero: parcel
FP M30.2 // Edge formation
S M21.1 // Fault in parcel sequence
Network 3 : Display: parcel detected
A DB1.DBX4.0 // Belt ON
A DB1.DBX0.0 // Opto_Bero
= DB1.DBX6.2 // Lamp: parcel detected
= M21.3 // Message flag (required later)
Network 4 : Stop-monitoring
A DB1.DBX4.0 // Belt_ON
A DB1.DBX1.0 // Parcel at end of belt
L S5T#5S // Monitoring time 5 seconds
SD T3 // ON delay
AT3
S M21.2 // Fault in parcel stop
Network 5 : Faults
O M21.1 // Fault_parcel sequence
O M21.2 // Fault_parcel stop
= M16.0 // Fault
A M16.0 // Fault
A M10.4 // Flashing frequency
= DB1.DBX6.1 // Red lamp on casing
A DB1.DBX2.1 // Acknowledgment button
R M21.1 // Fault_parcel sequence
R M21.2 // Fault_parcel stop