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> 2023 2024 2025 | 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> 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: drvModbusAsynConfigure exception 3 when ASLO and PREC fields of PV are changed |
From: | Mark Rivers via Tech-talk <tech-talk at aps.anl.gov> |
To: | "Marco A. Barra Montevechi Filho" <marco.filho at lnls.br> |
Cc: | Junior Cintra Mauricio <junior.mauricio at lnls.br>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>, João Pedro Burle Ishida <joao.ishida at lnls.br> |
Date: | Tue, 19 Apr 2022 19:26:15 +0000 |
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 From: Marco A. Barra Montevechi Filho <marco.filho at lnls.br>
Hello, Mark. Thank for the constant help! #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> # 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
2022/04/19 15:54:43.226 PNR:EU2408:P devAsynInt32::processCallbackOutput process error
epics> < /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") epicsEnvSet("BL","PNR") # 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
http://cars9.uchicago.edu/software/epics/modbusDoc.html ## Parameters to ModBus on /dev/ttyUSB0 ## used to USB #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") ## Configure 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 # pollMsec,
# 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, ""); ############################################################################################################################# ## Load record instances dbLoadRecords("db/dbEurotherm2408.db", "BL=PNR") Error: syntax error at or before "Readback" in file "db/dbEurotherm2408.db" line 423 ## Load record instances #dbLoadRecords("db/xxx.db","user=gabrielfedelHost") cd /usr/local/epics-nfs/apps/Eurotherm2408/1.0/iocBoot/iocEurotherm2408 iocInit Starting iocInit ############################################################################ ## EPICS R3.15.6 ## 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> From: Mark Rivers <rivers at cars.uchicago.edu> 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 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 From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of Marco A. Barra Montevechi Filho via Tech-talk Hello all and good evening. where MBUS_SL_ADDR=1, MBUS_WRITE=6 and MODBUS_POLL=1000.
field(DESC, "P Param") field(DTYP, "asynInt32") 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. 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") } 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") } 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. |