source: FOIAVistA/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LAHTCCAH.m@ 1354

Last change on this file since 1354 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 933 bytes
Line 
1LAHTCCAH ;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"
7RCHK K LATYPE S LATYPE=$P(IN,"~",2),LATYPE=$S("BCDEFU"[LATYPE:LATYPE,1:"Z") D @LATYPE S T=T-BASE Q
8B S ^LA(T,"P2")=0 Q ;RECIEVED STX
9C 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
12D S ^LA(T,"P")="QUIT" Q ;REC EOT
13E S ^LA(T,"P")="IN",OUT=$C(6),^LA(T,"P2")=0 Q ;REC ENQ
14F S Q=^LA(T,"O",0)+1 I $D(^(Q)) S ^(0)=Q,OUT=^(Q) ;GOT ACK SEND NEXT
15 Q
16U S OUT=^LA(T,"O",0) Q ;RECIEVED NAK RESEND
17Z 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
Note: See TracBrowser for help on using the repository browser.