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  <20132014  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  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: AutoSAVE file cannot use substitution macros
From: Tim Mooney <[email protected]>
To: Amien TLABS <[email protected]>
Cc: [email protected]
Date: Thu, 20 Jun 2013 09:36:28 -0500 (CDT)
Hi Amien,

When you use create_monitor_set(), autosave normally won't write a .sav file unless a
PV in the set has changed.

In autosave 5.1 is a new facility called configMenu, which does permit the loading of
a .cfg file (same as a .sav file, but with a different extension) with macros, as long
as all the macros were previously defined in a create_xxx_set() call, as they are in
your case.  I'm not sure configMenu is the best thing for your application.  It's intended
to let users select one of several .cfg files for loading at run time.

Tim

----- Original Message ----- 

> From: "Amien TLABS" <[email protected]>
> To: "Mark Rivers" <[email protected]>
> Cc: [email protected]
> Sent: Thursday, June 20, 2013 9:14:17 AM
> Subject: Re: AutoSAVE file cannot use substitution macros

> Hi Mark

> here's my test.req

> $(P):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" }

> my auto_settings.req
> file "test.req", P=$(dev)

> and in my st.cmd

> ###########################################################################
> ##################### START IOC SCRIPT
> #####################################
> ############################################################################

> dbLoadDatabase("iocBeagle48.dbd")
> iocBeagle48_registerRecordDeviceDriver(pdbbase)

> int32DriverInit("int32",-32768,32767)

> ##epicsEnvSet("PREFIX", "13SIM1:")
> ##### We load the HARPS template
> ##########################################
> dbLoadTemplate("iocPV.substitutions")

> ##### Load Save files
> #####################################################
> set_savefile_path("save")
> set_pass0_restoreFile("auto_settings.sav")
> set_pass1_restoreFile("auto_settings.sav")

> ##### INIT IOC here
> #######################################################
> iocInit()
> create_monitor_set("auto_settings.req",30,"P=$(harp100)")

> Under my /save directory I have auto_settings.sav
> I do not see anything in here after 30 seconds intervals...??

> What I'm I doing wrong?

> Amien

> On 20-Jun-2013 15:40, Mark Rivers wrote:

> > You did not show us the autoSave .req file you are using.  .req
> > files
> > can take macros.  For example:
> 

> > corvette:areaDetector/ADApp/Db>more ADBase_settings.req
> 
> > $(P)$(R)DataType
> 
> > $(P)$(R)ColorMode
> 
> > $(P)$(R)BinX
> 
> > $(P)$(R)BinY
> 
> > $(P)$(R)MinX
> 

> > That generic .req file is invoked by the IOC-specific .req file:
> 

> > corvette:areaDetector/iocBoot/iocSimDetector>more auto_settings.req
> 
> > file "simDetector_settings.req",    P=$(P),  R=cam1:
> 
> > file "simDetector_settings.req",    P=$(P),  R=cam2:
> 
> > file "ADBase_settings.req",         P=$(P),  R=cam1:
> 

> > which is in turn invoked from the startup script:
> 

> > # save things every thirty seconds
> 
> > create_monitor_set("auto_settings.req", 30, "P=$(PREFIX)")
> 

> > Mark
> 

> > ________________________________
> 
> > From: [email protected] [ [email protected]
> > ]
> > on behalf of Amien TLABS [ [email protected] ]
> 
> > Sent: Thursday, June 20, 2013 8:23 AM
> 
> > To: [email protected] Subject: AutoSAVE file cannot use
> > substitution macros
> 

> > 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.
> 

Replies:
Re: AutoSAVE file cannot use substitution macros Amien TLABS
References:
Re: AutoSAVE file cannot use substitution macros Amien TLABS

Navigate by Date:
Prev: Re: EPICS device disconnects and reconnects Ralph Lange
Next: Re: Edm Histogram Southern, Tim
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: AutoSAVE file cannot use substitution macros Amien TLABS
Next: Re: AutoSAVE file cannot use substitution macros Amien TLABS
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·