Changes between Initial Version and Version 1 of epics/saverestore


Ignore:
Timestamp:
12/09/15 19:24:55 (9 years ago)
Author:
Takashi Obina
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • epics/saverestore

    v1 v1  
     1= !Save/Restore の使い方 =
     2
     3== ダウンロード・インストール ==
     4 * 念のため最新の autosave をインストールする。
     5 * ダウンロード先は  http://aps.anl.gov/bcda/synApps/autosave/autosave.html
     6 * 今回はR5-7-1を使った。
     7
     8 * ダウンロードしたファイルを extensions/src 以下に展開
     9    * configure/RELEASE で base ディレクトリを指定
     10    * make
     11
     12== test Application 作成 ==
     13 * いつものように makeBaseApp.pl
     14 * configure/RELEASE で参照する場所を指定する
     15   {{{
     16   AUTOSAVE=$(EPICS_BASE)/../extensions/src/autosave-R5-7-1
     17   }}}
     18 * db ファイル作成し、waveformレコードを1つ作る
     19   {{{
     20   record(waveform, "obina:wf1")
     21   {
     22        field(DESC, "Analog input")
     23        field(INP,  "")
     24        field(NELM, "10")
     25        field(FTVL, "DOUBLE")
     26   }
     27   }}}
     28
     29== 実行例1:saveせず、単に初期値を設定したいとき ==
     30iocBoot ディレクトリでの作業
     31
     32 * st.cmd を編集して set_pass1_restoreFile の1行を追加する(iocInitの前)
     33   {{{
     34   .... (snip) ....
     35   dbLoadRecords "db/wf1.db"
     36   ...
     37   # for autosave
     38   set_pass1_restoreFile("auto.sav")
     39
     40   cd ${TOP}/iocBoot/${IOC}
     41   iocInit
     42   .... (snip) ....
     43   }}}
     44
     45 * 同じディレクトリに auto.sav というファイルを作成する。中身は1行のみで
     46   {{{
     47   obina:wf1 @array@ { "1" "2" "3" "4" "5" }
     48   }}}
     49 * ioc実行(st.cmd)
     50   {{{
     51   [obina@erlserv1 iocsrtest]$ ./st.cmd
     52   .... (snip) ....
     53   iocInit
     54   Starting iocInit
     55   ############################################################################
     56   ## EPICS R3.14.12.2 $Date: Mon 2011-12-12 14:09:32 -0600$
     57   ## EPICS Base built Jun 25 2012
     58   ############################################################################
     59   reboot_restore: entry for file 'auto.sav'
     60   reboot_restore: Found filename 'auto.sav' in restoreFileList.
     61   *** restoring from 'auto.sav' at initHookState 7 (after record/device init) ***
     62   reboot_restore: done with file 'auto.sav'
     63
     64   iocRun: All initialization complete
     65   }}}
     66
     67 * caget して、初期化されていることを確認。この例では NELM=10に対して、初期値は5個のみ与えている。
     68   {{{
     69   [obina@erlserv1 ~]$ caget obina:wf1
     70   obina:wf1 10 1 2 3 4 5 0 0 0 0 0
     71   }}}
     72 * 確認のため st.cmd 内の set_pass1_restoreFile 行をコメントアウトすると初期化されていない。
     73   {{{
     74   [obina@erlserv1 ~]$ caget obina:wf1
     75   obina:wf1 10 2.50321e-308 0 0 0 0 0 0 0 0 0
     76   }}}