EPICS Controls 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  2012  <20132014  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  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Modbus write register update when locally modified
From: Mark Rivers <[email protected]>
To: "'haquin'" <[email protected]>, tech-talk <[email protected]>
Date: Mon, 19 Aug 2013 15:21:42 +0000
This is a common problem when a device setting can be modified in more than one way.  It could be through some other application, local console as in your case, etc.

Let's assume that you currently have a longout record (MyParam) that has SCAN=Passive, and a longin record (MyParam_RBV) reading that Modbus value that has SCAN=I/O Intr.

Here is a solution.  You need to change MyParam to be soft device support, and add a new record MyParam_write that actually writes the value to Modbus.  You need to add a new record MyParam_sync that copies MyParam_RBV to MyParam.  This will update your longout whenever the longin changes:

record(longout, "$(P)$(R)MyParam")
{
    field(PINI, "YES")
    field(OUT, "$(P)$(R)MyParam_write PP")
    field(VAL, "1")
}

record(longout, "$(P)$(R)MyParam_write")
{
    field(SDIS, "$(P)$(R)MyParam_Sync.PACT")
    field(DISV, "1")
    field(DTYP, "asynInt32")
    field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))FILE_NUMBER")
}

record(longin, "$(P)$(R)MyParam_RBV")
{
    field(DTYP, "asynInt32")
    field(INP,  "@asyn($(PORT),$(ADDR),$(TIMEOUT))FILE_NUMBER")
    field(SCAN, "I/O Intr")
    field(FLNK, "$(P)$(R)MyParam_Sync")
}

record(longout, "$(P)$(R)MyParam_Sync")
{
    field(DOL,  "$(P)$(R)MyParam_RBV NPP")
    field(OMSL, "closed_loop")
    field(OUT,  "$(P)$(R)MyParam PP")
}

This is the only way I know how to do it currently, and if you have many records that can be locally changed you need to do this for all of them.

Mark



-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of haquin
Sent: Monday, August 19, 2013 9:35 AM
To: tech-talk
Subject: Modbus write register update when locally modified

Hi all,

I use Asyn (v4.19) ModbusTCP (v2.4) driver with longout record to write a consign.
when the plc is switched to Local control mode and consign is locally modified, when the plc is back in remote control 
mode, the record  hosting the consign is not updated with the new current value.

I've checked that the Modbus table is actually updated.
Is it possible to have the record updated in such circumstance ?
Such Local/Distant transition doesn't fall into the Disconnect/Reconnect scope.





Replies:
Re: Modbus write register update when locally modified haquin
References:
Modbus write register update when locally modified haquin

Navigate by Date:
Prev: Modbus write register update when locally modified haquin
Next: Re: Response Time Eric Norum
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Modbus write register update when locally modified haquin
Next: Re: Modbus write register update when locally modified haquin
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·