Hi,
As an aside, it is possible to get IEEE 32-bit floating point numbers out of the Eurotherm 2000 series. Chapter 6 in the communications manual describes how to access that data. Then you don’t have to deal with implied decimal points and
scaling on the EPICS side.
Cheers,
Matt
From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of Marco A. Barra Montevechi Filho via Tech-talk
Sent: Wednesday, April 20, 2022 10:33 AM
To: Mark Rivers <rivers at cars.uchicago.edu>
Cc: Junior Cintra Mauricio <junior.mauricio at lnls.br>; tech-talk at aps.anl.gov; João Pedro Burle Ishida <joao.ishida at lnls.br>
Subject: [EXTERNAL] Re: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed
Hi, Mark! I corrected the asynSetTraceIOMask and asynSetTraceMask errors you pointed, thanks. About the error in the
dbLoadRecords("db/dbEurotherm2408.db", "BL=PNR"), it was a typo in one of the records, its also corrected.
I found the communication manual of the equipment to compare the accepted integer values and according to it:
"The protocol is also limited to integer communication only. Series 2000 instruments allow the user to configure
either integer or full resolution. In integer mode all parameters will be rounded to the nearest integer value,
whereas in full resolution mode the decimal point position will be implied so that 100.01 would be transmitted
And indeed caputting <PVPREFFIX>:P to a value such as 15001 makes caget <PVPREFFIX>:P:RBV return 150.01. So i figure making
the <PVPREFFIX>:P.ASLO field a non-integer is simply a logic error(?) that i intend to remove.
At the end of this email i append the IOC initialization log with typos corrected and TraceMasks added just to be coherent.
asynSetTraceIOMask Eurotherm_EMODBUS_1_1_Wr_I -1 4
asynSetTraceMask Eurotherm_EMODBUS_1_1_Wr_I -1 9
because i know this function worked well with the <PVPREFIX>:I variable.
Finally, about the PV being processed in initialization even without PINI field, i believe (although i am not sure) that it
is caused by the other records that reference the PV:
record(dfanout, "${BL}:EU2408:SETASLO") {
field(OMSL, "closed_loop")
field(DOL, "${BL}:EU2408:CALCASLO PP")
field(OUTA, "${BL}:EU2408:SP.ASLO")
field(OUTB, "${BL}:EU2408:SP:RBV.ASLO")
field(OUTC, "${BL}:EU2408:RR.ASLO")
field(OUTD, "${BL}:EU2408:RR:RBV.ASLO")
field(OUTE, "${BL}:EU2408:PV:RBV.ASLO")
field(OUTF, "${BL}:EU2408:P.ASLO")
field(OUTG, "${BL}:EU2408:P:RBV.ASLO")
field(FLNK, "${BL}:EU2408:SETPREC")
record(dfanout, "${BL}:EU2408:SETPREC") {
field(OMSL, "closed_loop")
field(DOL, "${BL}:EU2408:PREC.RVAL")
field(OUTA, "${BL}:EU2408:SP.PREC PP")
field(OUTB, "${BL}:EU2408:SP:RBV.PREC PP")
field(OUTC, "${BL}:EU2408:RR.PREC PP")
field(OUTD, "${BL}:EU2408:RR:RBV.PREC PP")
field(OUTE, "${BL}:EU2408:PV:RBV.PREC PP")
field(OUTF, "${BL}:EU2408:P.PREC PP")
field(OUTG, "${BL}:EU2408:P:RBV.PREC PP")
record(calcout, "${BL}:EU2408:CALCASLO") {
field(INPA, "${BL}:EU2408:PREC.RVAL NPP")
field(CALC, "A==1?0.1:0.01")
record(mbbo, "${BL}:EU2408:PREC") {
field(ZRST, "1 Decimal Place")
field(ONST, "2 Decimal Places")
field(FLNK, "${BL}:EU2408:SETASLO")
So i think ${BL}:EU2408:PREC triggers all the process. Thanks so much for your attention! If this logic error
is indeed what is causing trouble, then i think the problem is solved.
OBS - IOC initialization log:
#!/usr/local/epics-nfs/apps/Eurotherm2408/1.0/bin/linux-x86_64/Eurotherm
< /usr/local/epics-nfs/apps/Eurotherm2408/1.0/iocBoot/iocEurotherm2408/envPaths
epicsEnvSet("IOC","iocEurotherm2408")
epicsEnvSet("TOP","/usr/local/epics-nfs/apps/Eurotherm2408/1.0")
epicsEnvSet("NFS","/usr/local/epics-nfs")
epicsEnvSet("SUPPORT","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support")
epicsEnvSet("ASYN","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/asyn-R4-33")
epicsEnvSet("STREAM","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/stream-R2-7-7c")
epicsEnvSet("MODBUS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/modbus-R2-11")
epicsEnvSet("EPICS_BASE","/usr/local/epics-nfs/base/R3.15.6")
epicsEnvSet("ALIVE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/alive-R1-1-0")
epicsEnvSet("AUTOSAVE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/autosave-R5-9")
epicsEnvSet("BUSY","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/busy-R1-7")
epicsEnvSet("CALC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/calc-R3-7-1")
epicsEnvSet("CAMAC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/camac-R2-7-1")
epicsEnvSet("CAPUTRECORDER","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/caputRecorder-R1-7-1")
epicsEnvSet("DAC128V","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/dac128V-R2-9")
epicsEnvSet("DELAYGEN","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/delaygen-R1-2-0")
epicsEnvSet("DXP","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/dxp-R5-0")
epicsEnvSet("DXPSITORO","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/dxpSITORO-R1-1")
epicsEnvSet("DEVIOCSTATS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/iocStats-3-1-15")
epicsEnvSet("IP","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ip-R2-19-1")
epicsEnvSet("IPAC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ipac-2-15")
epicsEnvSet("IP330","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ip330-R2-9")
epicsEnvSet("IPUNIDIG","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ipUnidig-R2-11")
epicsEnvSet("LOVE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/love-R3-2-6")
epicsEnvSet("LUA","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/lua-R1-2-2")
epicsEnvSet("MCA","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/mca-R7-7")
epicsEnvSet("MEASCOMP","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/measComp-R2-1")
epicsEnvSet("MODBUS_2_10_1","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/modbus-R2-10-1")
epicsEnvSet("MOTOR","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/motor-R6-10-1")
epicsEnvSet("OPTICS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/optics-R2-13-1")
epicsEnvSet("QUADEM","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/quadEM-R9-1")
epicsEnvSet("SOFTGLUE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/softGlue-R2-8-1")
epicsEnvSet("SOFTGLUEZYNQ","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/softGlueZynq-R2-0-1")
epicsEnvSet("SSCAN","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/sscan-R2-11-1")
epicsEnvSet("STD","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/std-R3-5")
epicsEnvSet("VAC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/vac-R1-7")
epicsEnvSet("VME","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/vme-R2-9")
epicsEnvSet("YOKOGAWA_DAS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/Yokogawa_DAS-R1-0-0")
epicsEnvSet("XXX","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/xxx-R6-0")
epicsEnvSet("AREA_DETECTOR","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1")
epicsEnvSet("ADCORE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1/ADCore")
epicsEnvSet("ADSUPPORT","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1/ADSupport")
epicsEnvSet("ADSIMDETECTOR","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1/ADSimDetector")
epicsEnvSet("SNCSEQ","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/seq-2-2-5")
epicsEnvSet("ALLEN_BRADLEY","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/allenBradley-2-3")
# Configuração da linha de luz
< /usr/local/epics-nfs/apps/Eurotherm2408/1.0/iocBoot/iocEurotherm2408/Eurotherm.config
epicsEnvSet("SERIAL_PORT","COM10")
epicsEnvSet("E_SHM","eurotherm")
epicsEnvSet("BAUD","9600")
epicsEnvSet("MBUS_SL_ADDR",1)
epicsEnvSet("MBUS_READ",3)
epicsEnvSet("MBUS_WRITE",6)
epicsEnvSet("MBUS_POLL",1000)
epicsEnvSet("STREAM_PROTOCOL_PATH","/usr/local/epics-nfs/apps/Eurotherm2408/1.0/db")
cd /usr/local/epics-nfs/apps/Eurotherm2408/1.0
## Register all support components
dbLoadDatabase "dbd/Eurotherm.dbd"
Eurotherm_registerRecordDeviceDriver pdbbase
## Configured by hxxp://cars9.uchicago.edu/software/epics/modbusDoc.html
## Parameters to ModBus on /dev/ttyUSB0
#drvAsynSerialPortConfigure("EMODBUS","10.20.41.43:4001",0,0,0)
drvAsynIPPortConfigure("EMODBUS","10.20.41.43:4002",0,0,1)
###############################################################################
###############################################################################
# Set up ASYN HYPPIE ports
# pxiCreateSM(asyn, shared memory name)
# drvasynPXIConfig(port, COM port, shared memory name, serial type)
#asynSetOption("EMODBUS", 0, "${BAUD}", "9600")
#asynSetOption("EMODBUS", 0, "bits", "8")
#asynSetOption("EMODBUS", 0, "parity", "none")
#asynSetOption("EMODBUS", 0, "stop", "1")
modbusInterposeConfig("EMODBUS",1,3000,0)
# drvModbusAsynConfigure(portName, => create a name
# tcpPortName, => defined before
# slaveAddress, => defined on equipament
# modbusFunction, => 3 : Read Holding Register (16-bit)
# modbusStartAddress, => adress of register
# modbusLength, => the length of data segment
# dataType, => default data type
# plcType); => Equipament name, not used
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_ATUNE", "EMODBUS", 1,3, 3072, 6, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_ATUNE", "EMODBUS", 1,6, 3072, 6,0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_PV", "EMODBUS", 1,3, 1, 3,0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_PV", "EMODBUS", 1, 6, 1, 3, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_WSP", "EMODBUS", 1,3, 5, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_RR", "EMODBUS", 1, 3, 35, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_RR", "EMODBUS", 1, 6, 35, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_MAN", "EMODBUS", 1, 3, 273, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_MAN", "EMODBUS", 1, 6, 273, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_PID", "EMODBUS", 1, 3, 351, 3, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_PID", "EMODBUS", 1, 6, 351, 3, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_P", "EMODBUS", 1, 3, 6, 3, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_I", "EMODBUS", 1, 3, 8, 3, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_D", "EMODBUS", 1, 3, 9, 3, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_P", "EMODBUS", 1, 6, 6, 3, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_I", "EMODBUS", 1, 6, 8, 3, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_D", "EMODBUS", 1, 6, 9, 3, 0, 1000, "");
#####ADDED FOR DEBUG. DELETE LATER###
asynSetTraceIOMask Eurotherm_EMODBUS_1_1_Wr_P -1 4
asynSetTraceMask Eurotherm_EMODBUS_1_1_Wr_P -1 9
asynSetTraceIOMask Eurotherm_EMODBUS_1_1_Wr_I -1 4
asynSetTraceMask Eurotherm_EMODBUS_1_1_Wr_I -1 9
#####################################
#############################################################################################################################
#Commands added 19/04/2022 by Marco Montevechi, Junior Cintra and Jo o Pedro Burle Ishida
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_PROG", "EMODBUS", 1, 3, 22, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_PROG", "EMODBUS", 1, 6, 22, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_PSP", "EMODBUS", 1, 3, 163, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_PSP", "EMODBUS", 1, 6, 163, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_CYC", "EMODBUS", 1, 3, 59, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_CYC", "EMODBUS", 1, 6, 59, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_SEG", "EMODBUS", 1, 3, 56, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_SEG", "EMODBUS", 1, 6, 56, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_STYP", "EMODBUS", 1, 3, 29, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_STYP", "EMODBUS", 1, 6, 29, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_STAT", "EMODBUS", 1, 3, 23, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_STAT", "EMODBUS", 1, 6, 23, 1, 0, 1000, "");
#############################################################################################################################
dbLoadRecords("db/dbEurotherm2408.db", "BL=PNR")
#dbLoadRecords("db/xxx.db","user=gabrielfedelHost")
cd /usr/local/epics-nfs/apps/Eurotherm2408/1.0/iocBoot/iocEurotherm2408
############################################################################
## EPICS Base built Sep 27 2021
############################################################################
2022/04/20 08:37:33.100 drvModbusAsyn::readInt32 port Eurotherm_EMODBUS_1_1_Wr_P function=0x6, offset=00, value=0x5dc
2022/04/20 08:37:33.100 drvModbusAsyn::readInt32 port Eurotherm_EMODBUS_1_1_Wr_I function=0x6, offset=00, value=0x1c
2022/04/20 08:37:33.602 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P WRITE_SINGLE_REGISTER address=06 value=0x3a98
iocRun: All initialization complete
## Start any sequence programs
#seq sncxxx,"user=gabrielfedelHost"
2022/04/20 08:37:33.688 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=3
2022/04/20 08:37:33.688 PNR:EU2408:P devAsynInt32::processCallbackOutput process error
So caputting into :P variable makes the epics terminal print:
epics> 2022/04/20 08:40:18.579 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P WRITE_SINGLE_REGISTER address=06 value=0x3e80
2022/04/20 08:40:18.641 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=3
2022/04/20 08:40:18.641 PNR:EU2408:P devAsynInt32::processCallbackOutput process error
2022/04/20 08:40:47.496 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P WRITE_SINGLE_REGISTER address=06 value=0x3a98
2022/04/20 08:40:47.559 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=3
2022/04/20 08:40:47.559 PNR:EU2408:P devAsynInt32::processCallbackOutput process error
and caputting into :I variable makes the epics terminal print:
2022/04/20 08:41:15.370 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_I WRITE_SINGLE_REGISTER address=010 value=0x1d
2022/04/20 08:41:15.406 drvModbusAsyn::writeInt32 port Eurotherm_EMODBUS_1_1_Wr_I function=0x6, modbusAddress=010, buffer[0]=0x1d, bufferLen=1
2022/04/20 08:41:20.447 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_I WRITE_SINGLE_REGISTER address=010 value=0x1c
2022/04/20 08:41:20.491 drvModbusAsyn::writeInt32 port Eurotherm_EMODBUS_1_1_Wr_I function=0x6, modbusAddress=010, buffer[0]=0x1c, bufferLen=1
Hi Marco,
Ø
Thats what seems weird to me: since the error only happens when we change the precision and ASLO, and since the exception indicates an incorrect command, can i just assume that the equipment is made to only accept commands that write the P parameter
with a certain precision? In a way that when the precision is changed the equipment refuses to accept the command?
No, it cannot be the precision. You are not sending ASCII characters with decimal digits over Modbus, you are sending 16-bit binary integers. So the PREC field should not matter. However the ASLO field controls
the conversion from engineering units to 16-bit integer so it can change the data you are sending.
You are getting these errors when you boot:
asynSetTraceIOMask Eurotherm_EMODBUS_1_1_Wr_P -1 HEX
PNR-Eurotherm2408-B-Eurotherm01.cmd line 73: Illegal integer 'HEX'
asynSetTraceMask Eurotherm_EMODBUS_1_1_Wr_P -1 ERROR|DRIVER
PNR-Eurotherm2408-B-Eurotherm01.cmd line 75: Illegal integer 'ERROR|DRIVER'
That is because you are running asyn R4-33 and the enhancement to allow symbolic names in the asynSetTrace commands was added in R4-35 in 2019. With this old version of asyn you need to change these commands to:
asynSetTraceIOMask Eurotherm_EMODBUS_1_1_Wr_P -1 4
asynSetTraceMask Eurotherm_EMODBUS_1_1_Wr_P -1 9
There is also an error when loading your database:
dbLoadRecords("db/dbEurotherm2408.db", "BL=PNR")
Error: syntax error
at or before "Readback" in file "db/dbEurotherm2408.db" line 423
You should fix that. It could even be the source of your problems, since I don’t know what records are defined after line 423.
It appears that the ao record is processing at iocInit, but the record does not have PINI=YES. I don’t understand that.
Mark
Hello, Mark. Thank for the constant help!
Thats what seems weird to me: since the error only happens when we change the precision and ASLO, and since the exception indicates an incorrect command, can i just assume that the equipment is made to only accept commands that write the P parameter with a
certain precision? In a way that when the precision is changed the equipment refuses to accept the command?
Im sorry for forgetting the complete message. The error message is:
## Start any sequence programs
#seq sncxxx,"user=gabrielfedelHost"
2022/04/19 15:27:21.537 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=3
2022/04/19 15:27:21.537 PNR:EU2408:P devAsynInt32::processCallbackOutput process error
epics>
I append the complete IOC initialization log in the end of this email. Also, i noticed something else that seems important: in the .db file, there is the following comment right next to the :P variable:
# Proportional gain term: address 351
# Note this must be set to operate engineering units (not %) for the precision to be correct
# otherwise it is a fixed precision of 1 decimal place
However, address 351 is not even mentioned in Eurotherm modbus communication manual and setting
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_P", "EMODBUS", 1, 6, 351, 3, 0, 1000, "");
instead of
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_P", "EMODBUS", 1, 6, 6, 3, 0, 1000, "");
results in
2022/04/19 15:54:43.225 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=2
2022/04/19 15:54:43.226 PNR:EU2408:P devAsynInt32::processCallbackOutput process error
epics>
Which i think means that this address is not supposed to be accessed.
Best regards,
Marco
#!/usr/local/epics-nfs/apps/Eurotherm2408/1.0/bin/linux-x86_64/Eurotherm
< /usr/local/epics-nfs/apps/Eurotherm2408/1.0/iocBoot/iocEurotherm2408/envPaths
epicsEnvSet("IOC","iocEurotherm2408")
epicsEnvSet("TOP","/usr/local/epics-nfs/apps/Eurotherm2408/1.0")
epicsEnvSet("NFS","/usr/local/epics-nfs")
epicsEnvSet("SUPPORT","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support")
epicsEnvSet("ASYN","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/asyn-R4-33")
epicsEnvSet("STREAM","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/stream-R2-7-7c")
epicsEnvSet("MODBUS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/modbus-R2-11")
epicsEnvSet("EPICS_BASE","/usr/local/epics-nfs/base/R3.15.6")
epicsEnvSet("ALIVE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/alive-R1-1-0")
epicsEnvSet("AUTOSAVE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/autosave-R5-9")
epicsEnvSet("BUSY","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/busy-R1-7")
epicsEnvSet("CALC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/calc-R3-7-1")
epicsEnvSet("CAMAC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/camac-R2-7-1")
epicsEnvSet("CAPUTRECORDER","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/caputRecorder-R1-7-1")
epicsEnvSet("DAC128V","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/dac128V-R2-9")
epicsEnvSet("DELAYGEN","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/delaygen-R1-2-0")
epicsEnvSet("DXP","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/dxp-R5-0")
epicsEnvSet("DXPSITORO","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/dxpSITORO-R1-1")
epicsEnvSet("DEVIOCSTATS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/iocStats-3-1-15")
epicsEnvSet("IP","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ip-R2-19-1")
epicsEnvSet("IPAC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ipac-2-15")
epicsEnvSet("IP330","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ip330-R2-9")
epicsEnvSet("IPUNIDIG","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/ipUnidig-R2-11")
epicsEnvSet("LOVE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/love-R3-2-6")
epicsEnvSet("LUA","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/lua-R1-2-2")
epicsEnvSet("MCA","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/mca-R7-7")
epicsEnvSet("MEASCOMP","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/measComp-R2-1")
epicsEnvSet("MODBUS_2_10_1","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/modbus-R2-10-1")
epicsEnvSet("MOTOR","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/motor-R6-10-1")
epicsEnvSet("OPTICS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/optics-R2-13-1")
epicsEnvSet("QUADEM","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/quadEM-R9-1")
epicsEnvSet("SOFTGLUE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/softGlue-R2-8-1")
epicsEnvSet("SOFTGLUEZYNQ","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/softGlueZynq-R2-0-1")
epicsEnvSet("SSCAN","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/sscan-R2-11-1")
epicsEnvSet("STD","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/std-R3-5")
epicsEnvSet("VAC","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/vac-R1-7")
epicsEnvSet("VME","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/vme-R2-9")
epicsEnvSet("YOKOGAWA_DAS","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/Yokogawa_DAS-R1-0-0")
epicsEnvSet("XXX","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/xxx-R6-0")
epicsEnvSet("AREA_DETECTOR","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1")
epicsEnvSet("ADCORE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1/ADCore")
epicsEnvSet("ADSUPPORT","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1/ADSupport")
epicsEnvSet("ADSIMDETECTOR","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/areaDetector-R3-3-1/ADSimDetector")
epicsEnvSet("SNCSEQ","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/seq-2-2-5")
epicsEnvSet("ALLEN_BRADLEY","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/allenBradley-2-3")
# Configuração da linha de luz
< /usr/local/epics-nfs/apps/Eurotherm2408/1.0/iocBoot/iocEurotherm2408/Eurotherm.config
epicsEnvSet("SERIAL_PORT","COM10")
epicsEnvSet("E_SHM","eurotherm")
epicsEnvSet("BAUD","9600")
epicsEnvSet("MBUS_SL_ADDR",1)
epicsEnvSet("MBUS_READ",3)
epicsEnvSet("MBUS_WRITE",6)
epicsEnvSet("MBUS_POLL",1000)
epicsEnvSet("STREAM_PROTOCOL_PATH","/usr/local/epics-nfs/apps/Eurotherm2408/1.0/db")
cd /usr/local/epics-nfs/apps/Eurotherm2408/1.0
## Register all support components
dbLoadDatabase "dbd/Eurotherm.dbd"
Eurotherm_registerRecordDeviceDriver pdbbase
## Parameters to ModBus on /dev/ttyUSB0
#drvAsynSerialPortConfigure("EMODBUS","10.20.41.43:4001",0,0,0)
drvAsynIPPortConfigure("EMODBUS","10.20.41.43:4002",0,0,1)
###############################################################################
###############################################################################
# Set up ASYN HYPPIE ports
# pxiCreateSM(asyn, shared memory name)
# drvasynPXIConfig(port, COM port, shared memory name, serial type)
#asynSetOption("EMODBUS", 0, "${BAUD}", "9600")
#asynSetOption("EMODBUS", 0, "bits", "8")
#asynSetOption("EMODBUS", 0, "parity", "none")
#asynSetOption("EMODBUS", 0, "stop", "1")
modbusInterposeConfig("EMODBUS",1,3000,0)
# drvModbusAsynConfigure(portName, => create a name
# tcpPortName, => defined before
# slaveAddress, => defined on equipament
# modbusFunction, => 3 : Read Holding Register (16-bit)
# modbusStartAddress, => adress of register
# modbusLength, => the length of data segment
# dataType, => default data type
# plcType); => Equipament name, not used
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_ATUNE", "EMODBUS", 1,3, 3072, 6,0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_ATUNE", "EMODBUS", 1,6, 3072, 6,0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_PV", "EMODBUS", 1,3, 1, 3,0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_PV", "EMODBUS", 1, 6, 1, 3, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_WSP", "EMODBUS", 1,3, 5, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_RR", "EMODBUS", 1, 3, 35, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_RR", "EMODBUS", 1, 6, 35, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_MAN", "EMODBUS", 1, 3, 273, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_MAN", "EMODBUS", 1, 6, 273, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_PID", "EMODBUS", 1, 3, 351, 3, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_PID", "EMODBUS", 1, 6, 351, 3, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_P", "EMODBUS", 1, 3, 6, 3, 0, 1000, "");
#####ADDED FOR DEBUG. ###
asynSetTraceIOMask Eurotherm_EMODBUS_1_1_Wr_P -1 HEX
PNR-Eurotherm2408-B-Eurotherm01.cmd line 73: Illegal integer 'HEX'
asynSetTraceMask Eurotherm_EMODBUS_1_1_Wr_P -1 ERROR|DRIVER
PNR-Eurotherm2408-B-Eurotherm01.cmd line 75: Illegal integer 'ERROR|DRIVER'
#####################################
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_I", "EMODBUS", 1, 3, 8, 3, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_D", "EMODBUS", 1, 3, 9, 3, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_P", "EMODBUS", 1, 6, 6, 3, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_I", "EMODBUS", 1, 6, 8, 3, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_D", "EMODBUS", 1, 6, 9, 3, 0, 1000, "");
#############################################################################################################################
#Commands added 19/04/2022 by Marco Montevechi, Junior Cintra and Jo o Pedro Burle Ishida
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_PROG", "EMODBUS", 1, 3, 22, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_PROG", "EMODBUS", 1, 6, 22, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Rd_PSP", "EMODBUS", 1, 3, 163, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_PSP", "EMODBUS", 1, 6, 163, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_CYC", "EMODBUS", 1, 3, 59, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_CYC", "EMODBUS", 1, 6, 59, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_SEG", "EMODBUS", 1, 3, 56, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_SEG", "EMODBUS", 1, 6, 56, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Rd_STYP", "EMODBUS", 1, 3, 29, 1, 0, 1000, "");
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_0_Wr_STYP", "EMODBUS", 1, 6, 29, 1, 0, 1000, "");
#############################################################################################################################
dbLoadRecords("db/dbEurotherm2408.db", "BL=PNR")
at or before "Readback" in file "db/dbEurotherm2408.db" line 423
#dbLoadRecords("db/xxx.db","user=gabrielfedelHost")
cd /usr/local/epics-nfs/apps/Eurotherm2408/1.0/iocBoot/iocEurotherm2408
############################################################################
## EPICS Base built Sep 27 2021
############################################################################
iocRun: All initialization complete
## Start any sequence programs
#seq sncxxx,"user=gabrielfedelHost"
2022/04/19 15:47:39.215 drvModbusAsyn::doModbusIO port Eurotherm_EMODBUS_1_1_Wr_P Modbus exception=3
2022/04/19 15:47:39.215 PNR:EU2408:P devAsynInt32::processCallbackOutput process error
epics>
Hi Marco,
This is an ao record and one of the links is P.ASLO. This means that depending on whether the link is broken the actual integer value being written to the device could change, since ASLO affects that.
According to page 48 of the Modbus reference document
hxxps://epics-modbus.readthedocs.io/en/latest/_downloads/c210fb586108fe21da5a09d202ab86d1/Modbus_Application_Protocol_V1_1b.pdf
Modbus exception 3 is “ILLEGAL DATA VALUE”. This means:
A value contained in the query data field is not an allowable value for server (or slave). This indicates a fault in the structure of the remainder of a complex request, such as that the implied length is incorrect.
It specifically does NOT mean that a data item submitted for storage in a register has a value outside the expectation of the application program, since the MODBUS protocol is unaware of the significance of any particular value of any particular register.
So according to the specification exception 3 should only be returned when the command syntax is wrong, not if the data value is outside the allowed range. However, it is always possible that Eurotherm has not
following the spec, and it is returning exception 3 for a data value outside the allowed range.
Please send the complete error message when you get the exception.
It may also be helpful to put the following 2 commands in your startup script:
asynSetTraceIOMask Eurotherm_EMODBUS_1_1_Wr_P -1 HEX
asynSetTraceMask Eurotherm_EMODBUS_1_1_Wr_P -1 ERROR|DRIVER
That will show the Modbus messages sent to and received from the device.
Mark
Hello all and good evening.
We are working with a modbus IOC, the one i asked about compiling errors here previously and Mark answered about removing modbus.dbd and leaving only modbusSupport.dbd to make it work.
The IOC has several modbus functions defined in its st.cmd file like:
drvModbusAsynConfigure("Eurotherm_EMODBUS_1_1_Wr_P", "EMODBUS", ${MBUS_SL_ADDR}, ${MBUS_WRITE}, 6, 3, 0, ${MBUS_POLL}, "");
where MBUS_SL_ADDR=1, MBUS_WRITE=6 and MODBUS_POLL=1000.
EMODBUS was defined in drvAsynIPPortConfigure("EMODBUS",{EUROTHERM_IP},0,0,1)
The above modbus function is used by a PV:
record(ao, "${BL}:EU2408:P:SOMETHING") {
field(OUT, "@asyn(Eurotherm_EMODBUS_1_1_Wr_P,0,1000)MODBUS_DATA")
and it works fine if the PV name doesnt end stop in ":P". If the PV name is only "${BL}:EU2408:P", then we get modbus exception 3 when initializing the
IOC and the PV doesnt work.
I suppose this happens because some other PV has a link to it and the link breaks when the name is changed. I dont know if there could be any cause to this behaviour.
The only PVs we found refering to "${BL}:EU2408:P:SOMETHING" PV are:
record(dfanout, "${BL}:EU2408:SETASLO") {
field(OMSL, "closed_loop")
field(DOL, "${BL}:EU2408:CALCASLO PP")
field(OUTA, "${BL}:EU2408:SP.ASLO")
field(OUTB, "${BL}:EU2408:SP:RBV.ASLO")
field(OUTC, "${BL}:EU2408:RR.ASLO")
field(OUTD, "${BL}:EU2408:RR:RBV.ASLO")
field(OUTE, "${BL}:EU2408:PV:RBV.ASLO")
field(OUTF, "${BL}:EU2408:P.ASLO") #HERE
field(OUTG, "${BL}:EU2408:P:RBV.ASLO")
field(FLNK, "${BL}:EU2408:SETPREC")
}
and
record(dfanout, "${BL}:EU2408:SETPREC") {
field(OMSL, "closed_loop")
field(DOL, "${BL}:EU2408:PREC.RVAL")
field(OUTA, "${BL}:EU2408:SP.PREC PP")
field(OUTB, "${BL}:EU2408:SP:RBV.PREC PP")
field(OUTC, "${BL}:EU2408:RR.PREC PP")
field(OUTD, "${BL}:EU2408:RR:RBV.PREC PP")
field(OUTE, "${BL}:EU2408:PV:RBV.PREC PP")
field(OUTF, "${BL}:EU2408:P.PREC PP") ######HERE
field(OUTG, "${BL}:EU2408:P:RBV.PREC PP")
}
so i suppose altering PVs PREC and ASLO alters the correct modbus function needed to access the parameter, but this makes no sense to me since the parameter stored in the equipment should still be the same.
Does someone know what am i missing?
Thanks in advance 🙂
Marco
Aviso Legal: Esta mensagem e seus anexos podem conter informações confidenciais e/ou de uso restrito. Observe atentamente seu conteúdo e considere eventual
consulta ao remetente antes de copiá-la, divulgá-la ou distribuí-la. Se você recebeu esta mensagem por engano, por favor avise o remetente e apague-a imediatamente.
Disclaimer: This email and its attachments may contain confidential and/or privileged information. Observe its content carefully and consider possible querying
to the sender before copying, disclosing or distributing it. If you have received this email by mistake, please notify the sender and delete it immediately.
|