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  <20172018  2019  2020  2021  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  <20172018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: StreamDevice Checksum Pseudo-Converter
From: Dirk Zimoch <[email protected]>
To: <[email protected]>
Date: Tue, 21 Mar 2017 14:43:17 +0100
I had added this feature in 2011 but forgot to update the documentation. I will do that soon.

Dirk

On 15.03.2017 10:53, Florian Feldbauer wrote:
Dear all,

sorry for reviving this old thread, but I received several questions if
and how I solved this problem during the last weeks.
Since it was never answered in Tech-Talk and the solution cannot be
found in the stream device documentation, I wanted to share it here:
To get the checksum as ASCII string one can use the "+" flag. So the
protocol for the example below would look like:

getActRotspd {
  # get actual frequency for pump
  # Example of command:
  # field (INP, "@Pfeiffer_TCP350.proto getActRotspd($(ADD)) $(PORT)")

  out "\${1}0030902=?%+<sum8>";
  in  "\${1}1030906%06u%+<sum8>";
}

Best regards,

Florian


On 11/21/2013 11:04 AM, Florian Feldbauer wrote:
Hey Dirk,

we want to control some turbo drag pumps from Pfeiffer Vacuum with EPICS.
The pumps have a RS485 interface, so we can use StreamDevice and asyn
for the
communication.
The protocol from Pfeiffer looks like this (using ASCII symbols):
3 digit address
2 digit action (read "00" or write "10")
3 digit parameter number
2 digit data length
x digits data (according to data length)
3 digit checksum
CR

The checksum is the sum of all ASCII symbols up to preceding checksum
modulo 256 (decimal)
converted into ASCII string.
As an example, reading the actual rotation speed for address 123 would
be:
"1230030902=?112\r"

Would it be possible to add a corresponding pseudo-converter to
StreamDevice with little effort,
or would it be easier to use records for the calculation?
In principal we need something like %<sum8> but formatted like %d

Best regards,
Florian



References:
Re: StreamDevice Checksum Pseudo-Converter Florian Feldbauer

Navigate by Date:
Prev: Re: StreamDevice exception handlers Dirk Zimoch
Next: Re: StreamDevice exception handlers Eric Norum
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: StreamDevice Checksum Pseudo-Converter Florian Feldbauer
Next: Thermocube EPICS Support Martin.Gaughran
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024