Page 1
CJ Series General-purpose Serial Connection Guide (RS-485 Modbus Communication) ORIENTAL MOTOR CO., LTD. Brushless Motor and Driver Package BLE Series FLEX RS-485 communication type P659-E1-01...
Page 2
About Intellectual Property Rights and Trademarks Microsoft product screen shots reprinted with permission from Microsoft Corporation. Windows is a registered trademark of Microsoft Corporation in the USA and other countries. Company names and product names in this document are the trademarks or registered trademarks of their respective companies.
Safety Precautions and Precautions for Safe Use in the manuals for each device which is used in the system. The table below lists the manuals provided by ORIENTAL MOTOR CO., LTD. (hereinafter referred to as Oriental Motor) and OMRON Corporation (hereinafter referred to as OMRON), which pertain to this document. Manufacturer Cat.
2.Terms and Definitions 2. Terms and Definitions Term Explanation and Definition Serial Gateway This is a function of PLC that performs serial communications by mode automatically converting a message (command data) to a specified protocol (either CompoWay/F, Modbus-RTU, or Modbus-ASCII) depending on a type of message.
(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 June 2016. It is subject to change for improvement without notice.
Receiving the response data Response data Returning the response data and storing in memory Prepare the CX-programmer project file with a latest version beforehand. To obtain the project file, contact your OMRON representative. Name File name Version CX-Programmer project file P659_CJ_Mod485_Oriental_BLE_EV100.cxp...
5.Applicable Devices and Device Configuration 5. Applicable Devices and Device Configuration 5.1. Applicable Devices The applicable devices are as follows: Manufacturer Name Model OMRON CJ2 CPU Unit CJ2[]-CPU[][] OMRON Serial Communications Unit CJ1W-SCU[]1-V1 CJ1W-SCU[]2 Oriental Motor Brushless Motor and Driver Package...
Precautions for Correct Use Prepare the project file with a latest version beforehand. To obtain the project file, contact your OMRON representative. Precautions for Correct Use Update CX-Programmer to the version specified in this Clause 5.2. or to a higher version.
Page 10
Additional Information For information on the serial cable (RS-485), refer to 3-4 RS-232C and RS-422A/485 Wiring of the CJ Series Serial Communications Units OPERATION MANUAL (Cat. No. W336). Additional Information For specifications of 24 VDC power supply available for Driver, refer to Brushless Motor and Driver Package BLE Series FLEX RS-485 communication type USER MANUAL (HM-5140).
6.Serial Communications Settings 6. Serial Communications Settings This section describes the contents of parameter settings and wiring that are all defined in this document. 6.1. Parameters The parameters required for connecting PLC and Driver using the serial communications are shown below. Item PLC (Serial Communications Unit) Driver...
6.Serial Communications Settings 6.2. Cable Wiring Refer to SECTION 3 Installation and Wiring of the CJ Series Serial Communications Units OPERATION MANUAL (Cat. No. W336) for details on cable wiring. Check connector configuration and pin assignments before wiring. ■Connector configuration and pin assignments CJ1W-SCU42 Serial Communications Unit applicable connector: Terminal block Pin No.
7.Serial Communications Connection Procedure 7. Serial Communications Connection Procedure This section describes the procedures for connecting PLC to Driver using serial communications. The explanations of procedures for setting up PLC and Driver given in this document are based on the factory default settings. For the initialization, refer to Section 8.
7.Serial Communications Connection Procedure 7.2. Oriental Motor Driver Setup Set up Oriental Motor Driver. 7.2.1. Hardware Settings Set the hardware switches on Driver and connect the cables. Precautions for Correct Use Make sure that the power supply is OFF when you set up. Make sure that Driver is powered OFF.
Page 15
7.Serial Communications Connection Procedure Set the address number (slave Set the slave address. address) as shown below. ・Set No.1 of Function setting switch2 (SW5) to OFF. Slave address Set the switch ON. ・Set Address number setting (Modbus protocol) switch (SW1) to 1. *The address number (slave address) is set to 1.
Page 16
7.Serial Communications Connection Procedure Connect 24 VDC power supply 24 VDC power supply to 24 VDC power supply input input terminal (CN5) terminal (CN5). 24 VDC power supply Connect 100 VAC power supply Main power supply input terminal (TB1) to Main power supply input terminal (TB1).
Page 17
7.Serial Communications Connection Procedure 7.2.2. Parameter Settings Set the parameters for Driver. The Parameters are set using the data setting software "MEXE02". Install the software and the device driver for communication cable on Personal computer beforehand. Precautions for Correct Use In this document, the settings are made assuming the 24 VDC power supply and the main power supply are simultaneously turned ON.
Page 18
7.Serial Communications Connection Procedure The Setting of the Communication Dialog Box is displayed. Check that ORIENTAL MOTOR/Virtual COM Port is displayed as the serial port. Click OK. *If ORIENTAL MOTOR/Virtual COM Port is not displayed as the serial port, open Windows Device Manager and check that the device driver is registered under Ports (COM &...
Page 19
7.Serial Communications Connection Procedure Operation data is displayed. Select Communication from the Move Menu. The edit window for Communication is displayed. Check that the following parameters are set as shown below. Communication parity: Even Communication stop bit: 1 bit *Use the default settings for other parameters.
7.Serial Communications Connection Procedure 7.3. PLC Setup Set up PLC. 7.3.1. Hardware Settings Set the hardware switches on Serial Communications Unit and connect the cables. Precautions for Correct Use Make sure that the power supply is OFF when you set up. Make sure that PLC is powered OFF.
Page 21
7.Serial Communications Connection Procedure Connect Serial Communications Unit to PLC as shown on the Personal Serial Communications Unit computer right. End Cover Connect Driver to Port 1 on Serial cable USB cable (RS-485) Serial Communications Unit with the Serial cable (RS-485). Power Supply CPU Unit Driver...
Page 22
CX-Programmer. CX-Programmer starts. Select Open from the File Menu. The Open CX-Programmer Project Dialog Box is displayed. Select P659_CJ_Mod485_ Oriental_BLE_EV100.cxp and click Open. *Obtain the project file from OMRON. After opening the project file, select Programs in the project workspace.
Page 23
7.Serial Communications Connection Procedure Select Change Model from the PLC Menu. The Change PLC Dialog Box is displayed. From the pull-down list of Device Type, select the device type of PLC to use. Click Settings. *CJ2M is selected in this document.
Page 24
7.Serial Communications Connection Procedure Check that USB is set as the network type in the Change PLC Dialog Box. Click OK. *If the USB is not set as the network type, select USB from the pull-down list. *If you changed Device Type in step 8 or CPU Type in step 9, the dialog box on the right is displayed.
Page 25
7.Serial Communications Connection Procedure The confirmation dialog box on the right is displayed. Confirm that there is no problem, and click Yes. Check that CX-Programmer and PLC are normally connected online. *The icon is pressed down during online connection. Additional Information If PLC cannot be connected online, check the cable connection.
Page 26
7.Serial Communications Connection Procedure 7.3.3. Creating the I/O Table Create the I/O table for PLC. If the operating mode of PLC is Run Mode or Monitor Mode, change it to Program Mode by following the steps below. (1)Select Operating Mode - Program from the PLC Menu in CX-Programmer.
Page 27
7.Serial Communications Connection Procedure Select Create from the Options Menu in the PLC IO Table Window. The confirmation dialog box on the right is displayed. Confirm that there is no problem, and click Yes. The confirmation dialog box on the right is displayed. Confirm that there is no problem, and click Yes.
Page 28
7.Serial Communications Connection Procedure 7.3.4. Parameter Settings Set the parameters for Serial Communications Unit. Double-click [0000] Main Rack in the PLC IO Table Window to expand the tree. Right-click 00 [1500] CJ1W-SCU42 and select Unit Setup. The View Parameters Dialog Box is displayed.
Page 29
7.Serial Communications Connection Procedure The setting items of Port1: Serial Gateway Settings are listed as shown in the figure on the right. (The figure shows the default values.) Select User settings for Port1: Port Settings from the pull-down list of Set Value. Set the following parameters in the same way as step 5.
Page 30
7.Serial Communications Connection Procedure The confirmation dialog box on the right is displayed. Confirm that there is no problem, and click Yes. Check that the transfer is completed as shown on the right. Click Close. The Dialog box on the right is displayed.
Page 31
7.Serial Communications Connection Procedure Click Compare in the View Parameters Dialog Box. Check that a message "Compare successful" is displayed in the dialog box on the right. Click Close. Click OK in the View Parameters Dialog Box. Select Exit from the File Menu of the PLC IO Table Window to close.
Page 32
7.Serial Communications Connection Procedure 7.3.5. Transferring the Project Data Transfer the project data to PLC. Select Programs in the project workspace of CX-programmer. Select Transfer - To PLC from the PLC Menu. Select Program(s), Comments, and Program index. Click OK. *The I/O table and Special Unit Setup are unnecessary to transfer here, because they are...
Page 33
7.Serial Communications Connection Procedure The dialog box on the right is displayed (stating "Download successful") when the transfer is complete. Click OK. Select Programs in the project workspace. Select Transfer - Compare with PLC from the PLC Menu. Select Program(s) and click OK. Check that a message stating "Compare successful"...
7.Serial Communications Connection Procedure 7.4. Serial Communication Status Check Start the send/receive processing and confirm that serial communications is performed normally. Always ensure safety before wiring the I/O in the state where the devices are powered OFF. Always read and follow the information provided in all safety precautions in the manuals for each device to be wired.
Page 35
7.Serial Communications Connection Procedure Select Operating Mode - Monitor from the PLC Menu. The confirmation dialog box on the right is displayed. Confirm that there is no problem, and click Yes. Check that the operating mode changes to Monitor Mode. In the Ladder Section Window, right-click Input_Start and select Set - On.
Page 36
7.Serial Communications Connection Procedure Select Edit - Memory from the PLC Menu. Double-click CIO on the Memory Tab of the PLC Memory Window. Select Display - Binary from the View Menu. Enter 5500 in the Start Address Field in the displayed CIO Window.
Page 37
7.Serial Communications Connection Procedure Select Monitor from the Online Menu. The Monitor Memory Areas Dialog Box is displayed. Select CIO and click Monitor. Check the received data in the CIO Window shown on the right. In the example on the right, the stored data starting from CIO5500 are in hexadecimal and are described as follows:...
Page 38
7.Serial Communications Connection Procedure Start MEXE02 and display the edit window for Operation data. *For information on how to start and operate MEXE02, refer to steps 2 to 7 in 7.2.2. Parameter Settings. Select Status,I/O monitor from the Tool Menu. The Status, I/O monitor Window is displayed.
Page 39
7.Serial Communications Connection Procedure The read data [00], [02], [00], ■Direct I/O and electromagnetic brake status (00D4h, 00D5h) Address(Hex) Description of address and [00] in step 13 correspond Bit 15 Bit 14 Bit 13 Bit 12 Bit 11 Bit 10 Bit 9 Bit 8 [00]...
8.Initialization method 8. Initialization method The setting procedures in this document are based on the factory default settings. Some settings may not be applicable unless you use the devices with the factory default settings. 8.1. Initializing PLC To initialize the settings of PLC, it is necessary to initialize Serial Communications Unit and CPU Unit.
8.Initialization method 8.1.2. CPU Unit To initialize the CPU Unit settings, select Clear All Memory Areas from the PLC Menu in CX-Programmer. Select Initialize in the Confirm All Memory Area Clear Dialog Box and click 8.2. Initializing Oriental Motor Driver For information on how to initialize Oriental Motor Driver, refer to Resetting data of applicable product to factory default settings of the Data setting software MEXE02 OPERATING MANUAL (HM-60131).
"#03E8" for hexadecimal data) Additional Information OMRON has confirmed that normal communications can be performed using this program under 5.2. Device Configuration, however, we do not guarantee the normal operation under the disturbance such as electrical noise or the performance variation of the device.
Page 43
9.Program 9.1.1. Outline of Processing The following figure shows the data flow from when PLC (SCU) issues command data to Destination Device using serial communications (Modbus-RTU communication) until PLC receives response data from Destination Device. (1)The ladder program executes the deliver command instruction (CMND instruction) for which Modbus-RTU communication is specified.
Page 44
(instruction word: CMND, hereinafter referred to as CMND instruction) and to send/receive messages. Additional Information For details on the CMND instruction, refer to Network Instructions in SECTION 3 Instructions of the CJ Series Programmable Controllers INSTRUCTIONS REFERENCE MANUAL (Cat. No. W474). ●CMND instruction operand data S: First command word ・The first address is specified to set a send command.
Page 45
9.Program C: First control word ・The first address is specified to set the first control word. ・Data is set in the following format. Item Description Number of command data bytes The number of command data bytes is set. (#0002 to maximum data length) Number of response data bytes The number of response data bytes is set.
Page 46
9.Program ●Send/Receive messages [Frames of send/receive messages] Send message Destination Device Silent Address Function Data Error check Silent interval interval code Receive message Silent Function Data Error check Silent Address interval interval code [S:Relation between the first command word (CMND instruction operand) and send messages] +0CH +1CH...
9.Program 9.2. Destination Device Command The functions to read or write coils or registers are defined as ''Modbus functions'' in Modbus-RTU communication. The Destination Device can be operated (command execution) by using the Modbus functions to read or write coils or registers defined by Destination Device.
Page 48
9.Program 9.2.2. Detailed Description of the Function The following explains the details on reading "Direct I/O and electromagnetic brake status" (register address: #00D4) by using the function "Reading from a holding register(s) (function code: #03)". Additional Information For details on register addresses, refer to Register address list in Method of control via Modbus RTU(RS-485 communication) of the Brushless Motor and Driver Package BLE Series FLEX RS-485 communication type USER MANUAL (HM-5140).
9.Program 9.3. Error Detection Processing In this program, the error detection processing is performed by means of dividing errors into the following areas (1) to (3). For error codes, refer to 9.7. Error Processing. Destination Device Serial cable (1)Errors when executing the CMND instruction (CMND instruction error) Errors that occur at execution of the CMND instruction, such as the Unit error, command format error, and parameter error, are detected as CMND instruction errors.
9.Program 9.4. Memory Maps The memory maps of this program are shown below. 9.4.1. Lists of Addresses The tables below list the addresses necessary to execute this program. You can change the allocations below to any addresses. Precautions for Correct Use Make sure that there is no duplicated address when changing the addresses.
Page 51
9.Program ●Internal memory These addresses are used to operate this program only. Address Data type Variable name Description Local_CMND_Executing 5000.01 BOOL Indicates the CMND instruction execution status. Turns ON when the CMND instruction is being executed, and turns OFF when the CMND instruction is not executed.
Page 52
For details on the CIO area allocated to SCU, refer to 2-3-2. CIO Area in 2-3. I/O Memory Allocations in SECTION 2 Initial Settings and I/O Memory Allocations of the CJ Series Serial Communications Units OPERATION MANUAL (Cat. No. W336).
9.Program 9.5. Ladder program 9.5.1. Functional Components of the Ladder Program The functional components of this program are shown below. Major classification Minor classification Description 1.Initialization 1.1.Response code clear The area of use is cleared, and the processing 1.2.Control word setting initialization setting is performed as a for CMND instruction preparation for communications.
Page 54
9.Program Outline Description 1.2. Control word setting Sets the control word of CMND instruction. for CMND instruction For details on the settings, refer to 9.2.2. Detailed Description of the Function. 1.3. Send/receive The FINS command and the Destination Device function are symbol setting set to the send symbol, and the receive data storage area is initialized.
Page 55
9.Program ●2.CMND instruction execution management Outline Description 2.1. CMND instruction Enters the CMND instruction executing status. executing The executing state is reset at a normal end or an error end of the program. 2.2. CMND instruction Executes the CMND instruction under the following execution conditions.
Page 56
9.Program Outline Description 2.3. Normal/error Detects a normal end or an error end of the result of detection processing send/receive processing. It is considered as a normal end when all the following conditions are satisfied. ・Normal end of CMND instruction (No CMND instruction error) (Condition of ''No communication error'' is included in (1).) ・Normal messages received from Destination Device...
Page 57
9.Program ●3.Normal end state management Outline Description 3.1. Normal end Turns ON the normal end flag if it is detected in 2.3. processing Normal/error detection processing that the send/receive processing ends normally. 3.2. Response code Sets response code "#0000" for a normal end in the setting response code storage area.
Page 58
9.Program ●4.Error end state management Outline Description 4.1. Error end processing Turns ON the error end flag if it is detected in 2.3. Normal/error detection processing that the send/receive processing ends in an error. 4.2. Response code Sets the response code corresponding to the error in the setting response code storage area when an error occurs.
CJ Series Communications Commands REFERENCE MANUAL (Cat. No. W342). Additional Information For details and troubleshooting on the CMND instruction errors, refer to 12-3 Troubleshooting in SECTION 12 Troubleshooting and Maintenance of the CJ Series Serial Communications Units OPERATION MANUAL (Cat. No. W336). 9.7.2.
Page 61
9.Program 9.7.3. Destination Device Error Code The upper byte of H402 stores the following error codes. [Format] Error code #Always #00 [Error code list] Error code (hex) Cause Description Invalid The process could not be executed because the function code function was invalid.
Need help?
Do you have a question about the CJ Series and is the answer not in the manual?
Questions and answers