The text of a manual · part 5 of 41
AdaptaScan Bar Code Readers (Cat. Nos. 2755-SN3, -SN5, and -SN8) Application Guide: 2 - Using ASCII Command Input
Pages 28 to 39 of 354, from AdaptaScan Bar Code Readers (Cat. Nos. 2755-SN3, -SN5, and -SN8) Application Guide
The original document is the PDF (3.2 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Accu-Sort 2755-SN3, Accu-Sort 2755-SN5, Allen-Bradley 2755-SN5, Accu-Sort 2755-SN8 and Allen-Bradley 2755-SN8
Page 28
Using ASCII Command Input Overview
This application describes how to configure an AdaptaScan Bar Code Reader to receive ASCII commands from a terminal emulator over an RS-232 link: • Terminal Emulator in Windows 3.1 • HyperTerminal in Windows 95 One character ASCII commands trigger the reader to start/stop scanning. For each trigger command the reader receives, it echoes a bar code string on the emulator. The application includes the necessary cable diagrams and configuration information for the AdaptaScan Bar Code Reader.
Hardware Requirements
The hardware items required for this application are: • 2755-SN3, -SN5 or -SN8 AdaptaScan Bar Code Reader • 2755-NB40 or -NB41 Wiring Base • 2755-NC43 or -NC48 Configuration Cable • 2755-PW46 or -PW47 Power Supply • Computer running Windows 3.1 (or later) or Windows 95 • 9-to-25 Pin Adapter (for computers with a 25-pin COM port)
Software Requirements
The software requirements for this application are: • 2755-ASN AdaptaScan Offline Programming Software • Terminal Emulator in Windows 3.1 or HyperTerminal in Windows 95
Related Publications
Publications you may want to refer to include: Publication
Description
2755-837
AdaptaScan Bar Code Readers User Manual
2755-838
AdaptaScan Software User Manual
Publication 2755-6.8
Page 29
2–2
Using ASCII Command Input
Connecting a Computer to the Reader
The following illustration shows the wiring base connections between the AdaptaScan Bar Code Reader and the personal computer. This RS-232 serial connection is used to download ASCII commands to the reader and to display bar code messages on the terminal emulator. Create a cable using Belden 8303 (or equivalent) and a connector (to match your computer’s RS-232 port). The other end of the cable is wired to the RS-232 port in the reader wiring base. Use Belden 8303 (or equivalent) To Computer
RX GND TX
Wiring Base of Reader
To Connector Compatible with Your Computer RS-232 Port
Connecting a Power Supply to the Reader
The following illustration shows how to connect a 2755-PW46 or -PW47 power supply to a single bar code reader. Use a shielded cable (Belden 9316 recommended) to make the connections. Connect the shield to the ground screw on the reader’s wiring base. 2755-PW46 Power Supply
Reader 24V+
V-
Ground Screw on Wiring Base
Publication 2755-6.8
Page 30
Using ASCII Command Input
Configuring the Reader
2–3
This section shows how to configure the AdaptaScan Reader using the AdaptaScan Software (Catalog No. 2755-ASN). The procedures in this section show how to: • configure a bar code label and symbol • define a DeviceNet address • configure the scanner • configure the decoder trigger for ASCII Command Input • configure one character ASCII commands to start/stop scanning • configure the serial port for terminal emulation • define the format and content of messages
Create a New Project Create a new project named ASCII Command Input for one AdaptaScan Bar Code Reader (Bar Code Reader 1). 1. Choose New from the Project menu to create a new project. 2. Click the New button to add a bar code reader (Bar Code Reader 1) to the project.
3. Choose Edit from the Project menu to rename the project ASCII Command Input.
4. Click Save to save the project under the new name and then Close to return to the Project dialog.
Publication 2755-6.8
Page 31
2–4
Using ASCII Command Input
Define the Bar Code Label 1. Click the Labels button to open the Bar Code Labels dialog. 2. Click the New button to define a label.
3. Click the New button to define a symbol for the label.
4. Select the symbology and define attributes such as Identifier and Lengths. 5. Click OK until you return to the Bar Code Labels dialog. 6. Click Save and then Close to return to the main Project dialog.
Publication 2755-6.8
Page 32
Using ASCII Command Input
2–5
Define the DeviceNet Address 1. Click the Device button on the Project dialog.
2. Select a DeviceNet address. 3. Connect the 2755-NC43 or -NC48 Configuration Cable to the reader. 4. Click the Apply button. 5. Click Save and Close to return to the Project dialog.
Configure the Scanner 1. Click the Scanner button on the Project dialog to open the Scanner dialog.
2. Configure the scan pattern and use the Focus procedure for optimum scanner focus. 3. Click the Close button and return to the Project dialog.
Publication 2755-6.8
Page 33
2–6
Using ASCII Command Input
Configure the Decoder Trigger This section defines ASCII Command Input 1 as the trigger for the reader’s decoder. 1. Click the Decoder button from the main Project dialog. 2. Under Triggered By, select ASCII Command Input 1 from the Input list.
3. Click the Save button. 4. Click the Close button and return to the main Project dialog.
Configure the ASCII Commands The following procedure defines the ASCII commands that will trigger the decoder to start/stop scanning. 1. Click the Input/Output button on the main Project dialog. 2. Under Inputs & Outputs, select ASCII Command Input 1.
Publication 2755-6.8
Page 34
Using ASCII Command Input
2–7
3. Click the Edit button to open the ASCII Command Input dialog.
The default ASCII commands for triggering the decoder are two character commands:
• BS (Begin Scan) • ES (End Scan) This application uses one character ASCII commands to trigger the decoder.
• B (Begin Scan) • E (End Scan) 4. In the Turn On field, type the letter B. (The command is case sensitive.) 5. In the Turn Off field, type the letter E. If you do not use an E in the Turn Off field, the trigger will then turn off in 1000 ms. (The command is case sensitive.) 6. Click the OK button. 7. Click the Save button to save the ASCII command definitions. 8. Click the Close button and return to the main Project dialog.
Publication 2755-6.8
Page 35
2–8
Using ASCII Command Input
Configure the Serial Port This section configures the RS-232 serial port so that it is compatible with the Terminal Emulator in Windows 3.1 or HyperTerminal in Windows 95. 1. Click the Serial Port button on the main Project dialog.
2. Verify that Terminal is selected in the Protocol list box. 3. In the Maximum Length field, type 1. With the Maximum Length set to 1, only one character is downloaded to the reader through the terminal via RS-232 port. If a message is configured, all bar code strings are read and uploaded to the terminal via RS-232 port. If the Maximum Length is set to 2, only two characters are downloaded to the reader through the terminal via RS-232 port. However, if a message is configured, only 2 bar code data characters are uploaded to the terminal. The same is true for a setting 4. Select RS232 from the Connection list box.
Publication 2755-6.8
Page 36
Using ASCII Command Input
2–9
5. Click the Edit button under Protocol. 6. Under Flow Control, select None.
7. Click OK to close the dialog. 8. Click the Save button to save the serial configuration. 9. Click Close to return to the main Project dialog.
Publication 2755-6.8
Page 37
2–10
Using ASCII Command Input
Create a Message This section defines the content of the message sent from the reader to the terminal emulator. 1. Click the Message button from the main Project dialog.
2. Under Triggered By, check the Enable check box. 3. Under Device, select Bar Code Reader 1. 4. Under Input, select [Decoder]. 5. Click the New button to define a message field.
6. Under Symbol Source, select Bar Code Reader 1. 7. Under Bar Code Labels & Symbols, select Symbol 1. 8. Check (enable) the Match Exactly check box. 9. Click the Edit button to open the Message Field Edit dialog.
Publication 2755-6.8
Page 38
Using ASCII Command Input
2–11
10. Under Replacement Strings, type nr in the Fail: field. Bar code data is sent to the emulator on a valid read. The Fail string sends the characters “nr” when a no read occurs.
11. Click OK to return to the Message Field dialog. 12. Click OK to return to the Message dialog.
Define the Message Format This section defines the format of the message to display on the terminal emulator. 1. Click the Format button from the Message dialog.
2. In the Trailer field, type \r\n (Carriage Return, Line Feed). 3. Under Message Destination, select Serial Port. 4. Click OK to return to the Message dialog. 5. Click the Save button and then the Close button to return to the Project dialog.
Publication 2755-6.8
Page 39
2–12
Using ASCII Command Input
Sending the Configuration to the Reader
From the main Project dialog, click the Send Device button to download the configuration to the bar code reader.
Running the Application
If your computer does not have two serial ports, switch the 2755-NC43 or -NC48 cable to the serial cable already wired to the AdaptaScan Reader’s wiring base. In the following illustration: • ASCII command B is entered to trigger the decoder to start scanning. • ASCII command E is entered to stop scanning. A timeout occurs if an E is not entered. • Bar code data is displayed on the terminal emulator. You must type B to trigger the decoder again and display the next bar code string on the emulator. Terminal Emulator Example
B E 12345678 B E abcdefg B E 12345678
Publication 2755-6.8
ASCII Turn On command ASCII Turn Off command Bar code data from AdaptaScan Reader