Hi Mark!
I did the recommended and append the results below. I also commented every modbus function that was not
NEG_EMODBUS_1_1_Rd_VTarget
and every record that was not
${BL}:${H}:${EQ}:TargetVoltRead
so i could focus the debug on this. Using wireshark captures and filtering by the device I.P., i noticed something interesting (I append the capture files in this e-mail): even when TargetVoltRead SCAN is set to Passive, my computer keeps sending modbusTCP
queries for the device and it even gets the answer. Should that be happening? It seems to me that the only difference between Passive and 1 Second scan is that passive doesnt store the queried info in the database while 1 second scan does, but both query the
device.
About the recommended debug: my st.cmd file now looks like:
#!/home/marco/work/cnpem_git/LCI/NEGPowerMINI/bin/linux-x86_64/NEG
< /home/marco/work/cnpem_git/LCI/NEGPowerMINI/iocBoot/iocNEG/envPaths
epicsEnvSet("BL","LCI")
epicsEnvSet("H","X")
epicsEnvSet("EQ","NEGPowerMINI")
epicsEnvSet("IOCNAME","NEG")
# Configuração da linha de luz
< /home/marco/work/cnpem_git/LCI/NEGPowerMINI/iocBoot/iocNEG/NEG.config
epicsEnvSet("STREAM_PROTOCOL_PATH","${TOP}/db")
cd ${TOP}
## Register all support components
dbLoadDatabase "dbd/NEG.dbd"
NEG_registerRecordDeviceDriver pdbbase
drvAsynIPPortConfigure("EMODBUS","10.20.41.90:502",0,0,1)
modbusInterposeConfig("EMODBUS",0,3000,0)
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_SoftwareVersion", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ}, 0x1000, 1, 2, ${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_HardwareVersion", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x1002,1,2,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_PowerSuppIntState", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x2000,1,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_LoggingState", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x2001,1,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_SysUptime", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x2002,2,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_InternalTemperature", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x2004,1,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_PumpTemperature", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x2005,1,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_OutVolt", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x2006,1,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_OutCurr", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x2007,1,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_TimeRunning", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x2008,2,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_Alarms", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x200A,2,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_TempAlarms", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x200C,2,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_WorkTime", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x200E,2,0,${MBUS_POLL}, "");
drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_VTarget",
"EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x3000,1,0,${MBUS_POLL},
"");
asynSetTraceMask NEG_EMODBUS_1_1_Rd_VTarget -1 9
dbLoadRecords("db/dbNEG.db",
"BL=${BL}, H=${H},
EQ=${EQ}")
cd ${TOP}/iocBoot/${IOC}
iocInit
the resumed output, along with the typed dbpf is below. Interestingly, after the dbpf, cagetting into te record retrieved its right value: 12, and not 0.
iocRun: All initialization complete
## Start any sequence programs
#seq sncxxx,"user=gabrielfedelHost"
epics> 2022/07/27 11:48:18.848 drvModbusAsyn::doModbusIO port NEG_EMODBUS_1_1_Rd_VTarget READ_REGISTERS
2022/07/27 11:48:19.879 drvModbusAsyn::doModbusIO port NEG_EMODBUS_1_1_Rd_VTarget READ_REGISTERS
2022/07/27 11:48:20.905 drvModbusAsyn::doModbusIO port NEG_EMODBUS_1_1_Rd_VTarget READ_REGISTERS
2022/07/27 11:48:21.932 drvModbusAsyn::doModbusIO port NEG_EMODBUS_1_1_Rd_VTarget READ_REGISTERS
dbpf LCI:X:NEGPowerMINI:TargetVoltRead 2
DBR_DOUBLE: 2
epics> 2022/07/27 11:48:22.528 drvModbusAsyn::readInt32 port NEG_EMODBUS_1_1_Rd_VTarget function=0x3, offset=00, value=0x4b0
2022/07/27 11:48:22.963 drvModbusAsyn::doModbusIO port NEG_EMODBUS_1_1_Rd_VTarget READ_REGISTERS
2022/07/27 11:48:23.994 drvModbusAsyn::doModbusIO port NEG_EMODBUS_1_1_Rd_VTarget READ_REGISTERS
2022/07/27 11:48:25.025 drvModbusAsyn::doModbusIO port NEG_EMODBUS_1_1_Rd_VTarget READ_REGISTERS
I dont think there is any new info in the following but if needed: the complete ioc init log output is:
#!/home/marco/work/cnpem_git/LCI/NEGPowerMINI/bin/linux-x86_64/NEG
< /home/marco/work/cnpem_git/LCI/NEGPowerMINI/iocBoot/iocNEG/envPaths
epicsEnvSet("IOC","iocNEG")
epicsEnvSet("TOP","/home/marco/work/cnpem_git/LCI/NEGPowerMINI")
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("AUTOSAVE","/usr/local/epics-nfs/modules/R3.15.6/synApps/R6.0/support/autosave-R5-9")
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("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","LCI")
epicsEnvSet("H","X")
epicsEnvSet("EQ","NEGPowerMINI")
epicsEnvSet("IOCNAME","NEG")
# Configuração da linha de luz
< /home/marco/work/cnpem_git/LCI/NEGPowerMINI/iocBoot/iocNEG/NEG.config
epicsEnvSet("E_SHM","eurotherm")
epicsEnvSet("MBUS_SL_ADDR",1)
epicsEnvSet("MBUS_READ",3)
epicsEnvSet("MBUS_WRITE",6)
epicsEnvSet("MBUS_POLL",1000)
epicsEnvSet("STREAM_PROTOCOL_PATH","/home/marco/work/cnpem_git/LCI/NEGPowerMINI/db")
cd /home/marco/work/cnpem_git/LCI/NEGPowerMINI
## Register all support components
dbLoadDatabase "dbd/NEG.dbd"
NEG_registerRecordDeviceDriver pdbbase
#######NOT USED ANYMORE. KEEPING FOR HISTORICAL REASONS###
## Configured by http://cars9.uchicago.edu/software/epics/modbusDoc.html
## Parameters to ModBus on /dev/ttyUSB0
## used to USB
#drvAsynSerialPortConfigure("EMODBUS","10.20.41.90:4001",0,0,0)
drvAsynIPPortConfigure("EMODBUS","10.20.41.90:502",0,0,1)
########NOT USED ANYMORE. KEEPING FOR HISTORICAL REASONS###
# 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",0,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("NEG_EMODBUS_1_1_Rd_SoftwareVersion", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ}, 0x1000, 1,2, ${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_HardwareVersion", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x1002,1,2,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_PowerSuppIntState", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x2000,1,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_LoggingState", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x2001,1,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_SysUptime", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x2002,2,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_InternalTemperature", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x2004,1,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_PumpTemperature", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x2005,1,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_OutVolt", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x2006,1,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_OutCurr", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x2007,1,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_TimeRunning", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x2008,2,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_Alarms", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x200A,2,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_TempAlarms", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x200C,2,0,${MBUS_POLL}, "");
# drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_WorkTime", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_READ},0x200E,2,0,${MBUS_POLL}, "");
drvModbusAsynConfigure("NEG_EMODBUS_1_1_Rd_VTarget", "EMODBUS", 1,3,0x3000,1,0,1000, "");
asynSetTraceMask NEG_EMODBUS_1_1_Rd_VTarget -1 9
#drvModbusAsynConfigure("NEG_EMODBUS_1_1_Wr_VTarget", "EMODBUS", ${MBUS_SL_ADDR},${MBUS_WRITE},0x3000,1,0,${MBUS_POLL}, "");
## Load record instances
dbLoadRecords("db/dbNEG.db", "BL=LCI, H=X, EQ=NEGPowerMINI")
cd /home/marco/work/cnpem_git/LCI/NEGPowerMINI/iocBoot/iocNEG
iocInit
Starting iocInit
############################################################################
## EPICS R3.15.6
## EPICS Base built Sep 27 2021
############################################################################
2022/07/27 11:48:18.322 drvModbusAsyn::readInt32 port NEG_EMODBUS_1_1_Rd_VTarget function=0x3, offset=00, value=0x0
iocRun: All initialization complete
## Start any sequence programs
#seq sncxxx,"user=gabrielfedelHost"
epics> 2022/07/27 11:48:18.848 drvModbusAsyn::doModbusIO port NEG_EMODBUS_1_1_Rd_VTarget READ_REGISTERS
2022/07/27 11:48:19.879 drvModbusAsyn::doModbusIO port NEG_EMODBUS_1_1_Rd_VTarget READ_REGISTERS
2022/07/27 11:48:20.905 drvModbusAsyn::doModbusIO port NEG_EMODBUS_1_1_Rd_VTarget READ_REGISTERS
2022/07/27 11:48:21.932 drvModbusAsyn::doModbusIO port NEG_EMODBUS_1_1_Rd_VTarget READ_REGISTERS
dbpf LCI:X:NEGPowerMINI:TargetVoltRead 2
DBR_DOUBLE: 2
epics> 2022/07/27 11:48:22.528 drvModbusAsyn::readInt32 port NEG_EMODBUS_1_1_Rd_VTarget function=0x3, offset=00, value=0x4b0
2022/07/27 11:48:22.963 drvModbusAsyn::doModbusIO port NEG_EMODBUS_1_1_Rd_VTarget READ_REGISTERS
2022/07/27 11:48:23.994 drvModbusAsyn::doModbusIO port NEG_EMODBUS_1_1_Rd_VTarget READ_REGISTERS
2022/07/27 11:48:25.025 drvModbusAsyn::doModbusIO port NEG_EMODBUS_1_1_Rd_VTarget READ_REGISTERS
As always, thanks for the help.
Marco