Rockwell Automation 1771-DMC_DMC1_DMC4_DXPS Control Coprocessor User Manual User Manual

Page 114

Advertising
background image

Chapter 7

Using the Serial Ports

7-6

/*****************************************************************************
* b a r c o d e . c Bar Code Reader Interface Program
******************************************************************************
* LANGUAGE: Microware C, using PCBridge release 1.4 or later
******************************************************************************
* TARGET SYSTEM AND VERSION:
******************************************************************************
* OS-9/68000 release 2.4 or later, on Allen-Bradley Control Coprocessor
* with Ethernet and Internet Support Package (ISP)
******************************************************************************
* REVISION LOG:
******************************************************************************
* Date By Description
* ----------- ----- ------------------------------------------------------
* 31-JUL-92 DER Initial issue for User’s Manual Example
******************************************************************************
* REFERENCES:
******************************************************************************
* Data Structures: see C:\OS9C\DEFS\*.h
* see #include directives below for list
* Source File: see C:\OS9C\EXAMPLES\barcode.c
* Linking Libraries: see C:\OS9C\LIB\libs for list
* Compile Commands: see C:\PCBRIDGE\pcbcc.bat
* “$ pcbcc barcode.c”, then
* use PCBridge to move executable
* module to Copro execution directory
* Executable Files: see C:\OS9C\EXAMPLES\barcode
* User’s Manuals: see Allen-Bradley Publication 1771-6.5.95,
* “1771 Control Coprocessor User Manual”,
* and various Microware user’s manuals
*******************************************************************************
* USAGE:
******************************************************************************
* The user runs this example program from the OS-9 shell prompt ($). This program
* displays the barcode read, then passes control to a user-developed subroutine
* for handling the decision-making part of the process. A simple example is
* provided. A typical barcode application sets up data in data modules upon a
* successful read, rather than printing to the screen. Modify the code here by
* eliminating the “printf()” calls and adding calls to link to a data module or
* write to a RAM-disk file using your barcode data.
* EXAMPLES:
* $ barcode <cr>
* Waiting for a read...
* Tag: ST0ZZ9ZZ read...
* This is a Twinsburg product.
* Waiting for a read...
* Tag: SD1ZZ9ZZ read...
* This is a Dublin product.
* Waiting for a read... <ctrl><E> Error 000:002
******************************************************************************
* INPUTS:
******************************************************************************
*
* port “/t2”: receive barcode reader characters. This program is set
* up for a reader that just sends the barcode characters followed by
* a carriage return. IT DOES NOT HANDLE STANDARD BARCODE READER PROTOCOLS
*
******************************************************************************
* OUTPUTS:
******************************************************************************
* Screen messages as in example above.

Advertising