Guardian Programmer's Guide

Table Of Contents
Communicating With Processes
Guardian Programmer’s Guide 421922-014
6 - 30
Processing Control, Setmode, Setparam, and
Controlbuf Messages
Processing Control, Setmode, Setparam, and
Controlbuf Messages
Your process should accept the -32 (Control), -33 (Setmode), -37 (Setparam), -34
(Resetsync), and -35 (Controlbuf) messages only if the process is simulating an I/O
device. In other words, some other process will issue CONTROL, SETMODE,
SETPARAM, or CONTROLBUF procedure calls against this process as if the process
were an I/O device.
For information on how to respond to each of these system messages, refer to the
Guardian Procedure Errors and Messages Manual. The following example provides a
skeletal outline:
CASE BUFFER OF
BEGIN
-32 -> BEGIN
!Process Control message;
!For application-defined protocols,
! set REPLY^LEN as appropriate.
END;
-33 -> BEGIN
!Process Setmode message
!If last-params requested,
! set REPLY^LEN as appropriate.
END;
-35 -> BEGIN
!Process Controlbuf message;
!For application-defined protocols,
! set REPLY^LEN as appropriate.
END;
-37 -> BEGIN
!Process Setparam message;
!If last-params requested,
! set REPLY^LEN as appropriate.
END;
OTHERWISE -> BEGIN
!Process any other message;
!set REPLY^LEN as approproate.
END;
END;
!Reply to the message:
CALL REPLYX(SBUFFER,
$MIN(REPLY^LEN, RECEIVE^INFO[1]),
!count^written!,
!message^tag!,
ERROR^CODE);