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  2016  2017  2018  2019  2020  2021  2022  <20232024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
<== Date ==> <== Thread ==>

Subject: Re: problem reading data from PLC
From: Sebastian Marsching via Tech-talk <tech-talk at aps.anl.gov>
To: Abhishek Dutta <abhishek.d at vecc.gov.in>
Cc: tech-talk at aps.anl.gov
Date: Mon, 7 Aug 2023 12:52:41 +0200
Hi,

in my experience, this kind of has one of three causes:

1. As already mentioned, the address might be invalid. It might make sense to add the address to a watch table in TIA Portal in order to verify that is correct and provides the right value.

2. The parameter passed to s7nodaveConfigureIsoTcpPort might be incorrect. Please ensure that the rack number and slot number match the CPU (again, this information can be found in TIA Portal).

3. The PLC has to be configured to allow access GET/PUT access and protection and optimized block access must be disabled. You can find details (including screenshots of the relevant configuration options in TIA Portal) in the Snap7 documentation, which is the library used by s7nodave: https://snap7.sourceforge.net/snap7_client.html#1200_1500

Best regards,
Sebastian


Am 04.08.2023 um 12:45 schrieb Abhishek Dutta <abhishek.d at vecc.gov.in>:

Sir,

I've been trying to establish communication with S7 1500 PLC. Trying to read IW0, MD0.

While starting the IOC, I don't get any syntax error etc. The message shows following:

#!../../bin/linux-x86_64/myS7
< envPaths
epicsEnvSet("IOC","iocmyS7")
epicsEnvSet("TOP","/ics/tools/myS7")
epicsEnvSet("ASYN","/ics/tools/asyn4-38")
epicsEnvSet("S7NODAVE","/home/training/Desktop/ics/tools/s7nodave-3.0.2")
epicsEnvSet("EPICS_BASE","/ics/tools/base-7.0.6")
epicsEnvSet("ETHER_IP","/ics/tools/ether_ip")
epicsEnvSet("SNCSEQ","/ics/tools/seq-2.2.9")
epicsEnvSet("AUTOSAVE","/ics/tools/autosave-R5-10-2")
epicsEnvSet("STREAM","/ics/tools/StreamDevice-master")
epicsEnvSet("BUSY","/ics/tools/busy-1-6-1")
epicsEnvSet("PVXS","/ics/tools/pvxs")
epicsEnvSet("PYDEVICE","/ics/tools/PyDevice-R1.1.1")
cd "/ics/tools/myS7"
## Register all support components
dbLoadDatabase "dbd/myS7.dbd"
myS7_registerRecordDeviceDriver pdbbase
#var mySubDebug 1
#traceIocInit
cd "/ics/tools/myS7/iocBoot/iocmyS7"
## Load record instances
#dbLoadTemplate "user.substitutions"
#dbLoadRecords "user.db"
< hall.cmd
s7nodaveConfigureIsoTcpPort("HallPLC","192.168.0.1",0,1,0)
s7nodaveConfigurePollGroup("HallPLC",'default',1.0,0)
s7nodaveConfigurePollGroup("HallPLC",'fast',0.1,0)
dbLoadRecords "hall1.db"
iocInit
Starting iocInit
############################################################################
## EPICS R7.0.6
## Rev. 2021-09-28T15:27-0400
############################################################################
iocRun: All initialization complete
## Start any sequence programs
#seq sncExample, "user=training"
epics> 2023/08/01 21:01:20.281 HallPLC error while reading 2 bytes from PLC address IB0.
2023/08/01 21:01:20.283 HallPLC error while reading 4 bytes from PLC address FB0.


IOC name is myS7 and following is the hall1.db file. It resides in the same st.cmd directory:

record(ai, "hall_ip1")
{
field(SCAN,"1 second")
field(DTYP,"s7nodave")
field(INP, "@HallPLC(DLV=0,DHV=27648) IW0 int16")
field(EGU,"V")
}

record(ai, "hall_uvolt")
{
field(SCAN,"1 second")
field(DTYP,"s7nodave")
field(INP, "@HallPLC MD0 float")
field(EGU,"V")
}

Please suggest solution for the same.

Regards,

अभिषेक दत्ता/Abhishek Dutta
परिवर्ती ऊर्जा साइक्लोट्रॉन केन्द्र/Variable Energy Cyclotron Center
ईमेल/e-mail: abhishek.d at vecc.gov.in



Attachment: smime.p7s
Description: S/MIME cryptographic signature


References:
problem reading data from PLC Abhishek Dutta via Tech-talk

Navigate by Date:
Prev: problem reading data from PLC S7NODAVE Abhishek Dutta via Tech-talk
Next: Re: netDev "channels" record type problem Arnold, Ned D. via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
Navigate by Thread:
Prev: AW: problem reading data from PLC Blomley, Edmund (IBPT) via Tech-talk
Next: netDev "channels" record type problem Владимир Сергейчик via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
ANJ, 07 Aug 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·