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

Subject: Re: How to calculate checksum (three ASCII values) when using streamdevice
From: LiangChih Chiang via Tech-talk <tech-talk at aps.anl.gov>
To: "Zimoch, Dirk" <dirk.zimoch at psi.ch>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Mon, 17 Aug 2026 17:13:23 +0800
Hi, Thanks Zimoch,

>By default checksums are written in binary. But with the modifier + you can
>change that to decimal: %+<sum>.
>(With %0<sum> it would be hexadecimal.)

Thanks. I works.


checksum calculation example:
Command: 1220074002=?110
ASCII: 49 50 50 48 48 55 52 48 48 50 61 63
sum and modulo 256 = 110

Response: 1221074006539212045
ASCII: 49 50 50 49 48 55 52 48 48 54 53 51 57 50 49 50
sum and modulo 256 = 045




>Wait, this looks like a typo: (20-12) is not -8.
>You need (12-20) to get that.
Yes. It's a typo. My mistake.


>>539212: -> 5.392x10^(20-12) hPa = 5.392x10^-8 hPa
>If you wonder how to parse that, try the following:
Your parsing method is better than mine. Thanks






On Mon, Aug 17, 2026 at 4:41 PM Zimoch, Dirk <dirk.zimoch at psi.ch> wrote:
On Mon, 2026-08-17 at 08:36 +0000, Zimoch, Dirk via Tech-talk wrote:
> > > > 539212: -> 5.392x10^(20-12) hPa = 5.392x10^-8 hPa

Wait, this looks like a typo: (20-12) is not -8.
You need (12-20) to get that.

> On Mon, 2026-08-17 at 08:26 +0000, Zimoch, Dirk via Tech-talk wrote:
>
> If you wonder how to parse that, try the following:
>
> %#/(.)(...)(..)/\1.\2E-\3/%f

%#/(.)(...)(..)/\1.\2E\3/%f

>
> This is a regular _expression_ substitution that groups the input into 1/3/2
> characters and inserts . and E-
>  539212 -> 5.392E-12

539212 -> 5.392E12

>
> Then then let the ai record scale the value with 1e20:
> field(ASLO, "1e20")
>

Scale with 1e-20:
field(ASLO, "1e-20")


References:
How to calculate checksum (three ASCII values) when using streamdevice LiangChih Chiang via Tech-talk
Re: How to calculate checksum (three ASCII values) when using streamdevice Zimoch, Dirk via Tech-talk
Re: How to calculate checksum (three ASCII values) when using streamdevice Zimoch, Dirk via Tech-talk
Re: How to calculate checksum (three ASCII values) when using streamdevice Zimoch, Dirk via Tech-talk
Re: How to calculate checksum (three ASCII values) when using streamdevice Zimoch, Dirk via Tech-talk

Navigate by Date:
Prev: Re: How to calculate checksum (three ASCII values) when using streamdevice Zimoch, Dirk via Tech-talk
Next: Re: Oxford Cryostream 1000 IOC questions James P. Withrow via Tech-talk
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  2025  <2026> 
Navigate by Thread:
Prev: Re: How to calculate checksum (three ASCII values) when using streamdevice Zimoch, Dirk via Tech-talk
Next: Effects of setting glibc's MALLOC_ARENA_MAX=1 Abdalla Ahmad via Tech-talk
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  2025  <2026> 
ANJ, 18 Aug 2026 · Home · News · About · Talk · Base · Modules · Extensions ·
· Distributions · Download · Documents · Links · Licensing ·