Interactive SourceMeter® Instrument Reference Manual Section 3:
2450-901-01 Rev. B/September 2013 3-67
Digital I/O programming example
The programming commands below illustrate how to set bit B1 of the digital I/O port high, and then
read the value.
Using SCPI commands:
:DIGital:LINE1:MODE DIGital, OUT
:DIGital:LINE1:STATe 1
:DIGital:LINE1:MODE DIGital, IN
:DIGital:LINE1:STATe?
Using TSP commands:
-- Set bit B1 high
digio.line[1].mode = digio.MODE_DIGITAL_OUT
digio.line[1].state = digio.STATE_HIGH
-- Read digital I/O port
digio.line[1].mode = digio.MODE_DIGITAL_IN
print(digio.line[1].state)
Digital I/O bit weighting
Bit weighting for the digital I/O lines is shown in the following table.
Line # Bit Pin Decimal Hexadecimal Binary
3 B3 3 4 0x04 000100