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: 回复:回复: Re: help for streamDevice question
From: [email protected] via Tech-talk <[email protected]>
To: Silver<[email protected]>
Cc: <[email protected]>
Date: Tue, 7 Jan 2020 17:33:04 +0800 (GMT+08:00)
Geyang,

I also need to implement a function which will have different response recording to revceived data.
Maybe asynDriver is a better choice.
Thank you for the same.

Regard,
YaweiZhang



---?????欢---
??欢浜? "Silver"<[email protected]>
??€???? 2020骞??????ㄤ?) 涓??8:27
?朵欢浜? "寮??濞?<[email protected]>;
涓婚?: ???: Re: help for streamDevice question

hi, 

Since you have used python, another choice is pcaspy, written by xiaoqiang wang in PSI.
  




Best wishes
Geyang 2020-01-07



##############on 2020-01-06, [email protected] wrote:###############
Hi Mark,

Your guess is absolutely right. 

I want to send a 24-byte hex packet and receive a packet which use same format.

I have found something may be helpful in your another answer.

So I will start to learn with


Thank you for your generous help.

Regards,
YaweiZhang









At 2020-01-06 21:19:33, "Mark Rivers" <[email protected]> wrote: >Hi YaweiZhang, > > >I looks like you need to send a 24-byte packet and receive a 4-byte response? > > >Is the output packet binary or hex ASCII characters? > > >Is the response binary or hex ASCII characters? Because you do not show any terminators on input or output I suspect it is binary, not hex. > > >Stream device may be able to construct the Check Code for you for with its "checksum" converter, but you need to see if your check code uses one of the algorithms that stream device supports. > > >I think you will need other software to create the timestamp bytes. > > >One way to do this is not to use stream device at all, but just use an asyn record. Your Python code would build the entire 24-byte array and write it to the BOUT field of the asyn record. The asyn record would then read the 4 byte response into the BINP field. > > >Alternatively you could write a little C++ driver based on asynPortDriver to build and send the string and parse the response. > > >Mark > > > >________________________________ >From: 寮??濞?<[email protected]> >Sent: Sunday, January 5, 2020 9:43 PM >To: Mark Rivers >Cc: [email protected] >Subject: Re:RE: help for streamDevice question > > >Sorry. >I want to send many socket packages to a device. >A single package consist of a 8 bytes time stamp(changeable), a 4 bytes protocol number, a 4 bytes determined number and a 8 bytes check code(changeable). > >Time Stamp > > >Protocol > >Vision > > >Command > > >Check Code > > >8 bytes > > >4 bytes > > >4 bytes > > >8 bytes > > >What I suppose is to use hex format to save the data. >So I write record like this: >record(waveform,"data") >{ >field (DTVP, "stream") >field(INP, "@devTest.proto array_in L0") >field(FTVL, "LONG") >field(NELM, "256") >field(PINI, "YES") >field(SCAN, "Passive") >} >and proto file >data0 = 0x23; >array_in { >out "\${data0}"; >in "%4x"; >} >In this case, only determined data can be sent. I hope to sent some changeable data which produced by a python program in real-time. > >Thank you very much. > >YaweiZhang > > > > >At 2020-01-06 00:22:42, "Mark Rivers" <[email protected]> wrote: >I think you need to be more specific. What is the format of the strings you are trying to write and read? > >Mark > > >From: Tech-talk <[email protected]> On Behalf Of ??? via Tech-talk >Sent: Sunday, January 5, 2020 8:22 AM >To: [email protected] >Subject: help for streamDevice question > >hi锛?> > I want to use streamDevice to communicate with a device just like https://epics.anl.gov/tech-talk/2016/msg01310.php does. > My problem is that I don't know how to write changeable data into record, which include time and a time-dependent encryption number. > Could someone give me a hand? > Thanks a lot. > >Regards, >YaweiZhang > > > > > > >


 


Navigate by Date:
Prev: Re: EPID record Vishnu Patel via Tech-talk
Next: Re: Ethernet question J. Lewis Muir 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: Re: EPICS R3.15 and menuScan.dbd Michael Westfall via Tech-talk
Next: EPICS release series after 7.0: 7.1 or 8.0? J. Lewis Muir 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, 07 Jan 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·