beautypg.com

Executing a management request – Rockwell Automation 6008-SI IBM PC I/O SCNNR 6008-SI User Manual

Page 70

background image

Chapter 7

Scanner Management

7-3

To start an MR, you store the required fields in the packet and then call the
mr_wait function. mr_wait waits until the request is completed or has
timed out and returns a completion status to your program.

Autoconfigure, setup, scan list, and fault dependent group can be executed
only in program mode. Link status and set mode can be executed in any
mode.

Timeout

The timeout period is the current value of global variable g_timout in 55
millisecond units. (The actual frequency is more nearly 1,193,180 / 64K
Hz, about 18.2065 per second or 54.925 ms each.) If the scanner doesn’t
complete the MR within this time, mr_wait assumes that the scanner never
completes the request.

The default timeout is 18 units, about 1 s. You can change the timeout
interval by storing a new value in g_timout. However, be sure to allow a
large enough interval. Worst-case times for autoconfigure and scan list are
272 ms and 704 ms respectively; for full explanations please see those
sections. Link status, set operating mode, fault dependent group, and setup
are always completed within one time unit, 55 ms.

The actual timeout interval can be as much as one unit less than the value
you store in g_timout. The reason is that the mr_wait routine copies
g_timout to the g_decrem counter, which counts down every 55 ms, and
when g_decrem reaches zero the mr_wait function considers the request
to have timed out. But if the clock tick happens to come right after
g_decrem was set, the effective value of the timeout is almost a full 55 ms
less that the nominal value. The bottom line? In deciding on a timeout (if
you don’t stick with the default value), always allow an extra unit above
the value you calculated.

Executing a Management

Request