Changes between Version 2 and Version 3 of epics/contec_cpi


Ignore:
Timestamp:
09/05/23 12:03:46 (11 months ago)
Author:
michkawa
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • epics/contec_cpi

    v2 v3  
    1818を使用した。 
    1919 
    20 == !RaspberryPi環境設定 == 
     20== RaspberryPi環境設定 == 
    2121 
    2222Raspberry Piに今回使用するボードの実行環境を整備する。[[br]] 
     
    5151=== ドライバのインストール === 
    5252 
    53 AIOとDIOは別々にインストールする必要があるが、インストール方法はほぼ同じ。 
     53AIOとDIOは別々にインストールする必要があるが、インストール方法はほぼ同じ。[[br]] 
     54例として、AIOドライバをインストールした時のログを記述するが、DIOは{{{caio->cdio}}}に読み替えればいい。 
    5455 
    5556ドライバーをRaspberryPiにコピーして展開。 
     
    7980 
    8081{{{ 
    81 root@raspberrypi:/home/epics/epics/caio530F/contec/caio# raspi-config 
     82root@raspberrypi:/root# raspi-config 
    8283 
    8384 3 Interface Options ->  
     
    9495これで認識されるようになるが、'''こんな記述はマニュアルにはない!!!'''[[br]] 
    9596 
    96 とりあえず認識されているかを確認するために、i2cbusを見てみる。 
     97とりあえず認識されているかを確認するために、i2cbusを見てみる。[[br]] 
     98どうやらi2cbusを2つ使うようで、0と1では違うデバイスが見えている。 
    9799 
    98100{{{ 
     
    119121}}} 
    120122 
     1230に見えているのが、今回接続したボードのアドレスのようで、試しにロータリースイッチを変更すると番号が変わることが確認できた。 
     124 
     125=== ドライバ設定 === 
     126 
     127このボードをプログラムから使用する際には、ドライバをインストールするだけでなく各ボードに名前を設定する必要がある。[[br]] 
     128ドライバをコンパイルすると、ディレクトリに{{{config}}}ディレクトリが作成され、その中の{{{config}}}を実行することでボード名を設定する。[[br]] 
     129 
     130{{{ 
     131root@raspberrypi:/home/epics/epics/caio530F/contec/caio/config# ./config 
     132---------------------------------- 
     133CONTEC API-AIO(LNX) Configuration 
     134---------------------------------- 
     135Message : Auto detecting devices. 
     136................................................................................... 
     137.. 
     138-------------------------------------------------------------------------------- 
     139 Devices list 
     140-------------------------------------------------------------------------------- 
     141    DeviceName   Product Name       ID              IP/Master IP    Status 
     142[1]:+ AIO000     CPI-AI-1208LI      1 
     143[2]:+ AIO001     CPI-AO-1602LC      0 
     144-------------------------------------------------------------------------------- 
     145[#]:Select device       [o]:List sort           [r]:Redetect devices list 
     146[d]:Delete device       [a]:Add device manually [e]:Diagnostic report 
     147[s]:Save settings       [q]:Exit 
     148Please select the device to set up. 
     149Please input >s 
     150******************************************************************************** 
     151Save OK?(y/n):y 
     152Message : Setting file is 'contec_aio.conf'. 
     153Message : Start script file is 'contec_aio_start.sh'. 
     154Message : Stop script file is 'contec_aio_stop.sh'. 
     155Confirm(y):y 
     156.. 
     157-------------------------------------------------------------------------------- 
     158 Devices list 
     159-------------------------------------------------------------------------------- 
     160    DeviceName   Product Name       ID              IP/Master IP    Status 
     161[1]:  AIO000     CPI-AI-1208LI      1 
     162[2]:  AIO001     CPI-AO-1602LC      0 
     163-------------------------------------------------------------------------------- 
     164[#]:Select device       [o]:List sort           [r]:Redetect devices list 
     165[d]:Delete device       [a]:Add device manually [e]:Diagnostic report 
     166[s]:Save settings       [q]:Exit 
     167Please select the device to set up. 
     168Please input >q 
     169******************************************************************************** 
     170}}} 
     171 
     172DIOの場合、 
     173 
     174{{{ 
     175root@raspberrypi:/home/epics/epics/cdio_820F/contec/cdio/config# ./config 
     176---------------------------------- 
     177CONTEC API-DIO(LNX) Configuration 
     178---------------------------------- 
     179Message : Auto detecting devices. 
     180........................................................................................................................................................ 
     181.. 
     182-------------------------------------------------------------------------------- 
     183 Devices list 
     184-------------------------------------------------------------------------------- 
     185    DeviceName   Product Name       ID              IP/Master IP    Status 
     186[1]:  DIO000     CPI-RRY-16         2 
     187[2]:+ DIO001     CPI-DIO-0808L      3 
     188-------------------------------------------------------------------------------- 
     189[#]:Select device       [o]:List sort           [r]:Redetect devices list 
     190[d]:Delete device       [a]:Add device manually [e]:Diagnostic report 
     191[s]:Save settings       [q]:Exit 
     192Please select the device to set up. 
     193Please input >s 
     194******************************************************************************** 
     195Save OK?(y/n):y 
     196Message : Setting file is 'contec_dio.conf'. 
     197Message : Start script file is 'contec_dio_start.sh'. 
     198Message : Stop script file is 'contec_dio_stop.sh'. 
     199Confirm(y): 
     200Confirm(y):y 
     201.. 
     202-------------------------------------------------------------------------------- 
     203 Devices list 
     204-------------------------------------------------------------------------------- 
     205    DeviceName   Product Name       ID              IP/Master IP    Status 
     206[1]:  DIO000     CPI-RRY-16         2 
     207[2]:  DIO001     CPI-DIO-0808L      3 
     208-------------------------------------------------------------------------------- 
     209[#]:Select device       [o]:List sort           [r]:Redetect devices list 
     210[d]:Delete device       [a]:Add device manually [e]:Diagnostic report 
     211[s]:Save settings       [q]:Exit 
     212Please select the device to set up. 
     213Please input >q 
     214******************************************************************************** 
     215}}} 
     216 
     217ドライバにアクセスするためには、付属ライブラリ内にある{{{contec_aio_start.sh}}}と{{{contec_dio_start.sh}}}を実行する必要があるそうなので、マニュアルに従って{{{/etc/rc.local}}}に記述する。 
     218 
     219{{{ 
     220root@raspberrypi:/root# emacs -nw /etc/rc.local 
     221cd /home/epics/epics/caio530F/contec/caio/config/ 
     222./contec_aio_start.sh 
     223cd /home/epics/epics/cdio_820F/contec/cdio/config/ 
     224./contec_dio_start.sh 
     225}}} 
     226 
     227ちなみにこのスクリプトを実行するためには、実行に必要なファイルを適当なディレクトリにコピーすることが求められているが、今回は展開先で直接実行するようにしておいた。 
     228 
     229== IOC == 
     230 
     231やっとIOC。 
     232