Can you send a link to your code (python and otherwise)? It might be helpful to see that…
Cheers,
Simon
______________________
Simon Rose
Software Engineer
Control System Software and Services
European Spallation Source ERIC
P.O. Box 176, SE-221 00 Lund, Sweden
Visiting address: Partikelgatan 2, 224 84 Lund
Mobile: +46 72 179 23 07
E-mail: simon.rose at ess.eu
From:
Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of liuxiaomin via Tech-talk <tech-talk at aps.anl.gov>
Reply to: liuxiaomin <liuxiaomin at sari.ac.cn>
Date: Tuesday, 11 October 2022 at 04:47
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Subject: modbus-tcp
Hi,
I am trying to control a device which can get the temperature values ,I used modbus_tk under python to get the value. In order to match with EPICS, I used
the support module PyDevice which is an EPICS device support for Python interpreter, When I run the st.cmd file,the complete output when the IOC boots as follows:
./st.cmd
#!../../bin/linux-x86_64/waveioc
< envPaths
epicsEnvSet("IOC","waveioc")
epicsEnvSet("TOP","/home/iocusr/iocs/WAVEIOC")
epicsEnvSet("MODULES","/opt/epics/base/../modules")
epicsEnvSet("AUTOSAVE","/opt/epics/base/../modules/autosave-R5-7-1")
epicsEnvSet("ASYN","/opt/epics/base/../modules/asyn-R4-41")
epicsEnvSet("BUSY","/opt/epics/base/../modules/busy-1-6-1")
epicsEnvSet("CALC","/opt/epics/base/../modules/calc-R3-7-4")
epicsEnvSet("CAPUTLOG","/opt/epics/base/../modules/caPutLog-3-5")
epicsEnvSet("IOCSTATS","/opt/epics/base/../modules/iocStats-3-1-16")
epicsEnvSet("MODBUS","/opt/epics/base/../modules/modbus-R3-2")
epicsEnvSet("NETDEV","/opt/epics/base/../modules/netDev-1-0-6")
epicsEnvSet("PC-MONITOR","/opt/epics/base/../modules/PC-MONITOR1-0-2")
epicsEnvSet("PROCSERVCONTROL","/opt/epics/base/../modules/procServControl-1-9")
epicsEnvSet("S7NODAVE","/opt/epics/base/../modules/s7nodave-2-1-3")
epicsEnvSet("S7PLC","/opt/epics/base/../modules/s7plc")
epicsEnvSet("SSCAN","/opt/epics/base/../modules/sscan-2-10")
epicsEnvSet("STREAM","/opt/epics/base/../modules/StreamDevice-2-8-9")
epicsEnvSet("SNCSEQ","/opt/epics/base/../modules/seq-2-2-6")
epicsEnvSet("PYDEVICE","/opt/PyDevice")
epicsEnvSet("EPICS_BASE","/opt/epics/base")
epicsEnvSet("EPICS_CA_SERVER_PORT", 5064))
epicsEnvSet("IOCNAME","waveioc")
cd "/home/iocusr/iocs/WAVEIOC"
## Register all support components
dbLoadDatabase "dbd/waveioc.dbd"
waveioc_registerRecordDeviceDriver pdbbase
Executing Python code: import pydev
Executing Python code: import builtins
Executing Python code: builtins.pydev=pydev
Executing Python code: import pydev
pydev("import sys; sys.path.insert(0,'/home/iocusr/iocs/WAVEIOC/iocBoot/waveioc')")
Executing Python code: import sys; sys.path.insert(0,'/home/iocusr/iocs/WAVEIOC/iocBoot/waveioc')
pydev("import modbus_tk")
Executing Python code: import modbus_tk
pydev("from wave import Temp")
Executing Python code: from wave import Temp
pydev("temp1 = Temp('192.168.0.11','502')")
Executing Python code: temp1 = Temp('192.168.0.11','502')
dbLoadRecords "db/dbWaveform.db", "user=waveioc"
# Configure IP port
# drvAsynIPPortConfigure("CAT1","10.40.15.9:502",0,0,1)
# Configure modbus
# modbusInterposeConfig("CAT1",ModbusLinkType,timeoutMsec,writeDelayMsec)
# drvModbusAsynConfigure("WORDIR","CAT1",slaveAddress,modbusFunction,modbusStartAddr,modbusLen,dataType,posMsec,"plcType")
cd "/home/iocusr/iocs/WAVEIOC/iocBoot/waveioc"
iocInit
Starting iocInit
############################################################################
## EPICS R7.0.5
## Rev. 2021-08-27T15:52+0800
############################################################################
sevr=info s7plcInit: no stations configured
drvStreamInit: Warning! STREAM_PROTOCOL_PATH not set. Defaults to "."
iocRun: All initialization complete
# List all PVs to PV information files.
#dbl >> ${PVINFOFILE}
epics> [31.1 0. 0. ... 21.2 0. 0. ]
[31.1 0. 0. ... 21.2 0. 0. ]
[31.1 0. 0. ... 21.2 0. 0. ]
db[31.1 0. 0. ... 21.2 0. 0. ]
l
waveioc:TEMP
waveioc:RISE
waveioc:PEAK
waveioc:GETDATA
epics> [31. 0. 0. ... 21.4 0.1 0. ]
[31. 0. 0. ... 21.4 0.1 0. ]
[31. 0. 0. ... 21.4 0.1 0. ]
[31. 0. 0. ... 21.4 0.1 0. ]
[31. 0. 0. ... 21.4 0.1 0. ]
Is there any way to prevent the epics terminal
from automatically displaying the values obtained?