beautypg.com

Startup – Rockwell Automation 6008-SI IBM PC I/O SCNNR 6008-SI User Manual

Page 45

background image

Chapter 5

Startup, Status, and Shutdown

5-2

In this section we’ll look at two functions that start the scanner and the
host talking to each other: start_6008 and setup_6008. Every application
uses one or the other, but not both. For most applications we recommend
setup_6008, which does more and is easier to use than start_6008.

Common Features

Both routines start the host watchdog, which your program must service
regularly. See chapter 5, ”Host Watchdog”, for more information.

Both routines also load the global variables g_ver_scnr and g_ver_host,
which are strings identifying the release of the scanner firmware and of the
host software driver. The scanner firmware version string g_ver_scnr is
no more than 39 characters long (38 plus the terminating zero byte), and
the host version string is 69 characters long (68 plus the zero byte). Your
program should display these strings so, that in case of trouble, you have
the information to give to A-B Technical Service.

setup_6008

setup_6008 initializes the interrupt handler and the global variables,
establishes communication with the scanner in program mode, and does
the initial baud and resistor setup (if required) and initial autoconfigure.
(For the meaning of autoconfigure, please see that section in chapter 7,
Scanner Management.)

Note: In the management request C_SETUP command, -1 indicates no
change.

Calling sequence:

status = setup_6008(

baud, resistor, irq_l, segment, &packet

);

Arguments:

baud:

an integer representing the baud rate multiplier applied to the

board’s base rate of 57.6 Kbaud. At present only 1 and 2 are legal, for
57.6 and 115.2 Kbaud; or use -1 which means the default, 57.6 Kbaud.

resistor:

an integer whose value is 1 if the line termination resistor is

connected and 0 if not; -1 means the default, resistor connected.

irq_l:

an integer whose value is 3, 5, 10, or 12, depending on the

hardware interrupt line desired; -1 means the default, IRQ3, is selected.

segment:

an unsigned representing the segment or paragraph address

of the global RAM. (Drop the final zero from the actual address to
obtain the paragraph address, which is the argument to this routine.) A

Startup