EPICS Home

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:Re: Re:RE: help for streamDevice question
From: 张亚威 via Tech-talk <[email protected]>
To: "Mark Rivers" <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Mon, 6 Jan 2020 21:59:52 +0800 (CST)
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.
https://epics.anl.gov/tech-talk/2018/msg02166.php

So I will start to learn with
https://github.com/epics-modules/measComp/blob/master/documentation/measCompTutorial.pdf


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 > > > > > > >


 


Replies:
Re:Re:Re: Re:RE: help for streamDevice question 张亚威 via Tech-talk
References:
help for streamDevice question 张亚威 via Tech-talk
RE: help for streamDevice question Mark Rivers via Tech-talk
Re:RE: help for streamDevice question 张亚威 via Tech-talk
Re: Re:RE: help for streamDevice question Mark Rivers via Tech-talk

Navigate by Date:
Prev: Re: Re:RE: help for streamDevice question Mark Rivers via Tech-talk
Next: Re:Re:Re: Re:RE: help for streamDevice question 张亚威 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: Re:RE: help for streamDevice question Mark Rivers via Tech-talk
Next: Re:Re:Re: Re:RE: help for streamDevice question 张亚威 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