
PK2300
40
s
System Development
A
B
Refer to Chapter 5, Software Reference, for further details.
$
How to Read the Inputs
This section provides information on using the Dynamic C software drivers
for the PK2300s protected digital inputs.
The following software driver reads the status of a specified protected
digital input. A sample program is provided.
int eioBrdDI
(
unsigned chanNum )
Reads the state of an input channel.
PARAMETER:
chanNum
must be a number ranging from 0 (for
IN-01) through 15 (for IN-16).
RETURN VALUE:
0 if and only if the input channel reads low.
1 if and only if the input channel reads high.
The Input Demonstration Program shows how to read the status of a digital
input.
Input Demonstration Program
#use eziopk23.lib
// Use the PK2300 I/O
// library
#define INPUT1 0
// Assign INPUT1 protected
// digital input IN-01
main() {
int I;
// Create integer I
eioBrdInit(0);
// Initialize the PK2300
I = eioBrdDI(INPUT1);
// Assign integer I the
// status of INPUT1
printf(IN-01 Status: %d\n, I);
// Print status of IN-01
// to the STDIO window
I = eioBrdDI(INPUT1);
// Assign integer I the
// status of INPUT1
printf(IN-01 Status: %d\n, I);
// Print status of IN-01
// to the STDIO window
}
// End of program
Summary of Contents for PK2300
Page 1: ...User s Manual Revision E PK2300 C Programmable Controller ...
Page 10: ...PK2300 x s About This Manual Blank ...
Page 24: ...PK2300 24 s Getting Started Blank ...
Page 88: ...PK2300 88 s Software Reference Blank ...
Page 106: ...106 s Serial Interface Board 2 PK2300 Blank ...
Page 114: ...PK2300 114 s Power Management Blank ...
Page 128: ...PK2300 128 s I O Map and Interrupt Vectors Blank ...
Page 132: ...PK2300 132 s Battery Blank ...
Page 138: ...PK2500 138 s Index Blank ...