HostPCにTTLレベルの信号を入力したいのですが。
パラレルポート経由でTTLレベルの信号をHostPCに入力し、入力のタイミングをEDFに記録することが可能です。
パラレルポートでのコミュニケーション用プログラム(PORT95NT)をダウンロードしDisplayPCにインストールしてください。
手順1 プリンタポートのモード識別
出力先のプリンタポートのモードをBIOSより確認します。
* AT, Normal, SPP
* PS/2, Bi-Directional
* EPP
* ECP
手順2 出力先のプリンタポートのモードに合わせてHostPCプリンタモード設定を合わせます
■HostPC をbidirectionモードにする場合
final.iniに以下の設定をコピーしてください。
## write_ioport <ioport> <data>
;; Writes data to I/O port. Useful to configure I/O cards.
;; <ioport>: byte hardware I/O port address
;; <data>: data to write
write_ioport 0x37A 0x20 ;enables the bidirectional mode
// DIGITAL INPUT PORT
;; up to 16 i/o lines can be reported
;; these consist of 2 ports, (high and low byte)
;;
;; port: 2 or 3 are digital input card ports:
;; 2 = port A, 3 = port B
;; other values are address of hardware I/O port
;;
;; if only 1 entry, 8-bit port (high byte)
input_data_ports 0x378 ;read the data from the data register
;; port bits can be masked so changes don't trigger events
input_data_masks = 0xFF
■HostPC をbidirectionモードにしない場合
final.iniに以下の設定をコピーしてください。
write_ioport 0x37A 0x0 ;disables the bidirectional mode
input_data_ports = 0x379 ;use the status register to read input data
input_data_masks = 0xFF;
手順3 入力信号を受け取りEDFファイルに記録する作業
"file_event_filter"にINPUTを追加
write_ioport 0x37A 0x0 ;disables the bidirectional mode
input_data_ports = 0x379 ;use the status register to read input data
input_data_masks = 0xFF;
// EVENT TYPE FILTER (FILE AND LINK)
;; Messages are always enabled for the file
;; but must be selected for the link
;; Messages, buttons and input port changes
;; are on at any time, eye events only while recording
;; the data passed are in a list with these types:
; LEFT - events for one or both eyes (active_eye limits this for monoscopic)
; RIGHT
; FIXATION - fixation start and end events
; FIXUPDATE - fixation (pursuit) state updates
; SACCADE - saccade start and end
; BLINK - blink start an end
; MESSAGE - messages (user notes in file)
; BUTTON - button 1..8 press or release
; INPUT - changes in input port lines
file_event_filter = LEFT,RIGHT,FIXATION,BLINK,MESSAGE,BUTTON,SACCADE,INPUT
手順4 ボタン(入力端子)の作成
final.iniに以下をコピーしてください。
データレジスタ 0X378(bidirectionの場合)
データレジスタ 0X379 (non-bidirectionの場合)
## create_button <number> <port> <bitmask> <invert?>
;; Defines a button to a bit in a hardware port.
;; <button>: button number, 1 to 8
;; <ioport>: address of hardware port
;; <bitmask>: 8-bit mask ANDed with port to test button line
;; <inverted>: 1 if active-low, 0 if active-high
create_button 1 0x378 0x01 0
create_button 2 0x378 0x02 0
create_button 3 0x378 0x04 0
create_button 4 0x378 0x08 0
create_button 5 0x378 0x10 0
create_button 6 0x378 0x20 0
create_button 7 0x378 0x40 0
create_button 8 0x378 0x80 0
手順5 ボタン(入力端子)の定義
// BUTTON FUNCTIONS:
## button_function <button_number>
## button_function <button_number> <press_command>
## button_function <button_number> <press_command> <release_command>
;; Buttons may be assigned to generate commands
;; Give the button number (1..31) then the command string in quotes
;; the first command is executed when the button is pressed
;; the optional second is executed when button is released
;; Giving NO strings deletes the button function
;; <button>: hardware button 1 to 8, keybutton 8 to 31
;; <presscmd>: command to execute when button pressed
;; <relcmd>: command to execute when button released
button_function 1 "data_message 'BUTTON_1_PRESSED'" "data_message 'BUTTON_1_RELEASED'"
button_function 2 "data_message 'BUTTON_2_PRESSED'" "data_message 'BUTTON_2_RELEASED'"
button_function 3 "data_message 'BUTTON_3_PRESSED'" "data_message 'BUTTON_3_RELEASED'"
button_function 4 "data_message 'BUTTON_4_PRESSED'" "data_message 'BUTTON_4_RELEASED'"
button_function 5 "data_message 'BUTTON_5_PRESSED'" "data_message 'BUTTON_5_RELEASED'"
button_function 6 "data_message 'BUTTON_6_PRESSED'" "data_message 'BUTTON_6_RELEASED'"
button_function 7 "data_message 'BUTTON_7_PRESSED'" "data_message 'BUTTON_7_RELEASED'"
button_function 8 "data_message 'BUTTON_8_PRESSED'" "data_message 'BUTTON_8_RELEASED'"
以上の設定で、TTLレベルの信号が入力されるとEDFファイル上では以下のように表示されます。
MSG 54161 TRIALID 1
START 54218 LEFT RIGHT EVENTS
INPUT 54218 0
MSG 54266 SET_TTL 2
BUTTON 54266 2 1
INPUT 54266 2
MSG 54266 BUTTON_2_PRESSED
MSG 55266 CLEAR_TTL 0
BUTTON 55267 2 0
INPUT 55267 0
MSG 55267 BUTTON_2_RELEASED
END 55283 EVENTS RES 30.40 28.40
INPUT 55286 0
MSG 55345 TRIAL_RESULT 0
...
MSG 55525 TRIALID 2
START 55582 LEFT RIGHT EVENTS
INPUT 55582 0
BUTTON 55633 1 1
BUTTON 55633 2 1
INPUT 55633 3
MSG 55633 BUTTON_1_PRESSED
MSG 55633 SET_TTL 3
MSG 55633 BUTTON_2_PRESSED
MSG 56633 CLEAR_TTL 0
BUTTON 56634 1 0
BUTTON 56634 2 0
INPUT 56634 0
MSG 56634 BUTTON_1_RELEASED
MSG 56634 BUTTON_2_RELEASED
END 56651 EVENTS RES 30.40 28.40
INPUT 56654 0
MSG 56713 TRIAL_RESULT 0
表示されるメッセージのコメントを変える場合はつぎのように編集します。
button_function 1 "data_message 'START_RECORDING'" "data_message 'STOP_RECORDING'"
HostPCをbidirectionモードにした場合のiniファイルはこちらです。ご参考にしてみてください。