Barcode scanners are essential tools in modern industrial automation, especially when paired with Programmable Logic Controllers (PLCs). As an Omron PLC supplier, I've had the privilege of working with various Omron PLC models and integrating them with barcode scanners. In this blog post, I'll share some practical insights on how to use a barcode scanner with an Omron PLC.
1. Choosing the Right Omron PLC Model
First things first, you need to pick the right Omron PLC for your barcode scanning application. Omron offers a wide range of PLCs, each with different features and capabilities.
For smaller-scale applications, the Omron CP2E-N14DR-A is a great option. It's compact, cost-effective, and has enough I/O points for basic barcode scanner integration.
If you're dealing with more complex systems, the Omron CJ2M-CPU35 is a powerful choice. It has high processing speed and can handle multiple tasks simultaneously, making it suitable for applications where barcode data needs to be processed quickly and integrated with other automation tasks.
The Omron CJ1W-PD025 is also a good option if you need to expand the I/O capabilities of your PLC. It can be used in conjunction with other Omron PLC models to provide more inputs and outputs for the barcode scanner and other devices.
For legacy systems or applications with specific requirements, the Omron CPM1A-40CDR-A-V1 might be the right fit. It's a reliable PLC that has been around for a while and has a large user base.
And if you're looking for a mid-range PLC with a good balance of performance and cost, the Omron CJ2M-CPU14 could be an ideal choice.
2. Understanding the Barcode Scanner Interface
Barcode scanners come with different interfaces, such as RS-232, RS-485, Ethernet, or USB. The most common ones are RS-232 and Ethernet.
RS-232 Interface
If your barcode scanner has an RS-232 interface, you'll need to connect it to the corresponding serial port on the Omron PLC. Make sure to configure the communication parameters correctly, including baud rate, data bits, stop bits, and parity. These parameters should match between the barcode scanner and the PLC to ensure proper data transfer.
For example, if the barcode scanner is set to a baud rate of 9600, 8 data bits, 1 stop bit, and no parity (9600,8,N,1), you need to configure the PLC's serial port with the same settings.
Ethernet Interface
Ethernet interfaces are becoming more popular because they offer faster data transfer rates and can be easily integrated into a network. To connect a barcode scanner with an Ethernet interface to the Omron PLC, you'll need to assign IP addresses to both devices and make sure they are on the same network.
You can use the Ethernet communication functions of the Omron PLC, such as FINS (Factory Interface Network Service), to establish a connection with the barcode scanner. Once the connection is established, you can exchange data between the two devices.
3. Programming the Omron PLC for Barcode Reading
Once the barcode scanner is physically connected to the Omron PLC, you need to write the appropriate program to read and process the barcode data.
Reading the Barcode Data
The first step is to read the data sent by the barcode scanner. If you're using the RS-232 interface, you can use the ASCII communication functions of the Omron PLC to receive the data. For example, in the Omron CX-Programmer software, you can use the GS (General Serial Communication) instruction to receive data from the serial port.
If you're using the Ethernet interface, you can use the network communication functions to receive the barcode data. For example, you can use the FINS commands to read the data from the barcode scanner's memory.
Processing the Barcode Data
After reading the barcode data, you'll likely want to process it in some way. This could involve validating the barcode, decoding the information, or comparing it to a database.
For example, you might have a database of product codes stored in the PLC's memory. When a barcode is scanned, you can compare the scanned code to the codes in the database to check if it's a valid product.
You can use ladder logic or structured text programming languages in the Omron PLC programming software to implement these data processing tasks.
4. Troubleshooting Common Issues
Even when everything is set up correctly, you might encounter some issues. Here are some common problems and how to solve them.


Communication Errors
If you're experiencing communication errors between the barcode scanner and the Omron PLC, the first thing to check is the communication settings. Make sure the baud rate, data bits, stop bits, and parity are the same on both devices.
You can also check the physical connection. Make sure the cables are properly plugged in and there are no loose connections.
Data Reading Errors
If the PLC is not reading the barcode data correctly, it could be due to a problem with the barcode scanner. Check if the scanner is properly calibrated and if it can read the barcodes accurately.
You can also try increasing the time interval between barcode scans to give the PLC enough time to process the data.
5. Integrating with Other Systems
In many industrial applications, barcode scanning is just one part of a larger system. You might need to integrate the barcode scanner data with other systems, such as a Warehouse Management System (WMS) or an Enterprise Resource Planning (ERP) system.
The Omron PLC can act as a bridge between the barcode scanner and these other systems. You can use the communication functions of the PLC to send the barcode data to a higher-level system.
For example, you can use the Ethernet communication to send the data to a server running the WMS or ERP system. The data can be sent in a specific format, such as XML or JSON, to make it easier for the other system to process.
Contact for Procurement
If you're interested in purchasing Omron PLCs for your barcode scanning applications or need more information on how to integrate barcode scanners with Omron PLCs, feel free to get in touch with me. I'm here to help you find the right solutions for your specific needs.
References
- Omron CX-Programmer User Manual
- Barcode Scanner Manufacturer's Documentation
