Allen-Bradley 1784-KTX Reference Manual page 41

Table of Contents

Advertisement

Table 4.A
Set Mode Error Conditions
Error Mnemonic
The routine in Example 4.A sets the scanner mode.
Example 4.A
#include "ktx_dp.h"
#include "ktx_err.h"
#include "ktxconst.h"
UBYTE
{
UBYTE
/**** Initialize the command buffer ****/
dp–>cmd_buffer.host_command = SET_MODE;
dp–>cmd_buffer.transaction_num = trans_num;
dp–>cmd_buffer.command_length = 1;
dp–>cmd_buffer.cmd.set_mode.scanner_mode = mode;
/**** Send the command ****/
dp–>int_status_from_host = SCANNER_COMMAND_FROM_HOST;
dp–>host_to_ktx_int_reg = INTERRUPT_KTX;
/**** Get and acknowledge the confirmation
status = get_confirmation(dp, trans_num, timeout);
if ((status != CONFIRMATION_TIMED_OUT) && (status != TRANS_NUM_MISMATCH))
acknowledge_confirmation(dp);
return status;
}
Allen-Bradley Parts
Code
/* 1784–KTX scanner dualport definition
/* 1784–KTX scanner error codes
/* 1784–KTX scanner constants
set_mode (KTX_DUALPORT far *dp, UBYTE mode, UBYTE trans_num,
USHORT timeout)
status;
Chapter 4
Description
****/
*/
*/
*/
4-3

Advertisement

Table of Contents
loading

This manual is also suitable for:

1784-ktxd1784-kts

Table of Contents