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."
])
}
$ 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.
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...
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.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
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
--
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. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 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
|