| 1 | == LAN/GPIBゲートウェイ使用例 == |
| 2 | Keithleyの例とほとんど同じなので、要点のみ |
| 3 | |
| 4 | LAN/GPIBの先にAgilent製の周波数カウンタ(Agilent 53181A)をGPIBアドレス22で接続した場合を例に挙げる。 |
| 5 | |
| 6 | 作業ディレクトリ作成 |
| 7 | {{{ |
| 8 | pfrproc2:~ % mkdir /users/obina/epics/app/AG53181A |
| 9 | pfrproc2:~ % cd /users/obina/epics/app/AG53181A |
| 10 | pfrproc2:AG53181A % makeBaseApp.pl -t ioc AG53181A |
| 11 | pfrproc2:AG53181A % makeBaseApp.pl -i -t ioc AG53181A |
| 12 | The following target architectures are available in base: |
| 13 | linux-x86 |
| 14 | linux-x86_64 |
| 15 | What architecture do you want to use? linux-x86_64 |
| 16 | The following applications are available: |
| 17 | AG53181A |
| 18 | What application should the IOC(s) boot? |
| 19 | The default uses the IOC's name, even if not listed above. |
| 20 | Application name? |
| 21 | }}} |
| 22 | |
| 23 | configure/RELEASE編集 |
| 24 | {{{ |
| 25 | pfrproc2:AG53181A % vi configure/RELEASE |
| 26 | |
| 27 | SNCSEQ=$(EPICS_BASE)/../modules/soft/seq/2.0.11 |
| 28 | ASYN=$(EPICS_BASE)/../modules/soft/asyn/4-11 |
| 29 | STREAM=$(EPICS_BASE)/../modules/soft/stream/2-5 |
| 30 | }}} |
| 31 | |
| 32 | srcディレクトリでの作業 |
| 33 | {{{ |
| 34 | pfrproc2:AG53181A % cd AG53181AApp/src |
| 35 | registrar(drvAsynIPPortRegisterCommands) |
| 36 | registrar(drvAsynSerialPortRegisterCommands) |
| 37 | registrar(vxi11RegisterCommands) |
| 38 | |
| 39 | pfrproc2:AG53181A % vi Makefile |
| 40 | AG53181A_DBD += aaiRecord.dbd |
| 41 | AG53181A_DBD += aaoRecord.dbd |
| 42 | AG53181A_DBD += asyn.dbd |
| 43 | AG53181A_DBD += stream.dbd |
| 44 | AG53181A_DBD += AG53181.dbd |
| 45 | |
| 46 | AG53181A_LIBS += asyn |
| 47 | AG53181A_LIBS += stream |
| 48 | }}} |
| 49 | |
| 50 | |
| 51 | Dbディレクトリでの作業 |
| 52 | {{{ |
| 53 | pfrproc2:AG53181A % cd AG53181AApp/Db/ |
| 54 | |
| 55 | pfrproc2:Db % vi AG53181.proto |
| 56 | Terminator = CR LF; |
| 57 | # |
| 58 | getIDN { |
| 59 | out "*IDN?"; in "%39c"; |
| 60 | } |
| 61 | |
| 62 | |
| 63 | pfrproc2:Db % vi test.db |
| 64 | |
| 65 | record(stringin, "obina:idn") |
| 66 | { |
| 67 | field(DESC, "get IDN") |
| 68 | field(DTYP, "stream") |
| 69 | field(INP, "@AG53181.proto getidn PS1 22") <---- GPIB機器のアドレスが22の場合 |
| 70 | } |
| 71 | |
| 72 | pfrproc2:Db % vi Makefile |
| 73 | DB += test.db |
| 74 | |
| 75 | pfrproc2:Db % cd ../ |
| 76 | pfrproc2:AG53181A % make |
| 77 | }}} |
| 78 | |
| 79 | startup script編集 |
| 80 | {{{ |
| 81 | pfrproc2:AG53181A % cd iocBoot/iocAG53181A/ |
| 82 | pfrproc2:iocAG53181A % vi st.cmd |
| 83 | |
| 84 | dbLoadRecords("db/test.db") |
| 85 | |
| 86 | vxi11Configure ("PS1","172.28.5.xxx",1,1000,"gpib0") <---- LAN/GPIBゲートウェイのIPアドレス |
| 87 | |
| 88 | |
| 89 | }}} |