Confirmation status codes, 7ć19, Xlat_conf – Rockwell Automation 6008-SI IBM PC I/O SCNNR 6008-SI User Manual
Page 86

Chapter 7
Scanner Management
7-19
This is a partial sample of coding for status of the adapter starting at rack
3, module group 4.
QMR config_pkt;
int status, fault;
. . .
if ( mr_wait(C_LINKSTAT, &config_pkt) != SC_OK ) {
/*error in MR execution*/
}
else {
status = cfg_info(&config_pkt, 3, 4);
fault = flt_info(&config_pkt, 3, 4);
if ( status & SL_IN_SCAN ) {
/*the adapter is in the scan list*/
printf(“adapter size: %d/4
rack\n”,1+(status&SL_SIZE)):
if ( ! (fault & SF_ON_LINE) )
printf(“adapter is faulted\n”);
if ( fault & SF_IN_FGRP )
printf(“in fault group %d\n”,
fault&SF_GRP_NUM);
}
}
Recall that the other bits in a configuration byte have no meaning if the
SL_IN_SCAN bit isn’t set. There are some additional dependencies, too:
you are encouraged to make use of the xlat_cfg and xlat_flt routines
described in later in this chapter in ”Print or Display Results”.
This section lists the confirmation status codes that the scanner may return
when processing an MR. Before the list of codes, we present a routine that
turns a numeric code into an English message.
xlat_conf
Translates a confirmation status. This function converts a confirmation
status value to English.
Calling sequence:
explan = xlat_conf(
status
);
Arguments:
status:
a confirmation status returned in the qbt_stat or qmr_stat field
of a packet after the packet was passed to a library routine.
Returned values:
a character pointer that points to a string suitable for printing. The
string length varies depending on the message, but do not exceed 47
characters (46 plus the terminating zero byte).
Confirmation
Status Codes