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  2015  <20162017  2018  2019  2020  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020 
<== Date ==> <== Thread ==>

Subject: read value from ai record to Device support
From: ishita bhatia <ishita3006@gmail.com>
To: EPICS Tech-Talk <tech-talk@aps.anl.gov>
Date: Tue, 1 Mar 2016 15:37:48 +0530
Hello,
I am trying to read value in ai record but following code attached herewith generates Segmentation Fault ( core dumbed) error on running ioc. I am attaching c file for consideration.
Please guide.

Thanks and Regards,
Ishita Bhatia
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

#include "alarm.h"
#include "cvtTable.h"
#include "dbDefs.h"
#include "dbAccess.h"
#include "recGbl.h"
#include "recSup.h"
#include "devSup.h"
#include "link.h"
#include "aiRecord.h"
#include "waveformRecord.h"
#include "epicsExport.h"
#include "endian.h"

static long read_GV0();


//------------------------------------ai struct to read GV0--------------------//
struct {
 long       number;
 DEVSUPFUN  report;
 DEVSUPFUN  init;
 DEVSUPFUN  init_record;
 DEVSUPFUN  get_ioint_info;
 DEVSUPFUN  read_GV0;
 DEVSUPFUN  special_linconv;
}devaiGV0={
      6,
      NULL,
      NULL,
      NULL,
      NULL,
      read_GV0,
      NULL};
epicsExportAddress(dset,devaiGV0);


//----------------------------CODE TO READ GV0 VALUE------------------
static long read_GV0(pGV0)
struct aiRecord *pGV0;
{
	long int t;
	
	struct dbAddr *paddr;
	t = pGV0->val;

	paddr = dbGetPdbAddrFromLink(&pGV0->inp);
	dbGet(paddr,DBR_FLOAT,(void *)t,0,1,NULL);
	printf("GV0=%ld",t);
return(2);
}



Replies:
RE: read value from ai record to Device support Mark Rivers
Re: read value from ai record to Device support Xiaoxu Ren
Re: read value from ai record to Device support Michael Davidsaver

Navigate by Date:
Prev: Re: Questions regarding PV access within CSS Abdalla Al-Dalleh
Next: RE: read value from ai record to Device support Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020 
Navigate by Thread:
Prev: Re: PV with TSE=-2 and SCAN=I/O Intr returns <undefined> time. Enrique Bernal
Next: RE: read value from ai record to Device support Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020 
ANJ, 15 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·