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: How to write a soft record with a constant long string value |
From: | "Cobb, Tom \(DLSLtd,RAL,LSCI\) via Tech-talk" <tech-talk at aps.anl.gov> |
To: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>, "Cobb, Tom (DLSLtd,RAL,LSCI)" <tom.cobb at diamond.ac.uk> |
Date: | Tue, 18 Aug 2020 15:40:28 +0000 |
This is my best attempt so far:
record(waveform, "TEST") { field(NELM, 200) field(FTVL, "STRING") field(INP, [ "a line that contains up to 39 chars,", "a space will be inserted before the", "next line. 'This works too', and so", "does {}, but backslash n and", "backslash escaped double quotes", "don't *seem* to work." ]) }The lack of \" makes it a bit difficult to put JSON in it, although I could always use a single quote and convert on the client...$ caget TEST.VAL TEST.VAL 200 a line that contains up to 39 chars, a space will be inserted before the next line. \'This works too\', and so does {}, but backslash n and backslash escaped double quotes don\'t *seem* to work.
I've tried the const JSON links too, but they also don't accept escaped quotes.
Any other ideas?
Thanks,
Tom
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Cobb, Tom (DLSLtd,RAL,LSCI) via Tech-talk <tech-talk at aps.anl.gov>
Sent: 18 August 2020 10:04 To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov> Subject: How to write a soft record with a constant long string value
Hi all,
I would like to write a database file with a single record that holds a constant chunk of JSON (generated by a script at IOC build time). I would prefer to do this by writing the JSON into the database file itself, rather than having to use a separate file,
or dbpf.
Does anyone know if this is possible?
Thanks,
Tom
-- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify
us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
-- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. |