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 | 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 |
<== Date ==> | <== Thread ==> |
---|
Subject: | AutoSAVE file cannot use substitution macros |
From: | Amien TLABS <[email protected]> |
To: | [email protected] |
Date: | Thu, 20 Jun 2013 15:23:34 +0200 |
Hi I'm using a 'waveform' record in my IOC, which I use to map my cable wiring to my channels at the start of the IOC. To populate the array, I then use a 'sav' (AutoSave) file that has the array values in it ( dev1:channelmap.VAL @array@ {"2" "12" "7"}) ) etc. This array is normally 48 elements. Now the users of the IOC can change this array to suit their mappings. My problem is that I would like to have a substitution macro in the 'dev1' part. However, one cannot use a substitution macro in a 'sav' file. I have a waveform record in my template file. Here's my st.cmd and template files: ################## START IOC SCRIPT ##################################### dbLoadDatabase("iocBeagle48.dbd") iocBeagle48_registerRecordDeviceDriver(pdbbase) int32DriverInit("int32",-32768,32767) ##### We load the HARPS template ########################################## dbLoadTemplate("iocPV.substitutions") ##### Load Save files ##################################################### set_savefile_path("save") set_pass0_restoreFile("channelmap_MB.sav") set_pass1_restoreFile("channelmap_MB.sav") #### INIT IOC here ####################################################### iocInit() ####################################################################### <<< Here's my iocPV.db >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> record(waveform, "$(dev):channelmap") { field(DTYP, "asynInt32ArrayOut") field(INP, "@asyn(int32 0 100)") field(NELM, "48") field(FTVL, "LONG") field(PINI, "YES") } <<< here's my substitution file >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> file iocPV.db { pattern { dev mux } {"harp100" "1" } } <<<<<<< and my SAV file >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> # save/restore V5.5 Automatically generated - DO NOT MODIFY - 130215-051243 harp100:channelmap.VAL @array@ { "32" "0" "1" "2" "3" "4" "5" "6" "7" "24" "25" "26" "27" "28" "29" "30" "31" "47" "17" "18" "19" "20" "21" "22" "23" "8" "16" "10" "11" "12" "13" "14" "15" "9" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" "45" "46" } <END> As you can see, i want to have a substitution macro for my sav file (harp100 should be substituted by pattern dev) Or maybe there is a better way to populate my waveform. Thanks Amien TLABS Cape Town. |