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 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 <2017> 2018 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: StreamDevice Checksum Pseudo-Converter |
From: | Florian Feldbauer <[email protected]> |
To: | EPICS Tech Talk <[email protected]> |
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 thecommunication. 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 CRThe 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 | ----------------------------------------