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  <20122013  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  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: stream device string/hex parsing
From: Gerrit Kühn <[email protected]>
To: Dirk Zimoch <[email protected]>
Cc: [email protected], [email protected]
Date: Wed, 1 Aug 2012 14:43:34 +0200
On Tue, 31 Jul 2012 16:30:05 +0200 Dirk Zimoch <[email protected]> wrote
about Re: stream device string/hex parsing:

DZ> > The documentation says the packet LRC is the two's complement of the
DZ> > sum over the packet's parameter and command bytes. Each binary data
DZ> > byte is transmitted as two hex digits which have to be transformed
DZ> > into binary form before adding them. So, looking at the available
DZ> > checksum algorithms, this calls for something like %<neghexsum8>,
DZ> > which does not exist...

DZ> %0<negsum>

Hm... not quite:

2012/08/01 14:33:43.162 ADC16_W Input byte 0xE7 does not match checksum
0xFC
2012/08/01 14:33:43.162 ADC16_S Input byte 0xEC does not match
checksum 0x01
2012/08/01 14:33:41.162 ADC16_C Input byte 0xD7 does not match checksum
0xFB


The description for <negsum> is

---
One byte. The negative of the sum of all characters modulo 2^8
---

However, I do not need to sum over all characters, I need to interpret
every two characters as hex value, sum over these, invert and compare the
result with the hex value represented by the two checksum characters. Or
am I misunderstanding something here?


cu
  Gerrit

Replies:
Re: stream device string/hex parsing Dirk Zimoch
References:
stream device string/hex parsing Gerrit Kühn
RE: stream device string/hex parsing peter.owens
Re: stream device string/hex parsing Gerrit Kühn
Re: stream device string/hex parsing Dirk Zimoch
Re: stream device string/hex parsing Gerrit Kühn
Re: stream device string/hex parsing Dirk Zimoch

Navigate by Date:
Prev: Matlab choices S. Stein
Next: Re: CSS BOY Dynamic Strip Charts with Macros Kasemir, Kay
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: stream device string/hex parsing Dirk Zimoch
Next: Re: stream device string/hex parsing Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·