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 | 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 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: modbus read error |
From: | Mark Rivers via Tech-talk <tech-talk at aps.anl.gov> |
To: | 'Дмитрий Прощенко' <proshchenko78 at yandex.ru> |
Cc: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Mon, 29 Mar 2021 17:05:42 +0000 |
Hi, Your db and st.cmd files look OK except perhaps for this: modbusInterposeConfig("PSU0",1,300,4) That sets a timeout of 300 ms for receiving a reply from the device. That may be too short, I suggest increasing that to 2000. You should enable asynTrace on the serial port so that you can see the full communication between the IOC and the device. Add these lines to your st.cmd right after modbusInterposeConfig() asynSetTraceIOMask("PSU0",0,”HEX”) asynSetTraceMask(“PSU0”,0,”ERROR|DRIVER”) Once you do that please send the complete output when the IOC boot and runs for 20 seconds or so. Mark From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of ??????? ???????? via Tech-talk Hi all, Im a student and a beginner in EPICS. I am currently developing an IOC to drive a power supply (PS) via Modbus RTU. Using lib modbus R3-2. I have a problem with DO reading, DO writing is successful. I can see, PS receives message and answers (what I dont know). I thought there was a mistake in the argument in function in st.cmd, but I tested modbus start address and slave address in Modpoll. Also asynReport was used, and according to it: ....name=IO_ERRORS, value=49,...... (depends on run time) My error: TEST-MSC-FUN:COIL-ONOFF-GET devAsynUInt32Digital::processCallbackInput process read error. and sometimes: drvModbusAsyn::doModbusIO port SET writeRead status back to normal having had 1 errors, nwrite=6/6, nread=5 What shout I pay attention to? Its my db: record (bi,"TEST-MSC-FUN:COIL-ONOFF-GET") { field(DESC, "Ctrl on/off PSU") field(DTYP, "asynUInt32Digital") field(INP, "@asynMask(GET 1 0x1) MODBUS_DATA") field(ONAM, "ON") field(SCAN, "1 second") field(ZNAM, "OFF") } record (bo,"TEST-MSC-FUN:COIL-ONOFF-SET") { field(DESC, "ON OFF PSU") field(DTYP, "asynUInt32Digital") field(ONAM, "ON") field(OUT, "@asynMask(SET 1 0x1)") field(ZNAM, "OFF") }
callbackParallelThreads drvAsynSerialPortConfigure("PSU0", "/dev/ttyS1", 0, 0, 0) asynSetOption("PSU0",0,"baud","57600") asynSetOption("PSU0",0,"parity","none") asynSetOption("PSU0",0,"bits","8") asynSetOption("PSU0",0,"stop","1") modbusInterposeConfig("PSU0",1,300,4) # Function code=1 drvModbusAsynConfigure("GET", "PSU0", 1, 1, 0, 300, 0, 500, "PSU") # Function code=5 drvModbusAsynConfigure("SET", "PSU0", 1, 5, 0, 128, 0, 1000, "PSU") |