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  2013  2014  <20152016  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  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Modbus Binary Output Readbacks
From: Mark Engbretson <[email protected]>
To: Mark Rivers <[email protected]>
Cc: "Wallace, Alex" <[email protected]>, "[email protected]" <[email protected]>
Date: Wed, 14 Oct 2015 21:29:45 -0500
I read this as a request for the modbus record to internally do this, so that you don't have to set up one block of registers to read, and then a different set with a different name to write.  No?


On Oct 14, 2015, at 21:21, Mark Rivers <[email protected]> wrote:

Hi Alex,

You can definitely have 2 two modbus ports pointing at the same registers, one for read and write.

One way to keep your bo record in sync with the coil is to use the following database construct.

record(bo, "$(P)$(R)B0")
{
   field(OUT, "$(P)$(R)BO_write PP")
}

record(bo, "$(P)$(R)B0_write")
{
   field(SDIS, "$(P)$(R)B0_Sync.PACT")
   field(DISV, "1")
   field(DTYP, "asynInt32")
   field(OUT, "@asyn($(OUTPORT),$(ADDR),$(TIMEOUT))")
}

record(bi, "$(P)$(R)BI")
   field(DTYP, "asynInt32")
   field(INP,  "@asyn($(INPORT),$(ADDR),$(TIMEOUT))")
   field(SCAN, "I/O Intr")
   field(FLNK, "$(P)$(R)B0_Sync")
}

record(bo, "$(P)$(R)BO_Sync")
{
   field(DOL,  "$(P)$(R)BI NPP")
   field(OMSL, "closed_loop")
   field(OUT,  "$(P)$(R)BO PP")
}

The BO record is the record your application writes to.  It uses soft device support.  It sends its output to the BO_write record that actually does the modbus write.  That record is disabled if it is being processed as a result of a callback to the bi record.  The BI record is I/O Intr processed when the coil value changes.  It writes the value to the BO record via the BO_sync record.  Note that I took this example from a non-modbus application so the DTYP and asyn link syntax is probably wrong, but you get the idea.

Mark




________________________________
From: [email protected] [[email protected]] on behalf of Wallace, Alex [[email protected]]
Sent: Wednesday, October 14, 2015 8:51 PM
To: [email protected]
Subject: Modbus Binary Output Readbacks


Hi,


Can anyone see an issue with modifying the modbus module to give certain records, eg. binary output (bo), two modbus ports to use, one for writes and one to keep the record syncd with the PLC output coil state?


There should be no reason I can see for having two modbus ports pointing at the same registers, one for read and write. But as for the bo record, I'm not really sure where to begin.


Thanks!

-Alex



Replies:
RE: Modbus Binary Output Readbacks Mark Rivers
References:
Modbus Binary Output Readbacks Wallace, Alex
RE: Modbus Binary Output Readbacks Mark Rivers

Navigate by Date:
Prev: RE: Modbus Binary Output Readbacks Mark Rivers
Next: RE: Modbus Binary Output Readbacks Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Modbus Binary Output Readbacks Mark Rivers
Next: RE: Modbus Binary Output Readbacks Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·