SPI Programming Manual (G06.24+, H06.03+, J06.03+)

SPI Programming in TACL
SPI Programming Manual427506-006
8-4
Token Codes
In the first two examples, you could substitute 18182 for G06; however, G06 is
recommended for clarity. The last two examples are possible subsystem IDs for a
subsystem you might write. The third example assumes that you define your versions
as simple integers. The fourth example assumes that you define them in the same
format HP uses.
The null value of the subsystem ID in TACL is 0.0.0.
Your TACL macro or routine must initialize a STRUCT for each subsystem with which
your application communicates. For NonStop Kernel subsystems, the name of this
STRUCT in the TACL definition file is
subsys^VAL^SSID. To initialize it, use
ZSPI^VAL^TANDEM for the Z^OWNER field, ZSPI^SSN^
subsys for the Z^NUMBER
field, and
subsys^VAL^VERSION for the subsystem Z^VERSION field. For example,
if your application sends commands to TMF, your macro or routine loads the definitions
supplied by TMF (in the file ZSPIDEF.ZTMFTACL) and might then include this #SET
call:
#SET ZTMF^VAL^SSID &
[ZSPI^VAL^TANDEM].[ZSPI^SSN^ZTMF].[ZTMF^VAL^VERSION]
If you are sending a command to a subsystem provided by a company other than HP,
you must make the appropriate, different entries for the Z^OWNER, Z^NUMBER, and
Z^VERSION fields.
Token Codes
The built-in functions for SPI accept token codes either as external-format integers or
numeric values, or as 32-bit STRUCTs.
Token-code STRUCT definitions, as generated by DDL, are included in the TACL
versions of the SPI and subsystem definition files. Your TACL macros and routines can
refer to the individual fields of a token code by copying the token code into
ZSPI^DDL^TOKENCODE:Z^TOKENCODE.
Token codes cannot be composed or decomposed by simple arithmetic, because the
token number is signed and simple arithmetic would extend the sign.
Token Maps
In TACL, a token map is a STRUCT whose data contains a valid SPI token map. The
definition of the STRUCT is irrelevant.
Token-map definitions, as generated by DDL, are included in the TACL definition files
for subsystems that define extensible structured tokens.
When using a token map, TACL verifies that the contents of the token map are
consistent with the size of the STRUCT in which it is stored.