EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: problem in communicating to the GPIB device with ASYN4-6
From: Eric Norum <[email protected]>
To: zhangdemin99 <[email protected]>
Cc: tech-talk <[email protected]>
Date: Thu, 2 Aug 2007 08:45:51 -0500
On Aug 2, 2007, at 5:51 AM, zhangdemin99 wrote:

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")
I suggest that you set the end-of-string values here rather than in the devGpib command table entries. For example:
asynOctetSetInputEos("L0",-1,"\n")
asynOctetSetOutputEos("L0",-1,"\n")



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.


I have declared the command array as follows:
{&DSET_SO,GPIBWRITE,IB_Q_LOW,0,"DISPlay:TEXT \"%S""EOSNL, 0,200,0,0,0,0,0,EOSNL},
1) You need to use a lower-case character for the format string.
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);
}

Who can give me any suggestion?
many thanks in advance.

zhang demin






劲 爆 150 万 同 时 在 线,众 人 追 捧 梦 幻 西 游

-- Eric Norum <[email protected]> Advanced Photon Source Argonne National Laboratory (630) 252-4793




Replies:
Re: problem in communicating to the GPIB device with ASYN4-6 Emmanuel Mayssat
References:
problem in communicating to the GPIB device with ASYN4-6 zhangdemin99

Navigate by Date:
Prev: problem in communicating to the GPIB device with ASYN4-6 zhangdemin99
Next: Web page, Re: EPICS Meeting in conjunction with ICALEPCS Kay-Uwe Kasemir
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: problem in communicating to the GPIB device with ASYN4-6 zhangdemin99
Next: Re: problem in communicating to the GPIB device with ASYN4-6 Emmanuel Mayssat
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Nov 2011 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·