Barcode Reader Connection Guide
Barcode Reader Connection Guide
CONTENTS
SAFETY PRECAUTIONS............................................ A-1
REVISIONS ................................................................. A-2
INTRODUCTION
About This Connection Guide...................................... 1
Required Modules and Devices................................... 1
Input/output cables ...................................................... 2
System Configuration for Connecting the Barcode Reader .. 3
BASIC OPERATIONS OF THE SLMP SCANNER
Basic Operation Flow of the SLMP Scanner ............... 4
Basic Operations of the SLMP Scanner ...................... 5
Data Blocks.................................................................. 5
Timing Chart of the SLMP Scanner ............................. 8
SETTING THE BARCODE READER
Setting the Barcode Reader ........................................ 9
SETTING THE PROGRAMMABLE CONTROLLER
Setting the Programmable Controller .......................... 14
CHECKING OPERATIONS
Checking Operations ................................................... 17
Setting a Trigger .......................................................... 17
Controlling with DMCC Commands ............................. 21
CONTENTS IN DATA BLOCKS
Contents in Data Blocks .............................................. 23
APPENDIX
USB Connection between a GOT and the Barcode Reader.. 27
SAFETY PRECAUTIONS
(Read these precautions before using this product.)
Before using the products described in this document, please read this manual and the relevant manuals
carefully and pay full attention to safety to handle the products correctly.
In this section, the safety precautions are classified into two levels: " WARNING" and " CAUTION".
Under some circumstances, failure to observe the precautions given under " CAUTION" may lead to
serious consequences.
Always observe the instructions of both levels to ensure personal safety.
A-1
REVISIONS
No. Revision Remarks
* First edition
A-2
INTRODUCTION
About This Connection Guide
This connection guide describes the procedures for connecting a COGNEX barcode reader to a
MELSEC programmable controller and controlling the barcode reader in the SLMP*1 scanner
communication.
COGNEX products
Commercial products
1
INTRODUCTION
Input/output cables
An input/output cable is used for supplying the power to the barcode reader.
Connect the pin 5 (Brown/White) (+24 V DC power supply) to the positive electrode and the pin 4 (Red)
(GND) to the negative electrode of the 24 V DC power supply.
2
INTRODUCTION
System Configuration for Connecting the Barcode Reader
HUB
GX Works2
DataMan Setup Tool
Barcode reader
IP address
(192.168.3.1)
IP address (192.168.3.3)
24 V DC
power supply
3
BASIC OPERATIONS OF THE SLMP SCANNER
Basic Operation Flow of the SLMP Scanner
Programmable
Barcode reader
controller
Importing images
Reading codes
Indicates the status of the
Write (Decode result
(e.g. Code read result)) barcode reader (Bit for Status):
Trigger ON
Acquiring
Decoding
Write (Turn on the Bit for Status.)
Decode Complete Toggle, etc.
4
BASIC OPERATIONS OF THE SLMP SCANNER
Basic Operations of the SLMP Scanner
In the SLMP Scanner, the barcode reader reads programmable controller devices assigned to control
blocks at the poll interval set with DataMan Setup Tool, and the processing is performed responding to
changes in the devices.
The processing status is written to the corresponding bit in the status block.
To control the barcode reader, assign devices of the programmable controller to each of the defined
data blocks (including control blocks) and use them.
The following shows the functions of six data blocks.
•Control block: This block is used to send control commands (including triggers) to
the barcode reader, and uses bit information. The barcode reader is
controlled by turning on and off the devices set to the control block
using the programmable controller.
•Status block: This block indicates the status of the barcode reader, and can be
checked with bit information.
•Input block: This block is used to input application data (including parameters)
from the programmable controller, and uses word information.
•Output block: This block is used to output code read results to the programmable
controller from the barcode reader, and uses word information.
•String command block: This block is used to set commands (string commands) to control the
barcode reader, and uses word information.
•String command result block: This block is used to output the results controlled by the commands,
and uses word information.
Data Blocks
The following shows the six data blocks defined to control the barcode reader.
5
BASIC OPERATIONS OF THE SLMP SCANNER
Status block
Output block
Reserved Reserved.
Trigger ID Trigger ID
Result ID Result ID
Result Code Result code
Result Length Length of the read code
Result Data Data of the read code
6
BASIC OPERATIONS OF THE SLMP SCANNER
Input block
Reserved Reserved.
User Data Length Length of user data
User Data User data (e.g. parameter values)
For details of the data block functions for controlling the barcode reader, refer to "Communications and
Programming.pdf" stored in the folder where DataMan Setup Tool has been installed.
7
BASIC OPERATIONS OF THE SLMP SCANNER
Timing Chart of the SLMP Scanner
The following shows a timing chart when "Trigger" of the control block is turned on from the
programmable controller.
To enable the trigger from the programmable controller, turn on "Trigger Enable" of the control block.
When "Trigger" of the control block is turned on from the programmable controller while "Trigger Ready"
of the control block is on, the status of the barcode reader is output to "Trigger Ack", "Acquiring",
"Decoding", and "Decode Complete Toggle" of the status block.
"Decode Complete Toggle" changes (toggles) the status at every completion.
"Trigger" turns off after "Trigger Ack" turns on.
Trigger Enable
1) 2) 3)
Trigger Ready
1) 2) 3)
Trigger
1) 2) 3)
Trigger Ack
1) 2) 3)
Acquiring
1) 2) 3)
Decoding
1) 2) 3)
Decode
Complete Toggle
8
SETTING THE BARCODE READER
Setting the Barcode Reader
(1) Setting an IP address to the personal computer
Set the IP address 192.168.3.3 to the personal computer from the Control Panel.
Select!
1
2
3
3 Set the IP address.
IP address: 192.168.3.1
4
5 Select [OK].
Select!
Select the displayed barcode reader, and
select [Connect].
Click!
9
SETTING THE BARCODE READER
3
1
2 Select "Single (external)".
4
5
3 Select "Tune".
Select!
2 Put a checkmark in "QR Code".
2
Select!
2 3
Select! Select! 2 Put a checkmark in "Standard".
1 3 Select "Standard".
Select!
10
SETTING THE BARCODE READER
Set full strings as read target data, and add "CR/LF" at the text end.
1 Select "Standard Formatting".
2 2 Select "Universal".
3
4
3 Select "General".
2 Click "Trigger".
11
SETTING THE BARCODE READER
(4) Communication setting
Select!
Select!
Put a checkmark in "Enabled".
Select!
Configure the following settings.
IP Address: 192.168.3.2
(IP address of the programmable controller)
Host Port [hex]: 3001
(Port of the programmable controller)
Timeout [ms]: 1000
Poll Interval [ms]: 100
PLC Series: QCPU
Network Number: 0
PC Number [hex]: FF
Destination Module: 0x3FF = Local station
POINT
Shortening the poll interval also shortens the interval to monitor the programmable controller status.
12
SETTING THE BARCODE READER
13
SETTING THE PROGRAMMABLE CONTROLLER
Select!
Double
Click! -click!
Select!
Select!
Click [Open Setting].
Select!
14
SETTING THE PROGRAMMABLE CONTROLLER
1
1 Select "HEX" for "IP Address/Port
2 3 Select! No. Input Format".* 1
4 Key input
2 Select "TCP" in "Protocol".
Click [End].
Click [End].
Click!
POINT The user have to set parameters for communication, however, do not need to create a program for
communication.
15
SETTING THE PROGRAMMABLE CONTROLLER
Click!
Connect to the barcode reader with
DataMan Setup Tool.
Select!
2 Select "SLMP Protocol".
Check that "MC scanner connection
established 192.168.3.2:3001" is
displayed in Status.
1
Select!
16
CHECKING OPERATIONS
Checking Operations
Control the barcode reader using the programmable controller and check the operations.
Setting a Trigger
Set a trigger to the barcode reader to acquire read results.
Open "Device/Buffer Memory Batch Monitor" in GX Works2 to display devices.
D1000 to D1001:
Control
D1002 to D1003:
Status
D1005 to D1009:
Input block
D1010 to D1110:
Output block
17
CHECKING OPERATIONS
Number of
When the reading is completed, the
read characters
"Decode Complete Toggle" bit (D1002.9)
changes (toggles) the status.
Read codes
D1015 to D1038
* The "Decode Complete Toggle" bit (D1002.9) changes (toggles) the status
when the decoding (reading) is completed.
Read codes
18
CHECKING OPERATIONS
Read codes
Read codes
19
CHECKING OPERATIONS
Select!
Codes read with DataMan Setup Tool
can be checked.
Select "Quick Setup".
Read codes
20
CHECKING OPERATIONS
Controlling with DMCC Commands
Control the barcode reader with DMCC commands.
In this section, "||>GET DEVICE.NAME", the DMCC command that acquires the device names of the
barcode reader, is sent to acquire the device names.
DMCC command
D2001 to D2009 =
"||>GET DEVICE.NAME"
End code
D2010 = 0A0DH (CRLF)
21
CHECKING OPERATIONS
Device name
D2102 to D2108 =
"DM60-1BD102"
Select!
To check the device names, switch
the display format to "ASC".
The other DMCC commands for controlling the barcode reader (e.g. "||>TRIGGER ON", the command
for setting a trigger) are provided.
For details, refer to "DataMan Control Commands".
22
CONTENTS IN DATA BLOCKS
Number of
Type Start device
devices
Control D1000 2
Status D1002 2
Input block D1005 5
Output block D1010 100
Command D2000 100
Command
D2100 100
result
23
CONTENTS IN DATA BLOCKS
Device assignment (Control)
24
CONTENTS IN DATA BLOCKS
Device assignment (Status)
25
CONTENTS IN DATA BLOCKS
Classification Device Control details (Application) Supplement
D1003.C Soft Event 4 Trigger Acknowledgment
D1003.D Soft Event 5 Trigger Acknowledgment
Status
D1003.E Soft Event 6 Trigger Acknowledgment
D1003.F Soft Event 7 Trigger Acknowledgment
Device assignment (Input block, Output block, Command, and Command result)
26
APPENDIX
USB Connection between a GOT and the Barcode Reader
The barcode reader can be connected to the USB interface on the front or back side of a GOT to
acquire results read by the barcode reader.
The GOT processes inputs from the barcode reader connected with a USB cable as keyboard inputs.
The GOT detects the keys (characters) that can be input with a Japanese 106 keyboard or 101 English
keyboard. (The other keys (characters) are invalid.)
The following shows applicable product models and software versions.
USB cable
Power supply
Set the barcode reader. Configure the setting to read the read target codes
with DataMan Setup tool.
USB Keyboard Save the setting, terminate DataMan Setup Tool, and
disconnect the barcode reader from the personal computer.
27
APPENDIX
(3) Setting the GOT
Select!
28
APPENDIX
(4) GOT screens and settings in the configuration example
(a) GOT screen
Set a switch for barcode input and a text input for read results as objects, and set the display of
a cursor and a key window related to the text input.
Configure the settings for the connected device and devices depending on the user's system.
Set!
Select!
Put a checkmark in "Alternate".
29
APPENDIX
Select "ON".
Select!
Set "GB1000".
Select!
Select "Basic Setting".
30
Barcode Reader Connection Guide
(COGNEX SLMP Connection)
Mitsubishi Electric Corporation Nagoya Works is a factory certified for ISO14001 (standards for environmental
management systems) and ISO9001(standards forquality assurance management systems)