EMS Manual
Retrieving Event Messages Programmatically
EMS Manual—426909-005
4-5
Filters and Filter Parameters
ZEMS^VAL^BUFLEN,
count^read);
IF <> THEN ... ! Handle the error
! 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 ... ! Handle error
! Filter correctly installed !
To reset the filter to the default (pass all event messages), send the same basic
message, omitting ZEMS^TKN^FILTERFILE and instead including
ZEMS^TKN^RESET^FILTER with value ZSPI^VAL^TRUE.
To pass parameters to a filter, you must have a DDL definition file that defines the
subsystem ID and the necessary tokens. The filter uses the subsystem ID and the
tokens to select the messages you want. If this definition file is not already available to
you, for a discussion of creating this DDL file, see the SPI Programming Manual. For a
complete description of the filter language aspects of parameter passing, see
Section 5, Compiled Filters, and Section 6, Filter Tables and Burst Filters.
After the definition file is available, use a CONTROL command message to pass the
parameters or to modify their values. To pass the parameters when you initially load
the filter, include the ZEMS^TKN^FILTERFILE parameter and the parameter tokens
and values you want to load with the filter. To change the values of the parameters
used by the current filter without reloading the filter, include the
ZEMS^TKN^REPLACE^PARAM token instead of the FILTERFILE token, and include
the parameter tokens and their new values. For information about more options and
restrictions, see Section 17, Distributor Commands and Responses.