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  2015  <20162017  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  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Scan problem when the ioc behave as client
From: Tasaddaq Khan <[email protected]>
To: [email protected]
Date: Mon, 14 Mar 2016 20:01:30 +0500
Hi

My IOC (as client) is communicating with the PLC (as master). PLC is continuously requesting to send data after 500ms with cmd-to-read=0x05 but it can request to update the data any time with cmd-to-read=0x01 or 0x02 or 0x03, in this case rod-status value is also updated. My Protocol file and records are following:

ExtraInput = Ignore;
data-to-plc {
   
    MaxInput=14;

    in 0x01 "%r" 0x08 "%(\$1)r" "%(\$2)r" 0x00 0x00 0x00 0x00 0x00 0x00 0x00 "%#<modbus>";

# in 0x01 "%(cmd-to-read.VAL)r" 0x08 "%(rod-addr.VAL)r" "%(rod-status.VAL)r" 0x00 0x00 0x00 0x00 0x00 0x00 0x00 "%#<modbus>";
}

record (ai, "cmd-to-read"){
    field(DESC, "Command to read value from PLC")
    field(DTYP, "stream")
    field(SCAN, ".5 second")
# field(SCAN, "I/O Intr")
    field(INP, "@ccr-cri.proto data-to-plc(rod-addr,rod-status,) L0")
 #  field(INP, "@ccr-cri.proto data-to-plc L0")
}

record (ai, "rod-addr"){
    field(DESC, "Command to increase the position")
#    field(DTYP, "stream")
#    field(SCAN, "Passive")
#    field(SCAN, "I/O Intr")
#    field(INP, "@ccr-cri.proto data-to-plc L0")
#    field(FLNK, "cmd-to-read")
}

record (ai, "rod-status"){
    field(DESC, "Command to decrease the position")
#    field(DTYP, "stream")
#    field(SCAN, "Passive")
#    field(SCAN, "I/O Intr")
#    field(INP, "@ccr-cri.proto data-to-plc L0")
#    field(FLNK, "cmd-to-read")
}

I use different combination to SCAN the records and face following problem:

1. When I use SCAN "I/O Intr" for all the records and all the records(as active), when plc sends one variable then I read 14 bytes at my terminal, but when my plc sends two variables (like cmd-to-read and rod-addr) then my terminal shows 28 bytes, and when the stream contains all the three variables then I got stream of 42 bytes and ioc stops and message displays (core dump). In this case sometimes my records are updated and sometimes not.

2. Since my plc is continuously sending data after 500ms, so I adjust the scan rate of all of my records as 500ms. But in this case I got the right stream of 14bytes and any change in data from the plc I can see on my terminal but none of my record is updating.

3. When I use one of my record active and the other two as passive then sometimes my records are updating and sometimes they miss the data. My records are updated when my terminal got the 28 bytes. But in this case when I got change in stream my terminal shows the data of multiple of 14.

Please suggest me how to handle the situation of PLC (as master) and my IOC (as slave).

Tasaddaq


Replies:
RE: Scan problem when the ioc behave as client Mark Rivers

Navigate by Date:
Prev: RE: NDTransform Plugin does not work Mark Rivers
Next: RE: NDTransform Plugin does not work Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: NDTransform Plugin does not work Mark Rivers
Next: RE: Scan problem when the ioc behave as client Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 15 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·