Section 7: Command reference
Models 707B and 708B Switching Matrix Reference Manual
7-56
707B-901-01 Rev. A / August 2010
Usage
data = digio.readbit(N)
data
A custom variable that stores the state of the I/O line
N
Digital I/O line number to be read (1 to 14)
Details
A returned value of zero (0) indicates that the line is low. A returned value of one (1) indicates that the line is
high.
Example
print(digio.readbit(4))
Assume line 4 is set high, and it is then read.
Output:
1.000
Also see
(on page 2-7)
(on page 7-56)
digio.readport()
This function reads the digital I/O port.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function Yes
Usage
data = digio.readport()
data
The present value of the input lines on the digital I/O port
Details
The binary equivalent of the returned value indicates the value of the input lines on the I/O port. The least
significant bit (0) of the binary number corresponds to Line 1. Bit 13 corresponds to Line 14.
For example, a returned value of 170 has a binary equivalent of 00000010101010, which indicates that Lines 2,
4, 6, and 8 are high (1), and the other 10 lines are low (0).
Example
data = digio.readport()
print(data)
Assume Lines 2, 4, 6, and 8 are set high when
the I/O port is read.
Output:
1.702
This is binary 10101010