6100 ADCCP Programming Manual

Application Tasks
Writing Applications that Use ADCCP
069225 Tandem Computers Incorporated 4–13
Note Simultaneous WRITEREAD calls on behalf of different opens may not have the same request ID in their
WRITEREAD buffers.
Setting Line Options Most applications do not need to set the line-configuration options. They are defined
in the SYSGEN program. If you specify the AUTOCONF option in the SYSGEN
program, the line configuration is downloaded from the host whenever the ADCCP
protocol module is downloaded. If at some point all openers close the line,
configuration occurs again on the next OPEN call. The configuration block
downloaded at these times is the one maintained by CP6100. (Refer to the CP6100 I/O
Process Programming Manual for a description of the configuration block, and to the
System Generation Manual for CP6100 for a description of AUTOCONF.)
If you have not specified AUTOCONF or if an application requires a change in the line
configuration, the application must make a WRITEREAD call with the SET
CONFIGURATION request. The values supplied in the request do not need to match
those in the SYSGEN configuration file. The SYSGEN configuration file should,
however, contain the configuration the lines use most frequently.
The following example is a TAL procedure that uses WRITEREAD to make a request.
In this example, D is the
buffer
parameter in the WRITEREAD call used for the
CONFIGURATION request and response.
proc receive(filenumber,list,txtout,txtin,cmd,count,tag^value) variable; !function
int filenumber, !value parameters
txtout,
txtin,
count,
cmd;
int(32) tag^value; !optional value parameter
string .list; !optional reference parameter
begin
int length;
d.msg.cmd := cmd; !MOVE FUNCTION BYTE
d.msg.mod := 0; !MOVE MODIFIER
d.msg.req^id := cmd; !USE FUNCTION CODE AS ID
d.msg.text^out := txtout; !MOVE LENGTH OF TEXT FIELD IN REQUEST
d.msg.text^in := txtin; !MOVE LENGTH OF TEXT FIELD IN RESPONSE
length := $LEN(D.basic) + txtout;
if NOT $PARAM(tag^value) then tag^value := 0D;
if $PARAM(list) then d.config.text ':=' list for txtout; !move definelist^array
CALL WRITEREAD(filenumber,D,length, count,count^trans,tag^value);
end;