Autoconfigure and link status information, 7ć15 – Rockwell Automation 6008-SI IBM PC I/O SCNNR 6008-SI User Manual
Page 82

Chapter 7
Scanner Management
7-15
Example: Suppose you have five adapters connected, four for the quarter
racks in rack 6 and one for the first half of rack 0. If you want to link the
four quarter-rack adapters in a fault dependent group, say group 1, and
leave the half-rack adapter out of all FDGs, you can do it this way:
QMR fdg;
. . .
memset(fdg.qmr_data, 0, MAXADAPT);
memset(fdg.qmr_data+6*4, 1|SF_IN_FGRP, 4);
if ( mr_wait(C_FLT_GRP,&fdg) )
/* error code here */
The autoconfigure and link status requests return a complicated data
structure in the qmr_data field of the packet:
The first part is fixed length and contains 32 words (byte pairs), one for
each possible adapter position. Within each byte pair, the first byte
contains configuration information, such as the size and type of the
adapter, and the second byte contains fault status and fault dependent
group information.
The second part is variable length, being the current scan list, 0 to 64
bytes long. The length of the scan list is found by subtracting 64 from
the value in the qmr_len field of the packet. Each byte contains an
adapter address in the form 4 x rack + group / 2.
Here is some quick code to print the current scan list:
int len;
char *scan;
. . .
len = packet.qmr_len - 2*MAXADAPT;
if ( !len )
printf(“scan list has no adapters\n”);
else
printf(“current scan list (%d adapters):\n”, len);
for ( scan=packet.qmr_data+2*MAXADAPT; len--; ++scan )
printf(“rack %d group %d\n”, *scan>>2, (*scan&3)<<1);
Most of this section explains how to extract the configuration and fault
information, working from the packet that was returned by a successful
autoconfigure or link status request.
Autoconfigure and
Link Status Information