
Chapter 9
129
Communication with External Equipment (Using the I/O Ports)
Sample Program to Use the I/O Port
1. Ch
apter
T
itle
2
. Cha
p
te
r T
itle
3
. Chap
te
r T
itle
9.
Communication w
ith
5. Chap
te
r T
itle
Exer
nal Equ
ipme
n
t
(U
s
ing
th
e I/
O Por
ts
)
Sample Program to Use the I/O Port
Communication with external equipment shows a sample program to communicate with
external equipment through the 8-bit I/O. This program is stored on the sample program
disk as the io_port.bas file.
Lines 20 to 60
Identifies the external controller and Instrument BASIC and sets the
GPIB address.
Line 80
Sets an 8-bit data value to OUT0 to OUT7 (outputs to the external
equipment). In this sample, 8 is set as an 8-bit data value, and therefore
the OUT3 line is set to TRUE.
Lines 100 to 140 Waits for the external equipment to set the IN3 line to TRUE (to input
8 to IN0 to IN3 as a 4-bit data value).
Example 9-1
Communication with external equipment
10 INTEGER Inpio,Bit3_stat
20 IF SYSTEM$("SYSTEM ID")="HP4294A" THEN
30 ASSIGN @Hp4294a TO 800
40 ELSE
50 ASSIGN @Hp4294a TO 717
60 END IF
70 !
80 OUTPUT @Hp4294a;"OUT8IO 8"
90 !
100 REPEAT
110 OUTPUT @Hp4294a;"INP8IO?"
120 ENTER @Hp4294a;Inpio
130 Bit3_stat=BIT(Inpio,3)
140 UNTIL Bit3_stat=1
150 END
Содержание 4294A
Страница 4: ...4 ...
Страница 18: ...18 Contents ...
Страница 24: ...24 Chapter1 To make effective use of this manual Other manuals attached to this unit ...
Страница 94: ...94 Chapter6 Reading Writing Measurement Data Reading Writing Data ...
Страница 110: ...110 Chapter7 Processing Measurement Results Analyzing Measurement Results ...
Страница 130: ...130 Chapter9 Communication with External Equipment Using the I O Ports Sample Program to Use the I O Port ...
Страница 136: ...136 Chapter10 Handling Errors Sample program for error handling ...
Страница 246: ...246 13 Application Sample Programs File Transfer Function ...
Страница 254: ...254 Chapter15 Setting the Display LCD Sample program for setting the LCD screen ...
Страница 507: ...Index Index 507 Index ...
Страница 508: ...508 Index Index ...
Страница 509: ...Index Index 509 Index ...
Страница 510: ...510 Index Index ...
Страница 511: ...Index Index 511 Index ...
Страница 512: ...512 Index Index ...
Страница 513: ...Index Index 513 Index ...
Страница 514: ...514 Index Index ...
Страница 515: ...Index Index 515 Index ...
Страница 516: ...516 Index Index ...
Страница 517: ...Index Index 517 Index ...
Страница 518: ...518 Index Index ...