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  <20112012  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  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Asyn/Modbus Delay
From: "Mark Rivers" <[email protected]>
To: "Robert Emery" <[email protected]>, <[email protected]>
Date: Tue, 8 Mar 2011 18:10:35 -0600
This is the first I have heard of this.

Here is the first thing to do.  Set the asynTraceMask to 0x9 on the
underlying asyn TCP port (AcromagDO1), and send the asyn output to a
file with asynSetTraceFile.  Then look at the timestamps to see if you
learn anything.  You can also then set the asynTraceMask on the asyn
Modbus port (CCC:ACROMAGDO1:Modbus:Output) and send its output to a
file.  By sending the asynTrace output to a file you hopefully won't
mess up the timing too much, though 20ms is still a pretty short delay
to be tracking down.

Mark


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Robert Emery
Sent: Tuesday, March 08, 2011 6:01 PM
To: [email protected]
Subject: Asyn/Modbus Delay

We are using Modbus/Asyn to talk to a Acromag ES2113 digital I/O 
device.  Since updating our controller software (Linux 2.6.24 to 2.6.32,

EPICS 3.14.8.2 to 3.14.12, Asyn 4.8 to 4.15, Modbus 1.1 to 2.1) the 
Modbus/Asyn communication has slowed down.  There is now a .02 sec delay

in messages sent out (see below).  To illustrate this I ran a simple db 
with 4 linked longout records writing to the Modbus/Asyn port and looked

at the timing with wireshark.

Any ideas why the delay and how I can get around it?

Thanks
Rob Emery
UW Medical Center


Original Timing

Time        Source     Destination           Protocol Info
0.000000    .0.33          .0.31          Modbus/TCP    query
0.002218    .0.31          .0.33          Modbus/TCP response
0.002229    .0.33          .0.31          TCP      53105 > 502 [ACK]
0.002288    .0.33          .0.31          Modbus/TCP    query
0.005003    .0.31          .0.33          Modbus/TCP response
0.005166    .0.33          .0.31          Modbus/TCP    query
0.007680    .0.31          .0.33          Modbus/TCP response
0.008171    .0.33          .0.31          Modbus/TCP    query
0.010342    .0.31          .0.33          Modbus/TCP response


New Timing

Time        Source    Destination           Protocol Info
0.000000   .0.33          .0.31          Modbus/TCP    query
0.002168   .0.31          .0.33          Modbus/TCP response
0.003864   .0.33          .0.31          TCP      59583 > asa-appl-proto

[ACK]
0.024044   .0.33          .0.31          Modbus/TCP    query
0.026214   .0.31          .0.33          Modbus/TCP response
0.046431   .0.33          .0.31          Modbus/TCP    query
0.048319   .0.31          .0.33          Modbus/TCP response
0.068693   .0.33          .0.31          Modbus/TCP    query
0.071181   .0.31          .0.33          Modbus/TCP response


Port Configuration

## Create the Asyn IP ports
drvAsynIPPortConfigure("AcromagDO1","192.168.0.31:502",0,0,1)

## Apply The Modbus Configuration to the IP ports
modbusInterposeConfig("AcromagDO1",0,1000)

## Create Test Port
drvModbusAsynConfigure("CCC:ACROMAGDO1:Modbus:Output","AcromagDO1",0,6,5
9, 
6,   0,  0, "Acro Test")


Test db

record(longout, Tuning:Asyn:Timing:Test:LongOut) {
   field(SCAN, "Passive")
   field(DTYP, "asynUInt32Digital")
   field(FLNK, "Tuning:Asyn:Timing:Test:LongOut2")
   field(OUT, "@asynMask(CCC:ACROMAGDO1:Modbus:Output 0 0xFFFF)")
   field(OMSL, "supervisory")
   field(VAL, "101")
}

record(longout, Tuning:Asyn:Timing:Test:LongOut2) {
   field(SCAN, "Passive")
   field(DTYP, "asynUInt32Digital")
   field(FLNK, "Tuning:Asyn:Timing:Test:LongOut3")
   field(OUT, "@asynMask(CCC:ACROMAGDO1:Modbus:Output 1 0xFFFF)")
   field(OMSL, "supervisory")
   field(VAL, "102")
}

record(longout, Tuning:Asyn:Timing:Test:LongOut3) {
   field(SCAN, "Passive")
   field(DTYP, "asynUInt32Digital")
   field(FLNK, "Tuning:Asyn:Timing:Test:LongOut4")
   field(OUT, "@asynMask(CCC:ACROMAGDO1:Modbus:Output 2 0xFFFF)")
   field(OMSL, "supervisory")
   field(VAL, "103")
}

record(longout, Tuning:Asyn:Timing:Test:LongOut4) {
   field(SCAN, "Passive")
   field(DTYP, "asynUInt32Digital")
   field(OUT, "@asynMask(CCC:ACROMAGDO1:Modbus:Output 3 0xFFFF)")
   field(OMSL, "supervisory")
   field(VAL, "104")
}



Replies:
RE: Asyn/Modbus Delay Mark Rivers
References:
Asyn/Modbus Delay Robert Emery

Navigate by Date:
Prev: Asyn/Modbus Delay Robert Emery
Next: Re: PyEpics segmentation faults Matt Newville
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Asyn/Modbus Delay Robert Emery
Next: RE: Asyn/Modbus Delay Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
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 ·