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: Ana Malagon <[email protected]>
To: Mark Rivers <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Thu, 15 Jan 2015 11:50:43 -0800

Hi Mark,

Thanks -  I've moved over to StreamDevice and now have a very simpleminded question. I've created a test application following the instructions here; make runs successfully in my top directory. When I run st.cmd, however, I get a 'no reply from device with 1000 ms'. I believe I'm using up to date versions of asyn (4.22), stream (2.6), and base (3.14). I'm sure I'm missing something obvious - is there some other setup step that I should have done? Below is the output from st.cmd -

Thanks,

Ana

admx@admxcontrol:~/admxepics/devices/fieldfoxstream/iocBoot/iocFIELDFOXSTREAMtest$ ./st.cmd

#!../../bin/linux-x86_64/FIELDFOXSTREAMtest

## You may have to change FIELDFOXSTREAMtest to something else

## everywhere it appears in this file

< envPaths

epicsEnvSet("ARCH","linux-x86_64")

epicsEnvSet("IOC","iocFIELDFOXSTREAMtest")

epicsEnvSet("TOP","/home/admx/admxepics/devices/fieldfoxstream")

epicsEnvSet("ASYN","/home/admx/epics/asyn4-22")

epicsEnvSet("STREAM","/home/admx/epics/StreamDevice-2-6")

epicsEnvSet("EPICS_BASE","/home/admx/epics/base-3.14.12.4")

epicsEnvSet "STREAM_PROTOCOL_PATH" "/home/admx/admxepics/devices/fieldfoxstream/db"

epicsEnvSet "P" "fieldfoxstream"

epicsEnvSet "R" "Test"

cd /home/admx/admxepics/devices/fieldfoxstream

## Register all support components

dbLoadDatabase "dbd/FIELDFOXSTREAMtest.dbd"

FIELDFOXSTREAMtest_registerRecordDeviceDriver pdbbase

drvAsynIPPortConfigure("L0", "10.95.101.76:5025", 0, 0, 0)

asynOctetSetInputEos("L0", 0, "\n")

st.cmd line 18: Command asynOctetSetInputEos not found.

asynOctetSetOutputEos("L0", 0, "\n")

st.cmd line 19: Command asynOctetSetOutputEos not found.

asynSetTraceIOMask("L0", -1, 0x2)

st.cmd line 20: Command asynSetTraceIOMask not found.

asynSetTraceMask("L0", -1, 0x9)

st.cmd line 21: Command asynSetTraceMask not found.

## Load record instances

dbLoadRecords("db/devFIELDFOXSTREAM.db","P=fieldfoxstream, R=Test, PORT=L0, A=0")

cd /home/admx/admxepics/devices/fieldfoxstream/iocBoot/iocFIELDFOXSTREAMtest

iocInit

Starting iocInit

############################################################################

## EPICS R3.14.12.4 $Date: Mon 2013-12-16 15:51:45 -0600$

## EPICS Base built May 20 2014

############################################################################

cas warning: Configured TCP port was unavailable.

cas warning: Using dynamically assigned TCP port 43138,

cas warning: but now two or more servers share the same UDP port.

cas warning: Depending on your IP kernel this server may not be

cas warning: reachable with UDP unicast (a host's IP in EPICS_CA_ADDR_LIST)

iocRun: All initialization complete

## Start any sequence programs

#seq sncxxx,"user=admxHost"

epics> 2015/01/15 11:20:44.557860 L0 fieldfoxstreamTestIDN: No reply from device within 1000 ms

2015/01/15 11:20:45.559805 L0 fieldfoxstreamTestIDNwf: No reply from device within 1000 ms


On Wed, Jan 14, 2015 at 12:03 PM, Mark Rivers <[email protected]> wrote:

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 Eric Norum
References:
calling the output of one record into another record Ana Malagon
RE: calling the output of one record into another record Mark Rivers

Navigate by Date:
Prev: Job Openings at Daresbury Laboratory graham.cox
Next: Re: calling the output of one record into another record Eric Norum
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: RE: calling the output of one record into another record Mark Rivers
Next: Re: calling the output of one record into another record Eric Norum
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 ·