Using SPI
Using Programmatic Interfaces
7–4
107365 Tandem Computers Incorporated
Using SPI
The Subsystem Programmatic Interface (SPI) allows you to store tokenized commands
in buffers, send them to Tandem subsystems (such as Pathway), and receive a buffer
containing tokenized replies. TACL uses standard SPI type names and supports
standard SPI data types. Before sending or receiving an SPI message, you must:
Know the subsystem ID for the desired subsystem.
Know the names of individual tokens of interest.
You can find the necessary files in the ZSPIDEF subvolume supplied by Tandem; load
them from within your TACL code or attach segment files (in the ZSPISEGF
subvolume) that contain the information.
The functions in Table 7-1 provide access to SPI formats and protocols.
Table 7-1. TACL Functions That Support SPI
Function
Description
#SSINIT
Initializes a STRUCT as an SPI message buffer.
#SSGET
Retrieves token values from an SPI buffer, converts the values to external
representation, and makes the results available.
#SSGETV
Retrieves token values from an SPI buffer, converts the values to external
representation, and makes the results available. #SSGETV must be used for
extensible structured tokens and tokens of type ZSPI^TYPE^STRUCT.
#SSPUT
Converts token values from external representation to binary form and puts them into
an SPI buffer.
#SSPUTV
Converts token values in extensible structured tokens and tokens of type
ZSPI^TYP^STRUCT.
#SSNULL
Initializes a structured token and sets the values to null.
#SSMOVE
Copies tokens from one message buffer to another by performing a sequence of
#SSGETV and #SSPUTV operations.
To use SPI, follow these steps:
1.
Define a message buffer (#DEF).
2.
Initialize any structured tokens you plan to use (#SSNULL).
3.
Initialize the buffer (#SSINIT).
4.
Store requests in the buffer (#SSPUT, #SSPUTV).
5.
Send the buffer (#APPENDV).
6.
Retrieve results from the buffer (#SSGET, #SSGETV).
To copy tokens from one buffer to another, use #SSMOVE, which performs a sequence
of #SSGETV and #SSPUTV operations.