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

Subject: RE: Problem accessing a Read/Write register via Asyn - Modbus/TCP
From: "Mark Rivers" <[email protected]>
To: "haquin" <[email protected]>, <[email protected]>
Date: Fri, 12 Sep 2008 08:19:22 -0500
Turn on the asynTrace flags.  You can get messages from asyn device support, from the asyn Modbus driver, and from the asyn TCP/IP driver, which should help to determine where the data is being lost.

Mark


-----Original Message-----
From: [email protected] on behalf of haquin
Sent: Fri 9/12/2008 7:20 AM
To: [email protected]
Subject: Problem accessing a Read/Write register via Asyn - Modbus/TCP
 
Hi all,

I am currently developing an IOC to drive a DC current supply via 
Modbus/TCP.
For this purpose I use the Asyn/Modbus device support.
My IOC currently runs on a Linux PC.
I use: EPICS 3.14.9, Modbus 1.1, Asyn 4-9
My IOC receives a consign value from a Motif Slider of an EDM screen.

I have a problem with a Read/Write access register used to set and read 
back the Consign in the DC current supply.
 From the EDM screen, I change the value of my ConsignRequested record 
using the Motif Slider.
The EDM screen displays the values :
- received by the IOC from one side (ConsignRequested record)
- the read back value from the other side(ConsignDisplay record).
The problem is that sometimes there is a mismatch between the two values !!!
After further investigations, it turns out that the last Motif Slider 
value is received by the IOC and pushed into the ConsignWrite record,
but the corresponding Mobus Write request is never sent by the IOC.

I use a Waveform (ConsignRead record) to read my Consign register, the 
scanning is I/O intr.
I use another Waveform (ConsignWrite record) to write into this 
register, the scanning is passive.
 
This problem can occur as soon as I move the slider, but most of the 
time I have to move it several times.
 
Here is my vdb file:
 
#! Read Consign Path
#! Record reading the Consign
record(waveform, "$(NOMOP):ConsignRead") {
  field(DESC, "Read 16bits Reg")
  field(SCAN, "I/O Intr")
  field(DTYP, "asynInt32ArrayIn")
  field(FLNK, "$(NOMOP):ConsignDisplay")
  field(INP, "@asyn($(PORTIN) 0)MODBUS_DATA")
  field(FTVL, "LONG")
}
 
#! Record used to Display the Consign
record(longout, "$(NOMOP):ConsignDisplay") {
  field(SCAN, "Passive")
  field(DOL, "$(NOMOP):ConsignRead.VAL")
  field(OMSL, "closed_loop")
  field(DRVH, "$(EGU_MAX)")
  field(DRVL, "$(EGU_MIN)")
  field(HOPR, "$(EGU_MAX)")
  field(LOPR, "$(EGU_MIN)")
}
 
#! Write Consign Path
#! Record receiveing the new consign from EDM via Channel Access
record(longin, "$(NOMOP):ConsignRequested") {
  field(SCAN, "Passive")
  field(FLNK, "$(NOMOP):ConsignCalc")
  field(HOPR, "$(EGU_MAX)")
  field(LOPR, "$(EGU_MIN)")
}
 
#! Record that select the 2 most significant bytes
record(calcout, "$(NOMOP):ConsignCalc") {
  field(FLNK, "$(NOMOP):ConsignWrite")
  field(CALC, "A >> 16")
  field(INPA, "$(NOMOP):ConsignRequested.VAL")
  field(OUT, "$(NOMOP):ConsignWrite.VAL")
  field(SCAN, "Passive")
}
 
#! Record that writes the Consign
record(waveform, "$(NOMOP):ConsignWrite") {
  field(SCAN, "Passive")
  field(DTYP, "asynInt32ArrayOut")
  field(INP, "@asyn($(PORTOUT) 0)MODBUS_DATA")
  field(FTVL, "LONG")
}
 
Here is what I do in my startup script for the Modbus communication:
# Physical Link Declaration
drvAsynIPPortConfigure("LB-DIA-ALB-TST2","172.16.59.60:502",0,1,1)
# Interpose Modbus/TCP Declaration
modbusInterposeConfig("LB-DIA-ALB-TST2",2,0,300)
# Declaration of functions used by ModBus Client
drvModbusAsynConfigure("LB-DIA-ALB-TST2:Read_6_1",  "LB-DIA-ALB-TST2", 4 
, 6 , 1 , 0 , 100 , "AlimGanil")
drvModbusAsynConfigure("LB-DIA-ALB-TST2:Write_6_1", "LB-DIA-ALB-TST2", 
16, 6, 1,    0,   1, "AlimGanil")
 
We made a network capture and when the problem occur,
though this value is in the Write Waveform (I have checked this with the 
dbgf command),
It has never been sent on the network. The TCP channel has never been 
broken.
 
It seems that :
The processing of the waveform has been interrupted but has not resumed,
Or the write request has been ignored by the Modbus driver
Or the write request has been ignored by the Asyn driver
 
There is no error message issued by the IOC.
 
Any Idea ?



References:
Problem accessing a Read/Write register via Asyn - Modbus/TCP haquin

Navigate by Date:
Prev: Bug in R3.14.8.2 Access Security Benjamin Franksen
Next: SNS Controls Group Software Position Kasemir, Kay (ky9)
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Problem accessing a Read/Write register via Asyn - Modbus/TCP haquin
Next: Bug in R3.14.8.2 Access Security Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·