I am having problems communicating with an Automation Direct BRX PLC. The problems are not consistently reproducible -- IOC starts without any error at all about 1 in 5 times. The errors only happen when starting the IOC, never when it's already running normally.
## Register all support components
dbLoadDatabase("../../dbd/heatedprintbed.dbd")
heatedprintbed_registerRecordDeviceDriver(pdbbase)
< errordemo.cmd
drvAsynIPPortConfigure("IP_PORT", "192.168.182.136:502",0,0,1)
modbusInterposeConfig("IP_PORT",0,5000,0)
drvModbusAsynConfigure("MI_READ", "IP_PORT", 255, 2, 549, 11, 0, 250, "BRX")
drvModbusAsynConfigure("MC_READ", "IP_PORT", 255, 1, 1999, 5, 0, 250, "BRX")
drvModbusAsynConfigure("MC_WRITE", "IP_PORT", 255, 5, 1999, 5, 0, 250, "BRX")
2021/05/20 15:58:50.578 drvModbusAsyn::doModbusIO port MC_WRITE error calling writeRead, error=asynManager::queueLockPort queueRequest failed: port IP_PORT not connected, nwrite=0/6, nread=0
## Load record instances
dbLoadTemplate("../../db/errordemo.substitutions")
iocInit
Starting iocInit
############################################################################
## EPICS R7.0.2
## EPICS Base built Apr 5 2019
############################################################################
2021/05/20 15:58:50.828 drvModbusAsyn::doModbusIO port MI_READ error calling writeRead, error=asynManager::queueLockPort queueRequest failed: port IP_PORT not connected, nwrite=0/6, nread=0
2021/05/20 15:58:50.828 drvModbusAsyn::doModbusIO port MC_READ error calling writeRead, error=asynManager::queueLockPort queueRequest failed: port IP_PORT not connected, nwrite=0/6, nread=0
iocRun: All initialization complete
## Start any sequence programs
#seq sncxxx,"user=kls286"
epics> 2021/05/20 16:01:25.169 drvModbusAsyn::doModbusIO port MI_READ writeRead status back to normal having had 124 errors, nwrite=6/6, nread=4
2021/05/20 16:01:25.175 drvModbusAsyn::doModbusIO port MC_READ writeRead status back to normal having had 124 errors, nwrite=6/6, nread=3
After a few minutes (variable, but usually less than 10), all of the read-only modbus ports put out a "back to normal" message like the one above.
The claim of "back to normal" does indeed seem to be true -- all PVs reading from these ports do so as intended.
The write-only modbus ports also go back to normal as soon as I do a dbpf to any of the PVs that will write to the port. Like so:
epics> dbpf demoButton:write 1
DBF_STRING: "Pushed"
epics> 2021/05/20 16:04:37.323 drvModbusAsyn::doModbusIO port MC_WRITE writeRead status back to normal having had 1 errors, nwrite=6/6, nread=5
K. Soloway