StickOS
DI-159 PLC Hardware Manual
Digital I/O
Digital I/O pins are designated in the DI-159 just as the label on the device states. For example,
digital input channel 0 is Di0. The example Boilerplate code provided shows all pin des-
ignations in the DI-159 PLC. Use the following for quick reference to
pinnames
:
Di0 = digital input channel 0
Di1 = digital input channel 1
Di2 = digital input channel 2
Di3 = digital input channel 3
Do0 = digital output channel 0
Do1 = digital output channel 1
Do2 = digital output channel 2
Do3 = digital output channel 3
Led0 = digital output channel Led0
Led1 = digital output channel Led1
Pb = digital input channel for the pushbutton
Digital input 0 is configured and the variable i0 is bound to the Di0 pin with the following state-
ment:
dim i0 as pin Di0 for digital input
.
Device Leds (Led0 and Led1) work as digital outputs while the pushbutton works as a digital
input designated as Pb.
A pin is configured for digital I/O, and a variable bound to that pin, with the following state-
ment:
dim
varpin
as pin
pinname
for digital
(
input
|
output
)
If a pin is configured for digital input, then subsequently reading the variable
varpin
will return
the value 0 if the digital input pin is currently at a low level, or 1 if the digital input pin is cur-
rently at a high level. It is illegal to attempt write the variable
varpin
(i.e., it is read-only).
59
Summary of Contents for DI-159
Page 51: ...StickOS DI 159 PLC Hardware Manual 4 is even _ 51...
Page 76: ...DI 159 Block Diagram 76...
Page 77: ...Dimensional Drawing 77...