SUBROUTINE LABINI(NUMCH,ICHARY,IST) C C C This routine requests channels of resident program C LABMON. Status is returned in IST C C NUMCH = Number of channels C C ICHARY = Channel array (note first channel=0) C requested channels must be packed into the C lower end of this array. C C Status is returned via IST C C IST=5 - requested channels are in use C IST=0 - sampling has started C IST=-1 - parameter error C IST=-2 - LMN not responding C IST=-3 - Can't connect to LMN C C C C LOGICAL MAP(16),ICHARY(16),ICMAP,J INTEGER CMDO(13),SER(8),LMN(2) EQUIVALENCE (ICMAP,CMDO(3)) DATA MAP/1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192, 1 16384,"100000/ DATA CMDO/'CH',12*' '/ DATA LMN/3R...,3RLMN/ C C IF(NUMCH.EQ.0.OR.NUMCH.GT.16)GOTO 50 C ICMAP=0 DO 10 I=1,NUMCH J=MAP(ICHARY(I)+1) 10 ICMAP=ICMAP.OR.J CALL REQUES(LMN,,IDS) IF(IDS.NE.1.AND.IDS.NE.-7)GOTO 60 CALL CNCT(LMN,9,,SER,,IDS) IF(IDS.NE.1)GOTO 70 20 CALL SEND(LMN,CMDO,33) !send CH cmd to LMN CALL WAITFR(9) !wait for LMN to emit status IST=SER(1) RETURN 50 IST=-1 RETURN 60 IST=-2 RETURN 70 IST=-3 RETURN END