EMS Manual
Retrieving Event Messages Programmatically
EMS Manual—426909-005
4-7
Event-Message Sources
! And send the command message
CALL WRITEREAD(fnum,
spibuffer,
buffer^length,
ZEMS^VAL^BUFLEN,
count^read);
IF <> THEN ... ! Handle the error
! The response message is now in spibuffer.
! Reset buffer length to what you declared for spibuffer
spi^error := SSPUTTKN(spibuffer,
ZSPI^TKN^RESET^BUFFER,
ZEMS^VAL^BUFLEN);
! See if anything wrong with response buffer
IF spi^error <> ZSPI^ERR^OK THEN ...
! Buffer ok, was distributor CONTROL command ok?
spi^error := SSGETTKN(spibuffer,
ZSPI^TKN^RETCODE,
error,
1);
! Handle any error from SPI procedure
IF spi^error <> ZSPI^ERR^OK THEN ...
IF error <> 0 THEN ...
For the other operations, send the same basic command message, but substitute a
different token for ZEMS^TKN^CONNECT^SRC^COLL:
To delete a collector, substitute the ZEMS^TKN^DISCONNECT^SRC^COLL token.
To add a log file, substitute the ZEMS^TKN^CONNECT^LOGFILE token.
To delete a log file, substitute the ZEMS^TKN^DISCONNECT^LOGFILE token.
These restrictions apply to CONTROL command messages that change the event-
message source:
Up to ten collectors can be connected simultaneously.
Only one log file can be connected at a time.
A collector cannot be added if a log file is connected, and a log file cannot be
added if one or more collectors are connected.