![]() |
![]() ![]()
Experimental Physics and
| ||||||||||||||
|
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
| ||||||||||||||
ANJ, 14 Sep 2022 |
![]() · Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |