Technical data

Appendix
27.6 Sample Programs
Programming with STEP 7
660 Manual, 05/2010, A5E02789666-01
27.6.3.4 OB1 and OB80
As the start event information of OB1 (OB for cyclic program) is not evaluated in this example, only
the start event information of OB80 is displayed.
OB1 Code Section
Enter the following STL user program in the code section of OB1:
STL (OB1) Explanation
CALL FC 12 Calls the function FC12
OB80 Declaration Section
In contrast to the default declaration section of OB80 the following temporary local variables are
declared:
Structure for the entire start event information (STARTINFO)
Within the STARTINFO structure a structure for the time (T_STMP)
Variable Name Data Type Declaration Comment
STARTINFO STRUCT TEMP Entire start event information of OB80
declared as structure
E_ID WORD TEMP Event ID:
PR_CLASS BYTE TEMP Priority class
OB_NO BYTE TEMP OB number
RESERVED_1 BYTE TEMP Reserved
RESERVED_2 BYTE TEMP Reserved
A1_INFO WORD TEMP Additional information about the event
that caused the error
A2_INFO DWORD TEMP Additional information about the event ID,
priority class, and OB no. of the error
T_STMP STRUCT TEMP Structure for time-of-day details
YEAR BYTE TEMP
MONTH BYTE TEMP
DAY BYTE TEMP
HOUR BYTE TEMP
MINUTES BYTE TEMP
SECONDS BYTE TEMP
MSEC_WDAY WORD TEMP
END_STRUCT TEMP
END_STRUCT TEMP