wiki:epics/streamdevice/example2

Version 1 (modified by obina, 7 years ago) (diff)

--

LAN/GPIBゲートウェイ使用例

Keithleyの例とほとんど同じなので、要点のみ

LAN/GPIBの先にAgilent製の周波数カウンタ(Agilent 53181A)をGPIBアドレス22で接続した場合を例に挙げる。

作業ディレクトリ作成

pfrproc2:~ % mkdir /users/obina/epics/app/AG53181A
pfrproc2:~ % cd /users/obina/epics/app/AG53181A
pfrproc2:AG53181A % makeBaseApp.pl -t ioc AG53181A
pfrproc2:AG53181A % makeBaseApp.pl -i -t ioc AG53181A
The following target architectures are available in base:
    linux-x86
    linux-x86_64
What architecture do you want to use? linux-x86_64
The following applications are available:
    AG53181A
What application should the IOC(s) boot?
The default uses the IOC's name, even if not listed above.
Application name?

configure/RELEASE編集

pfrproc2:AG53181A % vi configure/RELEASE

SNCSEQ=$(EPICS_BASE)/../modules/soft/seq/2.0.11
ASYN=$(EPICS_BASE)/../modules/soft/asyn/4-11
STREAM=$(EPICS_BASE)/../modules/soft/stream/2-5

srcディレクトリでの作業

pfrproc2:AG53181A % cd AG53181AApp/src
registrar(drvAsynIPPortRegisterCommands)
registrar(drvAsynSerialPortRegisterCommands)
registrar(vxi11RegisterCommands)

pfrproc2:AG53181A % vi Makefile 
AG53181A_DBD += aaiRecord.dbd
AG53181A_DBD += aaoRecord.dbd
AG53181A_DBD += asyn.dbd
AG53181A_DBD += stream.dbd
AG53181A_DBD += AG53181.dbd

AG53181A_LIBS += asyn
AG53181A_LIBS += stream

Dbディレクトリでの作業

pfrproc2:AG53181A % cd AG53181AApp/Db/

pfrproc2:Db % vi AG53181.proto
Terminator = CR LF;
#
getIDN {
    out "*IDN?";   in "%39c";
}


pfrproc2:Db % vi test.db

record(stringin, "obina:idn")
{
    field(DESC, "get IDN")
    field(DTYP, "stream")
    field(INP,  "@AG53181.proto getidn PS1 22")          <---- GPIB機器のアドレスが22の場合
}

pfrproc2:Db % vi Makefile
DB += test.db

pfrproc2:Db % cd ../
pfrproc2:AG53181A % make

startup script編集

pfrproc2:AG53181A % cd iocBoot/iocAG53181A/
pfrproc2:iocAG53181A % vi st.cmd

dbLoadRecords("db/test.db")

vxi11Configure ("PS1","172.28.5.xxx",1,1000,"gpib0")   <---- LAN/GPIBゲートウェイのIPアドレス