www.vtiinstruments.com
EX1629 Command Set
149
vtex1629_get_dio_input
F
UNCTION
P
ROTOTYPE
ViStatus vtex1629_get_dio_input (ViSession
vi
, ViPInt32
dioIn
);
F
UNCTION
P
ARAMETERS
vi
= contains a session handle to the instrument. This handle is obtained by the function and remains valid until the
session is closed.
dioIn
= an integer return value indicating the input state of the digital I/O. See the
Description
below for more
information concerning this parameter. Valid return values: 0 to 65535.
D
ATA
I
TEM
R
ESET
V
ALUE
Not applicable to this function.
D
ESCRIPTION
This function queries and returns the current input state of both banks of the digital I/O. The
dioIn
parameter is a
decimal value that must be converted to a 16-bit binary value. Once done, the eight most significant bits correspond
to the eight channels of bank one (channels 8-15). The eight least significant bits correspond to the eight channels of
bank zero (channels 0-7). This is illustrated below.
bank one
channel #
bank zero
dioIn
15
0
14
0
13
0
12
0
11
0
10
0
9
0
8
0
7
0
6
0
5
0
4
0
3
0
2
0
1
0
0
0
The upper 16-bits will always be zero.
For example, a user queries the output state and the following was returned:
dioIn
= 49164 → 0x0000C00C → 11000000 00001100
This indicates that channels 2 and 3 of digital I/O bank zero and channels 14 and 15 of digital I/O bank one are high,
while the remaining channels are low.
E
XAMPLE
ViSession instrumentHandle;
ViStatus status;
ViInt32 dio_in;
…
status = vtex1629_get_dio_input(instrumentHandle, &dio_in);
Содержание EX1629
Страница 310: ...VTI Instruments Corp 310 EX1629 Command Set...
Страница 342: ...VTI Instruments Corp 342 EX1629 Onboard Memory...