Ejemplo n.º 1
0
static long devAoNI6254_init_record(aoRecord *precord)
{
	ST_dpvt *pSTdpvt = (ST_dpvt*) malloc(sizeof(ST_dpvt));
	int i;

	switch(precord->out.type) {
		case INST_IO:
			strcpy(pSTdpvt->recordName, precord->name);
			i = sscanf(precord->out.value.instio.string, "%s %s %s",
					pSTdpvt->arg0, pSTdpvt->devName, pSTdpvt->arg1);

			kLog (K_INFO, "[devAoNI6254_init_record] %d: %s %s %s\n",
					i, pSTdpvt->devName, pSTdpvt->arg0, pSTdpvt->arg1);

			if (1 == i) {
				ST_MASTER *pMaster = get_master();
				pSTdpvt->pSTDdev = (ST_STD_device*) ellFirst(pMaster->pList_DeviceTask);
			}
			else if (3 == i) {
				pSTdpvt->pSTDdev = (ST_STD_device *)get_STDev_from_name(pSTdpvt->devName);
			}

			if (!pSTdpvt->pSTDdev) {
				recGblRecordError(S_db_badField, (void*) precord, 
						"devAoNI6254Control (init_record) Illegal INP field: task_name");
				free(pSTdpvt);
				precord->udf = TRUE;
				precord->dpvt = NULL;
				return S_db_badField;
			}

			break;

		default:
			recGblRecordError(S_db_badField,(void*) precord,
					"devAoNI6254Control (init_record) Illegal OUT field");
			free(pSTdpvt);
			precord->udf = TRUE;
			precord->dpvt = NULL;
			return S_db_badField;
	}

	if (!strcmp(pSTdpvt->arg0, AO_DAQ_BEAM_PULSE_STR)) {
		pSTdpvt->ind		= AO_DAQ_BEAM_PULSE;
		pSTdpvt->n32Arg0	= strtoul(pSTdpvt->arg1, NULL, 0);
	}
	else if (!strcmp(pSTdpvt->arg0, AO_INTEGRAL_STIME_STR)) {
		pSTdpvt->ind		= AO_INTEGRAL_STIME;
		pSTdpvt->n32Arg0	= strtoul(pSTdpvt->arg1, NULL, 0);
	}
	else if (!strcmp(pSTdpvt->arg0, AO_INTEGRAL_TIME_STR)) {
		pSTdpvt->ind		= AO_INTEGRAL_TIME;
		pSTdpvt->n32Arg0	= strtoul(pSTdpvt->arg1, NULL, 0);
	}

	precord->udf = FALSE;
	precord->dpvt = (void*) pSTdpvt;

	return 2;     /* don't convert */
}
Ejemplo n.º 2
0
static long init_record(void *rec_p, int pass)
{
    rfmRecord   *precord  = (rfmRecord*)rec_p;
    rfmdset     *pdset    = NULL;
    long        status    = OK;

    if(pass==0) return status;

    /* check device entry table */
    if((pdset = (rfmdset*)(precord->dset)) == NULL) {
        recGblRecordError((status = S_dev_noDSET), precord, "rfm: init_record");
        return status;
    }

    /* must have read_rfm function defined */
    if((pdset->number<5) ||(pdset->read_rfm == NULL)) {
        recGblRecordError((status = S_dev_missingSup), precord, "rfm: init_record");
        return status;
    }

    /* execute device support level initialization */
    if(pdset->init_record) status = (*pdset->init_record)(precord);

    return status;
}
Ejemplo n.º 3
0
static long init_record(stringoutRecord *prec, int pass)
{
    STATIC_ASSERT(sizeof(prec->oval)==sizeof(prec->val));
    struct stringoutdset *pdset;
    long status=0;

    if (pass==0) return(0);

    if (prec->siml.type == CONSTANT) {
	recGblInitConstantLink(&prec->siml,DBF_USHORT,&prec->simm);
    }

    if(!(pdset = (struct stringoutdset *)(prec->dset))) {
	recGblRecordError(S_dev_noDSET,(void *)prec,"stringout: init_record");
	return(S_dev_noDSET);
    }
    /* must have  write_stringout functions defined */
    if( (pdset->number < 5) || (pdset->write_stringout == NULL) ) {
	recGblRecordError(S_dev_missingSup,(void *)prec,"stringout: init_record");
	return(S_dev_missingSup);
    }
    /* get the initial value dol is a constant*/
    if (prec->dol.type == CONSTANT){
	if(recGblInitConstantLink(&prec->dol,DBF_STRING,prec->val))
	    prec->udf=FALSE;
    }
    if( pdset->init_record ) {
	if((status=(*pdset->init_record)(prec))) return(status);
    }
    strcpy(prec->oval,prec->val);
    return(0);
}
Ejemplo n.º 4
0
/*****************************************************************************
 *
 * Init the record, then call the device support module to let it know that
 * this record intends on using it.
 *
 ******************************************************************************/
static long init_record(void *precord, int pass)
{
    vsRecord *pvs = (vsRecord *)precord;
    vsdset *pdset;
    long status;
        
    if (pass == 0) return (0);
    
    pvs->chgc = 0;

    if ( (pdset = (vsdset *)(pvs->dset) )== NULL) {
	recGblRecordError(S_dev_noDSET, (void *)pvs, "vs: init_record");
	return (S_dev_noDSET);
    }

    /*** must have readWrite_vs function defined ***/
    if ((pdset->number < 5) || (pdset->readWrite_vs == NULL)) {
	recGblRecordError(S_dev_missingSup, (void *)pvs, "vs: init_record");
	return (S_dev_missingSup);
    }
    
    
    /*** if everything is OK init the record ***/
    if (pdset->init_record) {
	if ((status = (*pdset->init_record) (pvs))) {
	    return (status);
	}
    }
    return (0);
}
Ejemplo n.º 5
0
static long init_record(subArrayRecord *prec, int pass)
{
    struct sadset *pdset;

    if (pass==0){
        if (prec->malm <= 0)
            prec->malm = 1;
        if (prec->ftvl > DBF_ENUM)
            prec->ftvl = DBF_UCHAR;
        prec->bptr = callocMustSucceed(prec->malm, dbValueSize(prec->ftvl),
            "subArrayRecord calloc failed");
        prec->nord = 0;
        return 0;
    }

    /* must have dset defined */
    if (!(pdset = (struct sadset *)(prec->dset))) {
        recGblRecordError(S_dev_noDSET,(void *)prec,"sa: init_record");
        return S_dev_noDSET;
    }

    /* must have read_sa function defined */
    if ( (pdset->number < 5) || (pdset->read_sa == NULL) ) {
        recGblRecordError(S_dev_missingSup,(void *)prec,"sa: init_record");
        return S_dev_missingSup;
    }

    if (pdset->init_record)
        return (*pdset->init_record)(prec);

    return 0;
}
Ejemplo n.º 6
0
static long init_record(stringinRecord *prec, int pass)
{
    STATIC_ASSERT(sizeof(prec->oval)==sizeof(prec->val));
    struct stringindset *pdset;
    long status;

    if (pass==0) return(0);

    if (prec->siml.type == CONSTANT) {
	recGblInitConstantLink(&prec->siml,DBF_USHORT,&prec->simm);
    }

    /* stringin.siol must be a CONSTANT or a PV_LINK or a DB_LINK */
    if (prec->siol.type == CONSTANT) {
        recGblInitConstantLink(&prec->siol,DBF_STRING,prec->sval);
    } 

    if(!(pdset = (struct stringindset *)(prec->dset))) {
	recGblRecordError(S_dev_noDSET,(void *)prec,"stringin: init_record");
	return(S_dev_noDSET);
    }
    /* must have read_stringin function defined */
    if( (pdset->number < 5) || (pdset->read_stringin == NULL) ) {
	recGblRecordError(S_dev_missingSup,(void *)prec,"stringin: init_record");
	return(S_dev_missingSup);
    }
    if( pdset->init_record ) {
	if((status=(*pdset->init_record)(prec))) return(status);
    }
    strcpy(prec->oval,prec->val);
    return(0);
}
Ejemplo n.º 7
0
static long init_wf_wr(struct waveformRecord *pwf) {
    int parmOK = 0;

    if (pwf->inp.type!=VME_IO) {
        recGblRecordError(S_db_badField, (void *)pwf,
                          "devWfWrD212 Init_record, Illegal INP");
        pwf->pact=TRUE;
        return (S_db_badField);
    }

    pwf->dpvt = (void*) calloc(1, sizeof(recPrivate*));

    ((recPrivate*) pwf->dpvt)->pCard = getCardStruct(pwf->inp.value.vmeio.card);

    do {
        CHECK_WFPARM("WF_WR_1", CPCI_WF_WR_1);
    } while(0);

    if (!parmOK) {
        recGblRecordError(S_db_badField, (void *)pwf,
                      "devWfWrD212 Init_record, bad parm");
        pwf->pact=TRUE;
        return (S_db_badField);
    }

    if (pwf->ftvl != DBF_FLOAT) {
        recGblRecordError(S_db_badField, (void *)pwf,
                   "devWfWrD212 (init_record) Illegal FTVL field");
        return(S_db_badField);
    }

    return 0;
}
Ejemplo n.º 8
0
static long init_record(longoutRecord *prec, int pass)
{
    struct longoutdset *pdset;
    long status=0;

    if (pass==0) return(0);
    if (prec->siml.type == CONSTANT) {
	recGblInitConstantLink(&prec->siml,DBF_USHORT,&prec->simm);
    }
    if(!(pdset = (struct longoutdset *)(prec->dset))) {
	recGblRecordError(S_dev_noDSET,(void *)prec,"longout: init_record");
	return(S_dev_noDSET);
    }
    /* must have  write_longout functions defined */
    if( (pdset->number < 5) || (pdset->write_longout == NULL) ) {
	recGblRecordError(S_dev_missingSup,(void *)prec,"longout: init_record");
	return(S_dev_missingSup);
    }
    if (prec->dol.type == CONSTANT) {
	if(recGblInitConstantLink(&prec->dol,DBF_LONG,&prec->val))
	    prec->udf=FALSE;
    }
    if( pdset->init_record ) {
	if((status=(*pdset->init_record)(prec))) return(status);
    }
    prec->mlst = prec->val;
    prec->alst = prec->val;
    prec->lalm = prec->val;
    return(0);
}
Ejemplo n.º 9
0
static long init_record(mbbiRecord *prec, int pass)
{
    struct mbbidset *pdset;
    long status;

    if (pass==0) return(0);

    if (prec->siml.type == CONSTANT) {
	recGblInitConstantLink(&prec->siml,DBF_USHORT,&prec->simm);
    }
    if (prec->siol.type == CONSTANT) {
	recGblInitConstantLink(&prec->siol,DBF_USHORT,&prec->sval);
    }
    if(!(pdset = (struct mbbidset *)(prec->dset))) {
	recGblRecordError(S_dev_noDSET,(void *)prec,"mbbi: init_record");
	return(S_dev_noDSET);
    }
    /* must have read_mbbi function defined */
    if( (pdset->number < 5) || (pdset->read_mbbi == NULL) ) {
	recGblRecordError(S_dev_missingSup,(void *)prec,"mbbi: init_record");
	return(S_dev_missingSup);
    }
    /* initialize mask*/
    prec->mask = (1 << prec->nobt) - 1;

    if( pdset->init_record ) {
	if((status=(*pdset->init_record)(prec))) return(status);
    }
    init_common(prec);
    prec->mlst = prec->val;
    prec->lalm = prec->val;
    prec->oraw = prec->rval;
    return(0);
}
Ejemplo n.º 10
0
static long ai_init_record(aiRecord* pr)
{
    int		i;
    char	*parm;
    pvtArea	*pvt = NULL;

	if(pr->inp.type!=INST_IO)
	{
		recGblRecordError(S_db_badField,(void*)pr,
			"devAiStats (init_record) Illegal INP field");
		return S_db_badField;
	}
	parm = pr->inp.value.instio.string;
	for(i=0;statsGetParms[i].name && pvt==NULL;i++)
	{
		if(strcmp(parm,statsGetParms[i].name)==0)
		{
			pvt=(pvtArea*)malloc(sizeof(pvtArea));
			pvt->index=i;
			pvt->type=statsGetParms[i].type;
		}
	}
	if(pvt==NULL)
	{
		recGblRecordError(S_db_badField,(void*)pr,
			"devAiStats (init_record) Illegal INP parm field");
		return S_db_badField;
	}

    /* Make sure record processing routine does not perform any conversion*/
    pr->linr=0;
    pr->dpvt=pvt;
    return 0;
}
Ejemplo n.º 11
0
static long init_record(epidRecord *pepid, int pass)
{
    struct epidDSET *pdset;
    int status;

    if (pass==0) return(0);
    /* initialize the setpoint for constant setpoint */
    if (pepid->stpl.type == CONSTANT) {
        if(recGblInitConstantLink(&pepid->stpl,DBF_DOUBLE,&pepid->val))
            pepid->udf = FALSE;
    }

    /* must have dset defined */
    if (!(pdset = (struct epidDSET *)(pepid->dset))) {
        recGblRecordError(S_dev_noDSET,(void *)pepid,"epid: init_record1");
        return(S_dev_noDSET);
    }
    /* must have do_pid function defined */
    if ( (pdset->number < 5) || (pdset->do_pid == NULL) ) {
        recGblRecordError(S_dev_missingSup,(void *)pepid,"epid: init_record2");
        printf("%ld %p\n",pdset->number, pdset->do_pid);
        return(S_dev_missingSup);
    }
    if (pdset->init_record) {
        if ((status=(*pdset->init_record)(pepid))) return(status);
    }
    return(0);
}
Ejemplo n.º 12
0
static long stringin_init_record(stringinRecord* pr)
{
    int		i;
    char	*parm;
    pvtArea	*pvt = NULL;

	if(pr->inp.type!=INST_IO)
	{
		recGblRecordError(S_db_badField,(void*)pr,
			"devStringinStats (init_record) Illegal INP field");
		return S_db_badField;
	}
	parm = pr->inp.value.instio.string;
	for(i=0;statsGetStrParms[i].name && pvt==NULL;i++)
	{
		if(strcmp(parm,statsGetStrParms[i].name)==0)
		{
			pvt=(pvtArea*)malloc(sizeof(pvtArea));
			pvt->index=i;
			pvt->type=statsGetStrParms[i].type;
		}
	}
	if(pvt==NULL)
	{
		recGblRecordError(S_db_badField,(void*)pr, 
		   "devStringinStats (init_record) Illegal INP parm field");
		return S_db_badField;
	}

    pr->dpvt=pvt;
    return 0;	/* success */
}
Ejemplo n.º 13
0
static long init_ai(aiRecord *prec)
{
    int i;

    if (prec->inp.type != INST_IO) {
        recGblRecordError(S_db_badField, (void *)prec,
                          "devAiGeneralTime::init_ai: Illegal INP field");
        prec->pact = TRUE;
        return S_db_badField;
    }

    for (i = 0; i < NELEMENTS(ai_channels); i++) {
        struct ai_channel *pchan = &ai_channels[i];
        if (!epicsStrCaseCmp(prec->inp.value.instio.string, pchan->name)) {
            prec->dpvt = pchan;
            return 0;
        }
    }

    recGblRecordError(S_db_badField, (void *)prec,
                      "devAiGeneralTime::init_ai: Bad parm");
    prec->pact = TRUE;
    prec->dpvt = NULL;
    return S_db_badField;
}
Ejemplo n.º 14
0
static long init_record(boRecord *prec,int pass)
{
    struct bodset *pdset;
    long status=0;
    myCallback *pcallback;

    if (pass==0) return(0);

    /* bo.siml must be a CONSTANT or a PV_LINK or a DB_LINK */
    if (prec->siml.type == CONSTANT) {
	recGblInitConstantLink(&prec->siml,DBF_USHORT,&prec->simm);
    }

    if(!(pdset = (struct bodset *)(prec->dset))) {
	recGblRecordError(S_dev_noDSET,(void *)prec,"bo: init_record");
	return(S_dev_noDSET);
    }
    /* must have  write_bo functions defined */
    if( (pdset->number < 5) || (pdset->write_bo == NULL) ) {
	recGblRecordError(S_dev_missingSup,(void *)prec,"bo: init_record");
	return(S_dev_missingSup);
    }
    /* get the initial value */
    if (prec->dol.type == CONSTANT) {
	unsigned short ival = 0;

	if(recGblInitConstantLink(&prec->dol,DBF_USHORT,&ival)) {
	    if (ival  == 0)  prec->val = 0;
	    else  prec->val = 1;
	    prec->udf = FALSE;
	}
    }

    pcallback = (myCallback *)(calloc(1,sizeof(myCallback)));
    prec->rpvt = (void *)pcallback;
    callbackSetCallback(myCallbackFunc,&pcallback->callback);
    callbackSetUser(pcallback,&pcallback->callback);
    pcallback->precord = (struct dbCommon *)prec;

    if( pdset->init_record ) {
	status=(*pdset->init_record)(prec);
	if(status==0) {
		if(prec->rval==0) prec->val = 0;
		else prec->val = 1;
		prec->udf = FALSE;
	} else if (status==2) status=0;
    }
    prec->mlst = prec->val;
    /* convert val to rval */
    if ( prec->mask != 0 ) {
	if(prec->val==0) prec->rval = 0;
	else prec->rval = prec->mask;
    } else prec->rval = (epicsUInt32)prec->val;

    prec->mlst = prec->val;
    prec->lalm = prec->val;
    prec->oraw = prec->rval;
    prec->orbv = prec->rbv;
    return(status);
}
Ejemplo n.º 15
0
static long devWaveNI6123_init_record(waveformRecord *precord)
{
	ST_dpvt *pSTdpvt = (ST_dpvt*) malloc(sizeof(ST_dpvt));
	int i;

	switch(precord->inp.type) {
		case INST_IO:
			strcpy(pSTdpvt->recordName, precord->name);
			i = sscanf(precord->inp.value.instio.string, "%s %s %s",
					pSTdpvt->devName, pSTdpvt->arg0, pSTdpvt->arg1);

			kLog (K_INFO, "[devWaveNI6123_init_record] %d: %s %s %s\n",
					i, pSTdpvt->devName, pSTdpvt->arg0, pSTdpvt->arg1);

			pSTdpvt->pSTDdev = (ST_STD_device *)get_STDev_from_name(pSTdpvt->devName);

			if (!pSTdpvt->pSTDdev) {
				recGblRecordError(S_db_badField, (void*) precord,
						"devWaveNI6123 (init_record) Illegal INP field: task name");
				free(pSTdpvt);
				precord->udf = TRUE;
				precord->dpvt = NULL;
				return S_db_badField;
			}

			break;

		default:
			recGblRecordError(S_db_badField, (void*) precord,
					"devWaveNI6123 (init_record) Illegal INP field");
			free(pSTdpvt);
			precord->udf = TRUE;
			precord->dpvt = NULL;

			return S_db_badField;
	}

	pSTdpvt->ind	= -1;

	if (3 == i) {
		if (!strcmp (pSTdpvt->arg1, WAVE_RAW_VALUE_STR)) {
			pSTdpvt->ind		= WAVE_RAW_VALUE;
			pSTdpvt->n32Arg0	= strtoul(pSTdpvt->arg0, NULL, 0);
		}
		else if (!strcmp (pSTdpvt->arg1, WAVE_VALUE_STR)) {
			pSTdpvt->ind		= WAVE_VALUE;
			pSTdpvt->n32Arg0	= strtoul(pSTdpvt->arg0, NULL, 0);
		}
	}
	else {
		kLog (K_ERR, "[devWaveNI6123_init_record] arg cnt (%d) \n",  i );
		return -1;	/*returns: (-1,0)=>(failure,success)*/
	}

	precord->udf	= FALSE;
	precord->dpvt	= (void*) pSTdpvt;

	return 2;    /* don't convert */ 
}
Ejemplo n.º 16
0
LOCAL long init_lo (struct longoutRecord *prec)
{
  struct abio   *pabio;
  devPvt        *pdevPvt;
  abStatus       drvStatus;
  long           status = 0;
  void          *drvPvt;
  short          value[2];

  if (prec->out.type != AB_IO)
  {
    recGblRecordError (S_db_badField, (void *) prec, "init_lo: Bad OUT field");
    return (S_db_badField);
  }

  pabio = (struct abio *) &(prec->out.value);
  drvStatus = (*pabDrv->registerCard) (pabio->link, pabio->adapter, pabio->card,
                                       typeBo, "BINARY", NULL, &drvPvt);
  switch (drvStatus)
  {
  case abSuccess :
    pdevPvt    = (devPvt *) (*pabDrv->getUserPvt) (drvPvt);
    prec->dpvt = pdevPvt;
    break;

  case abNewCard :
    pdevPvt = calloc (1, sizeof (devPvt));
    pdevPvt->drvPvt = drvPvt;
    prec->dpvt      = pdevPvt;
    (*pabDrv->setUserPvt) (drvPvt, (void *) pdevPvt);
    drvStatus = (*pabDrv->setNbits) (drvPvt, abBit16);
    if (drvStatus != abSuccess)
    {
      status = S_db_badField;
      recGblRecordError (status, (void *) prec, "init_lo: setNbits");
      return (status);
    }
    break;

  default:
    status = S_db_badField;
    printf ("init_lo: %s\n", abStatusMessage[drvStatus]);
    recGblRecordError (status, (void *) prec, "init_lo: registerCard");
    return (status);
  }

  drvStatus = (*pabDrv->readBo) (drvPvt, (unsigned long *)value, 0x0000ffff);
  if (drvStatus == abSuccess)
  {
    prec->val = (long)value[1];
    status = 0;
  }
  else
  {
    status = 2;
  }

  return (status);
}
Ejemplo n.º 17
0
static long devBoNI6123_init_record(boRecord *precord)
{
	ST_dpvt *pSTdpvt = (ST_dpvt*) malloc(sizeof(ST_dpvt));
	int i;

	switch(precord->out.type) {
		case INST_IO:
			strcpy(pSTdpvt->recordName, precord->name);
			i = sscanf(precord->out.value.instio.string, "%s",
					pSTdpvt->arg0);

			kLog (K_INFO, "[devBoNI6123_init_record] arg num: %d: %s\n",i, pSTdpvt->arg0);

			ST_MASTER *pMaster = get_master();
			pSTdpvt->pSTDdev = (ST_STD_device*) ellFirst(pMaster->pList_DeviceTask);
			if(!pSTdpvt->pSTDdev) {
				recGblRecordError(S_db_badField, (void*) precord, 
						"devBoNI6123Control (init_record) Illegal INP field: task_name");
				free(pSTdpvt);
				precord->udf = TRUE;
				precord->dpvt = NULL;
				return S_db_badField;
			}

			break;

		default:
			recGblRecordError(S_db_badField,(void*) precord,
					"devBoNI6123Control (init_record) Illegal OUT field");
			free(pSTdpvt);
			precord->udf = TRUE;
			precord->dpvt = NULL;

			return S_db_badField;
	}
	if(!strcmp(pSTdpvt->arg0, BO_AUTO_RUN_STR)) {
                pSTdpvt->ind = BO_AUTO_RUN;
        }
	else if (!strcmp(pSTdpvt->arg0, BO_DAQ_STOP_STR)) {
		pSTdpvt->ind = BO_DAQ_STOP;
	} 
	else if (!strcmp(pSTdpvt->arg0, BO_TREND_RUN_STR)) {
		pSTdpvt->ind = BO_TREND_RUN;
	} 
	else if (!strcmp(pSTdpvt->arg0, BO_CALC_RUN_STR)) {
		pSTdpvt->ind = BO_CALC_RUN;
	} 
	else {
		pSTdpvt->ind = -1;
		kLog (K_ERR, "ERROR! devBoNI6123_init_record: arg0 \"%s\" \n",  pSTdpvt->arg0 );
	}

	precord->udf = FALSE;
	precord->dpvt = (void*) pSTdpvt;

	return 2;	  /*returns:(0,2)=>(success,success no convert*/
}
Ejemplo n.º 18
0
static long process(stringoutRecord *prec)
{
	struct stringoutdset	*pdset = (struct stringoutdset *)(prec->dset);
	long		 status=0;
	unsigned char    pact=prec->pact;

	if( (pdset==NULL) || (pdset->write_stringout==NULL) ) {
		prec->pact=TRUE;
		recGblRecordError(S_dev_missingSup,(void *)prec,"write_stringout");
		return(S_dev_missingSup);
	}
        if (!prec->pact
        && (prec->dol.type != CONSTANT)
        && (prec->omsl == menuOmslclosed_loop)) {
		status = dbGetLink(&(prec->dol),
			DBR_STRING,prec->val,0,0);
		if(prec->dol.type!=CONSTANT && RTN_SUCCESS(status)) prec->udf=FALSE;
	}

        if(prec->udf == TRUE ){
                recGblSetSevr(prec,UDF_ALARM,INVALID_ALARM);
        }

        if (prec->nsev < INVALID_ALARM )
                status=writeValue(prec); /* write the new value */
        else {
                switch (prec->ivoa) {
                    case (menuIvoaContinue_normally) :
                        status=writeValue(prec); /* write the new value */
                        break;
                    case (menuIvoaDon_t_drive_outputs) :
                        break;
                    case (menuIvoaSet_output_to_IVOV) :
                        if(prec->pact == FALSE){
                                strcpy(prec->val,prec->ivov);
                        }
                        status=writeValue(prec); /* write the new value */
                        break;
                    default :
                        status=-1;
                        recGblRecordError(S_db_badField,(void *)prec,
                                "stringout:process Illegal IVOA field");
                }
        }

	/* check if device support set pact */
	if ( !pact && prec->pact ) return(0);

	prec->pact = TRUE;
	recGblGetTimeStamp(prec);
	monitor(prec);
	recGblFwdLink(prec);
	prec->pact=FALSE;
	return(status);
}
Ejemplo n.º 19
0
static long devAoXXX_init_record(aoRecord *precord)
{
	ST_dpvt *pDpvt = (ST_dpvt*) malloc(sizeof(ST_dpvt));
	int nval;
	char arg0[SIZE_DPVT_ARG];
	char arg1[SIZE_DPVT_ARG];
	char arg2[SIZE_DPVT_ARG];

	switch(precord->out.type) 
	{
		case INST_IO:
			nval = sscanf(precord->out.value.instio.string, "%s %s %s %s", pDpvt->devName, arg0, arg1, arg2);
			pDpvt->pSTDdev = get_STDev_from_name(pDpvt->devName);
			if(!pDpvt->pSTDdev) {
				recGblRecordError(S_db_badField, (void*) precord, 
						  "devAoXXX (init_record) Illegal OUT field: task_name");
				free(pDpvt);
				precord->udf = TRUE;
				precord->dpvt = NULL;
				return S_db_badField;
			}
			break;
			
		default:
			recGblRecordError(S_db_badField,(void*) precord,
					  "devAoXXX (init_record) Illegal OUT field");
			free(pDpvt);
			precord->udf = TRUE;
			precord->dpvt = NULL;
			return S_db_badField;
	}


	if (!strcmp(arg0, AO_TEST_1_STR))
		pDpvt->ind = AO_TEST_1;
	
	else if (!strcmp(arg0, AO_TEST_2_STR)) {
		pDpvt->ind = AO_TEST_2;
		pDpvt->n32Arg0 = strtoul(arg1, NULL, 0); /* chennel id */
		pDpvt->n32Arg1 = strtoul(arg2, NULL, 0); /* section id */
	}
	


	else {
		pDpvt->ind = -1;
		epicsPrintf("ERROR!! devAoXXX_init_record: arg0 \"%s\" \n",  arg0 );
	}

	precord->udf = FALSE;
	precord->dpvt = (void*) pDpvt;
	
	return 2;     /*returns: (0,2)=>(success,success no convert)*/
}
Ejemplo n.º 20
0
static long init_ai(struct aiRecord *pai)
{
    int signal;
    int parmOK=0;

    signal = pai->inp.value.vmeio.signal;

    if (pai->inp.type!=VME_IO) {
        recGblRecordError(S_db_badField, (void *)pai,
                          "devLiD212 Init_record, Illegal INP");
        pai->pact=TRUE;
        return (S_db_badField);
    }

    pai->dpvt = (void*) calloc(1, sizeof(recPrivate*));

    ((recPrivate*) pai->dpvt)->pCard = getCardStruct(pai->inp.value.vmeio.card);    do {
        CHECK_AIPARM("FIX_FREQUENCY", CPCI_AI_FIX_FREQUENCY);
        CHECK_AIPARM("WORK_PERIOD", CPCI_AI_WORK_PERIOD);
        CHECK_AIPARM("AMP_SET", CPCI_AI_AMP_SET);
        CHECK_AIPARM("AMP_COEFFICIENT", CPCI_AI_AMP_COEFFICIENT);
        CHECK_AIPARM("AMP_P_SET", CPCI_AI_AMP_P_SET);
        CHECK_AIPARM("AMP_I_SET", CPCI_AI_AMP_I_SET);
        CHECK_AIPARM("AMP_I1_SET", CPCI_AI_AMP_I_SET1);
        CHECK_AIPARM("AMP_I2_SET", CPCI_AI_AMP_I_SET2);
        CHECK_AIPARM("AMP_I3_SET", CPCI_AI_AMP_I_SET3);
        CHECK_AIPARM("BIAS_SET", CPCI_AI_BIAS_SET);
        CHECK_AIPARM("FIX_TUNING_ANGLE", CPCI_AI_FIX_TUNING_ANGLE);
        CHECK_AIPARM("TUNING_ANGLE_OFFSET", CPCI_AI_TUNING_ANGLE_OFFSET);
        CHECK_AIPARM("TUNE_P_SET", CPCI_AI_TUNE_P_SET);
        CHECK_AIPARM("TUNE_I_SET", CPCI_AI_TUNE_I_SET);
        CHECK_AIPARM("TUNE_I1_SET", CPCI_AI_TUNE_I_SET1);
        CHECK_AIPARM("TUNE_I2_SET", CPCI_AI_TUNE_I_SET2);
        CHECK_AIPARM("TUNE_I3_SET", CPCI_AI_TUNE_I_SET3);
        CHECK_AIPARM("FRONT_BIAS_SET", CPCI_AI_FRONT_BIAS_SET);
        CHECK_AIPARM("FRONT_TUNE_P_SET", CPCI_AI_FRONT_TUNE_P_SET);
        CHECK_AIPARM("FRONT_TUNE_I_SET", CPCI_AI_FRONT_TUNE_I_SET);
        CHECK_AIPARM("FRONT_FIX_TUNING_ANGLE", CPCI_AI_FRONT_FIX_TUNING_ANGLE);
        CHECK_AIPARM("PHASE_I", CPCI_AI_PHASE_I);
	CHECK_AIPARM("PHASE_P", CPCI_AI_PHASE_P);
	CHECK_AIPARM("INITIAL_PHASE", CPCI_AI_INITIAL_PHASE);
        CHECK_AIPARM("FF_DELAY", CPCI_AI_FF_DELAY);
        CHECK_AIPARM("ARC_COUNT", CPCI_AI_ARC_COUNT);
    } while(0);

    if (!parmOK) {
        recGblRecordError(S_db_badField, (void *)pai,
                      "devLiD212 Init_record, bad parm");
        pai->pact=TRUE;
        return (S_db_badField);
    }

    return 0;
}
Ejemplo n.º 21
0
static long add_record(dbCommon *pcommon)
{
    aiRecord *prec = (aiRecord *)pcommon;
    DBLINK *plink = &prec->inp;
    dbChannel *chan;
    devPvt *pdevPvt;
    processNotify *ppn;

    if (plink->type == CONSTANT) return 0;

    if (plink->type != PV_LINK) {
	long status = S_db_badField;

        recGblRecordError(status, (void *)prec,
            "devAiSoftCallback (add_record) Illegal INP field");
        return status;
    }

    chan = dbChannelCreate(plink->value.pv_link.pvname);
    if (!chan) {
	long status = S_db_notFound;

        recGblRecordError(status, (void *)prec,
            "devAiSoftCallback (add_record) link target not found");
        return status;
    }

    pdevPvt = calloc(1, sizeof(*pdevPvt));
    if (!pdevPvt) {
        long status = S_db_noMemory;

        recGblRecordError(status, (void *)prec,
            "devAiSoftCallback (add_record) out of memory, calloc() failed");
        return status;
    }
    ppn = &pdevPvt->pn;

    plink->type = PN_LINK;
    plink->value.pv_link.precord = pcommon;
    plink->value.pv_link.pvlMask &= pvlOptMsMode;   /* Severity flags only */

    ppn->usrPvt = prec;
    ppn->chan = chan;
    ppn->getCallback = getCallback;
    ppn->doneCallback = doneCallback;
    ppn->requestType = processGetRequest;

    pdevPvt->options = GET_OPTIONS;

    prec->dpvt = pdevPvt;
    return 0;
}
Ejemplo n.º 22
0
static long devAoRfm5565_init_record(aoRecord *precord)
{
	ST_dpvt *pDpvt = (ST_dpvt*) malloc(sizeof(ST_dpvt));
	int nval;

	switch(precord->out.type) 
	{
		case INST_IO:
			strcpy(pDpvt->recordName, precord->name);
			nval = sscanf(precord->out.value.instio.string, "%s %s", pDpvt->devName, pDpvt->arg0 );
#if 0
			printf("devAo arg num: %d: %s %s\n", nval,  pDpvt->arg0, pDpvt->arg1);
#endif
			pDpvt->pSTDdev = get_STDev_from_name(pDpvt->devName);
			if(!pDpvt->pSTDdev) {
				recGblRecordError(S_db_badField, (void*) precord, 
						  "devAoRfm5565 (init_record) Illegal OUT field: task_name");
				free(pDpvt);
				precord->udf = TRUE;
				precord->dpvt = NULL;
				return S_db_badField;
			}
			break;
			
		default:
			recGblRecordError(S_db_badField,(void*) precord,
					  "devAo (init_record) Illegal OUT field");
			free(pDpvt);
			precord->udf = TRUE;
			precord->dpvt = NULL;
			return S_db_badField;
			
	}


	if (!strcmp(pDpvt->arg0, AO_SET_READ_OFFSET_STR)) {
		pDpvt->ind = AO_SET_READ_OFFSET;
	} else if (!strcmp(pDpvt->arg0, AO_RFM_WRITE_VALUE_STR)) {
		pDpvt->ind = AO_RFM_WRITE_VALUE;
	}

	else {
		pDpvt->ind = -1;
		epicsPrintf("ERROR_Rfm5565! devAoRfm5565_init_record: arg0 \"%s\" \n",  pDpvt->arg0 );
		
	}

	precord->udf = FALSE;
	precord->dpvt = (void*) pDpvt;
	
	return 2;     /*returns: (0,2)=>(success,success no convert)*/
}
Ejemplo n.º 23
0
static long init_bi(struct biRecord *pbi) {
    int parmOK = 0;

    if (pbi->inp.type != VME_IO) {
        recGblRecordError(S_db_badField, (void *)pbi,
                          "devBiD212 Init_record, Illegal INP");
        pbi->pact = TRUE;
        return (S_db_badField);
    }

    pbi->dpvt = (void*) calloc(1, sizeof(recPrivate*));

    ((recPrivate*) pbi->dpvt)->pCard = getCardStruct(pbi->inp.value.vmeio.card);
    do {
    	/******* no int ***********
        CHECK_BIPARM("RUN_MODE",   CPCI_BI_RUN_MODE);
        ****************************/
        CHECK_BIPARM("INT_ENABLE",   CPCI_BI_INT_ENABLE);  
        CHECK_BIPARM("RF_RESET",   CPCI_BI_RF_RESET);
        CHECK_BIPARM("SWEEP_OPTION",   CPCI_BI_SWEEP_OPTION);
        CHECK_BIPARM("AMP_OPTION",   CPCI_BI_AMP_OPTION);
        CHECK_BIPARM("AMP_FF_OPTION",   CPCI_BI_AMP_FF_OPTION);
        CHECK_BIPARM("AMP_MODIFY_OPTION",   CPCI_BI_AMP_MODIFY_OPTION);
        CHECK_BIPARM("TUNE_OPTION",   CPCI_BI_TUNE_OPTION);
        CHECK_BIPARM("FRONT_TUNE_OPTION",   CPCI_BI_FRONT_TUNE_OPTION);
        CHECK_BIPARM("TUNE_FF_OPTION",   CPCI_BI_TUNE_FF_OPTION);
        CHECK_BIPARM("TUNE_MODIFY_OPTION",   CPCI_BI_TUNE_MODIFY_OPTION);
        CHECK_BIPARM("PHASE_OPTION",   CPCI_BI_PHASE_OPTION);
        CHECK_BIPARM("POINT_SWEEP",  CPCI_BI_POINT_SWEEP);
	CHECK_BIPARM("ALARM0",  CPCI_BI_ALARM0);
	CHECK_BIPARM("ALARM1",  CPCI_BI_ALARM1);
	CHECK_BIPARM("ALARM2",  CPCI_BI_ALARM2);
	CHECK_BIPARM("ALARM3",  CPCI_BI_ALARM3);
	CHECK_BIPARM("ALARM4",  CPCI_BI_ALARM4);
	CHECK_BIPARM("ALARM5",  CPCI_BI_ALARM5);
	CHECK_BIPARM("ALARM6",  CPCI_BI_ALARM6);
	CHECK_BIPARM("ALARM7",  CPCI_BI_ALARM7);
	CHECK_BIPARM("PHASE_FF_OPTION",  CPCI_BI_PHASE_FF_OPTION);
	CHECK_BIPARM("PHASE_MODIFY_OPTION",  CPCI_BI_PHASE_MODIFY_OPTION);
	CHECK_BIPARM("DRV_RESET",  CPCI_BI_DRV_RESET);
	CHECK_BIPARM("SG_MODE",  CPCI_BI_SG_MODE);
    } while(0);

    if (!parmOK) {
        recGblRecordError(S_db_badField, (void *)pbi,
                      "devBiD212 Init_record, bad parm");
        pbi->pact=TRUE;
        return (S_db_badField);
    }

    return 0;
}
Ejemplo n.º 24
0
static long devStringinAdmin_init_record(stringinRecord *precord)
{
	ST_devAdmin_dpvt *pdevAdmin_dpvt = (ST_devAdmin_dpvt*) malloc(sizeof(ST_devAdmin_dpvt));
	int nval;

	switch(precord->inp.type) 
	{
		case INST_IO:
			strcpy(pdevAdmin_dpvt->recordName, precord->name);
			nval = sscanf(precord->inp.value.instio.string, "%s", pdevAdmin_dpvt->arg0 );
#if PRINT_DEV_SUPPORT_ARG
			printf("devStringinAdmin arg num: %d: %s\n",nval, pdevAdmin_dpvt->arg0);
#endif
			pdevAdmin_dpvt->ptaskConfig = drvAdmin_get_AdminPtr();
			if(!pdevAdmin_dpvt->ptaskConfig) 
			{
				recGblRecordError(S_db_badField, (void*) precord, 
						  "devStringinAdmin (init_record) Illegal INP field: task_name");
				free(pdevAdmin_dpvt);
				precord->udf = TRUE;
				precord->dpvt = NULL;
				return S_db_badField;
			}
		
		
				   
			break;
		default:
			recGblRecordError(S_db_badField,(void*) precord,
					  "devStringinAdmin (init_record) Illegal INP field");
			free(pdevAdmin_dpvt);
			precord->udf = TRUE;
			precord->dpvt = NULL;
			return S_db_badField;
			
	}


	if(!strcmp(pdevAdmin_dpvt->arg0, STRINGIN_ERROR_STRING_STR)) {
		pdevAdmin_dpvt->ind = STRINGIN_ERROR_STRING;
	}  
	else {
		pdevAdmin_dpvt->ind = -1;
		epicsPrintf("ERROR! devStringinAdmin_init_record: arg0 \"%s\" \n",  pdevAdmin_dpvt->arg0 );
	}

	precord->udf = FALSE;
	precord->dpvt = (void*) pdevAdmin_dpvt;
	
	return 0;    /*returns: (-1,0)=>(failure,success)*/
}
Ejemplo n.º 25
0
static long devStringoutV792Control_init_record(stringoutRecord *precord)
{
	ST_dpvt *pST_dpvt = (ST_dpvt*) malloc(sizeof(ST_dpvt));
	int i;
	char arg0[SIZE_DPVT_ARG];
	char arg1[SIZE_DPVT_ARG];

	switch(precord->out.type) 
	{
		case INST_IO:
			i = sscanf(precord->out.value.instio.string, "%s %s %s", pST_dpvt->devName, arg0, arg1);

#if PRINT_DEV_SUPPORT_ARG
			epicsPrintf("devAoV792Control arg num: %d: %s %s\n",i, pST_dpvt->devName,  arg0, arg1);
#endif
			pST_dpvt->pSTDdev = get_STDev_from_name(pST_dpvt->devName);
			if(!pST_dpvt->pSTDdev) {
				recGblRecordError(S_db_badField, (void*) precord, 
						  "devStringoutV792Control (init_record) Illegal INP field: task_name");
				free(pST_dpvt);
				precord->udf = TRUE;
				precord->dpvt = NULL;
				return S_db_badField;
			}
			break;
			
		default:
			recGblRecordError(S_db_badField,(void*) precord,
					  "devStringoutV792Control (init_record) Illegal OUT field");
			free(pST_dpvt);
			precord->udf = TRUE;
			precord->dpvt = NULL;
			return S_db_badField;
			
	}


	if(!strcmp(arg0, STRINGOUT_TAG_STR)) {
		pST_dpvt->ind = STRINGOUT_TAG;
		pST_dpvt->n32Arg0 = strtoul(arg1, NULL, 0); /* port id */
	}
	else {
		pST_dpvt->ind = -1;
		epicsPrintf("ERROR! devStringoutV792Control_init_record: arg0 \"%s\" \n",  pST_dpvt->arg0 );
	}

	precord->udf = FALSE;
	precord->dpvt = (void*) pST_dpvt;
	
	return 0; /*returns: (-1,0)=>(failure,success)*/
}
Ejemplo n.º 26
0
static long init_record(lsoRecord *prec, int pass)
{
    lsodset *pdset;

    if (pass == 0) {
        size_t sizv = prec->sizv;

        if (sizv < 16) {
            sizv = 16;  /* Enforce a minimum size for the VAL field */
            prec->sizv = sizv;
        }

        prec->val = callocMustSucceed(1, sizv, "lso::init_record");
        prec->len = 0;
        prec->oval = callocMustSucceed(1, sizv, "lso::init_record");
        prec->olen = 0;
        return 0;
    }

    dbLoadLink(&prec->siml, DBF_USHORT, &prec->simm);

    pdset = (lsodset *) prec->dset;
    if (!pdset) {
        recGblRecordError(S_dev_noDSET, prec, "lso: init_record");
        return S_dev_noDSET;
    }

    /* must have a write_string function defined */
    if (pdset->number < 5 || !pdset->write_string) {
        recGblRecordError(S_dev_missingSup, prec, "lso: init_record");
        return S_dev_missingSup;
    }

    dbLoadLinkLS(&prec->dol, prec->val, prec->sizv, &prec->len);

    if (pdset->init_record) {
        long status = pdset->init_record(prec);

        if (status)
            return status;
    }

    if (prec->len) {
        strcpy(prec->oval, prec->val);
        prec->olen = prec->len;
        prec->udf = FALSE;
    }

    return 0;
}
Ejemplo n.º 27
0
static long devBiXXX_init_record(biRecord *precord)
{
	ST_dpvt *pDpvt = (ST_dpvt*) malloc(sizeof(ST_dpvt));
	int nval;

	char arg0[SIZE_DPVT_ARG];
	char arg1[SIZE_DPVT_ARG];
	
	switch(precord->inp.type) 
	{
		case INST_IO:
			nval = sscanf(precord->inp.value.instio.string, "%s %s %s", pDpvt->devName, arg0, arg1);
			pDpvt->pSTDdev = get_STDev_from_name(pDpvt->devName);
			if(!pDpvt->pSTDdev) {
				recGblRecordError(S_db_badField, (void*) precord,
						  "devBiXXX (init_record) Illegal INP field: task name");
				free(pDpvt);
				precord->udf = TRUE;
				precord->dpvt = NULL;
				return S_db_badField;
			}
			break;
			
		default:
			recGblRecordError(S_db_badField, (void*) precord,
					  "devBiXXX (init_record) Illegal INP field");
			free(pDpvt);
			precord->udf = TRUE;
			precord->dpvt = NULL;
			return S_db_badField;
	}

	
	if(!strcmp(arg0, BI_TEST_1_STR)) {
		pDpvt->ind = BI_TEST_1;
		pDpvt->n32Arg0 = strtoul(arg1, NULL, 0); /* chennel id */	
	}
	else if(!strcmp(arg0, BI_TEST_2_STR))
		pDpvt->ind = BI_TEST_2;

	else {
		pDpvt->ind = -1;
		epicsPrintf("ERROR!! devBiXXX_init_record: arg0 \"%s\" \n",  arg0 );
	}

	precord->udf = FALSE;
	precord->dpvt = (void*) pDpvt;

	return 0;    /*returns: (-1,0)=>(failure,success)*/
}
Ejemplo n.º 28
0
static long devBiNI6254_init_record(biRecord *precord)
{
	ST_dpvt *pSTdpvt = (ST_dpvt*) malloc(sizeof(ST_dpvt));
	int i;

	switch(precord->inp.type) {
		case INST_IO:
			strcpy(pSTdpvt->recordName, precord->name);
			i = sscanf(precord->inp.value.instio.string, "%s", pSTdpvt->arg0);

			kLog (K_INFO, "[devBiNI6254_init_record] %d: %s\n", i, pSTdpvt->arg0);

			pSTdpvt->pMaster = get_master();

			if (!pSTdpvt->pMaster) {
				recGblRecordError(S_db_badField, (void*) precord,
						"devBiNI6254 (init_record) Illegal INP field: task name");
				free(pSTdpvt);
				precord->udf = TRUE;
				precord->dpvt = NULL;
				return S_db_badField;
			}

			break;

		default:
			recGblRecordError(S_db_badField, (void*) precord,
					"devBiNI6254 (init_record) Illegal INP field");
			free(pSTdpvt);
			precord->udf = TRUE;
			precord->dpvt = NULL;

			return S_db_badField;
	}

	pSTdpvt->ind	= -1;

	if (0) {
	}
	else {
		kLog (K_ERR, "[devBiNI6254_init_record] arg cnt (%d) \n",  i );
		return -1;	/*returns: (-1,0)=>(failure,success)*/
	}

	precord->udf	= FALSE;
	precord->dpvt	= (void*) pSTdpvt;

	return 0;
}
Ejemplo n.º 29
0
/***************************************************
* scaler_init_record()
****************************************************/
STATIC long scaler_init_record(struct scalerRecord *psr, CALLBACK *pcallback)
{
	int card = psr->out.value.vmeio.card;
	int status;
	devScalerPvt *dpvt;

	Debug(5,"scaler_init_record: card %d\n", card);
	dpvt = (devScalerPvt *)calloc(1, sizeof(devScalerPvt));
	dpvt->card = card;
	psr->dpvt = dpvt;
	if (scaler_state == NULL) {
		recGblRecordError(S_dev_noDevSup,(void *)psr, "");
		return(S_dev_noDevSup);
	}
	scaler_state[card]->psr = psr;

	/* out must be an VME_IO */
	switch (psr->out.type)
	{
	case (VME_IO) : break;
	default:
		recGblRecordError(S_dev_badBus,(void *)psr,
			"devScaler (init_record) Illegal OUT Bus Type");
		return(S_dev_badBus);
	}

	Debug(5,"VME scaler: card %d\n", card);
	if (!scaler_state[card]->card_exists)
	{
		recGblRecordError(S_dev_badCard,(void *)psr,
		    "devScaler (init_record) card does not exist!");
		return(S_dev_badCard);
    }

	if (scaler_state[card]->card_in_use)
	{
		recGblRecordError(S_dev_badSignal,(void *)psr,
		    "devScaler (init_record) card already in use!");
		return(S_dev_badSignal);
    }
	scaler_state[card]->card_in_use = 1;
	psr->nch = scaler_state[card]->num_channels;

	/* setup interrupt handler */
	scaler_state[card]->pcallback = pcallback;
	status = scalerISRSetup(card);

	return(0);
}
Ejemplo n.º 30
0
LOCAL long init_signed_ai (struct aiRecord *prec)
{
  struct abio   *pabio;
  devPvt        *pdevPvt;
  abStatus       drvStatus;
  long	         status = 0;
  void          *drvPvt;

  if (prec->inp.type != AB_IO)
  {
    recGblRecordError (S_db_badField, (void *) prec, "init_signed_ai: Bad INP field");
    return (S_db_badField);
  }

  /* set linear conversion slope*/
  prec->eslo = (prec->eguf -prec->egul)/65535.0;
  /* pointer to the data addess structure */
  pabio = (struct abio *) &(prec->inp.value);
  drvStatus = (*pabDrv->registerCard) (pabio->link, pabio->adapter, pabio->card,
                                       typeBi, "BINARY", devCallback, &drvPvt);
  switch (drvStatus)
  {
  case abSuccess :
    pdevPvt    = (devPvt *) (*pabDrv->getUserPvt) (drvPvt);
    prec->dpvt = pdevPvt;
    break;

  case abNewCard :
    pdevPvt = calloc (1, sizeof (devPvt));
    pdevPvt->drvPvt = drvPvt;
    prec->dpvt      = pdevPvt;
    (*pabDrv->setUserPvt) (drvPvt, (void *) pdevPvt);
    scanIoInit (&pdevPvt->ioscanpvt);
    drvStatus = (*pabDrv->setNbits) (drvPvt, abBit16);
    if (drvStatus != abSuccess)
    {
      status = S_db_badField;
      recGblRecordError (status, (void *) prec, "init_signed_ai: setNbits");
    }
    break;

  default:
    status = S_db_badField;
    recGblRecordError (status, (void *)prec, "init_signed_ai: registerCard");
    break;
  }

  return (status);
}