11-6
EZ I/O
PC-510 user’s manual
Writing and reading from EZ I/O
Writing to or reading from the desired EZ I/O port is accomplished with
single program statements:
1. To write a bit pattern to the desired EZ I/O port:
OUT 332h, FFh
All bits of port C go high; all input bits are unaffected.
2. To read a bit pattern from the desired EZ I/O port:
PORTC = INP(332h)
The byte read from port C is assigned to variable port C.
EZ I/O output program examples
To configure ports A, B, and C as all outputs, issue the commands:
OUT 333h, 2
‘Direction’ Mode
OUT 330h, FFh
‘PortA’
OUT 331h, FFh
‘PortB’
OUT 332h, FFh
‘PortC’
OUT 333h, 3
‘Operation’ Mode
Note
With CAMBASIC, Octagon’s multitasking industrial language, you can
also accomplish the same configuration and outputs with one statement.
Enter:
CONFIG EZ I/O &330, &0, &FF, &0, &FF, &0, &FF
Ports A, B, and C will now output all "1"s after issuing the following
commands:
OUT 330h, FFh (portA)
OUT 331h, FFh (portB)
OUT 332h, FFh (portC)
or all "0"s after:
OUT 330h, 0 (portA)
OUT 331h, 0 (portB)
OUT 332h, 0 (portC)
EZ I/O input program examples
To configure ports A and C as inputs and port B as outputs, issue the
following commands:
OUT 333h, 2
'Direction Mode'
OUT 330h, 0
OUT 331h, FF
OUT 332h, 0
OUT 333h, 3
'Operation Mode'
Summary of Contents for PC-510
Page 7: ...Notice to user PC 510 user s manual ...
Page 17: ...xii Contents PC 510 user s manual ...
Page 23: ...About this manual PC 510 user s manual ...
Page 25: ...Overview of Section 1 PC 510 user s manual ...
Page 35: ...2 2 Quick start PC 510 user s manual Figure 2 1 PC 510 component diagram ...
Page 45: ...2 12 Quick start PC 510 user s manual ...
Page 55: ...3 10 SETUP programs PC 510 user s manual ...
Page 59: ...4 4 Save and run programs PC 510 user s manual ...
Page 61: ...Overview of Section 2 PC 510 user s manual ...
Page 73: ...5 12 Serial ports PC 510 user s manual ...
Page 77: ...6 4 LPT1 parallel port PC 510 user s manual ...
Page 83: ...7 6 Console devices PC 510 user s manual ...
Page 119: ...13 8 CRTs and flat panels PC 510 user s manual ...
Page 123: ...14 4 GPS interface PC 510 user s manual ...
Page 125: ...15 2 PC 104 expansion PC 510 user s manual ...
Page 127: ...Overview of Section 3 PC 510 user s manual ...
Page 131: ...16 4 Watchdog timer and hardware reset PC 510 user s manual ...
Page 147: ...18 8 Transferring files remote disks PC 510 user s manual ...
Page 177: ...21 22 CPU power management PC 510 user s manual ...
Page 181: ...22 4 Troubleshooting PC 510 user s manual ...
Page 183: ...Overview of Section 4 PC 510 user s manual ...
Page 203: ...A 20 Technical data PC 510 user s manual ...
Page 231: ...B 28 Software utilities PC 510 user s manual ...