EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: calling the output of one record into another record
From: Mark Rivers <[email protected]>
To: "'Ana Malagon'" <[email protected]>, "[email protected]" <[email protected]>
Date: Wed, 14 Jan 2015 20:03:25 +0000

Hi Ana,

 

If you are new to EPICS then I suggest that you not use the devGPIB support that you appear to be using, but rather use the StreamDevice support.  devGPIB is obsolete and is not being developed any more.  We still support it for existing applications, but it really should not be used for new applications.

 

Mark

 

 

From: [email protected] [mailto:[email protected]] On Behalf Of Ana Malagon
Sent: Wednesday, January 14, 2015 1:32 PM
To: [email protected]
Subject: calling the output of one record into another record

 

Hi,

 

Sorry, this is a newbie Epics question: I'm working on making an IOC for a fieldfox network analyzer (model KT-N9918A) and need to cut off the number of values returned in a 'read measurement' command based on the number of points in the measurement, but I'm not sure how to go about doing this.

 

I have one record to store the number of points in the measurement, and another record that reads in the measurement values - how would I go about incorporating the number of points in the 'read measurement' record?

 

 

Here is how I've defined the read measurement command:

 /* Param 18 -- Read S21 Format: (Re,Im) dB */

    {&DSET_WF, GPIBREAD, IB_Q_HIGH, ":CALC1:PAR1:DEF S21;:CALC1:PAR1:SEL;:CALC1\

:SEL:DATA:SDAT?", NULL, 0, 1E6, readWF, 0, 0, NULL, NULL, NULL}

and here is the query of the points:

    /* Param 21 - Get Points in Sweep */

    {&DSET_AI, GPIBREAD, IB_Q_HIGH, ":SENS1:SWE:POIN?", NULL, 0, 100, readData, 0, 0, N\

ULL, NULL, NULL},

where the conversion function readWF is defined as:

static int readWF(struct gpibDpvt *pdpvt,int P1, int P2, char**P3) {

  struct waveformRecord *pwf=(struct waveformRecord *)pdpvt->precord;

  asynUser *pasynUser = pdpvt->pasynUser;

  double* value = (double *)pwf->bptr;

  const char* cpymsg = pdpvt->msg;

  double data;

  int n;

  pwf->nord=0;

  while ((pwf->nord < pwf->nelm) && sscanf(cpymsg,"%lE,%n",&data,&n)==1) {

    if (P1==1) data/=1E6;

    if (P1==2 && (pwf->nord==0 || pwf->nord==1)) data/=1E6;

    memcpy(value+pwf->nord,&data,sizeof(double));

    pwf->nord++;

    cpymsg+=n;

       asynPrint(pasynUser,ASYN_TRACE_FLOW,"(NORD,VAL) : (%i,%E)\n",pwf->nord,data);   \

  }

  if (pwf->nord == 0) return -1;

  pwf->udf = 0;

  return 0;

}

the readData conversion function is:

 

static int readData(struct gpibDpvt *pdpvt,int P1, int P2, char**P3) {

  struct aiRecord *pai=(struct aiRecord *)pdpvt->precord;

printf("got: %s\n",pdpvt->msg);

  double meas =(double)atof(pdpvt->msg);

  pai->val = meas;

  pai->udf = 0;

  return 0;

}

and the database definition entry for the read measurement comand is below, where NELM was defined to be 2x the maximum number of points one can request in a measurement:

record(waveform, "$(P):S21")

{

    field(DESC, "S21 (Re,Im)")

    field(EGU,"dB")

    field(SCAN, "Passive")

    field(NELM, "20002")

    field(DTYP, "fieldfox")

    field(FTVL, "DOUBLE")

    field(INP,  "#L$(L) A$(A) @18")

    field(FLNK, "$(P):FREQ")

    field(DISV, "0")

    field(SDIS, "$(P):OPC.VAL PP")

}

 

The reason I need to cut off the values is because the current syntax in the read measurement command not only returns the measurement data but also the x-axis values, which I don't want.

 

Sorry again for the very basic question, and thanks!

 

Ana Malagon


Replies:
Re: calling the output of one record into another record Ana Malagon
References:
calling the output of one record into another record Ana Malagon

Navigate by Date:
Prev: calling the output of one record into another record Ana Malagon
Next: Alarm annunciation with ALH and other PC based systems Rod Nussbaumer
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: calling the output of one record into another record Ana Malagon
Next: Re: calling the output of one record into another record Ana Malagon
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·