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

SPI Programming in TAL
SPI Programming Manual427506-006
9-2
Subsystem ID
structure described in SPI Buffer in Section 4. Use this declaration to allocate a buffer
variable of the recommended size (
subsys^VAL^BUFLEN):
STRUCT .buf(subsys^DDL^MSG^BUFFER^DEF);
Then you can easily refer to the Z^MSGCODE (-28), Z^BUFLEN, and Z^OCCURS
fields of this structure as needed.
Some subsystems provide additional buffer declarations allocating different
recommended buffer-size values for different commands. For details, see the individual
subsystem management programming manuals.
If you wish to define a buffer larger than the recommended size in order to handle a
large number of response records per reply, you can write your own buffer declaration,
following the pattern of
subsys^DDL^MSG^BUFFER^DEF.
Subsystem ID
In TAL, before the first time you call SSINIT to send a command to a subsystem, you
must initialize the subsystem ID. For NonStop Kernel subsystems, the name of the
subsystem ID structure in the TAL definition file is
subsys^VAL^SSID^DEF. 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 Z^VERSION field. For
example, if your application sends commands to TMF, your program would use the
definitions supplied with TMF (in the file ZSPIDEF.ZTMFTAL) and could then declare
and initialize the subsystem ID:
STRUCT .ZTMF^VAL^SSID (ZTMF^VAL^SSID^DEF);
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.
Defining Token Maps
Defining and initializing token maps in TAL requires that you use the LITERAL and
DEFINE names produced by DDL:
For every token map you define, the DDL name is
subsys-MAP-name
This name is translated to TAL as
DEFINE subsys^MAP^name = initialization-list-for-TAL-array #;
LITERAL subsys^MAP^name^WLN = n ;
where n is the size of the TAL array to be initialized.