
16
•
Registers Format
3.6 Programming Examples
The ACL-7225's registers can be accessed through direct I/O
instructions, such as
inport
and
outport
instructions in Borland C/C++
language. You can write (outport) control word to relay output register to
turn the relay's ON/OFF. Also, you can read (inport) back the signal of
relay status or isolated input signals.
1. Read operation
A read operation on BASE+2 will read in the value ( status) of the first 8
corresponding digital input channels.
For example:
To get the status of these channels using the BASIC language,
value = INP(BASE+2)
In C Language
value = inp( BASE + 2);
2. Write operation
A write operation on BASE+0 will set the desired status on the first 8
corresponding relay output channels.
For example:
In Basic Language:
OUT BASE,abc
In C Language :
outp( BASE, abc);
the value of
abc
should be between 0 and 255 . The status
of the relay output can be monitored by reading back registers
In Basic:
STATUS = INP(BASE)
In C Language:
status = inp( base);