LAMSP ; IHS/DIR/FJE - MICROSCAN PROTOCALL ROUTINE W/O ACK-NAK 7/20/90 09:49 ;
;;5.2;LA;;NOV 01, 1997
;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
A L ^LA(T,"P") I '$D(^LA(T,"P")) S ^("P")="MICROSCAN^IN"
S MODE=$P(^LA(T,"P"),"^",2),CTRL=$S($F(IN,"~")=$L(IN):$P(IN,"~",2),1:" ") D @MODE L Q
;
IN ;C= <STX>+<LF>+<CR> or there replaced values.
G:CTRL["D" SETOUT S:CTRL["E" OUT=$C(6),$P(^LA(T,"P"),"^",2)="IN" Q
OUT Q
SETOUT ;Change to output
Q:'$D(^LA(T,"O",0)) Q:^LA(T,"O")'>^LA(T,"O",0) S $P(^LA(T,"P"),"^",2)="OUT" Q
;The MicroScan needs to have the field delimiter set to | (124)
;LF is set to @ (64). Set " to 0.
;Timeout set to a min of 20, Protocall set to ACK/NAK.
;STX = ~B, ETX = ~C, EOT = ~D, ENQ = ~E, ACK = ~F, NAK = ~U
LAMSP ; IHS/DIR/FJE - MICROSCAN PROTOCALL ROUTINE W/O ACK-NAK 7/20/90 09:49 ;
+1 ;;5.2;LA;;NOV 01, 1997
+2 ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
A LOCK ^LA(T,"P")
IF '$DATA(^LA(T,"P"))
SET ^("P")="MICROSCAN^IN"
+1 SET MODE=$PIECE(^LA(T,"P"),"^",2)
SET CTRL=$SELECT($FIND(IN,"~")=$LENGTH(IN):$PIECE(IN,"~",2),1:" ")
DO @MODE
LOCK
QUIT
+2 ;
IN ;C= <STX>+<LF>+<CR> or there replaced values.
+1 IF CTRL["D"
GOTO SETOUT
IF CTRL["E"
SET OUT=$CHAR(6)
SET $PIECE(^LA(T,"P"),"^",2)="IN"
QUIT
OUT QUIT
SETOUT ;Change to output
+1 IF '$DATA(^LA(T,"O",0))
QUIT
IF ^LA(T,"O")'>^LA(T,"O",0)
QUIT
SET $PIECE(^LA(T,"P"),"^",2)="OUT"
QUIT
+2 ;The MicroScan needs to have the field delimiter set to | (124)
+3 ;LF is set to @ (64). Set " to 0.
+4 ;Timeout set to a min of 20, Protocall set to ACK/NAK.
+5 ;STX = ~B, ETX = ~C, EOT = ~D, ENQ = ~E, ACK = ~F, NAK = ~U