Technical data
Appendix
27.6 Sample Programs
Programming with STEP 7
656 Manual, 05/2010, A5E02789666-01
27.6.3.2 FC12
Declaration Section
The following temporary local variables are declared in the declaration section of FC12:
Variable Name Data Type Declaration Comment
IN_TIME TIME_OF_DAY TEMP Start time
IN_DATE DATE TEMP Start date
OUT_TIME_DATE DATE_AND_TIME TEMP Start date/time converted
OK_MEMORY BOOL TEMP Enable for setting time-of-day interrupt
STL Code Section
Enter the following STL user program in the code section of FC12:
STL (FC12) Explanation
Network 1
CALL SFC 31
OB_NO := 10
RET_VAL:= MW 208
STATUS := MW 16
Network 2:
AN Q 4.0
JC mond
L D#1995-1-27
T #IN_DATE
L TOD#20:0:0.0
T #IN_TIME
JU cnvt
mond: L D#1995-1-23
T #IN_DATE
L TOD#5:0:0.0
T #IN_TIME
cnvt: NOP 0
SFC QRY_TINT
Query STATUS of time-of-day interrupts
Specify start time dependent on Q 4.0 (in variable
#IN_DATE and #IN_TIME)
Start date is a Friday
Start date is a Monday