Experimental Physics and
| |||||||||||||||||
|
I suggest that you set the end-of-string values here rather than in the devGpib command table entries. For example:Dear all, There are something wrong when I run the application, and it says: #!../../bin/linux-x86/PSM6003 ##You may have to change PSM6003 to something else ##everywhere it appears in this file #<envPaths ##Register all support components dbLoadDatabase("../../dbd/PSM6003dbd",0,0) PSM6003_registerRecordDeviceDriver(pdbbase) ##Load record instances dbLoadRecords("../../db/psm6003.db","P=PSM6003:,R=,L=0,A=0") drvAsynSerialPortConfigure("L0","/dev/ttyS0",0,0,0) asynSetOption("L0",-1,"baud","9600") asynSetOption("L0",-1,"bits","8") asynSetOption("L0",-1,"parity","none") asynSetOption("L0",-1,"stop","1") asynSetOption("L0",-1,"clocal","Y") asynSetOption("L0",-1,"crtscts","N") asynOctetSetInputEos("L0",-1,"\n") asynOctetSetOutputEos("L0",-1,"\n") 1) You need to use a lower-case character for the format string.asynSetTraceMask("L0",-1,0x9) asynSetTraceIOMask("L0",-1,0x2) iocInit() Starting iocInit ############################################################ ##EPICS R3.149-$R3-14-9-prel $2006/11/20 21:09:36$ ##EPICS Base built May 13 2007 ############################################################ The CA server's beacon address list was empty after initilization? iocInit:All initilization complete ##start any sequence programs #seq sncPSM6003,"user=zhm" epics>2007/08/02 16:18:38.422 /dev/ttyS0 write 15 DISPlay:TEXT?LF 2007/08/02 16:18:48.422 display-query read status ""nin 0 2007/08/02 16:18:48.422 display-query error. 2) As mentioned above, it is better to set the end-of-string values elsewhere. With these changes the command table entry becomes: {&DSET_SO,GPIBWRITE,IB_Q_LOW,NULL,"DISP:TEXT \"%s"",0,200,NULL, 0,0,NULL,NULL,NULL} {&DSET_SI,GPIBREAD,IB_Q_LOW,"DISPlay:TEXT?"EOSNL,0,0,200,readString, 0,0,0,0,EOSNL}You don't need a custom conversion function. The following should work: &DSET_SI,GPIBREAD,IB_Q_LOW,"DISP:TEXT?","%39[^\r\n]",0,200,NULL, 0,0,NULL,NULL,NULL} static int readString(gpibDpvt *pdpvt,int P1, int P2,char **P3) {stringinRecord *prec=(stringinRecord*)pdpvt->precord; strncpy(pre->val,pdpvt->msg,sizeof(prec->val)); prec->val[sizeof(prec->val)-1]=0; return(0); }
| ||||||||||||||||
ANJ, 10 Nov 2011 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |