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

SPI Programming in TACL
SPI Programming Manual427506-006
8-32
Example: Printing or Displaying the Status Structure
of the Subsystem Control Point (SCP)
For a larger example illustrating the use of SPI in TACL, see the
Distributed Name
Service (DNS) Management Programming Manual
.
== Reset the buffer after receiving the response.
#SET err [#SSPUT spi_buf ZSPI^TKN^RESET^BUFFER
ZCOM^VAL^BUFLEN]
[#IF err |THEN| *** ERROR [err] from #SSPUT RESET^BUFFER]
== Retrieve the return code and test its value.
#SETMANY err _{count 1} retcode &
, [#SSGET /INDEX 1/ spi_buf ZSPI^TKN^RETCODE]
[#IF err |THEN| *** ERROR [err] from #SSGET RETCODE]
[#IF retcode <> ZSPI^ERR^OK |THEN|
*** ERROR [err] FROM %1%.#ZSPI on STATUS command]
== Retrieve the SCP status structure from the response.
#SETMANY err, [#SSGETV /INDEX 1/ spi_buf ZSCP^MAP^STATUS^PROC
ZSCP^DDL^STATUS^PROC]
[#IF err |THEN| *** ERROR [err] from #SSGETV MAP^STATUS^PROC]
== Display the SCP response structure.
#OUTPUTV ZSCP^DDL^STATUS^PROC
#UNFRAME
{scpstat}
Example 8-1. Printing or Displaying the Status Structure of the SCP
(page 2 of 2)