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

Subject: Re: Modbus TCP/IP "PSH" Command
From: Michael Davidsaver <[email protected]>
To: [email protected]
Date: Fri, 05 Sep 2014 20:19:43 +0200
Hello Tobin,

First, I think you may be mixing your protocol layers.  The only "PSH" I see in your packet dump is the TCP flag, which is a hint to the receiver's IP stack to deliver data to the user application.  Unless Acromag is using a custom IP stack this is probably of no consequence.  The exception are modbus/tcp errors, in this case indicating that an illegal function code (1) is being used.  Most modbus devices implement only a few of the defined function codes (aka types of operations).

Looking at your packet capture I see several strange things.

1) The duplicate acks with 300ms delay are an indication of packet loss incurring a TCP retransmit.

2) The host .182 is sending a truncated/invalid request of only 6 bytes (or wireshark is dropping packets).

I'm guessing this has something to do with a missing drvModbusAsynConfigure() iocsh command, which is how the modbus driver is instructed as to which function code to use.

An example using a modbus RTU serial device.

drvAsynSerialPortConfigure("A", "/dev/ttyACM0", 0, 0, 0)
asynSetOption("A",0,"baud","115200")
modbusInterposeConfig("A", 1)
# PORT, SRC, SADDR, FUNC, OFFSET, LEN, TYPE, POLL, ID
drvModbusAsynConfigure("AREAD", "A", 0, 3, 0,   8, 0, 1000, "ARDR")
drvModbusAsynConfigure("AWRITE","A", 0, 6, 0,   8, 0, 1000, "ARDW")
dbLoadRecords("../../db/asynRecord.db","P=test:,R=portr,PORT=AREAD,ADDR=0,IMAX=40,OMAX=40")
dbLoadRecords("../../db/asynRecord.db","P=test:,R=portw,PORT=AWRITE,ADDR=1,IMAX=40,OMAX=40")

Defines asyn ports "AREAD" and "AWRITE" which use function codes 3 and 6 respectively.  See the modbus driver documentation for the meaning of the other arguments.

Michael


On 09/05/2014 06:11 PM, Tobin Weber wrote:

Hello Colleagues,

We use a type of distributed I/O device that talks Modbus TCP/IP called an Acromag 952EN-4012. We have had re-occurring issues with these devices over the last few years. Most recently, we have experienced the devices losing communication with our EPICS IOC. We believe we have traced the source of this problem down to a Port checking procedure that we were doing. This procedure simply involves processing an asyn record that is linked to the IP Port created for modbus access.

The simplest example of an IOC that produces these errors is created with the following start up file:

drvAsynIPPortConfigure("ReadPort","192.168.0.78:502",0,0,1)

modbusInterposeConfig("ReadPort", 0, 1000,0)

dbLoadRecords("db/PortCheck.vdb")

With PortCheck.vdb being:

record(asyn, AcroRead) {
field(PORT, "ReadPort")
field(TMOD, "Write/Read")
field(SCAN, "1 second")
}

We usually read the .ERRS and .CNCT fields on AcroRead to check the port, but I left that out of the epics code b/c it doesn't appears to make a difference.

When AcroRead processes, we think the CPU (0.182) sends a "PSH" or Push Command to the Acromag Device (0.78) [See attached wirehshark file Acroamg_Port_Check_Tech_Talk]. After acknowledging this packet, the Acromag device responds with an exception. It appears to not understand the "PSH" command. I've spoken with Acromag Engineers and they said their devices will not know how to process this command.

We are fairly certain that this process, when combined with the reads and writes we do, will intermittently cause the Acromag device to stop responding completely to the EPICS IOC.

My question: Is the "PSH" command being sent expected behavior in this situation? What are the origins of this command?

Thanks very much for any help you can provide.

Toby

-- 
Tobin Weber
University of Washington
Fast Neutron Therapy
206-598-0485


References:
Modbus TCP/IP "PSH" Command Tobin Weber

Navigate by Date:
Prev: RE: Processing a record a in loop Mark Rivers
Next: Re: Modbus TCP/IP "PSH" Command Tobin Weber
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Modbus TCP/IP "PSH" Command Tobin Weber
Next: CS-Studio freezes with high value in XY graph Márcio Paduan Donadio
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·