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  2020  2021  <20222023  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  <20222023  2024 
<== Date ==> <== Thread ==>

Subject: pv invalid using stream
From: 网易邮件中心 via Tech-talk <tech-talk at aps.anl.gov>
To: tech-talk at aps.anl.gov
Date: Mon, 9 May 2022 16:46:02 +0800 (CST)
Hi all,
     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'


Question:
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.
--db file:
record(ai, "temperature")
{
 field(DESC, "temperature in tank")
 field(DTYP, "stream")
 field(INP, "@HSPY.proto GetTem PS1")
 field(EGU, "degree")
 field(SCAN, "1 second")
}
--proto file:
Terminator = LF;
GetTem {
        in "%*2r%r%*4r";
        ExtraInput = Ignore;
}

Then I got in IOC:
---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
VAL: 0

---epics> dbtr temperature
record active

Question:
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.

Thanks,
Liang


 


Replies:
AW: pv invalid using stream Zimoch Dirk (PSI) via Tech-talk

Navigate by Date:
Prev: Re: measComp R3-1 available Mark Rivers via Tech-talk
Next: AW: pv invalid using stream Zimoch Dirk (PSI) 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  <20222023  2024 
Navigate by Thread:
Prev: Re: Employment opportunity at the East Asian Observatory/JCMT in Hilo, Hawaii Maren Purves via Tech-talk
Next: AW: pv invalid using stream Zimoch Dirk (PSI) 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  <20222023  2024 
ANJ, 14 Sep 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·