EMS Manual
Example of Retrieving Event Messages
EMS Manual—426909-005
A-14
TACL Source File
TACL Source File
This file contains the main TACL source:
?TACL MACRO
== File name: MYAPMAIN
==
== MYAPMAIN
== - Starts and opens a consumer distributor
== - Gets a CPU number from the user
== - Issues an SPI CONTROL command message to
== connect collector $0
== load a filter file
== load a filter param
== (cpu-number from user)
== - Performs the following steps in a loop:
== -- Issue SPI GETEVENT command message
== -- Display event on home terminal
==
== The program will wait for new events from the given CPU
== and will display them as they arrive.
== To terminate the program, press the BREAK key.
== The filter file must be $SYSTEM.FILT.MYAPFOBJ
== NOTE: The error handling in this example is very basic.
== The error text causes TACL to stop executing the program
== and point to the error text.
== Load variables if they are not already.
#FRAME
#PUSH #HOME
#SET #HOME : == Guarantee a 'writeable' home
== Load SPI and EMS defined variables
== Use the ATTACHSEG command to gain access to an existing
== TACL segment file.
ATTACHSEG SHARED $dsv.zspisegf.zspisegf :spidir
ATTACHSEG SHARED $dsv.zspisegf.zemssegf :emsdir
== Set USE so that TACL will find the variables in :spidir
== and :emsdir
== USE also makes sure that : :UTILS :UTILS:TACL are included
== in #USELIST
USE [#USELIST] :spidir :emsdir
== Initialize SSID for EMS
[#IF [#MATCH [zems^val^ssid] 0.0.0] |THEN|
#SET zems^val^ssid &
[ZSPI^VAL^TANDEM].[ZSPI^SSN^ZEMS].[ZEMS^VAL^VERSION]
]
[#IF NOT [#VARIABLEINFO/EXISTENCE/ myap^val^ssid] |THEN|
#LOAD/LOADED vars/ MYAPTACL