EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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  <20202021  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  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: StreamDevice: Timeout after reading 27 bytes
From: 李姣赛 via Tech-talk <tech-talk at aps.anl.gov>
To: tech-talk at aps.anl.gov
Date: Mon, 11 May 2020 18:08:04 +0800 (GMT+08:00)

Dear all,

I wrote a power control IOC. The function of the power supply is realized, but when I start the IOC, it appears in cycles “Timeout after reading 27 bytes…”,eg

 

(base) [root@localhost iocelexample]# ./pulse_el.cmd

#!../../bin/linux-x86_64/elexample

< envPaths

epicsEnvSet("ARCH","linux-x86_64")

epicsEnvSet("IOC","iocelexample")

epicsEnvSet("TOP","/home/EPICS/elCtrl")

epicsEnvSet("EPICS_BASE","/home/EPICS/base-3.14.12")

epicsEnvSet("ASYN","/home/EPICS/app/asyn4-17")

epicsEnvSet("STREAM","/home/EPICS/app/stream")

cd /home/EPICS/elCtrl

dbLoadDatabase "dbd/elexample.dbd"

elexample_registerRecordDeviceDriver pdbbase

 

#where can protocols be located?

epicsEnvSet "STREAM_PROTOCOL_PATH", "."

 

#the device name is "pulse"

#输入IP和端口号

#dbLoadTemplate "db/userHost.substitutions"

#dbLoadRecords "db/dbSubExample.db", "user=rootHost"

drvAsynIPPortConfigure "pulse_el", "172.17.126.22:8080"

#drvAsynIPPortConfigure "pulse_el", "192.168.157.1:8080"

#drvAsynIPPortConfigure "pulse_el", "192.168.5.8:30000"

asynSetTraceMask("pulse_el",-1,0x1)

dbLoadRecords "db/pulse_el.db","p=PulseEl"

epicsEnvSet("EPICS_CA_SERVER_PORT","5064")

epicsEnvSet("EPICS_CA_REPEATER_PORT", "5065")

epicsEnvSet("EPICS_CA_AUTO_ADDR_LIST", "YES")

epicsEnvSet("EPICS_CA_ADDR_LIST", "192.168.6.17:5066")

cd /home/EPICS/elCtrl/iocBoot/iocelexample

iocInit

Starting iocInit

############################################################################

## EPICS R3.14.12 $Date: Wed 2010-11-24 14:50:38 -0600$

## EPICS Base built Jan 16 2020

############################################################################

iocRun: All initialization complete

 

epics> 2020/05/11 07:54:24.626883 pulse_el PulseEl:IMon: Timeout after reading 27 bytes "...<01>*<00><01><00><00><00>@IB3O<9c>@<00><00><ff><ff>"

2020/05/11 07:54:25.628253 pulse_el PulseEl:VMon: Timeout after reading 27 bytes "...<01>*<00><01><00><00><00>@IB3O<9c>@<00><00><ff><ff>"

2020/05/11 07:54:27.629832 pulse_el PulseEl:IMon: Timeout after reading 27 bytes "...<01>*<00><01><00><00><00>@IB3O<9c>@<00><00><ff><ff>"

2020/05/11 07:54:29.633361 pulse_el PulseEl:VMon: Timeout after reading 27 bytes "...<01>*<00><01><00><00><00>@IB3O<9c>@<00><00><ff><ff>"

 

The command is hexadecimal, when sending a hexadecimal command to the power supplyFF FF 00 00 0E 00 04 01 2A AA 00 00 FF FF

, received the power back reading commandFFFF00001B0004012A00AA01000000DC404942334F9C400000FFFF

My record file

 

record (ai, "$(p):IMon")

{

         field (DTYP, "stream")

         field (INP,  "@pulse_el.proto Read_IMon pulse_el")

         field (SCAN, "2 second")

}

record (ai, "$(p):VMon")

{

         field (DTYP, "stream")

         field (INP,  "@pulse_el.proto Read_VMon pulse_el")

         field (SCAN, "2 second")

}

My proto file

Read_IMon {   

         out "\xFF\xFF\x00\x00\x0E\x00\x04\x01\x2A\xAA\x00\x00\xFF\xFF";         

         in "%*15r%(/$p:IMon)#R%*8r";

         #in "%*15r%(/$p:IMon)#R%(/$p:VMon)#R%*4r";

         MaxInput = 28;

         ExtralInput = Error;

}

Read_VMon { 

         out "\xFF\xFF\x00\x00\x0E\x00\x04\x01\x2A\xAA\x00\x00\xFF\xFF";         

         in "%*19r%(/$p:VMon)#R%*4r";

         MaxInput = 28;

         ExtralInput = Error;

}

 

If you comment out this sentence ”MaxInput=28;” there will be no errors like “timeout after …”, but PV: PulseEl:IMon and PulseEl:VMon value is 0, which are not the correct values (normal values: PulseEl:IMon is 50.3133 and PulseEl:VMon is 4.88467). On the official website, about InTerminal:

 

“If a device has different terminators for input and output, use this for the input terminator. If no Terminator or InTerminator is defined, the underlying driver may use its own terminator settings. If InTerminator = "", a read timeout is not an error but a valid input termination.”

 

So in this case, timeout is not an error, but because this error will occur repeatedly, if there are other errors, they may be washed away, resulting in the failure to find the problem. I wonder if there are other ways to avoid this error, and get two valid normal values.

 

Thanks very much and best wishes!

JiaosaiLi, IMPCAS



Replies:
Re: StreamDevice: Timeout after reading 27 bytes Ralph Lange via Tech-talk
Re: StreamDevice: Timeout after reading 27 bytes Mark Rivers via Tech-talk

Navigate by Date:
Prev: Phoebus-color.def & font.def are not effictive 白丹萍 via Tech-talk
Next: Re: StreamDevice: Timeout after reading 27 bytes Ralph Lange via Tech-talk
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  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: 回复:Phoebus-color.def & font.def are not effictive 白丹萍 via Tech-talk
Next: Re: StreamDevice: Timeout after reading 27 bytes Ralph Lange via Tech-talk
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  <20202021  2022  2023  2024 
ANJ, 12 May 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·