Experimental Physics and
| |||||||||||||||
|
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
| ||||||||||||||
ANJ, 20 Apr 2015 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |