Programming Examples
Appendix B
B-8
ktxconst.h file
/************************************************************************
* KTXCONST.H *
* *
* Description: *
* *
* This file contains defintions for all of the global constants used *
* the 1784–KTX Scanner examples. *
* *
* History: *
* *
* 02/22/93 MJG Original creation. *
* *
************************************************************************/
#ifndef KTXCONST_H
#define KTXCONST_H 1
/* boolean definitions */
#define FALSE
0
#define TRUE
1
#define OFF
0
#define ON
1
#define SUCCESS
0
#define FAIL
1
#define NO
0
#define YES
1
/* initialization constants */
#define
SCANNER_LINK_ADDRESS
0xFD
#define
KTX_SCANNER_PROTOCOL
0x06
#define
LINK_230_KBAUD
0xFE
#define
LINK_115_KBAUD
0xFD
#define
LINK_57_KBAUD
0xFC
/* int_status_to_host values */
#define NO_KTX_INT_AVAILABLE
0
#define INIT_DONE_INTERRUPT
1
#define CONFIRMATION_INTERRUPT
2
#define PROCESSING_PROBLEM_INTERRUPT
3
/* int_status_from_host values */
#define INTERRUPT_PROCESSED 0
#define SCANNER_COMMAND_FROM_HOST 1
#define CONFIRMATION_PROCESSED 2
/* possible command ids */
#define SET_MODE 1
#define SET_SCAN_LIST 2
#define AUTOCONFIG 3
#define BT_WRITE 4
#define BT_READ 5
#define SET_FAULT_GROUP 6
#define GET_SCAN_LIST 7
/* modes of operation */
#define PROGRAM 0
#define TEST 1
#define RUN 2
/* number of words by rack size */
#define
QUARTER_RACK_SIZE
2
#define
HALF_RACK_SIZE
4
#define
THREE_QUARTER_RACK_SIZE
6
#define
FULL_RACK_SIZE
8