Rockwell Automation 6008-SI IBM PC I/O SCNNR 6008-SI User Manual
Page 54

Chapter 5
Startup, Status, and Shutdown
5-11
fatal_6008
This function obtains the scanner shutdown code, if available. Your
program should call this function, and display its result, whenever
g_act_scnr goes negative.
Calling sequence:
code = fatal_6008( );
Arguments:
none.
Returned values:
unsigned: 0 if the scanner is currently active, 1 if the scanner is inactive
but the function can’t obtain the actual code because the host doesn’t
have access to the global RAM (or because the scanner left no shutdown
code), or a value greater than 1 if the error code is obtainable.
If the global variable g_act_scnr is negative, either after a failed
setup_6008 or start_6008 or at any other time during execution,
fatal_6008 may return a meaningful error code. In that case, your
program should display the function value.
You should know about two special values that might be returned by
fatal_6008:
101 means that the interrupt handler let the scanner shut down
because your program hadn’t called host_active recently enough.
For more on this feature, please see chapter 5, ”Host Watchdog”.
102 means that your application program shut down interrupts
properly through the stop_6008 function, as described later in this
chapter. This code usually means that one of the setup parameters
in the SETUP command did not match the physical hardware
setting of the scanner. Recheck the scanner’s memory and
interrupt configuration.
CAUTION: If you ever get an error code other than 0, 101,
and 102 from fatal_6008, please call A-B immediately, because
a hardware or firmware problem with the scanner may have
occurred.