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 Rivers <[email protected]>
To: "Wallace, Alex" <[email protected]>, "[email protected]" <[email protected]>
Date: Thu, 15 Oct 2015 02:21:22 +0000
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 Engbretson
References:
Modbus Binary Output Readbacks Wallace, Alex

Navigate by Date:
Prev: Modbus Binary Output Readbacks Wallace, Alex
Next: Re: Modbus Binary Output Readbacks Mark Engbretson
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: Modbus Binary Output Readbacks Wallace, Alex
Next: Re: Modbus Binary Output Readbacks Mark Engbretson
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 ·