■ 戻 る   ■ i2net HOME   ■ HTBASIC HOME

タイトルイメージ

ines/ELAN D403/D480サンプルプログラム
(8/11)



110 INTEGER D(2) ! Data arrays
120 INTEGER Dummy ! dummy variable for initialization
130 INTEGER Hdio,Cdio! Device handle for DIO, Numbers of the samples read
140 DIM A$[16] ! string of 16 characters
150 PRINT "i403/D403 DIO CALL Daqhtb_writei(1,Hdio,D(*)) Test"
160 PRINT "--------------------------------------------------"
161 Cdio=2
170 Input_port:!
180 INPUT "Port A-E ? = ",Port$
190 Port$=UPC$(Port$)
200 IF Port$<"A" OR Port$>"E" THEN GOTO Input_port
210 PRINT "Port is ";Port$;"."
220 !---------- initialization ------------------------------------------------------
230 CALL Daqhtb_ioctl(Dummy,"( fctn init) ")
240 !---------- open device ---------------------------------------------------------
250 CALL Daqhtb_open(Hdio,"i403 DIO "&Port$,0)
260 !---------- configure DIO device and start writing ------------------------------
270 CALL Daqhtb_ioctl(Hdio,"( iod ( dir 255 ) ) ")!
280 Repeat:!
290 INPUT "byte( disp >=0 ; quit <0)",P
300 A$=IVAL$(P,2) ! binary expression of P
310 IF P<0 THEN GOTO Fines
320 PRINT P,A$[9] ! sub stgring expression of lower 8 characters
330 D(1)=P
340 CALL Daqhtb_writei(Cdio,Hdio,D(*))
350 GOTO Repeat
360 Fines:!
370 D(1)=BINAND(BINCMP(0),255)! inverse of 0
380 CALL Daqhtb_writei(Cdio,Hdio,D(*))! end of display
390 !----------- close device ---------------------------------------
400 CALL Daqhtb_close(Hdio)
410 DELSUB Daqhtb_ioctl TO END
420 END
430 !

2−(3)  DIOwriteiDemo.bas  (1ビットずつインクリメントします)
1. 操作
a)テストするポートをインプットします
 D403の場合A-E、D480の場合A-F
 b)255までで終了します

[拡大画像]

[1] [2] [3] [4] [5] [6] [7] 8 [9] [10] [11]  NEXT

アイネット株式会社
  〒103-0014 東京都中央区日本橋蛎殻町1-1-9-7階
  TEL:03-5623-2301(代表) FAX:03-5623-2305
  E-mailでのお問い合わせ
_/_/_/ Copyright 1998-2011 I2NET Co., Ltd. AllRights Reserved. _/_/_/