Timing of discrete i/o, 6ć10 – Rockwell Automation 6008-SI IBM PC I/O SCNNR 6008-SI User Manual
Page 65

Chapter 6
Discrete I/O
6-10
Returned values:
none.
Example: dumps the output image table by words to the screen.
pr_array(stderr, “output image”, g_oit, MAXGROUP);
Example: dumps the scan list from a management request packet to a
file by bytes. Here filrec is the value returned by an earlier call to the
standard library routine fopen, which is supplied with your compiler.
pr_array(filrec, “scan list”, pkt.qmr_data, -pkt.len);
It’s important to bear in mind that when you update your output image
table there is not an immediate effect on the outside world. (Though we
talk about output in this section the same timing applies to input: it takes as
long for a new input value to find its way from the input module to your
program as it does for an output value to follow the reverse path.)
Here is the chain of events for an output:
Your program updates g_oit, your output image table, either directly or
by using a library routine.
Some time later, the scanner interrupts the host.
The host interrupt handler (which runs in background as far as your
program is concerned) copies from the scanner’s input image table to
g_ipt, your input image table, and copies from g_oit to the scanner’s
output image table.
If the interrupt occurred just after you changed the output, the new data
is transferred when the scanner has run through its entire scan list back
to the point of the last interrupt. (The scanner interrupts the host once
per scan list to refresh I/O in both directions.)
Later the scanner comes to the adapter associated with the changed data,
and sends the new information to the adapter.
Timing of
Discrete I/O