Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: RE: Epics gateway writeNotify issue
From: "Hill, Jeffrey O" <johill@lanl.gov>
To: "Hill, Jeffrey O" <johill@lanl.gov>, Provenzano Matteo <matteo.provenzano@psi.ch>, "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Thu, 1 Mar 2012 18:36:03 +0000

Considering this matter further, the situation is somewhat more complex than it initially appeared.

To completely fix the problem there will need to be two changes as follows.

1) casChannel::writeNotify should call casChannel::write

2) We need also a new class casChannelDefault which forwards all of its virtual function directly to the casPV interface. A casChannelDefault object shall be created only when the user doesn't implement a factory for the casChannel interface in casPV.

https://bugs.launchpad.net/epics-base/+bug/944188

 

From: tech-talk-bounces@aps.anl.gov [mailto:tech-talk-bounces@aps.anl.gov] On Behalf Of Hill, Jeffrey O
Sent: Thursday, March 01, 2012 11:06 AM
To: Provenzano Matteo; tech-talk@aps.anl.gov
Subject: RE: Epics gateway writeNotify issue

 

Hi Matteo,

 

Executive Summary:

=================

I believe that you have found a bug. There are at least four permutations using these abbreviations new gateway (NGW), old gateway (OGW), new CAS server library (NCAS), and old CAS server library (OCAS).

 

{NGW, NCAS} (no bug)

{OGW, NCAS} (bug, probably your situation, and bad old behavior not updating clients when write notify is in progress)

{NGW, OCAS} (probably no bug, but bad old behavior not updating clients when write notify is in progress)

{OGW, OCAS} (no bug)

 

I created bug entry 944188, and you could also easily patch this issue yourself, but I recommend instead that you upgrade to the latest version of the gateway (which will also resolve your issue and fix the old gateway behavior wrt write notify). To verify that you have the older version of the gateway check to see if it is implementing the writeNotify virtual function.

 

Detailed explanation:

=================

 

First some background info.

 

When inspecting casdef.h (defining the interface between the server and services) one can see two interfaces casPV and casChannel. Both of them have a similar virtual functions for implementing read, write, and writeNotify etc in the service. The casPV interface was first and it can be used when the PV is client agnostic in the service (its behavior does not change depending on what client is attached). In contrast, the casChannel interface was added later for services which need to implement a PV that has a behavior which is different depending on what client is attached, or for implementing behavior that requires client specific state variables. To maintain backwards compatibility the base class casChannel forwards requests such as read, write, or writeNotify to the interface in casPV. This happens when the service does not implement a factory for casChannel derived objects.

 

Furthermore, in the original casPV interface there was only a “write” interface. Sometime back we discovered that it was difficult to have a robust implementation of the gateway if the gateway was unable to determine if the CA request was a put, or a put notify. Therefore, a new writeNotify interface was added so that the gateway could be improved wrt put notify requests (as I recall the old gateway would stop updating its clients when a put notify request was pending). Of course to maintain backwards compatibility the writeNotify interface calls the write interface if the service doesn’t implement writeNotify.

 

Ok now about resolving your issue.

 

I believe that casChannel::writeNotify is forwarding to casPV::writeNotify. This is a bug. To maintain strict backwards compatibility casChannel::writeNotify should call casChannel::write.

 

Jeff

 

From: tech-talk-bounces@aps.anl.gov [mailto:tech-talk-bounces@aps.anl.gov] On Behalf Of Provenzano Matteo
Sent: Thursday, March 01, 2012 2:09 AM
To: tech-talk@aps.anl.gov
Subject: Epics gateway writeNotify issue

 

Hello everybody,

 

I recompiled the epics gateway with the base.3.14.12. Now if I try to execute a writeNotify I always get the following error in the log file:

 

Virtual gateVcData::write called for <channel name>

   This is an error!

 

I searched for the source of this error and I found it in the file gateVc.cc (gateway/):

 

// This is the virtual write function defined in casPV.  It should no

// longer be called if casChannel::write is implemented.

caStatus gateVcData::write(const casCtx& ctx, const gdd& dd)

{

        fprintf(stderr,"Virtual gateVcData::write called for %s.\n"

          "  This is an error!\n",name());

        return S_casApp_noSupport;

}

 

This function is actually called by this piece of code in casPV.cc (which is in

epics base/):

 

//

// casPV::writeNotify()

//

caStatus casPV :: writeNotify (

    const casCtx & ctx, const gdd & val )

{

    // plumbed this way to preserve backwards

    // compatibility with the old interface which

    // did not include a writeNotify interface

        return this->write ( ctx, val );

}

 

With the epics base.3.14.8 there was no problem.

 

Has anyone idea how to solve this problem?

 

Thank you for your help,

 

Cheers,

 

Matteo


References:
Epics gateway writeNotify issue Provenzano Matteo
RE: Epics gateway writeNotify issue Hill, Jeffrey O

Navigate by Date:
Prev: Re: CRC issues using Modbus/asyn on 64bit Linux Martin L. Smith
Next: Re: BOY FAQ: howto plot a live waveform record cartesian plot Peter Milne
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: RE: Epics gateway writeNotify issue Hill, Jeffrey O
Next: CRC issues using Modbus/asyn on 64bit Linux Ralph Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·