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: related to coding
From: priya tiwari <[email protected]>
To: "Mooney, Tim M." <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Mon, 2 Feb 2015 10:35:44 +0530
Thanks Sir,
I changed in a code but still i got the errors at run time.please provide me solution.

On Mon, Feb 2, 2015 at 9:50 AM, Mooney, Tim M. <[email protected]> wrote:
Hi Priya,

Return 2, instead of 0, from read_ai.  That tells the record that you put the value in VAL.  If you return 0, you are telling the record you put the value in RVAL, and that the record should convert RVAL to get VAL.
See "Device Support Routines" in 

Tim Mooney ([email protected]) (630)252-5417
Software Services Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab


From: [email protected] [[email protected]] on behalf of priya tiwari [[email protected]]
Sent: Sunday, February 01, 2015 9:54 PM
To: [email protected]
Subject: related to coding

Hello,
I am trying to write the value into val field of ai record from device support.I am beginner in EPICS so I have no idea about this. But i have tried then i got the errors at run time please help me.I am attaching code file.
Thanks in advance...

Attachment: Screenshot from 2015-02-02 10:30:06.png
Description: PNG image

#include <stdio.h>
#include <stddef.h>
#include <string.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 "epicsExport.h"

static long init();
static long init_record();
static long read_ai();

char buf[100];

struct {
 long       number;
 DEVSUPFUN  report;
 DEVSUPFUN  init;
 DEVSUPFUN  init_record;
 DEVSUPFUN  get_ioint_info;
 DEVSUPFUN  read_ai;
 DEVSUPFUN  special_linconv;
}devaiVal={
      6,
      NULL,
      init,
      init_record,
      NULL,
      read_ai,
      NULL};
epicsExportAddress(dset,devaiVal);

static long init()
{

return(2);
}

static long init_record(precord)
struct aiRecord *precord;
{
 switch (precord->inp.type) {
    case (CONSTANT) :
	return(0);
	break;
    case (PV_LINK) :
    case (DB_LINK) : 
    case (CA_LINK) :
    break;
    default :
	recGblRecordError(S_db_badField,(void *)precord,
		"devWfSoft (init_record) Illegal INP field");
	return(S_db_badField);
    }
return(2);
}

static long read_ai(precord) 
struct aiRecord *precord;
{
char myptr[100];
int e;
DBADDR *dbaddr;
precord->VAL=3;
e=precord->VAL;
dbaddr= dbGetPdbAddrFromLink(precord->inp);
dbPut(dbaddr,precord->DOUBLE,(void *)myptr,&e);
//printf("value=",e);
return(2);
}


Replies:
Re: related to coding Mark Engbretson
References:
related to coding priya tiwari
RE: related to coding Mooney, Tim M.

Navigate by Date:
Prev: RE: related to coding Mooney, Tim M.
Next: Re: related to coding Mark Engbretson
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: related to coding Mooney, Tim M.
Next: Re: related to coding Mark Engbretson
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 ·