[613] | 1 | LAHTCCAH ;SLC/DLG - HITACHI 717 THRU CCA SYSTEM PROTOCALL CONTROLLER ;7/20/90 09:18 ;
|
---|
| 2 | ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
|
---|
| 3 | ;;
|
---|
| 4 | ;Call with T set to Instrument data is to/from
|
---|
| 5 | ; P1= RESET POINT FOR INCOMING RECORDS, P3=Reset point FOR RECORDS SENT
|
---|
| 6 | S:'$D(^LA(T,"P2")) ^("P2")=0,^("P")="IN"
|
---|
| 7 | RCHK K LATYPE S LATYPE=$P(IN,"~",2),LATYPE=$S("BCDEFU"[LATYPE:LATYPE,1:"Z") D @LATYPE S T=T-BASE Q
|
---|
| 8 | B S ^LA(T,"P2")=0 Q ;RECIEVED STX
|
---|
| 9 | C F I=1:1:$L(IN)-2 S LASUM=LASUM+$A(IN,I)
|
---|
| 10 | S ^LA(T,"P2")=LASUM#256 I $E(IN,1)="D" S ^LA(T,"P")="D"
|
---|
| 11 | Q
|
---|
| 12 | D S ^LA(T,"P")="QUIT" Q ;REC EOT
|
---|
| 13 | E S ^LA(T,"P")="IN",OUT=$C(6),^LA(T,"P2")=0 Q ;REC ENQ
|
---|
| 14 | F S Q=^LA(T,"O",0)+1 I $D(^(Q)) S ^(0)=Q,OUT=^(Q) ;GOT ACK SEND NEXT
|
---|
| 15 | Q
|
---|
| 16 | U S OUT=^LA(T,"O",0) Q ;RECIEVED NAK RESEND
|
---|
| 17 | Z S OUT=$S(($L(IN)=3&+IN=^LA(T,"P2")):$C(6),1:$C(21))
|
---|
| 18 | S ^LA(T,"P2")=0 I ^LA(T,"P")="D" S ^("P")="OUT",Q=^LA(T,"O",0)+1 I $D(^(Q)) S ^(0)=Q L ^LA("Q") S Q=^LA("Q")+1,^("Q")=Q,^("Q",Q)=T L
|
---|