LABCX7S ; IHS/DIR/FJE - ; [ 05/27/2003 6:53 AM ]
;;5.2;LA;**1016**;MAY 27, 2003
DOC ;Used to start and stop the CX7s
0 S A=0 F I=1:1 S A=$O(^LAB(62.4,"D","CX7",A)) Q:'A S VAR="D"_I,@VAR=A
I '$D(D1) W *7,*7,!!,"YOU HAVE NO DEVICES DEFINED IN THE AUTO INSTRUMENT FILE AS A CX7!!" K A,I,VAR Q ;JPC FIXED SPELLING OF INSTRUMENT
S D=I-1 F I=1:1:D S VAR="D"_I,T=@VAR D ASK
EXIT F I=1:1:D S VAR="D"_I K @VAR
K A,I,J,VAR,D,T,NAME,ANS,OPT,LTA,POP,X
Q
ASK ;
S NAME=$P(^LAB(62.4,T,0),U)
W !!,"Do you want to ",OPT," device ",T,", ",NAME,"? N// "
R ANS:30 I ANS'["Y" W " No action taken" Q
D @OPT Q
Q
START ;
S IOP=$P(^LAB(62.4,T,0),U,2)
I IOP="" W !,*7,"This does NOT have a device in file 62.4." Q
S LTA=$O(^%ZIS(1,"B",IOP,0))
I LTA="" W !,*7,"This device is NOT in the DEVICE file." Q
S LTA=$P(^%ZIS(1,LTA,0),U,2)
I LTA="" W !,*7,"Invalid device name in the DEVICE file" Q
D ^%ZIS ;***JPC - CHECK POP AFTER %ZIS, NOT %ZISC
I POP K IOP W !,"The interface for device ",T," is already running, no action needed." Q ;JPC - ADDED KILL IOP
I 'POP D ^%ZISC K IOP H 5 S X="J DQ^LABCX7"_T_":(NAME=""Lab CX7 "_T_""",IN="""_LTA_""")" X X ;JPC/JK3 ADDED 'NAME=' PARAM, CLOSE DEVICE
W " Job Started" Q
STOP ;
S ^LA("STOP",T)="" W *7," Interface is now down"
Q
LABCX7S ; IHS/DIR/FJE - ; [ 05/27/2003 6:53 AM ]
+1 ;;5.2;LA;**1016**;MAY 27, 2003
DOC ;Used to start and stop the CX7s
0 SET A=0
FOR I=1:1
SET A=$ORDER(^LAB(62.4,"D","CX7",A))
IF 'A
QUIT
SET VAR="D"_I
SET @VAR=A
+1 ;JPC FIXED SPELLING OF INSTRUMENT
IF '$DATA(D1)
WRITE *7,*7,!!,"YOU HAVE NO DEVICES DEFINED IN THE AUTO INSTRUMENT FILE AS A CX7!!"
KILL A,I,VAR
QUIT
+2 SET D=I-1
FOR I=1:1:D
SET VAR="D"_I
SET T=@VAR
DO ASK
EXIT FOR I=1:1:D
SET VAR="D"_I
KILL @VAR
+1 KILL A,I,J,VAR,D,T,NAME,ANS,OPT,LTA,POP,X
+2 QUIT
ASK ;
+1 SET NAME=$PIECE(^LAB(62.4,T,0),U)
+2 WRITE !!,"Do you want to ",OPT," device ",T,", ",NAME,"? N// "
+3 READ ANS:30
IF ANS'["Y"
WRITE " No action taken"
QUIT
+4 DO @OPT
QUIT
+5 QUIT
START ;
+1 SET IOP=$PIECE(^LAB(62.4,T,0),U,2)
+2 IF IOP=""
WRITE !,*7,"This does NOT have a device in file 62.4."
QUIT
+3 SET LTA=$ORDER(^%ZIS(1,"B",IOP,0))
+4 IF LTA=""
WRITE !,*7,"This device is NOT in the DEVICE file."
QUIT
+5 SET LTA=$PIECE(^%ZIS(1,LTA,0),U,2)
+6 IF LTA=""
WRITE !,*7,"Invalid device name in the DEVICE file"
QUIT
+7 ;***JPC - CHECK POP AFTER %ZIS, NOT %ZISC
DO ^%ZIS
+8 ;JPC - ADDED KILL IOP
IF POP
KILL IOP
WRITE !,"The interface for device ",T," is already running, no action needed."
QUIT
+9 ;JPC/JK3 ADDED 'NAME=' PARAM, CLOSE DEVICE
IF 'POP
DO ^%ZISC
KILL IOP
HANG 5
SET X="J DQ^LABCX7"_T_":(NAME=""Lab CX7 "_T_""",IN="""_LTA_""")"
XECUTE X
+10 WRITE " Job Started"
QUIT
STOP ;
+1 SET ^LA("STOP",T)=""
WRITE *7," Interface is now down"
+2 QUIT