Common I/O options
Introduction
Most I/O modules use a common syntax for mapping physical I/O points to MAT
points. In addition, each I/O module may have additional configuration.
Mapping
The mapping between the physical I/O and the plc points is specified using
the "map" table.
The format of each line is
map [inv | invert] {in | out} <io_addr> <matplc
point>
inv
or invert
- invert the value being read
from/writen to physical IO All the bits are inverted, which is handy for
physical I/O that uses negative logic (on = 0, off = 1) - whether it's
simply a wrongly wired switch, or a sensor that's only available N/C where
previously it was N/O.
in
- copy the state of the physical Input/Output to the
matplc point (it is an input)
out
- copy the state of the matplc point to the physical
Output (it is an output)
<io_addr>
- address of physical input/output. The
acceptable format this address will depend on the type physical I/O we will
be interfacing with. Each different MatPLC I/O module accepts a different
io_addr format.
<matplc point>
- the MAT point to which this
physical input/output is to be mapped.
Example
For instance, suppose that we are using the parallel port I/O module. We
have leds that will light up when the output is low, so we choose to invert
all the outputs so the leds will light up when the plc point is set to 1.
According to the Parallel port section, D.x
is the acceptable format for the parallel port I/O module. D specifies the
D register, and x the bit of that register.
The mapping table might look something like this:
map inv out D.0 L1
map inv out D.1 L2
map inv out D.2 L3
map inv out D.3 L4
$Date: 2004/12/28 05:32:11 $