beautypg.com

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

Page 74

background image

Chapter 7

Scanner Management

7-7

Setup

This MR lets you change the baud rate and connect or disconnect the line
termination resistor. It also lets you put the scanner into “debugging
mode,” which disables the scanner watchdog. The scanner must be in
program mode to execute a setup request; otherwise the scanner returns an
error code.

Note: In the SETUP_6008( ) function, -1 indicates default parameters.

The symbolic name of the setup command is C_SETUP. The setup
request takes three bytes of data:

baud rate, 1 for 57.6 Kbaud, 2 for 115.2 Kbaud, or -1 to leave the

present baud rate unchanged.

resistor, 1 to connect, 0 to disconnect, or -1 for no change.

debugging mode, 1 to disable the scanner watchdog and any other value

to enable the watchdog. Debugging mode is discussed below.

WARNING: Debugging mode should be used only when
someone is physically present to monitor the process. If the
host program stops while scanner debugging mode is in effect,
all output modules stay in last state. You should shut off the
host computer’s power switch immediately to terminate the
process.

Calling sequence:

packet.qmr_data[0] = . . . /* baud rate */
packet.qmr_data[1] = . . . /* resistor */
packet.qmr_data[2] = . . . /* debugging mode */
status = mr_wait(C_SETUP,

&packet

);

where

packet

is a QMR type packet. Note that the argument to mr_wait is a

pointer to the packet.

Returned values:

status and packet.qmr_stat as explained under General Form, above.

global

variable

g_op_stat

reflects whether the scanner is in debugging

mode (SO_DEBUG bit).