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> | 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> |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: Checksum for StreamDevice input with regular expression |
From: | "Baker, Keith \(DLSLtd, RAL, LSCI\) via Tech-talk" <tech-talk at aps.anl.gov> |
Cc: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Thu, 8 May 2025 12:16:42 +0000 |
Thanks Dirk. I was concerned I was doing something silly, but you’ve confirmed what I’m seeing is as expected. It would be good if the checksum only worked on the transmitted data stream, but I can see that means a big change to how the data is processed. I’ll stick with what I’ve got or maybe use sCalcout if I get chance to try this. I think I can process the input string more than once so also wondered about using one record to
verify the checksum on the raw data, then other records using I/O Intr could reformat the string for their use. I just need to work out how to stop the extra records processing if the checksum fails. Hmm, lots of options to think about. Regards, Keith From: Zimoch Dirk <dirk.zimoch at psi.ch>
Hi Keith
Yes, the regsub modifies the input buffer on which the checksum is calculated. I never thought about that case. It would make sense of course to calculate the checksum on the original input. Not quite sure how to implement that best, though.
I would need to keep the original around for any potential checksum while using the modified string for anything else. That means I need to go away from in-place substitution and have to handle checksums different from all other formats. For the time being, I see two work-arounds: 1. ignore the checksum, as you did, or 2. post-process the strings externally, for example in an sCalcout record. Dirk
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom. |