Page 1
Programmable Controller CJ-series Serial (RS-232C) Communications Connection Guide OMRON Corporation Auto Focus Multi Code Reader V320-F / V420-F / V430-F-series Z414-E1-01...
Page 2
Microsoft product screen shots used with permission from Microsoft. Windows is a registered trademark of Microsoft Corporation in the USA and other countries. Sysmac and SYSMAC are trademarks or registered trademarks of OMRON Corporation in Japan and other countries for OMRON factory automation products.
1. Related Manuals 1. Related Manuals The following manuals are related to this document. To ensure system safety, make sure to always read and follow the information provided in all Safety Precautions and Precautions for Safe Use in the manuals for each device which is used in the system.
2. Terms and Definitions 2. Terms and Definitions Term Description/Definition Protocol Macro This function enables data send/receive with general-purpose external devices by storing the data send/receive procedure (Protocol) used with the general-purpose external devices in the Serial Communication Board or Unit and executing the PMCR instruction in the CPU Unit. Protocol The unit that comprises an independent communication processing for a specific general-purpose external device as a data send/receive procedure...
(4) It is prohibited to copy, to reproduce, and to distribute a part or the whole of this document without the permission of OMRON Corporation. (5) The information contained in this document is current as of February 2023.
4. Overview 4. Overview This document describes the procedures for connecting the OMRON code reader products (V320-F/V420-F/V430-F Series) to a CJ Series Programmable Controller with a Serial Communications Unit (hereinafter referred to as PLC) via serial communications and for checking their connections.
For details on the above products (other than communication connection procedures), please refer to the instruction manual for the product or contact OMRON. Precautions for Correct Use The connection and connection check procedures described in this document use the devices listed in section 5.2, from among the above applicable devices.
CX-One Installed) V430-WPLC-2M RJ50 to RS-232 and external power supply, USB cable straight V320-WRX-2M Manufact Name Model Version urer OMRON CPU Unit CJ2M-CPU11 Ver. 2.0 OMRON Serial Communications Unit CJ1W-SCU22 Ver. 2.0 OMRON Power Supply Unit CJ1W-PA202 OMRON CX-One CXONE-AL□□C-V4...
Page 10
V420-WUB-1M V420-F cable accessories, RJ50 to DB-15 V320-WR-1M Manufact Name Model Version urer PC (OS: Windows 10) OMRON Code reader Ver. 2.1.0 V320-F000M12M-SRX OMRON V/F320-F adapter for all V420-F cable V320-WR-1M accessories, RJ50 to DB-15 OMRON USB breakout cable V420-WUB-1M...
Page 11
V430-WPLC-2M Cable (RS-232 breakout (DB-15) USB cable and external power supply input) V420-WRX-1M Manufact Name Model Version urer OMRON CPU Unit CJ2M-CPU11 Ver. 2.0 OMRON Serial Communications Unit CJ1W-SCU22 Ver. 2.0 OMRON Power Supply Unit CJ1W-PA202 OMRON CX-One CXONE-AL□□C-V4 Ver. 4.□□...
Page 12
To use WebLink, the following system components for USB connection are required. V420-F000M12M-SRX (OS: Windows 10) USB breakout cable V420-WUB-1M Manufact Name Model Version urer PC (OS: Windows 10) OMRON Code reader Ver. 2.1.0 V420-F000M12M-SRX OMRON USB breakout cable V420-WUB-1M...
Page 13
*1. Refer to 6.2. Cable Wiring Diagram for how to prepare the RS-232C cable yourself. Precautions for Correct Use Obtain the latest versions of the project file and protocol macro data in advance. Contact OMRON for information on how to obtain these files.
Page 14
The configuration may not be reproduced if the system component models or versions differ. Check your configuration and, if there is any difference in the models or versions, contact OMRON. Note This document assumes that the USB is used to connect the PLC. For information on how to install the USB driver, refer to the CX-Programmer Operation Manual (Cat.
6. Serial Communications Settings 6. Serial Communications Settings This section shows the specifications of the communication parameter settings, cable wiring, and other information provided in this document. Note You need to modify the program to use communication settings that are not described in this section.
6. Serial Communications Settings 6.2. Cable Wiring Diagram For details on cable wiring, refer to Section 3 Installation and Connection in the CJ-series Serial Communications Boards/Units Operation Manual (Cat. No. W336). Check the connector shape and signal lines (pin assignment) before you prepare the cable. ■...
Page 17
6. Serial Communications Settings ■ RS-232C Cable Pin Assignment Prepare the RS-232C cable with reference to the following wiring diagram. Serial Communications Unit RS-232C-to-I/O two-way cable (V (CJ1W-SCU22) side Series) side Signal Signal Pin No. Pin No. name name RS-232C RS-232C interface interface...
6. Serial Communications Settings 6.3. Example of Connection Check for Communications In this document, an example of sending and receiving messages between the controller and the code reader using a ladder program and protocol macro data is given. Between the PLC and the code reader, the “Execute Read (Sequence No. 900)” message is sent and received.
7. Connection Procedure 7. Connection Procedure This section describes the procedures for connecting the code reader to the PLC for serial communications. In this document, it is assumed that the PLC and the code reader use the factory default settings. For how to initialize the devices, refer to Section 8. Initializing the System. 7.1.
7. Connection Procedure 7.4.4. Checking the Receive Data In the CX-Programmer, check that the correct data is written to the I/O memory of the PLC. 7.2. Code Reader Setup Set up the code reader. Precautions for Correct Use Use a PC (personal computer) to set the parameters for the code reader. Note that you may need to change the PC settings depending on the condition of your PC.
Page 21
7. Connection Procedure [V430-F Series Only] Connect the Ethernet connector Ethernet cable on the code reader to the PC V430-WE-3M using Ethernet cable V430-WE-3M. Ethernet Turn ON the 24 VDC power Connector supply. [V430-F Series Only] Set the IP Address of the PC. For the IP address, enter 192.168.188.100.
Page 22
7. Connection Procedure When WebLink startup screen is displayed, go to step cannot access WebLink, go to step 7. If the WebLink startup screen does not appear, it means that communications are not established between the code reader and the PC. Please check the following. ・...
Page 23
7. Connection Procedure The Advanced Settings Screen appears. Select the Communications Tab and check that the settings are as follows. [RS232A] Baud Rate: 9600 Parity: None Stop Bits: 1 Data Length: 8 [Host Protocol] Protocol Selection: Point-to-Point [Preamble] Preamble: Disabled Postamble Postamble: Enabled Postamble...
Page 24
7. Connection Procedure About WebLink is displayed, so you can check the current version of the code reader. Please update the code reader latest version necessary.
7. Connection Procedure 7.3. PLC Setup Set up the PLC. 7.3.1. Setting the Hardware Set the hardware switch on the Serial Communications Unit. Precautions for Correct Use Turn OFF the power supply before setting the hardware. Confirm that the power supply to the PLC is OFF.
Page 26
Menu. The Open CX-Programmer Project Dialog Box is displayed. Select OMRON_V320_V420_V430 _PMCR232C_V100.cxp and click Open. * Obtain the latest version of the project file from the OMRON website. After the loading of the project file completed, select Programs project workspace.
Page 27
7. Connection Procedure Select Change Model from the PLC Menu. The Change PLC Dialog Box is displayed. Select the PLC type from the Device Type pull-down menu, and click Settings. * In this document, CJ2M is used. The Device Type Settings Dialog Box is displayed.
Page 28
7. Connection Procedure In the Change PLC Dialog Box, confirm that USB is selected in Network Type, and click OK. * If USB is not selected in Network Type, select USB from the pull-down menu. * If you change the PLC type in step 6 or CPU type in step 7, a confirmation dialog box as shown in the figure on the...
Page 29
7. Connection Procedure A dialog box as shown in the figure on the right appears. Click Yes. Confirm that CX-Programmer is online with the PLC. * The CX-Programmer is online if the icon appears to be depressed. Note If you cannot go online with the PLC, check the physical cable connections, etc. If the physical cable connections are correct, return to step 5 and check the settings in steps 6 to 8.
Page 30
7. Connection Procedure 7.3.3. Creating the I/O Table Create the I/O table for the PLC. If the PLC Operating Mode is set to either Run or Monitor, follow steps (1) to (3) to change it to Program. CX-Programmer, select Operating Mode – Program from the PLC Menu.
Page 31
7. Connection Procedure In the CX-Programmer, select Edit – I/O Table and Unit Setup from the PLC Menu. The PLC IO Table Window is displayed. In the PLC IO Table Window, select Create from the Options Menu. A dialog box as shown in the figure on the right appears.
Page 32
7. Connection Procedure The Transfer from PLC Dialog Box is displayed. Select the check boxes for IO Table and SIO Unit Parameters and click Transfer. When the transfer is completed, the Transfer Results Dialog Box appears. Check the messages in this dialog box to confirm that the transfer process is successfully completed.
Page 33
7. Connection Procedure 7.3.4. Setting the Parameters Set the parameters for the Serial Communications Unit. In the PLC IO Table Window, double-click [0000] Main Rack to open the tree. Right-click 00[1500]CJ1W-SCU22 select Unit Setup from the menu. The View Parameters Dialog Box is displayed.
Page 34
7. Connection Procedure The settings of Port2: Protocol macro Settings are listed as shown on the right. (The figure on the right shows the default settings.) As the set value for Port settings, select User settings. In the same way as in step 5, set the parameters as follows.
Page 35
7. Connection Procedure A dialog box as shown in the figure on the right appears. Click Yes. Confirm that the transfer is successfully completed shown on the right, and then click Close. A dialog box as shown in the figure on the right appears. Click Yes.
Page 36
7. Connection Procedure In the View Parameters Dialog Box, click Compare. Confirm that the comparison is successful as shown on the right, and then click Close. In the View Parameters Dialog Box, click OK. Close the Edit Parameters Dialog Box and the PLC IO Table Window,...
Page 37
7. Connection Procedure 7.3.5. Transferring the Project Data Transfer the project data to the PLC. In the CX-Programmer, select Programs project workspace, and select Transfer – To PLC from the PLC Menu. Select the check boxes for Program(s), Comments, and Program index, and click the OK Button.
Page 38
7. Connection Procedure Confirm that the download is successfully completed shown on the right, and then click OK. Select Programs in the project workspace, and select Transfer – Compare with PLC from the PLC Menu. Select check Program(s), and click the OK Button.
Page 39
The Open Dialog Box is displayed. Select OMRON_V320_V420_V430_P MCR_V100.psw and click Open. * Obtain the latest version of the protocol macro data from the OMRON website. The protocol macro data is loaded and displayed in the project workspace and project windows.
Page 40
7. Connection Procedure 7.3.7. Going Online and Transferring the Protocol Macro Data Go online with the CX-Protocol and transfer the protocol macro data to the Serial Communications Unit. Double-click OMRON_V320_V330_V430_P MCR_V100 project workspace to open the tree. Select Edit PC-PLC Comms Settings from the PLC Menu.
Page 41
7. Connection Procedure In the Change PLC Dialog Box, confirm that USB is selected in Network Type, and click OK. * If USB is not selected in Network Type, select USB from the pull-down menu. Select Connect to PLC from the PLC Menu.
Page 42
7. Connection Procedure A project window as shown on right displayed. Confirm that SCU [0] is entered in Target. * If SCU [0] is not entered, select SCU [0] as shown on the right. With Protocol List selected, select Download Protocols from the Protocol Menu.
Page 43
7. Connection Procedure A dialog box as shown in the figure on the right appears. Click Confirm that Downloaded % shows 100% in the dialog box on the right, and click Close. With Protocol List selected, select Compare Protocols from the Protocol Menu.
Page 44
7. Connection Procedure compile process complete when Compiled% shows 100% in the dialog box on the right. Confirm that compile process successfully completed as shown on the right, and then click Compare. A dialog box as shown in the figure on the right appears. Click Compared Confirm that...
7. Connection Procedure 7.4. Checking That Serial Communications Work Execute the program to check that serial communications work correctly. Sufficiently confirm safety before you perform continuity/current value monitoring in the Ladder Section Window or current value monitoring in the Watch Window. Incorrectly operating shortcut keys to execute force-set/reset or set/reset may cause malfunction of devices connected to Output Units, regardless of the operating mode of the CPU Unit.
Page 46
7. Connection Procedure tree structure under NewPLC1 is open. Select the Serial Communications Unit (SCU[0] in the figure on the right). In the project window, select the Trace 2 icon ( (Confirm that Trace highlighted as shown on the right.) * Trace 2 corresponds to the “Port 2”...
Page 47
7. Connection Procedure 7.4.2. Executing the Program Execute the program in the CX-Programmer. In the CX-Programmer, open the tree structure under Programs in the project workspace, and double-click Section1. In the Ladder Section Window, the ladder diagram for Section1 is displayed. Ladder Section Window This document uses a barcode as shown in the right figure as...
Page 48
7. Connection Procedure Confirm that the Input_Start contact is ON. The program starts running and the PLC performs serial communications with the code reader to read the barcode . * The reading is a successful if the PASS LED indicator on the code reader is lit green.
Page 49
7. Connection Procedure 7.4.3. Checking the Trace Data Using the trace data of the CX-Protocol, check that the correct data is sent and received. CX-Protocol, select Upload Trace from the PLC Menu. A dialog box as shown in the figure on the right appears. Click Yes.
Page 50
7. Connection Procedure 7.4.4. Checking the Receive Data In the CX-Programmer, check that the correct data is written to the I/O memory of the PLC. In the CX-Programmer, select Edit – Memory from the PLC Menu. In the PLC Memory Window displayed, double-click listed in the Memory Tab Page.
Page 51
7. Connection Procedure Select Monitor from the Online Menu. The Monitor Memory Area Dialog Box is displayed. Select the check box next to CIO and click Monitor. Check the received data (read code) in the CIO Window in the figure on the right. * In the example on the right, the data stored in words starting from CIO5501 is “3439 3132...
8. Initializing the System 8. Initializing the System In this document, it is assumed that the controller and the code reader use the factory default settings. If you change their settings from the default, you may not be able to perform various setting procedures as described.
8. Initializing the System 8.1.2. CPU Unit To initialize the CPU Unit, select Clear All Memory Areas from the PLC Menu in the CX-Programmer. In the Confirm All Memory Area Clear Dialog Box, select Initialize and click OK. 8.2. Initializing the Code Reader For information on initializing the code reader, please refer to How to initialize the settings? in Q&A in Appendices of the MicroHAWK V320-F/V330-F/V420-F/V430-F Series Barcode Reader User Manual (Cat.
9. Program 9. Program This section describes the details of the program and protocol macro data used in this document. 9.1. Overview This section describes the specifications and functions of the program and protocol macro data used to check the connection between the code reader and the PLC (Serial Communications Unit (hereinafter SCU unit)).
Page 56
9. Program 9.1.1. Communications Data Flow This is the flow from issuing command data from the PLC (SCU unit) to the code reader through serial communications and receiving response data from the code reader. Communications Sequence The PROTOCOL MACRO instruction (Mnemonic: Execution Processing PMCR) for the sequence number specified in the program is executed to call the communications...
Page 57
9. Program C1: Control Data Set three types of data about the SCU unit. ・ Communications port No. (Internal logical port): #0 to 7 ・ Serial port No. (Physical port): #1 to 2 (#1: PORT1, #2: PORT2) ・ Unit address of communications partner: #Unit No. + #10 Control data: C1 Unit address of communications partner...
Page 58
9. Program … (m-1) Receive Area: D Words No. of words in Receive Area ● Send and Receive Messages Overview of Send and Receive Messages Send message Code reader Words Terminator Receive message Words Terminator Relationship between Send Area S (PMCR Instruction Operand) and Send Message +(n-1) CPU →...
9. Program 9.2. Communications Sequence This section describes the communications sequence (protocol macro data) that can be used with PMCR instructions in the program. 9.2.1. Communications Sequence Number The communications sequence (protocol macro data) registered in the SCU unit is identified by the communications sequence number.
9. Program 9.3. Error Judgment Processing This program performs error judgment processing for the following three types of errors (1) to (3). Refer to 9.8. Error Processing for error codes. Code reader RS-232C cable (1) PMCR instruction execution error (PMCR instruction error) An error such as a sequence No.
9. Program 9.4. Memory Map This section describes the memory map of the program. 9.4.1. Usable Memory Addresses The tables below show area and word addresses that are required to execute the program. You can change the following allocations to any addresses. Precautions for Correct Use When you change the address allocations, be careful not to cause address duplication.
Page 62
9. Program ● Internal Memory Below are the word addresses that are used only for calculations by the program. Address Data Variable name Description type 5000.01 BOOL Internal_PMCRInstructionExecuting Indicates the execution status of the PMCR instruction. Turns ON when the PMCR instruction is executed and turns OFF when not executed.
Page 63
9. Program 9.4.2. Fixed CIO Area and Related Auxiliary Area Addresses The tables below show area addresses that are required to execute the program. ● CIO Area The following address allocations cannot be arbitrarily changed since they are fixed by the unit address (unit number) setting for the SCU unit.
9. Program 9.5. Ladder Program 9.5.1. Functional Components of Ladder Program The functional components of the program are as follows. Category Subcategory Description 1. Initialization 1.1. Clear End Code Clear the used area and make initial 1.2. Assign PMCR settings preparation Instruction Operands communications.
Page 65
9. Program 9.5.2. Detailed Description of Functional Components The functional components of the program are shown below. ● 1. Initialization Overview Description 1.1. Clear End Code Clears the error code storage area to zeros. 1.2. Assign PMCR Instruction Sets the execution parameters (operands) of the PMCR Operands instruction.
Page 66
9. Program ● 2. PMCR Instruction Executing Status Control Overview Description 2.1. PMCR Instruction Changes to the PMCR Instruction Executing status. Executing The executing status is cleared at the normal/error end of the program. 2.2. PMCR Instruction Executes the PMCR instruction on condition that Execution Processing communications port No.
Page 67
9. Program Overview Description 2.3. Normal/Error Judgment Judges whether program execution has ended normally Processing or abnormally. The program is considered to have ended normally if all of the following conditions are met. (1) PMCR instruction at normal end (without PMCR instruction error) (2) Communications sequence at normal end (without communications error)
Page 68
9. Program ● 3. Normal End Status Control Overview Description 3.1. Normal End Processing Turns ON the normal end flag when the program is judged to have ended normally in 2.3. Normal/Error Judgment Processing, 3.2. Set End Code Sets the end code for normal end “#0000” in the end code storage area.
Page 69
9. Program ● 4. Error End Status Control Overview Description 4.1. Error End Processing Turns ON the Error End Flag when the program is judged to have ended abnormally in 2.3. Normal/Error Judgment Processing. 4.2. Set End Code Sets the end code for error end corresponding to the error cause in the end code storage area.
9. Program 9.6. Protocol Macro Data Protocol macro data consists of the following components: Sequence, Step, Send Message, Receive Message, and “Reception Matrix”. ● When there is only one receive message format for one step (i.e., single send and receive operation) ・...
Page 71
9. Program 9.6.2. Protocol Macro Processing Procedure The protocol macro processing procedure is as follows. Step No. 00 Issue a send message (SD_RDCODE). ▼ If Step No. 00 ends normally If Step No.00 ends abnormally ▼ ▼ Next processing: Error processing: Abort the step and end communications sequence as End.
Page 72
9. Program 9.6.3. Sequence Settings The protocol macro data uses a “Read trigger” (Communications sequence No. 900) to read the code. The setting items for the communications sequence include Timeout. Note For details on the sequence settings, refer to 3-2 Sequence Attributes (Common to All Steps) in the CX-Protocol Operation Manual (Cat.
Page 73
9. Program 9.6.4. Step Settings The step settings for communications sequence No.900 are shown below. The step settings include Retry, Send Message and Recv Message (message names), Next, and Error. The sequence in the protocol macro data consists of Step No. 00 only. Note For details on the step settings, refer to 3-3 Step Attributes in the CX-Protocol Operation Manual (Cat.
Page 74
9. Program ● Next Processing and Error Processing Settings The Next and Error processing settings for the step are shown below. The Next processing setting will be executed when the step execution ends normally. The Error processing setting will be executed when a communication error occurs. Step Setting Screen Settings Step...
Page 75
9. Program 9.6.5. Send Message Settings The send message settings are shown below. Note For details on the Send Message settings, refer to 3-4 Communication Message Attributes in the CX-Protocol Operation Manual (Cat. No. W344). Send Message Setting Screen ● Settings for Send Message “SD_RDCODE” Settings "<...
Page 76
9. Program 9.6.6. Receive Message Settings The receive message settings are shown below. Note For details on receive message settings, refer to 3-4 Communication Message Attributes in the CX-Protocol Operation Manual (Cat. No. W344). Receive Message Setting Screen ● Settings for Receive Message “RV_RDCODE” Settings (W(1),*)+<t>...
9. Program 9.7. Timing Chart The timing chart for the program is shown below. The timing chart patterns are defined as follows. Error End 1 Error End 2 Pattern Normal End ExecPMCR Instruction Protocol Macro Error Error Command Normal Error Error Code reader Normal...
9. Program 9.8. Error Processing This section provides information on errors that can occur during the execution of the program. 9.8.1. Protocol Macro Error Codes These errors are detected by the macro operation monitoring function of the SCU unit. They are stored in the word H400 (Variable name: Output_ProtocolMacro_ErrorCode). Error Code List Error code Name...
Need help?
Do you have a question about the V320-F Series and is the answer not in the manual?
Questions and answers