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 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
<== Date ==> <== Thread ==>

Subject: Re: StreamDevice Checksum Pseudo-Converter
From: Florian Feldbauer <florian@ep1.ruhr-uni-bochum.de>
To: EPICS Tech Talk <tech-talk@aps.anl.gov>
Date: Wed, 15 Mar 2017 10:53:05 +0100
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


--
----------------------------------------
| Dr. Florian Feldbauer                |
|                                      |
| Helmholtz-Institut Mainz             |
| Sektion SPECF                        |
| Staudinger Weg 18                    |
| D-55128 Mainz                        |
|                                      |
| Office: 03-149                       |
| Phone:  (+49)6131 / 39-29655         |
----------------------------------------


Replies:
Re: StreamDevice Checksum Pseudo-Converter Dirk Zimoch

Navigate by Date:
Prev: RE: NTNDArrays, Java Madden, Timothy J.
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  <2017
Navigate by Thread:
Prev: RE: NTNDArrays, Java Mark Rivers
Next: Re: StreamDevice Checksum Pseudo-Converter Dirk Zimoch
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
ANJ, 21 Mar 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·