6100 ADCCP Programming Manual
ADCCP Programming Example Using Transaction Application Language (TAL)
069225 Tandem Computers Incorporated B–29
If the frame that arrived was a SABM (an I-frame would have a Text In value
greater than 2), the program immediately posts a RECEIVETEXT with the same tag
as in the request that completed. (The decrement here undoes the increment that
occurred earlier in the procedure.)
IF D.COMMAND^RESPONSE.TEXT^IN = 2 THEN !SABM FRAME
BEGIN
READ^POSTED := FALSE; !POST ANOTHER READ
IF EXP^CNT = 1 THEN RTAG := $DBL(3)
ELSE RTAG := $DBL(exp^cnt -1);
CALL SBLANK(D,IOSIZE+$LEN(D.BASIC));
CALL RECEIVE(RFNUM,,0,0,LTF^RCVTEXT,IOSIZE+$LEN(D.BASIC),RTAG);
READ^POSTED := TRUE;
RETURN;
END;
length^left := framesize - 1;
IPTR := 1; !first word of text is station-id,station-status
The second word of the text field is in^key, which serves as a sequence number for
the frame. See the out^key in the build^buf subprocedure.
while length^left do
begin
if in^key <> D.COMMAND^RESPONSE.TXT[IPTR+1] then goto frame^in^err;
if (length^left := length^left - 1) then
if length^left >= fox^msg^size then
begin
if D.COMMAND^RESPONSE.TXT[IPTR+2] '<>' brown^fox^msg for fox^msg^size then
goto frame^in^err;
length^left := length^left - fox^msg^size;
IPTR := IPTR + 1 + FOX^MSG^SIZE;
end
else
If the text received is accurate, the program increases the sequence number and the
count of frames read by 1.
If D.COMMAND^RESPONSE.TXT[IPTR+2] '<>' D.COMMAND^RESPONSE.TXT[IPTR+1]
for length^left then
goto frame^in^err
else length^left := 0
else;
end;
if in^key = 32767 then
in^key := 0
else in^key := in^key + 1;
records^read := records^read + 1;
return;
frame^in^err:
sbuf[9] ':=' "Lost message or bad data @ in^key = " -> @ptr;
call numout(ptr,in^key,10,5);
@ptr := @ptr[5];
call write^err^msg;
session := false; !this will kill us
end;