EMS Manual
Reporting Events
EMS Manual—426909-005
8-12
Task 4: Write the EMS Interface in Your Program
For specific information about how to define a subsystem ID, see the SPI
Programming Manual. For more information about DDL, see the Data Definition
Language (DDL) Reference Manual.
For an explanation on how a DDL dictionary (not a source file) is used to create
event templates and store other information for a subsystem, see Section 9,
Standard Events, Section 10, Generating Standard Events, and the DSM Template
Services Manual.
The DDL file must contain definitions for tokens that appear in event messages created
by your subsystem and, if your subsystem also supports a command-response
interface, for tokens in your command and response messages as well. For event
messages, for example, the DDL file would include definitions for these (and other)
items in addition to the subsystem ID:
Symbolic names representing the possible values of the ZEMS-TKN-
EVENTNUMBER token
Tokens that represent the possible subjects of the event messages
Tokens that contain information describing the event that occurred
Task 4: Write the EMS Interface in Your
Program
To implement the EMS interface that you have designed, include these steps in your
program:
1. Open an EMS collector process: either the primary collector ($0) or an alternate
collector.
2. Build an event message for each type of event your subsystem reports.
3. Send the event messages to the collector.
4. Close the collector.
Example: Writing an EMS Interface Into a Program
This example shows how to use these four steps to implement the EMS interface to
your program.
Step 1: Open an EMS Collector
To open an EMS collector process, use the OPEN procedure, passing either $0 or the
alternate collector name as the file name. READ/WRITE access mode and SHARED
exclusion mode are required but need not be specified, as they are assumed by
default. This TAL example illustrates this call:
INT COLNAME [0:11] := [ "$0", 11*[" "] ];
INT FILENUM := -1;