Experimental Physics and Industrial Control System
|
Hello Liang,
It looks like your protocol is binary. That means it can contain any bytes as values. That does not mix well with Terminator=LF because
LF (\x010) may be part of your data. The result would be a too short message.
If your messages have all the same length (11 bytes including a terminating LF?), I suggest to use MaxInput=11 instead of Terminator=LF.
Using ExtraInput=Ignore and data ignoring formats like %*2r you disable much error checking. It is better to make sure that you get
the correct data.
A more detailed description of your format (what are those bytes?) and c copy of your python program would help to answer the question
if your protocol is right and if streamDevice is suitable or not. It is suitable for a lot of things.
StreamDevice sets the record to INVALID severity when something goes wrong.
It prints an error message when that happens which may help to understand the problem. Make sure that 'var streamError' is 1. Do you see any error messages?
StreamDevice does sets status UDF only if something does very wrong, e.g. the
protocol has a syntax error or the asyn port does not exist. If the device only sends something that the protocol cannot parse, the status would be CALC, not UDF. Check if there are error messages when the IOC starts.
Dirk
Von: Tech-talk <tech-talk-bounces at aps.anl.gov>
Im Auftrag von ?????? via Tech-talk
Gesendet: Montag, 9. Mai 2022 10:46
An: tech-talk at aps.anl.gov
Betreff: pv invalid using stream
I have a python program( xxx.py ), which simulate a hardware( actually it was prepared for a can bus device ). The xxx.py uses TCP protocols.
The xxx.py would produce data, I intend to do the comunication with PC-linux and epics using xxx.py.
I means ask IOC get the value produced by xxx.py.
the xxx.py send and receive message like these:
sending msg: b'\x05\x03\x01\x04A\x00\x00\x00W\x19'
receiving msg: b'\x05\x03\x02\x04@\xe0\x00\x00W ' # 7 byte?
sending msg: b'\x05\x03\x02\x04A\x10\x00\x00V\xef'
receiving msg: b'\x05\x03\x01\x04A\x00\x00\x00W\x19' # 8 byte?
sending msg: b'\x05\x03\x01\x04A \x00\x00V\xd3'
receiving msg: b'\x05\x03\x02\x04A\x10\x00\x00V\xef'
sending msg: b'\x05\x03\x02\x04?\x80\x00\x00N\xea'
receiving msg: b'\x05\x03\x01\x04A \x00\x00V\xd3'
sending msg: b'\x05\x03\x01\x04@\x00\x00\x00V\xe5'
receiving msg: b'\x05\x03\x02\x04?\x80\x00\x00N\xea'
sending msg: b'\x05\x03\x02\x04@@\x00\x00W\x02'
receiving msg: b'\x05\x03\x01\x04@\x00\x00\x00V\xe5' # has some strange character?
sending msg: b'\x05\x03\x01\x04@\x80\x00\x00W\r'
receiving msg: b'\x05\x03\x02\x04@@\x00\x00W\x02'
sending msg: b'\x05\x03\x02\x04@\xa0\x00\x00V\xf4'
receiving msg: b'\x05\x03\x01\x04@\x80\x00\x00W\r'
sending msg: b'\x05\x03\x01\x04@\xc0\x00\x00V\xd9'
receiving msg: b'\x05\x03\x02\x04@\xa0\x00\x00V\xf4'
I created an example ioc, added the db and proto, added " drvAsynIPPortConfigure("PS1","127.0.0.1:9011") " and STREAM_PROTOCOL_PATH in st.cmd.
record(ai, "temperature")
field(DESC, "temperature in tank")
field(INP, "@HSPY.proto GetTem PS1")
---epics> dbpr temperature
ASG: DESC: temperature in tank DISA: 0
DISP: 0 DISV: 1 NAME: temperature RVAL: 0
SEVR: INVALID STAT: UDF SVAL: 0 TPRO: 0
---epics> dbtr temperature
1) Another better tool than stream device?
2) Does the proto I the right?
3) why my temperatre pv was invalid undefined?
4) the received message was not so regular, stream device suitable?
Could someone do me a favor. ioc was run in unbuntu PC, epics was 7.0.x.
|
- Replies:
- Re:AW: pv invalid using stream 网易邮件中心 via Tech-talk
- References:
- pv invalid using stream 网易邮件中心 via Tech-talk
- Navigate by Date:
- Prev:
pv invalid using stream 网易邮件中心 via Tech-talk
- Next:
Device support of asyn port driver for system commands. Phillip A. Sorensen 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
2020
2021
<2022>
2023
2024
- Navigate by Thread:
- Prev:
pv invalid using stream 网易邮件中心 via Tech-talk
- Next:
Re:AW: pv invalid using stream 网易邮件中心 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
2020
2021
<2022>
2023
2024
|
ANJ, 14 Sep 2022 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
·
Search
·
EPICS V4
·
IRMIS
·
Talk
·
Bugs
·
Documents
·
Links
·
Licensing
·
|