source: FOIAVistA/trunk/r/AUTOMATED_LAB_INSTRUMENTS-LA/LAEPXPXX.m@ 635

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

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1LAEPXPXX ;SLC/DLG - AUTOMATED SINGLE INSTRUMENT EPX DIRECT CONNECT LAB INTERFACE ;9/5/90 14:34 ;
2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
3 ;THIS ROUTINE IS STARTED TO RUN AN INSTRUMENT DIRECT TO A CPU
4 ;RATHER THAN THRU THE LSI. IT IS A CONSTANT BACKGROUND JOB
5 ;THAT ONLY STOPS WHEN SYSTEM IS TAKEN DOWN OR THE JOB IS STOPPED BY
6 ;SETTING THE ^LA("STOP",INST#)=""
7 ;THE CODE HAS A DATA TRAP CAPABILITY TO TRAP ALL DATA GOING THRU
8 ;THIS ROUTINE. S ^LA("D"_T,0)=0 WHERE T IS THE AUTOINSTRUMENT
9 ;ENTRY NUMBER WILL TURN THE TRAP ON. K ^LA("D"_T) WILL TURN THE
10 ;TRAP OFF AND KILL ALL THE DATA.
11 S:$D(ZTQUEUED) ZTREQ="@" S LANM=$T(+0),(HOME,T)=+$E(LANM,7,8) Q:+T<1 Q:$D(^LA("LOCK",T))
12 S DEB="D"_T,PAR=$S($D(^LAB(62.4,T,.5))#2:^(.5),1:""),OUT="",BASE=0,TOUT=5,U="^",IOP=$P(^LAB(62.4,HOME,0),"^",2) G:IOP="" H^XUS S IOP=IOP_";255",%ZIS=""
13 D ^%ZIS G:POP H^XUS U IO X ^%ZOSF("TYPE-AHEAD"),^%ZOSF("LABOFF")
14 C:IO(0)'=IO IO(0) S X="TRAP^"_LANM,@^%ZOSF("TRAP"),DUZ=.5
15 S ^LA("LOCK",T)=$J
16 R X:1,X:1 ;ALLOW BREAK AND FLUSH BUFFER
17LA2 I OUT]"" D:$D(^LA(DEB,0)) DEBUGO W OUT G:OUT'["#" W W *13 S TRY=0,OUT=""
18RD S IN="" F I=0:0 R *X:TOUT Q:'$T Q:X=13 S IN=IN_$C(X) Q:$L(IN)=255
19 G:X<0 TOUT
20LA22 D SET
21 L ^LA(T) G LA22:'$D(^LA(T,"I"))#2 S CNT=^LA(T,"I")+1,^("I")=CNT,^("I",CNT)=IN L
22 D:$D(^LA(DEB,0)) DEBUGI
23 I IN'["#" G RD
24 I PAR]"" S OUT="" X PAR I OUT]"" S T=T+BASE G LA2
25 G RD
26W IF $D(^LA("STOP",HOME)) K ^LA("LOCK",HOME),^LA("STOP",HOME) G H^XUS
27 S OUT="" S CNT=^LA(T,"O",0)+1 IF $D(^(CNT)) S ^(0)=CNT,OUT=^(CNT)
28 S TOUT=5 G LA2
29 ;
30SET S:'$D(^LA(T,"I"))#2 ^LA(T,"I")=0,^("I",0)=0
31SETO S:'$D(^LA(T,"O"))#2 ^LA(T,"O")=0,^("O",0)=0 Q
32 ;
33TOUT S TOUT=$S(TOUT<8:TOUT+1,1:5) G:TOUT'=5 RD S OUT="" G RD:'$D(^LA(T))
34 I $D(^LA(T,"O",0)),^LA(T,"O")>^LA(T,"O",0) G W
35 G RD Q
36DQ K ^LA("LOCK",$E($T(+0),7,8)) G LAEPXPXX
37DEBUGO S (Q,^LA(DEB,0))=^LA(DEB,0)+1,^(Q)="OUT: "_$E(OUT,1,230)_"%^%"_$H Q
38DEBUGI S (Q,^LA(DEB,0))=^LA(DEB,0)+1,^(Q)="IN: "_$E(IN,1,230)_"%^%"_$H Q
39TRAP D ^LABERR S T=TSK D SET G @("LA2^"_LANM)
40 Q
Note: See TracBrowser for help on using the repository browser.