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  <20132014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: the cheksum of Streamdevice
From: 于春蕾 <yuchunlei@impcas.ac.cn>
To: tech-talk@aps.anl.gov
Date: Tue, 23 Apr 2013 21:17:43 +0800 (GMT+08:00)
Hi all,
Recently I try to use Streamdevice to control a power supply, but the protocal of this power supply is very special, especially the check. 
The checksum is similar to LRC but different, here is the example.
       Field name                    ASCII                                Hex
        start character                          :                                       3A
        slave address                          01                                   30 31
        command code                        03                                   30 33
        read data1 high                       04                                   30 34
        read data1 low                         01                                   30  31
        read data2 high                       00                                   30 30
        read data2 low                         01                                   30 31
        LRC checksum                         F6                                  46 36
        End mark                                 CR LF     ;                         0D 0A
The calculation of LRC checksum is as followed. First, SUM =01+03+04+01+00+01=0a(hex). Then, LRC checksum is the negative of SUM, so the checksum is F6(ASCII). I use %<01negsum>, but the calculation of SUM is 30+31+30+33+30+34+30+31+30+30+30+31, so the checksum is error. According to %<hexsum>, I want to try %<01hexnegsum>, but it shows unkown cheksum algorithm. What can I do with this kind of checksum, I am so anxious.
Thanks very much and best wishes!
                       Chunlei





Replies:
Re: the cheksum of Streamdevice Dirk Zimoch

Navigate by Date:
Prev: RE: How to create EPICS device support for a simple serial or GPIB device Vahe Sahakyan
Next: RE: caget delays Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: RE: How to create EPICS device support for a simple serial or GPIB device Vahe Sahakyan
Next: Re: the cheksum of Streamdevice Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·