Changes between Initial Version and Version 1 of epics/system


Ignore:
Timestamp:
05/23/17 10:02:40 (7 years ago)
Author:
obina
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • epics/system

    v1 v1  
     1= iocsh上でシステムコマンド実行 = 
     2 
     3== build方法 == 
     4EPICS version 3.14.5 以降が必要。 
     5例えばよく使う "example application" の場合には ioc_system.dbd ファイルを作成して中に 
     6{{{ 
     7registrar(iocshSystemCommand)  
     8}}} 
     9と記載し、Makefileで 
     10{{{ 
     11example_DBD += ioc_system.dbd 
     12}}} 
     13とすれば良いだけ。すると iocsh 上で help と打つと system コマンドが使えるようになっていることが分かる。 
     14 
     15 
     16== 使用例と感想 == 
     17{{{ 
     18hepics> help 
     19Type 'help command_name' to get more information about a particular command. 
     20...,. 
     21setIocLogDisable                system          taskwdShow      tpn 
     22...... 
     23epics> 
     24 
     25 
     26epics> system date 
     272017年  5月 23日 火曜日 09:50:46 JST 
     28epics> 
     29}}} 
     30 
     31バックグランドで実行したいときや、引数を与えたいときには(良い例ではないですが)例えば xclock だと 
     32{{{ 
     33epics> system "xclock &" 
     34}}} 
     35のようにクオートで括れば良い。 
     36 
     37ただし、このままだと2重・3重にスクリプトが起動できるので実際の運転に使うにはちょっと....それくらいならば 
     38procServを使った方が色々な面で良いと思う(2重起動を防止とか、ログ出力とか、マシン起動時に実行するとかできるので) 
     39 
     40== 経緯 == 
     41[http://www.rri.kyoto-u.ac.jp/EPICS/program.html 
     42 EPICS Collaboration Meeting 2017] においてNSLS2の発表スライド中でsystemコマンドを実行していることに気づいた。 
     43以前から「おそらく出来るだろう」くらいには思っていたが使う機会もなく全く試すことはなかったが、あらためて 
     44application dev. guide をみるとちゃんと掲載されていた。 
     45http://www.aps.anl.gov/epics/base/R3-16/1-docs/AppDevGuide/IOCShell.html#x19-73700018.2.5 
     46 
     47 
     48{{{ 
     49Send command_string to the system command interpreter for execution.  
     50This command is present only if some application database definition file  
     51contains registrar(iocshSystemCommand) and if the system provides  
     52a suitable command interpreter (vxWorks does not). 
     53}}} 
     54 
     55 
     56ついでに、いつから実装されていたのかを確認したところ、3.14.5 のRelease Note に記載があった。 
     57http://www.aps.anl.gov/epics/base/R3-14/5-docs/RELEASE_NOTES.html 
     58{{{ 
     59IOC shell system command 
     60 
     61The 'system' command has been added to the IOC shell.  
     62To enable this command, add registrar(iocshSystemCommand)  
     63to an application database description file. 
     64}}} 
     65 
     66 
     67 
     68