EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  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  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Bug in asyn 4-7 and up ??
From: Eric Norum <[email protected]>
To: "[email protected] Techtalk" <[email protected]>
Date: Mon, 19 Oct 2009 10:13:43 -0500
On Oct 19, 2009, at 4:05 AM, [email protected] wrote:

Hi Eric,
last week I was going to switch from asyn 4-6 to asyn 4-10 and I run into a problem with an IEEE- device.

This device uses a simple linefeed char to terminate a reply and does not use the EOI line. And here is where the problem occurred: Reading a reply from the device makes the softIOC crash. Some debugging and reading the code revealed that it crashes in line 413 of function readIt (file asynGpib.c)

*eomReason |= ASYN_EOM_EOS; (This line was added in release 4-7 for the first time)

Nothing wrong with that code, but the calling function, which is gpibRead (file devSupportGpib.c), does not
pass a proper address for eomReason:

status = pasynOctet->read(asynOctetPvt,pasynUser,pgpibDpvt- >msg,pgpibCmd->msgLen,&nchars,0);

I have changed this in my local copy to:

status = pasynOctet->read(asynOctetPvt,pasynUser,pgpibDpvt- >msg,pgpibCmd->msgLen,&nchars,&eomReason);

and now I can read the device without problems.


I have attached my versions of asynGpib.c and devSupportGpib.c, please check them and if you agree,
put them into the next release.


BTW.: We are using epicsRelease 3.14.10, softIOC runnung under Suse linux 10.2

I made a slightly different change to fix this problem. Please apply the following to asyn/asynGpib/asynGpib.c

Index: asyn/asynGpib/asynGpib.c
===================================================================
RCS file: /net/phoebus/epicsmgr/cvsroot/epics/modules/soft/asyn/asyn/ asynGpib/asynGpib.c,v
retrieving revision 1.43
diff -u -r1.43 asynGpib.c
--- asyn/asynGpib/asynGpib.c	28 May 2008 18:58:50 -0000	1.43
+++ asyn/asynGpib/asynGpib.c	19 Oct 2009 13:48:51 -0000
@@ -410,12 +410,12 @@
    if(status!=asynSuccess) return status;
    if(pgpibPvt->eoslen==1 && nt>0) {
        if(data[nt-1]==pgpibPvt->eos) {
-            *eomReason |= ASYN_EOM_EOS;
+            if (eomReason) *eomReason |= ASYN_EOM_EOS;
            nt--;
        }
    }
    if(nt<maxchars) data[nt] = 0;
-    if(nt==maxchars) *eomReason |= ASYN_EOM_CNT;
+    if((nt==maxchars) && eomReason) *eomReason |= ASYN_EOM_CNT;
    *nbytesTransfered = (size_t)nt;
    pasynOctetBase->callInterruptUsers(pasynUser,pgpibPvt->pasynPvt,
        data,nbytesTransfered,eomReason);


My apologies for introducing this bug, which has been present since 2006-07-17 (and thus is present in asyn R4-7 through R4-12).
--
Eric Norum <[email protected]>
Advanced Photon Source
Argonne National Laboratory
(630) 252-4793



Navigate by Date:
Prev: Incorrect get_precision Schoeneburg, Bernd
Next: RE: EPICS build for MVME3100 Lawrence T. Hoff
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Incorrect get_precision Schoeneburg, Bernd
Next: genSub and synApps 5_4_1 Emmanuel Mayssat
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024