|
|
Experimental Physics and
| ||||||||||||||
|
|
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. #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(0);
}
static long init_record()
{
return(0);
}
static long read_ai(precord)
struct aiRecord *precord;
{
char myptr[100];
int e;
DBADDR *dbaddr;
precord->VAL=2;
e=precord->VAL;
dbaddr= dbGetPdbAddrFromLink(precord->inp);
dbPut(dbaddr,precord->DOUBLE,(void *)myptr,&e);
//printf("value=",e);
return(0);
}
Attachment:
dbtest.dbd
| ||||||||||||||
| ANJ, 16 Dec 2015 |
·
Home
·
News
·
About
·
Talk
·
Base
·
Modules
·
Extensions
·
· Distributions · Download · Documents · Links · Licensing · |