I have created a device support to fetch data from waveform record and this waveform record gets input from asyn record. When I run ioc I get error as Segmentation fault(core dumped).
kindly suggest how to resolve this error.
[srk@srk VME]$ cd iocBoot/iocmyExample/
[srk@srk iocmyExample]$ ./st.cmd
#!../../bin/linux-x86/myExample
## You may have to change myExample to something else
## everywhere it appears in this file
< envPaths
epicsEnvSet("ARCH","linux-x86")
epicsEnvSet("IOC","iocmyExample")
epicsEnvSet("TOP","/home/srk/VME")
epicsEnvSet("ASYN","/home/srk/EPICS/R3.14.12.1/synApps_5_7/support/asyn-4-21")
epicsEnvSet("CALC","/home/srk/EPICS/R3.14.12.1/synApps_5_7/support/calc-3-2")
epicsEnvSet("EPICS_BASE","/home/srk/EPICS/R3.14.12.1/base")
cd /home/srk/VME
## Register all support components
dbLoadDatabase "dbd/myExample.dbd"
myExample_registerRecordDeviceDriver pdbbase
## initialize port for test serial
drvAsynSerialPortConfigure("L2","/dev/ttyS0",0,0,0)
asynSetOption("L2",-1,"baud","19200")
asynSetOption("L2",-1,"bits","8")
asynSetOption("L2",-1,"parity","none")
asynSetOption("L2",-1,"stop","1")
asynSetOption("L2",-1,"clocal","Y")
## Load record instances
dbLoadTemplate "db/userHost.substitutions"
dbLoadRecords "db/dbSubExample.db", "user=srkHost"
dbLoadRecords "db/project.db"
Can't set "wafData.INP" to "vmeInput.BINP"
Error at or before ")" in file "db/project.db" line 29
## Set this to see messages from mySub
#var mySubDebug 1
## Run this to trace the stages of iocInit
#traceIocInit
cd /home/srk/VME/iocBoot/iocmyExample
iocInit
Starting iocInit
############################################################################
## EPICS R3.14.12.1 $Date: Tue 2011-04-26 15:36:19 -0500$
## EPICS Base built Oct 7 2014
############################################################################
iocRun: All initialization complete
## Start any sequence programs
#seq sncExample, "user=srkHost"
../online_notify.c: CA beacon (send to "
127.0.0.1:5065") error was "Connection refused"
Value=5
../online_notify.c: CA beacon (send to "
127.0.0.1:5065") error was "Connection refused"
Value=5
epics>
Value=5
Value=5
Value=5
Value=5
../online_notify.c: CA beacon (send to "
127.0.0.1:5065") error was "Connection refused"
Value=5
Value=5
Value=5
Value=5
Value=5
Value=5
Value=5
Value=5
Value=5
Value=5
Segmentation fault (core dumped)
[srk@srk iocmyExample]$
record(asyn, vmeInput) {
field(SCAN, "1 second")
field(DTYP, "asynRecordDevice")
field(FLNK, "wafData")
field(PORT, "L2")
field(TMOD, "Write/Read")
field(IFACE, "asynOctet")
field(AOUT, "ST03@U#PKT01!")
field(OFMT, "ASCII")
field(NRRD, "80")
field(IFMT, "Hybrid")
field(BAUD, "19200")
field(PRTY, "None")
field(DBIT, "8")
field(SBIT, "1")
field(CNCT, "Connect")
field(ENBL, "Enable")
}
record(waveform, wafData) {
field(SCAN, "Passive")
field(DTYP, "wafsupport")
field(INP, "vmeInput.BINP")
field(NELM, "72")
field(FTVL, "CHAR")
field(FLNK, "forwardlink")
}
record(ai, analogInput) {
field(SCAN, ".1 second")
field(DTYP, "aisupport")
}
#include <stdio.h>
#include <string.h>
#include <stddef.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"
//static int v=1;
static int v=2,y=3,z;
//long n;
//char myptr[72];
//struct DBADDR *paddr;
static long read_aiValue();
//static long read_aiValue1();
static long read_waveform();
// structure for ai
struct
{
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_aiValue;
DEVSUPFUN special_linconv;
}
devmyai = {
6,
NULL,
NULL,
NULL,
NULL,
read_aiValue,
NULL};
epicsExportAddress(dset,devmyai);
//------------STRUCTURE FOR WAVEFORM---------
struct
{
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_waveform;
}
devmywaveform = {
5,
NULL,
NULL,
NULL,
NULL,
read_waveform};
epicsExportAddress(dset,devmywaveform);
static long read_aiValue(pai)
struct aiRecord *pai;
{
//static int v=2,y=3,z;
pai->val=(v+y);
z=(v+y);
printf("\nValue=%d\n",z);
return(2);
}
static long read_waveform(pwaf)
struct waveformRecord *pwaf;
{
long int n;
char myptr[100];
struct dbAddr *paddr;
//long status,n;
n = pwaf->nelm;
paddr = dbGetPdbAddrFromLink(&pwaf->inp);
dbGet(paddr,pwaf->ftvl,(void *)myptr,0,&n,NULL);
//printf("\nstatus=%s\n",myptr);
return 0;
}
Please help me with this error.