Omron E5 D, E5 C, E5 C-T Connection Manual

Page 1
Programmable Controller CJ-s
eries
General-purpose Serial
Connection Guide (RS-485 CompoWay/F)
OMRON Corporation
Digital Temperature Controller (E5D/E5C/E5C-T)
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 guide are the t rademarks or registered trademarks of their respective companies.
Page 3
Table of Contents
1. Related Manuals ........................................................................................ 1
2. Terms and Definitions ............................................................................... 2
3. Precautions ................................................................................................ 3
4. Overview .................................................................................................... 4
5. Applicable Devices and Device Configuration ....................................... 5
5.1. Applicable Devices ............................................................................. 5
5.2. Device Configuration .......................................................................... 7
6. Serial Communications Settings ............................................................. 9
6.1. Parameters ........................................................................................ 9
6.2. Cable Wiring .................................................................................... 10
7. Serial Communications Connection Procedure .................................... 11
7.1. Work Flow ......................................................................................... 11
7.2. Digital Temperature Controller Setup ............................................... 13
7.3. PLC Setup ........................................................................................ 17
7.4. Serial Communication Status Check ................................................ 38
8. Initialization Method ................................................................................ 44
8.1. Initializing a PLC .............................................................................. 44
8.2. Initializing a Digital Temperature Controller ...................................... 45
9. Program .................................................................................................... 46
9.1. Overview .......................................................................................... 46
9.2. Communications Sequence ............................................................. 51
9.3. Error Detection Processing .............................................................. 52
9.4. Memory Maps .................................................................................. 53
9.5. Ladder Program ............................................................................... 56
9.6. Protocol Data ................................................................................... 62
9.7. Timing Charts ................................................................................... 73
9.8. Error Processing .............................................................................. 74
10. Revision History .................................................................................. 77
Page 4
1.Related Manuals
1
/ AL□□D-V4
OPERATION MANUAL
H224
E5□D
Digital Temperature Controllers User’s Manual
Communications Manual

1. Related Manuals

To ensure system safety, make sure to always read and follow the information provi ded i n all Safety Precautions and Precautions for Saf e Use in the manuals for each device which is used in the system. The table below lists the manuals pertaining to t his guide.
Cat. No. Model Manual name
W472 CJ2M-CPU□□
CJ2H-CPU6 CJ2H-CPU6□-EIP
W473 CJ2M-CPU□□
CJ2H-CPU6 CJ2H-CPU6□-EIP
W336 CJ1W-SCU□1-V1
CJ1W-SCU□2
W474 CJ2□-CPU□□ CJ Series
W446 CXONE-AL□□C-V4
CJ Series CJ2 CPU Unit Hardware USER'S MANUAL CJ Series CJ2 CPU Unit Software USER'S MANUAL CJ Series Serial Communications Units OPERATION MANUAL
Programmable Controllers INSTRUCTIONS REFERENCE MANUAL CX-Programmer
W344 CXONE-AL□□C-V4
/ AL□□D-V4
H225 E5D Digital Temperature Controllers
H175 E5C Digital Temperature Controllers
H174 E5C Digital Temperature Controllers User’s Manual H186 E5C-T Digital Temperature Controllers
H185 E5C-T Digital Temperature Controllers
CX-Protocol OPERATION MANUAL
Communications Manual
Programmable Type Communications Manual
Programmable Type User’s Manual
Page 5
2.Terms and Definitions
2
in a CPU Unit.
device. A protocol consists of more than one sequence.
buffer clear, or step wait. Up to 15 steps can be set for per sequence.
general-purpose external device.

2. Terms and Definitions

Term Explanation and Definition
protocol macro A data transfer procedure (protocol) with a general-purpose external
device is created and stored in a Serial Communications Board or a Serial Communications Unit. This functional protocol enables data to be exchanged with general-purpose external devices by executing the protocol macro instruction (hereinafter ref erred to as "PMCR instruction")
protocol A set of rules governing the data transfer procedures that gather
independent communication processing wit h a specific general-purpose
sequence A unit of action to perform the independent communication processing that
can be started by executing the PMCR instruction in a program. A sequence that is started by the instruction executes steps registered in its own sequence.
step A unit to execute any one of the followings: message send processing,
message receive processing, message send/ receive processing, receive
send message A communications frame (command) sent to a general-purpose external
device. A send message is invoked by steps in a sequence and is sent to a
receive message A communications frame (response) sent from a general-purpose external
device. A receive message is invoked by steps in the sequence and is compared with data received from general-purp ose external devices.
matrix A function to register and use some communications frames (responses)
when more than one communications frame is expected to be received from a general-purpose external device. The receive processing can be executed according to registered communications frames by using this funct ion.
case A unit to register multiple communications frames (response) to a matrix.
One communications frame is registered as one case. Up to 15 types of cases can be registered per matrix.
Page 6
3.Precautions
3
Precautions for Safe Use
Additional Information
This information is provided to increase unders tanding or make operation easier.
Symbol

3. Precautions

(1) Understand the specifications of devices which are used in the system. Allow some
margin for ratings and performance. Provide saf ety measures, such as installing a safety circuit, in order to ensure safety and minimize the risk of abnormal occurrence.
(2) 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.
(3) The user is encouraged to confirm the standards and regulations that the system must
conform to.
(4) It is prohibited to copy, to reproduce, and to distribute a part or the whole of this guide
without the permission of OMRON Corporation.
(5) The information contained in this guide is current as of March 2018. It is subject to
change for improvement without notice.
The following notations are used in this guide.
Indicates a potentially hazardous situation whi ch, if not avoided, may result in minor or moderate injury or property damage.
Precautions on what to do and what not to do to ensure saf e usage of the product.
Precautions for Correct Use
Precautions on what to do and what not to do to ensure proper operation and performance.
Additional information to read as required.
The triangle symbol indicates precautions (including warnings). The specific operation is shown in the triangle and expl ained in the text. This example indicates a general precaution.
The filled circle symbol indicates operations that you must do. The specific operation is shown in the circl e and explained in the text. This example shows a general precaution for something t hat you must do.
Page 7
4

4. Overview

Serial communications
(RS-485)
Digital Temperature
Controller
Command data
Response data
This guide describes procedures for connecting a Di gital Temperature Controller (E5D, E5C or E5□C-T) to a CJ-series Programmable Controller + Ser i al Communications Unit (hereinafter referred to as the "PLC") via serial communications, both produced by OMRON Corporation (hereinafter referred to as "OMRON"), and f or checking their communication status. Refer to Section 6. Serial Communications S ettings and Section 7. Serial Communication s Connection Procedure to understand setting methods and key points to send or receive a message via serial communications. The ladder program in the prepared CX-Programmer project file is used to check the serial connection by sending or receiving a message of ''Properties Read'' to/from the Digital Temperature Controller.
■The send/receive messages of "Properties Read ''
4.Overview
PLC
Sending command data Executing the command
Receiving response data
and storing in memory
Prepare the CX-Programmer project file and the C X-Protocol project file with latest versi ons beforehand. To obtain the project files, contact your OMRON representative.
Name File name Version CX-Programmer project file (extension: cxp) CX-Protocol project file (extension: psw)
This guide aims to explain wiring methods and communications settings necessary to connect corresponding devic es and provides the setting procedures. The program used in this guide is not designed to be cons tantly used at a site but is designed to check if the c onnection is properly established. Both functionalities and performances are therefore not fully considered for the program. When you actually construct a system, please us e the wiring methods, communications settings and setting procedures described in this guide as a reference, and design a program according to you r appl ication needs.
P704_CJ_CWF485_OMRON_E5CD_V100.cxp Ver.1.00
P704_CJ_CWF_OMRON_E5CDV100.psw Ver.1.00
Returni ng response data
Page 8
5

5. Applicable Devices and Device Configuration

OMRON
CJ2 CPU Unit
CJ2□-CPU□□
CJ1W-SCU□2
E5CD-□□2□□M-002
E5EC-T□□4SM-022

5.1. Applicable Devices

5.Applicable Devices and Device Configuration
The applicable devices are as follows:
Manufacturer Name Model
OMRON Serial Communications Unit CJ1W-SCU1-V1
OMRON Digital Temperature Controller
E5CD-□□2□□M-004 E5ED-□□4□□M-004 E5ED-□□4□□M-008 E5ED-□□4□□M-022 E5CC-□□□□□M-002 E5CC-□□□□□M-003 E5CC-□□□□□M-004 E5AC-□□□□SM-004 E5AC-□□□□SM-008 E5AC-□□□□SM-009 E5AC-□□□□SM-012 E5AC-□□□□SM-014 E5EC-□□□□□M-004 E5EC-□□□□□M-008 E5EC-□□□□□M-009 E5EC-□□□□□M-012 E5EC-□□□□□M-014 E5DC-□□□□□M-002 E5DC-□□□□□M-015 E5GC-□□□□□M-015 E5CC-T□□3SM-002 E5CC-T□□3SM-003 E5CC-T□□3SM-004 E5AC-T□□4SM-004 E5AC-T□□4SM-008 E5AC-T□□4SM-020 E5AC-T□□4SM-022 E5EC-T□□4SM-004 E5EC-T□□4SM-008 E5EC-T□□4SM-020
Page 9
5.Applicable Devices and Device Configuration
6
Precautions for Correct Use
Additional Information
In this guide, the devices with models and versions listed in 5.2. Device Configuration are used as examples of applicable devices to des cribe the procedures for connecting the devices and checking their connection. You cannot use devices with versions lower than the versions li st ed in 5.2. To use the above devices with models not listed in 5.2. or versions higher than t hose listed in
5.2., check the differences in the specifications by referring to t he manuals before operating the devices.
This guide describes the procedures for establi shing the network connection. It does not provide information on operation, installation, wiring method, device functional it y, or device operation, which is not related to the connection procedures. Refer to the manuals or contact your OMRON representative.
Page 10
5.Applicable Devices and Device Configuration
7
OMRON
Serial Communications Unit
CJ1W-SCU42
Ver.2.0
OMRON
CJ2 CPU Unit
CJ2M-CPU12
Ver.2.0
OMRON
Power Supply Unit
CJ1W-PA202
OMRON
CX-One
CXONE-AL□□C-V4
/AL□□D-V4
Ver.4.□□ OMRON
CX-Programmer
(Included in CX-One)
Ver.9.65
OMRON
CX-Protocol
(Included in CX-One)
Ver.1.992
OMRON
CX-Programmer project file
P704_CJ_CWF485_ OMRON_E5CD_V100.cxp
Ver.1.00
OMRON
CX-Protocol project file
P704_CJ_CWF_OMRON_ E5CD_V100.psw
Ver.1.00
-
Personal computer (OS: Windows 7)
-
-
USB cable (USB 2.0 type B connector)
-
-
Serial cable (RS-485)
- OMRON
Digital Temperature Controller
E5CD-RX2A6M-002
Precautions for Correct Use
Precautions for Correct Use
CJ2M-CPU12+ CJ1W-SCU42
Personal computer OS: Windows 7)
Serial cable (RS-485)
E5CD-RX2A6M-002

5.2. Device Configuration

The hardware components to reproduce the connect i on procedures in this guide are as follows:
(CX-One installed,
Manufacturer Name Model Version
USB cable
Prepare the CX-Programmer project file and t he CX-Protocol projec t file with latest vers ions beforehand. To obtain the project files, contact your OMRON representative.
Update CX-Programmer and CX-Protocol to t he versions specified in this Clause 5.2. or to higher versions. If you use a version higher than the one specified, the procedures and related screenshots described in Section 7. and the subsequent sections may not be applicable. In that case, use the equivalent procedures described in this guide by referring to the CX-Programmer OPERATION MANUAL (Cat. No. W446) and the CX-Protocol OPERATION MANUAL (Cat. No. W344).
Page 11
8
Precautions for Correct Use
Additional Information
Additional Information
Turn ON the terminating resistance switch on Serial Communications Unit and connect terminating resistance to the terminals of the Digital Temperat ure Controller at either end of the RS-422A/485 transmission path.
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 Unit s OPERATION MANUAL (Cat. No. W336).
The system configuration in this guide uses USB for the connection between the personal computer and the PLC. For information on how to install the USB driver, refer to A-5 Installing the USB Driver of the CJ-series CJ2 CPU Unit Hardware USER'S MANUAL (Cat. No. W472).
5.Applicable Devices and Device Configuration
Page 12
6.Serial Communications Settings
9
Precautions for Correct Use
program by changing both the CIO area and the cont rol data of the PMCR instruction.

6. Serial Communications Settings

This section describes the parameters and cable wiri ng, which are set up in this guide.

6.1. Parameters

The following parameters are required to connect the PLC and the Digital Temperature Controller via serial communications.
Setting item
Unit No. 0 ­Communications Unit No. (slave address) Serial communications port (connection) Terminating resistance Terminating resistance ON
2-wire or 4-wire 2-wire (WIRE: 2) 2-wire (fixed) Serial communications mode Data length (transmission character) Stop bits 2 bits (default) 2 bits (default) Parity (parity bit) Even (default) Even (default) Baud rate 9,600 bps (default) 9,600 bps (default) Protocol macro transmission method Communications method - CompoWay/F (default) Send data wait time - 20 m s (default)
(Serial Communications Unit)
- 1 (default)
Port 1 (RS-422A/485) -
(TERM: ON)
Protocol macro -
7 bits (default) 7 bits (default)
Half-duplex (default) -
PLC
Digital Temperature
Controller
-
The connection procedure described in this gui de assumes that the following Serial Communications Unit, port and unit number are used.
Model: CJ1W-SCU42 Serial communications port: Port 1 Unit No.: 0
If you connect devices under different conditions, refer to Section 9. Program and create a
Page 13
6.Serial Communications Settings
10
Pin No.
Symbol
Signal name
Input/Output
Pin No.
Signal name
Input/Output
13
B(+)
Input/Output
SDB+
4
Additional Information
T erminating r esistance

6.2. Cable Wiring

For details on cable wiring, refer to SECTION 3 Install ati on and Wiring of the CJ Series Serial Communications Units OPERATION MANUAL (Cat. No. W336).
Check the connector configurations and pin assignments before wiring.
■Connector configuration and pin assignment Serial Communications Unit (CJ1W-SCU42) applicable connector: Terminal block
1 (See note 1.) RDA Receive data - Input 2 (See note 1.) RDB Receive data + Input 3 (See note 1.) SDA Send data - Output 4 (See note 1.) SDB Send data + Output 5 (See note 2.) FG Shield -
Note 1: For 2-wire connection, use either pins 1 and 2 or pins 3 and 4.
2: Pin 5 (Shield) is connected to the GR terminal on the Power Supply Unit though the
Serial Communications Unit. The cable shield can thus be grounded if you g round the GR terminal of the Power Supply Unit.
Digital Temperature Controller (E5CD) applicable connector: Terminal block
1-12
14 A(-) Input/Output 15-18
■Cable and pin assignment
Serial Communications
Unit (CJ1W-SCU42) RS-422A/ 485 interface
Signal name RDA- 1 13 RDB+ 2 14 SDA- 3
FG 5
Terminal block Terminal block
Digital Temperature Controller
Pin No. Terminal
No.
*Connect 120 Ω (1/2 W) terminating resistance
between B(+) and A(-) of the Digital Temperature Controller that is connected at the end of the network.
E5CD
Signal name B(+) A(-)
RS-485 interface
For information on the connector configurations and pin assignments of the other models, refer to their respective manuals.
Page 14
7.Serial Communications Connection Procedure
11
Setup
Set up the Digital Temperature Controller. Set parameters for the Digital Temperature
Controller.
7.3. PLC Setup
Set up the PLC.
Set the hardware switches on the Serial Communications Unit and connect the cables .
Going Online with the PLC
Start CX-Programmer, open the project file, and go Create an I/O table for the PLC.
Set parameters for the Serial Communications Unit.
Transfer the created project data to the PLC.
Start CX-Protocol and open the project file.
Go online with CX-Protocol and transfer the

7. Serial Communications Connection Procedure

This section describes the procedures for connecting the PLC to the Digital Temperature Controller via serial communications. The procedures for setting up the PLC and the Digital Temperature Controller in this guide are based on the factory default settings. For the initialization, refer to Section 8. Initialization Method.

7.1. Work Flow

Take the following steps to connect the PLC and the Digital Temperature Controller via serial communications and to send or receive a message.
7.2. Digital Temperature Controller
7.2.1. Parameter Settings
7.3.1. Hardware Settings
7.3.2. Opening the Project File and
7.3.3. Creating an I/O Table
7.3.4. Parameter Settings
7.3.5. Transferring the Project Data
7.3.6. Starting CX-Protoc ol and
Opening the Project File
online with the PLC.
7.3.7. Going Online and Transferring the Protocol Data
protocol data to the Serial Communications Unit.
Page 15
7.Serial Communications Connection Procedure
12
Check
written to the I/O memory of the PLC.
7.4. Serial Communication Status
7.4.1. Starting the Trace Start traci ng with CX-Protocol.
7.4.2. Executing the Communications
Sequence
7.4.3. Checking the Trace Data Check that correct data is sent and received, using
7.4.4. Checking Received Dat a With CX-Programmer, check that correct data is
Start the send/receive processing and confirm that
serial communications performs normall y.
Execute the com m unications sequence with
CX-Programmer.
the trace data in CX-Protocol.
Page 16
7.Serial Communications Connection Procedure
13
1
manuals.
2
(Down) Key
3
4
Serial cable

7.2. Digital Temperature Controller Setup

Set up the Digital Temperature Controller.

Parameter Settings 7.2.1.

Set parameters for the Digital Temperature Controller.
Connect the power supply and a serial cable to the terminal block located on the back of Digital Temperature Controller.
*Only the parameters in
Communications Setting Level are described in this guide. If you use the parameters in Adjustment Level that is specific to each of the models, refer to their respective
(RS-485)
Check the positions of each of the keys, No.1 and No. 2 displays and Operation indicators.
In this guide, the keys are described as follows:
L (Level) Key M (Mode) Key U (Up) Key
D
Turn ON Digital Temperature Controller. The current temperature is displayed on No. 1 display once Digital Temperature Controller is turned ON. (Operation Level)
Press the L (Level) Key for at least 3 seconds.
L (Level) Key for at least 3 seconds
Page 17
7.Serial Communications Connection Procedure
14
"in-t" (Initial Setting Level) is
5
displayed on No. 1 display.
Press the L (Level) Key again for less than 1 second.
The display changes to
6
Communications Setting Level. "psel" (Protocol Setting) and "cwf" (CompoWay/F) are displayed on No. 1 and No. 2 displays, respectively.
*If the setting value is different,
press the U (Up) or D (Down) Key to change the parameter.
Press the M (Mode) Key. "u-no" (Communications Unit
7
No.) is displayed. Check that Communications Unit No. is 1.
*If the setting value is different,
change it in the same way as step 6.
Press the M (Mode) Key.
"bps" (Communications Baud
8
Rate) is displayed. Check that Communications Baud Rate is 9.6 kbps.
*If the setting value is different,
change it in the same way as step 6.
Press the M (Mode) Key.
L (Level) Key
< Setting value>
CWF / Mod (default: CWF)
CWF: CompoWay/F Mod: Modbus-RTU
M (Mode) Key
<Setting value>
0 to 99 (default: 1)
M (Mode) Key
<Setting value>
9.6, 19.2, 38.4 or
57.6 kbps (default: 9.6)
M (Mode) Key
Page 18
7.Serial Communications Connection Procedure
15
"len" (Communications Data
9
Length) is displayed. Check that Communications Data Length is 7 bits.
*If the setting value is different,
change it in the same way as step 6.
Press the M (Mode) Key.
"sbit" (Communications Stop
10
Bits) is displayed. Check that Communications Stop Bits is 2 bits.
*If the setting value is different,
change it in the same way as step 6.
Press the M (Mode) Key.
"prty" (Communications Parity)
11
is displayed. Check that Communications Parity is EVEN.
*If the setting value is different,
change it in the same way as step 6.
Press the M (Mode) Key.
"sdwt" (Send Data Wait Time) is
12
displayed. Check that Send Data Wait Time is 20.
*If the setting value is different,
change it in the same way as step 6.
Press the L (Level) Key for less than 1 second.
<Setting value>
7 or 8 bits (default: 7)
M (Mode) Key
<Setting value>
1 or 2 bits (default: 2)
M (Mode) Key
<Setting value>
NONE, EVEN or ODD (default: EVEN)
M (Mode) Key
<Setting value>
0 to 99 ms (default: 20)
L (Level) Key
Page 19
7.Serial Communications Connection Procedure
16
15
"in-t" ((Initial Setting Level) is
13
displayed.
Press the L (Level) Key for at least 1 second.
The display returns to Operation
14
Level as shown in step 4.
Turn OFF Digital Temperature Controller.
L (Level) Key for at least 1 second
Page 20
7.Serial Communications Connection Procedure
17
be applicable.
2
3 4
5
TERM (Terminating resistance ON/OFF switch) WIRE (:2-wire or 4-wire switch)
2: 2-wire, 4: 4-wire

7.3. PLC Setup

Set up the PLC.

Hardware Settings 7.3.1.

Set the hardware switches on the Serial Communications Unit and connect the cables.
Precautions for Correct Use
Make sure that the power supply is OFF when you set up. If it is ON, the settings described in the following steps and subsequent procedures may not
Make sure that PLC is powered
1
OFF. Check the positions of the hardware switches and Port 1 on the front panel of Serial Communications Unit by referring to the figure on the right.
Set Unit number switch to 0. The unit number is set to 0 as the factory default setting.
Set Terminating resistance ON/OFF switch to ON. (Terminating resistance ON).
Set 2-wire or 4-wire switch to 2 (2-wire).
OFF: Terminating resistance OFF ON: Terminating resistance ON
Page 21
18
Connect Serial Communications
PLC
Serial Communications Unit
End Cover
Serial cable
(RS-485)
Personal
USB cable
CPU Unit
Power Supply Unit
6
Unit to PLC as shown on the right.
Connect Digital Temperature Controller and Port 1 on Serial Communications Unit with the serial cable.
Connect Personal computer and PLC with a USB cable.
7.Serial Communications Connection Procedure
computer
Page 22
7.Serial Communications Connection Procedure
19
1
Temperature Controller.
2
CX-Programmer.
3
5
6

Opening the Project File and Going Online with the PLC 7.3.2.

Start CX-Programmer, open the project file, and go online with the PLC. Install CX-Programmer and the USB driver on your personal computer beforehand.
Turn ON PLC and Digital
Start CX-Programmer.
*If the User Account Control
Dialog Box is displayed at start, make a selection to start
CX-Programmer starts up.
Select Open from the File Menu.
4
The Open CX-Programmer Project Dialog Box is displayed. Select P704_CJ_CWF_OMRON _E5CD_V100.cxp and click Open.
*Obtain the project file from
OMRON.
After opening the project file, select Programs in the project workspace.
(Project workspace)
Page 23
20
Select Change Model from the
8
9
7
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 guide.
7.Serial Communications Connection Procedure
The Device Type Settings Dialog Box is displayed. From the pull-down list of CPU Type, select the CPU type to use. Click OK.
*CPU12 is selected in this guide.
Page 24
7.Serial Communications Connection Procedure
21
11
Check that the network type is
10
set to USB in the Change PLC Dialog Box. Click OK.
*If not, select USB from the
pull-down list.
*If you have changed the device
type in step 8 or the CPU type in step 9, the dialog box on the right will be displayed. Confirm that there is no problem, and click Yes. Make sure that the program has been converted normally. ("0 errors" must be shown.) (Although the duplicated output warnings are detected as shown on the right, they are not problems.)
Select Programs in the project workspace.
Select Work Online from the PLC Menu.
Page 25
22
The dialog box on the right is
during online connection.
Additional Information
12
displayed. Confirm that there is no problem, and click Yes.
7.Serial Communications Connection Procedure
13
Check that CX-Programmer and PLC are online.
*The icon is pressed down
If the online connection to the PLC cannot be establi shed, check the cable connection. After checking the cable connection, return t o step 7, check the settings described in steps 8 to 10, and try online again. For details, refer to Connecting Directly t o a CJ2 CP U Unit Using a USB Cable of the CX-Programmer OPERATION MANUAL (Cat. No. W446).
Additional Information
Some dialog boxes described in this guide may not be displayed depending on the environmental settings of CX-Programmer. For details on the environmental settings, refer to
Options and Preferences in CHAPTER 3 Projec t Reference of the CX-Programmer OPERATION MANUAL (Cat. No. W446).
The procedures with CX-Programmer in t his guide assume that the check box ''Confirm all operations affecting the PLC'' has been selected on the PLCs Tab Page.
Page 26
23

Creating an I/O Table 7.3.3.

1
(Project workspace)
Precautions for Correct Use
Create an I/O table for the 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.
(2)The dialog box on the right is
displayed. Confirm that there is no problem, and click Yes.
*Refer to Additional Information
on the previous page for the settings concerning the dialog display.
(3)Check that Stop/Program
Mode is displayed to the right of the PLC model in the project workspace of CX-Programmer.
7.Serial Communications Connection Procedure
Select Edit - I/O Table and Unit
2
Setup from the PLC Menu in CX-Programmer.
The PLC I/O table Window is displayed.
The PLC will be reset after creating and transferring an I/O table in step 3 and the subsequent steps. Always confirm safety before creating and transferring an I/O table.
Page 27
24
Select Create from the Options
3
Menu of the PLC IO Table Window.
The dialog box on the right is displayed. Confirm that there is no problem, and click Yes.
The dialog box on the right is displayed. Confirm that there is no problem, and click Yes.
7.Serial Communications Connection Procedure
The Transfer from PLC Dialog
4
Box is displayed. Select IO Table and SIO Unit Parameters. Click Transfer.
When the transfer is completed, the Transfer Results Dialog Box is displayed. Check that the transfer is successfully completed by referring to the message in the dialog box. When an I/O table is created successfully, the dialog box displays as follows: Transfer Success: 1 Unit Transfer Unsuccessful: 0 Unit
Click OK.
Page 28
7.Serial Communications Connection Procedure
25
1
2
3

Parameter Settings 7.3.4.

Set parameters for the Serial Communications Uni t.
Double-click [0000] Main Rack in the PLC IO Tabl e Window to expand the tree.
Right-click 00 [1500]
CJ1W-SCU42 and select Unit Setup.
The View Parameters Dialog Box is displayed. Select Port1: Protocol macro Settings from the pull-down list of Displayed Parameter.
*This setting is required to use
Port 1 of Serial Communications Unit.
Page 29
26
The setting items of "Port1:
5
6
4
Protocol macro Settings" are listed as shown in the figure on the right. (The figure on the right shows the default values.)
Select User settings from the pull-down list of Set Value for "Port1: Port settings".
7.Serial Communications Connection Procedure
Set the following parameters in the same way as step 5.
Serial communications mode:
Protocol macro
・Data length: 7 bits ・Stop bits: 2 bits ・Parity: Even ・Baud rate: Default(9600bps)
Protocol macro Transmission
method: Half-duplex
*Use the default values for other
parameters.
Click Transfer[PC to Unit].
Page 30
27
The dialog box on the right is
8
9
7
displayed. Confirm that there is no problem, and click Yes.
Check that the transfer is completed as shown on the right. Click Close.
7.Serial Communications Connection Procedure
The dialog box on the right is displayed. Check the contents and click Yes.
The Select Port Dialog Box is displayed. Select All ports and click OK.
The dialog box on the right is displayed. Check the contents and click OK.
Page 31
28
Click Compare in the View
12
13
10
Parameters Dialog Box.
7.Serial Communications Connection Procedure
Check that a message stating
11
"Compare successful" is displayed as shown on the right. Click Close.
Click OK in the View Parameters Dialog Box.
Select Exit from the File Menu of the PLC IO Tabl e Window to close.
Page 32
29
1
2
3
7.Serial Communications Connection Procedure

Transferring the Project Data 7.3.5.

Transfer the created project data to the 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 already set in 7.3.3. Creating
an I/O Table and 7.3.4. Parameter Settings.
*The Comments and the
Program index Check Boxes
may not be displayed depending on the device type. In that case, select Program(s) only and transfer the project data.
The dialog box on the right is displayed. Confirm that there is no problem, and click Yes.
Page 33
30
The dialog box on the right is
5
6
4
displayed (stating "Download successful") when the transfer is completed. Click OK.
Select Programs in the project workspace. Select Transfer - Compare with PLC from the PLC Menu.
7.Serial Communications Connection Procedure
Select Program(s) and click OK.
Check that a message is
7
displayed stating "Compare successful". Click OK.
Page 34
7.Serial Communications Connection Procedure
31
1
CX-Protocol.
2
3
Project Window
Project Output
Window

Starting CX-Protocol and Opening the Project File 7.3.6.

Start CX-Protocol and open the project file.
Start CX-Protocol.
*If the User Account Control
Dialog Box is displayed at start, make a selection to start
Start CX-Protocol.
The following panes are displayed in this window.
Top left: Project Workspace Bottom left: Output Window Right: Project Window
Workspace
Select Open from the File Menu.
The Open Dialog Box is
4
displayed. Select P704_CJ_CWF_ OMRON_E5CD_V100.psw and click Open.
*Obtain the project file from
OMRON.
The project data read are
5
displayed in both the Project Workspace and the Project Window.
Page 35
7.Serial Communications Connection Procedure
32
1
display a tree.
2

Going Online and Transferring the Protocol Data 7.3.7.

Go online with CX-Protocol and transfer the protoc ol data to the Serial Communications Unit.
Double-click P704_CJ_ CWF_OMRON_E5CD_V100 in the Project Workspace to
Select Edit PC-PLC Comms Settings from the PLC Menu.
The Change PLC Dialog Box is
3
displayed. From the pull-down list of Device Type, select the device type of PLC to use. Click Settings.
*CJ2M is selected in this guide.
Page 36
33
The Device Type Settings
5
6
4
Dialog Box is displayed. From the pull-down list of CPU Type, select the CPU type to use. Click OK.
*CPU12 is selected in this guide.
7.Serial Communications Connection Procedure
Check that the network type is set to USB in the Change PLC Dialog Box. Click OK.
*If not, select USB from the
pull-down list.
Select Connect to PLC from the PLC Menu.
Page 37
34
In the Project Workspace, the
following step 8.
8
9
10
7
PLC mode displayed next to the PLC Icon changes from Offline to Program. It means that PLC is online and in operating mode.
*If the other operating mode
(Monitor or Run) is displayed, change it to Program mode by
If the operating mode is Monitor mode or Run mode in step 7, select Operating Mode ­Program from the PLC Menu.
The dialog box on the right is displayed. Confirm that there is no problem, and click Yes. Check that the operating mode changes to Program mode as shown in step 7.
7.Serial Communications Connection Procedure
Double-click New Protocol List in the Project Workspace to display a tree.
The Project Window on the right is displayed. Check that SCU [0] is selected in the Target Column.
*If SCU [0] is not shown, select
SCU [0] as shown in the figure on the right.
Click New Protocol List in the
11
Project Workspace and select Download Protocols from the Protocol Menu.
Page 38
35
The dialog box on the right is
13
14
12
displayed. Select Include Source Information and click
Compile.
The compiling is complete when 100% is displayed in the Complied % Column. Click Download after checking that the compiling is completed.
7.Serial Communications Connection Procedure
The dialog box on the right is displayed. Confirm that there is no problem, and click OK.
Page 39
36
Check that 100% is displayed in
16
17
15
the Downloaded % Column as shown on the right. Click Close.
Select Compare Protocols from the Protocol Menu.
7.Serial Communications Connection Procedure
The dialog box on the right is displayed. Select Include Source Information and click Compile.
Page 40
37
The compiling is complete when
19
20
18
100% is displayed in the Complied % Column. Click Compare after checking that the compiling is completed.
The dialog box on the right is displayed. Check that Successful is displayed in the Result Column. Click OK.
7.Serial Communications Connection Procedure
Check that 100% is displayed in the Compared % Column as shown on the right. Click Close.
Page 41
7.Serial Communications Connection Procedure
38
Precautions for Correct Use
If not, turn OFF both devices, and then connect the seri al cable.
1 3
4

7.4. Serial Communication Status Check

Start the send/receive processing and confirm that serial communications performs norm al ly.
If the PLC memory is changed by malfunction during the monitoring of power flow and present value status in the Ladder Section Window or in the Watch Window, the devices connected to Output Units may malfunction, regardless of the operating mode of the CPU Unit. Always ensure safety before monitoring power fl ow and present value status in the Ladder Section Window or in the Watch Window.
Check that the serial cable is connected before performing the following procedure.

Starting the Trace 7.4.1.

Start tracing with CX-Protocol.
Select Operating Mode - Monitor from the PLC Menu in CX-Protocol.
The dialog box on the right is
2
displayed. Confirm that there is no problem, and click Yes.
Check that the operating mode changes to Monitor mode.
Double-click NewPLC1.
The tree under NewPLC1 expands.
Select Serial Communications Unit. (SCU [0] is selected as shown on the right.)
Page 42
39
Select the Trace 1 Icon ( ) in
of Serial Communications Unit.
6
7
5
the Project Window. (Check that the Trace 1 is highlighted as shown in the figure on the right.)
*Trace 1 corresponds to Port 1
Select Start Trace - One Shot Trace from the PLC Menu.
Check that the status of Trace 1 in the Project Window changes to One-shot Trace Running.
7.Serial Communications Connection Procedure
Page 43
7.Serial Communications Connection Procedure
40
1

Executing the Communications Sequence 7.4.2.

Execute the communications sequence with CX-Programmer.
Expand the tree under Programs in the project workspace of CX-Programmer and double-click Section1. The Ladder Section Window shows the Section1 ladder program.
Ladder section window
In the Ladder Section Window,
2
right-click Input_Start and select Set - On.
Check that the Input_Start
3
contact is turned ON as shown in the figure on the right.
Page 44
7.Serial Communications Connection Procedure
41
1
2
3
Second row of receive message: in hexadecimal

Checking the Trace Data 7.4.3.

Check that correct data is sent and received, using the trace data in CX-Protocol.
Select Upload Trace from the PLC Menu in CX-Protocol.
*Once the trace data is stored,
the menu item "Upload Trace" will be selectable.
The dialog box on the right is displayed. Check the contents and click Yes.
Check the receive message in the trace data file as shown in the figure on the right.
(In the example on the right, "45 35 43 44 2D 52 58 32 41 36" in hexadecimal and "E5CD-RX2A6" in string are received as properties of the Digital Temperature Controller.)
*The example shows that the
received data (properties of Digital Temperature Controller) is "E5CD-RX2A6" in string; however, the received data varies depending on Digital Temperature Controller used.
First row of receive message: in string
Page 45
7.Serial Communications Connection Procedure
42
1
3

Checking Received Data 7.4.4.

With CX-Programmer, check that correct data is written to the I/O memory of the PLC.
Select Edit - Memory from the PLC Menu in CX-Programmer.
Double-click CIO in the Memory
2
Tab of the PLC Memory Window.
Enter 5500 in the Start Address Field of the CIO Area. Check that the start address changes to CIO5500.
Page 46
43
Select Monitor from the Online
5
6
Settings.
4
Menu.
The Monitor Memory Areas Dialog Box is displayed. Select CIO and click Monitor.
7.Serial Communications Connection Procedure
Check received data (properties of Digital Temperature Controller) in the CIO Area as shown on the right.
*In the example on the right, the
stored data starting from CIO5503 is in hexadecimal and is described as follows: 4535 4344 2D52 5832 4136
These values can be expressed as a string “E5CD-RX2A6” which is the same as the trace data described in step 3 of 7.4.3. Checking the Trace Data.
*The number of words being
used (0009 in hexadecimal) is stored in CIO5500. The properties of Digital Temperature Controller are stored in the addresses from CIO5503 to CIO5507.
*For details, refer to 9.2.2.
PMCR Instruction Operand
Page 47
8.Initialization Method
44

8. Initialization Method

The setting procedures in this guide are based on the f actory default settings. Some settings may not be applicable unless you use the devices with the factory default settings.

8.1. Initializing a PLC

To initialize the settings of a PLC, it is necessary to initialize a Serial Communications Unit and a CPU Unit. Change the operating mode of the PLC to PROG RAM mode before the initialization.

Serial Communications Unit 8.1.1.

To initialize the settings of a Serial Communications Unit, select Edit - I/O Table and Unit Setup from the PLC Menu in CX-Programmer and perform the following steps.
(1) Right-click Serial Communications Unit in the PLC IO Table Window and select Unit Setup
from the menu.
(2) In the CJ1W-SCU42 [View Parameters] Dialog Box, click Set Defaults first, then click
Transfer[PC to Unit].
Page 48
8.Initialization Method
45

CPU Unit 8.1.2.

To initialize the settings of a CPU Unit, 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
OK.

8.2. Initializing a Digital Temperature Controller

To initialize the settings of a Digital Temperature Controller, refer to Parameter Initialization in 6-8 Advanced Function Setting Level of the Digital Temperature Controllers User's Manual
(Cat. No. H224/H174/H185).
Page 49
9.Program
46
Additional Information

9. Program

This section describes the details on the program used in this guide.

9.1. Overview

The following explains the specificat i ons and functions of the program that are used to check the connection between the Digital Temperature Controller (hereinafter referred to as the "Destination Device") and the PLC (Serial Communications Unit (hereinafter referred to as the "SCU")).
This program uses the protocol macro function of the SCU, to send/receive the "Properties Read" command to/from the Destination Device and detect a normal end or an error end. A normal end of the send/receive processing means a normal end of the communications sequence. An error end means an error end of the communications sequence and an error of the Destination Device (identified in the response data from the Destination Device)
Here, the prefix "&" is added to decimal dat a and the prefix "#" is added to hexadec imal data when it is necessary to distinguish between decimal and hexad ecimal data. (e.g. , "&1000 " for decimal data and "#03E8" for hexadecimal data)
OMRON has confirmed that normal communic ations can be performed using this program under the conditions of 5.2. Device Configuration. However, we do not guarantee the normal operation under disturbances such as electri cal noise or device performance variation.
Page 50
9.Program
47
PLC
Digital Temperature
Controller
CPU Unit
SCU
Protocol data
Response data
(2) Sends command data.
(Sequence No. 618)
storage area
(4) Receives the
(Sequence No. 618)
Command data
(1) Executes the PMCR
(Specifying the sequence No. 618)
(3) Executes the
response data.
PMCR
Sequence No. 1
Sequence No. 2
Sequence No. 618
setting area

Outline of Processing 9.1.1.

The following figure shows the data flow from when the PLC (SCU) sends command data to Destination Device via serial communicat ions until the PLC receives response data from the Destination Device.
(1)The ladder program executes the PMCR instruction for which the communications
sequence No. 618 is specified.
(2)The PLC reads the parameters (which are s et in the send data setting area) according to
the send message defined by the communications sequence No. 618, and sends command data to Digital Temperature Controller.
(3)The Digital Temperature Controller executes the command by receiving the command data
from the PLC, and returns response data to the PLC.
(4)The PLC receives the response data from Digital Temperature Controller according to the
receive message defined by the communicat i ons sequence No. 618, and stores the data in the response data storage area.
Ladder program
instruction.
CIO 5020 onwards
Send data
CIO 5501 onwards
Response data
RS-485
command and returns
response data and stores it in the specified memory.
Page 51
9.Program
48
Additional Information
No. W474).

PMCR Instruction and Send/Receive Messages 9.1.2.

The following describes the PMCR instruction and t he general operat ion of sending/ receiving a message.
For details, refer to Serial Communications I nst ructions (PMCR) in SECTION 3 Instructions of the CJ Series Programmable Controllers INST RUCT IONS REFERENCE MANUAL (Cat.
●PMCR Instruction Operands
Page 52
9.Program
49
Control word:
C1
+0 word
*
* * *
0
15
Bits
Unit address of Destination Device
Serial port No. (physical port)
Communications port No. (Internal logical port)
Control word: C2
+0 word
* * *
*
Communications sequence No. &0 to 999 (#0000
to 03E7)
0
15
Bits
Send area: S No. of send area words
+0 word
+1 word
+2 words
words
(n
-1) words
* * * * * * *
*
0
15
Bit
* * * * * * * * * * *
*
+3 words
* * *
*
Data
0
15 0 15 0 15 0
15 0
15
Receive area: R
No. of receive area words
+0 word
+1 word
+2 words
…words
(m-1) word
* * * * * * *
*
0
15
Bit
* * * * * * * * * * *
*
+3 words
* * *
*
Data
0
15 0 15 0 15 0 15 0 15
C1: Control word 1
The following three items are set for SCU.
Communications port No. (internal logical port): #0 to #7Serial port No. (physical port): #1 or #2 (#1: PORT1, #2: PORT2) Unit address of Destination Device: # unit number + #10
C2: Control word 2
The communications sequence number is set, which is registered as protocol data. For information on the communications sequenc e num ber registered in this protocol data, refer to 9.2.1 Communications Sequence Number.
[S: First send word (send area specification)]
The first word of the words required to send data is spec ified. S contains the number of words (n) to be sent. (i.e., including the S word) Between #0000 and #00FA (n=&0 and &250) words can be send. The send data (variable data) is entered in the words from S+1 to S+(n-1).
If there is no operand specified in the execution sequence, such as a direct or linked word, set constant #0000 for S.
[R: First Receive Word (receive area specification)]
The number of receive words (m) is automaticall y stored in R (i.e., including the R word). The received data is stored in the words from R+1 to R+(m-1). (m=&0 to &250 or #0000 to #00FA)
Page 53
9.Program
50
Send message
PLC
Receive message
Destination
Device
CR
LF * * * * * *
Terminator
Data
CR
LF
* * * * *
*
Data
Terminator
SCU → Destination
Device
Send message
CPU→SCU
Send area:S
+0
word
+1 word
+2 words
+(n-1) words
* * * * *
*
*
*
0
15 0 15 0 15 0 15
Bit
* * * * * * *
*
No. of send area words
CR
LF * * * * * *
Terminator
Data
Destination Device SCU
Receive message
SCU CPU
Receive area: R
+0 word
+1 word
+2 words
+(n-1) words
* * * * * * *
*
0
15 0 15 0 15 0 15
Bit
* * * * * * *
*
No. of receive
area words
CR
LF * * * * * *
Terminator
Data
●Send/Receive Messages
[Frames of send/receive messages]
[Relationship between send area S (PMCR inst ruction operand) and send message]
[Relationship between receive area R (PM CR i nstruction operand) and receive mess age]
Page 54
9.Program
51
618
Properties Read
Reads the properties of the Destination Devic e .
Word
Description (data type)
Data (description)
Communications port No. (1-digit hex)
Serial port No. (1-digit hex)
Unit address of Destination Device (2-digit hex)
Word
Description (data type)
Data (description)
C2
Communications sequence No.
&618 (Properties Read)
Word
Description (data type)
Data (description)
S
Number of send words (4-digit hex)
#0002 (send data: 2 words )
S+1
Node number
#0001 (destination node No.)
Word
Description (data type)
Data (description)
R
Number of receive words (4-digit hex)
Stores the number of words used, including the R word
R+1
End code (CompoWay/F) (UINT)
Stores the CompoWay/F end code.
R+2
MRES/SRES (FINS-mini) (UINT)
Stores the end code of the command execured on the Destination Device.
R+3
Model numbers 1 and 2 (WORD)
R+4
Model numbers 3 and 4 (WORD)
R+5
Model numbers 5 and 6 (WORD)
R+6
Model numbers 7 and 8 (WORD)
R+7
Model numbers 9 and 10 (WORD)
R+8
Buffer size (WORD)

9.2. Communications Sequence

The following describes the communications sequence that is used for the PMCR instruct i on in this program.

Communications Sequence Number 9.2.1.

A communications sequence that is registered in the SCU is identified by a communications sequence number. The Destination Device executes the command corresponding to the communications sequence number that is specified in the program for executing the PMCR instruction. The protocol data used in this guide includes the foll owing communications sequence.
No. Command name Description

PMCR Instruction Operand Settings 9.2.2.

The PMCR instruction operands for the comm uni cations sequence No. 618 (#026A) "Properties Read" are shown below.
Control word C1 setting (C1: CIO 5010)
C1
Control word C2 setting (C2: CIO 5011)
First send word S setting (S: CIO 5020)
First receive word R setting (R: CIO 5500)
#7110 (communications port No. 7,
serial port No. 1 and #unit number + #10)
Stores the read-out properties of the Destination Device.
Page 55
52

9.3. Error Detection Processing

Normal
message
STX
“01”
“00”
“00”
“03”
“05”
“00”
“00”
***
ETX
**
Send
Node
Sub
End
MRC
SRC
MRES
SRES
Data
Send
BCC
Start
No.
Address
code End
Error
message
STX
“01”
“00”
“**”
“03”
“05”
“**”
“**”
ETX
**
Send
Node
Sub
End
MRC
SRC
MRES
SRES
Send
BCC
start
No.
Address
code
end
Error
message
STX
“01”
“00”
“**”
ETX
**
Send
Node
Sub
End
Send
BCC start
No.
address
code
end
Additional Information
Serial cable
CJ2M-CPU12 CJ1W-SCU42
Destination Device
(1)
(2)
(3)
With this program, the error detection processing is performed according to the following descriptions (1) to (3). For information on error codes, refer to 9.8. Error Processing.
(1)Errors at the execution of the PMCR instruction (PMCR instruction errors)
An incorrect communications sequence number and an incorrect memory address, both of which prevent the execution of the PMCR instruc tion, are detected as PMCR instruction errors. If an error occurs, the error code (1519.00 to 03) wil l be generated to identify the error, which indicates the port operating status in the CIO area allocated to the SCU.
(2)Errors in communications with the Desti nation Device (Communications error)
Errors that occur in communications with the Des tination Device, such as character corruption and transmission errors caused by unmatched baud rate setting, are detected as communications errors. If an error occurs, the Sequence Abort End Completion flag (1519.10) in the CIO area allocated to the SCU will be turned ON to identify the error.
(3)Errors in the Destination Device (Destinat i on Device errors)
Destination Device errors include a command err or, a parameter error, a data error and an execution failure in the Destination Device. An error is identified in the response data that is returned from the Destination Device. Wit h this program, an error can be detected by comparing difference in frames between a receive message in normal (he reinafter referred to as a "normal message") and a receive message in error (hereinafter referred to as an "error message"). Refer to 9.6.6. Receive Message Settings for details.
9.Program
For information on the CIO area allocated to the SCU, refer to 9. 4.2 Lists of Allocations.
Page 56
53

9.4. Memory Maps

Precautions for Correct Use
The memory maps of this program are shown below.

Lists of Addresses 9.4.1.

The tables below list the addresses necessary t o execut e this program. You can change the allocations below to any addresses.
Make sure that there is no duplicated address when changing the addresses.
●Input memory The below addresses are used to operate this program.
Address Data type Variable name Description
5000.00 BOOL Input_Start Starts the send/receive process ing when this flag changes from OFF to ON.
5021 UINT Input_DestinationNodeNo Sets the node number of the Destin ation Device
(send destination).
9.Program
●Output memory The execution results of the program are stored in these addresses.
Address Data type Variable name Description
5000.02 BOOL Output_NormalEnd Turns ON when the send/receive processing ends normally.
5000.03 BOOL Output_ErrorEnd Turns ON when one or more of the following errors occur. (1) PMCR instruction error (2) Communications error (3) Destination Device error
5503 WORD Output_Model 1_2 Stores the model numbers 1 and 2 received from the
Destination Device.
5504 WORD Output_Model 3_4 Stores the model numbers 3 and 4 received from the
Destination Device.
5505 WORD Output_Model 5_6 Stores the model numbers 5 and 6 received from the
Destination Device.
5506 WORD Output_Model 7_8 Stores the model numbers 7 and 8 received from the
Destination Device.
5507 WORD Output_Model 9_10 Stores the model numbers 9 and 10 received from the
Destination Device.
5508 WORD Output_BufferSize Stores the buffer size received from the Destination
Device.
H400 UINT Output_PMCR_ErrorCode Stores the error code when a PMCR instruction error
or a communications error occurs.
Page 57
54
Address Data type Variable name Description
H402 UINT Output_DestinationDevice
H403 UINT Output_DestinationDevice
●Internal memory These addresses are used to operate this program onl y.
Address Data type
5000.01 BOOL Local_PMCRExecuting Indicates the PMCR instruction execution status.
5000.04 BOOL Local_PMCRNormalEnd Turns ON when the PMCR instruction ends normall y.
5000.05 BOOL Local_PMCRErrorEnd Turns ON when a communications error (such as a
5000.06 BOOL Local_DestinationDevice
5000.07 BOOL Local_PMCRError Turns ON when a PMCR instruction error (any of the
5010 UINT Local_ControlWord1 Execution parameter of the PMCR instruction. 5011 UINT Local_ControlWord2 Execution parameter of the PMCR instruction. 5012 UINT Local_PMCR_ErrorCode Stores the error code when a PMCR instruc tion error
5020 UINT Local_FirstSendWord Sets the number of send words of the PMCR
5500 UINT Local_FirstReceiveWord Stores the number of words received from the
5501 UINT Local_ResposeCode[0] Stores the er r or code of the Destination Device (end
5502 UINT Local_ResposeCode[1] Stores the er r or code of the Destination Device
ErrorCode[0]
ErrorCode[1]
Variable name Description
Error
9.Program
Stores the error code received from the Destination Device when an error occurs in the Destination Device. (CompoWay/F) Stores the error code received from the Destination Device when an error occurs in the Destination Device. (FINS-mini)
Turns ON when the PMCR instruction is being executed, and turns OFF when the PMCR instruction is not executed.
transmission error) occurs. Turns ON when a Destination Device error occurs.
following three errors) occurs.
(1) Sequence num ber error (2) Data read/write range error (3) Protocol data syntax error
occurs.
instruction.
Destination Device.
code of CompoWay/F) when a Destination Device error occurs.
(MRES/SRES of FINS-mini) when a Destination Device error occurs.
Page 58
9.Program
55
1509
UINT
ProtocolMacroErrorCode_SCU_0_P1
1509.15
BOOL
ProtocolMacroExecuting_SCU_0_P1
Additional Information
For details on the CIO area allocated to the SCU, refer to
of the
A202.07
BOOL
CommPortEnabledFlag_P7
Additional Information
For information on the related auxiliary area for the PMCR instruction, refer to

Lists of Allocations 9.4.2.

The tables below list the addresses necessary t o execut e this program.
●CIO area These addresses are allocated and fixed in the CIO area ac cordi ng to t he unit number (uni t address) that is set for the SCU. Unit number 0 is used in this program.
Address Data type Variable name
1509.10 BOOL SequenceAbortEndCompletion_SCU_0_P1
1509.11 BOOL SequenceEndCompletion_SCU_0_P1
2-3-2. CIO Area
Serial Communications Units OPERATION MANUAL (Cat. No. W336).
CJ Series
●Related auxiliary area The following address is allocated and fixed in the related auxiliary area according to the communications port number (logical port) that i s specified in the program (PMCR instruction operands). The communications port No. 7 is used in this program.
Address Data type Variable name
Auxiliary Area Words and Bits in Serial Communications Instructions (PMCR) in SECTION 3. Instructions of the CJ Series Programmable Contr ol lers INSTRUCTIONS REFERENCE MANUAL (Cat. No. W474).
Related
Page 59
56

9.5. Ladder Program

management
set.
management
error cause is set.

Functional Components of the Ladder Program 9.5.1.

The functional components of this program are shown below.
Major classification
1.Initialization processing
2.PMCR instruction execution management
3.Normal end state
Minor classification Description
1.1. Response code clear
1.2. Operand setting for PMCR instruction
1.3. Send/receive symbol setting
2.1. PMCR instruction executing
2.2. PMCR instruction execution processing
2.3. Normal/error detection processing
3.1. Normal end processing
3.2. Response code setting
The area of use is cleared, and the initialization setting is performed as a preparation for communications.
The communications sequence registered in SCU is identified and executed. A normal end or an error end is detected based on the related flags or receive data after the execution.
The normal completion flag is turned ON. The response code for a normal end is
9.Program
4.Error end state
4.1. Error end processing
4.2. Response code setting
The error end flag is turned ON. The response code corresponding to the
Page 60
57

Detailed Description of Each Functional Component 9.5.2.

setting
The program used in this guide is shown below.
●1. Initialization processing
9.Program
No. Name Description
1.1. Response code cl ear Clears the error code storage areas to zero.
1.2. Operand setti ng for PMCR instruction
1.3. Send/receive symbol
Sets execution parameters (operands) of the P MCR instruction. Initializes the receive data storage areas .
Page 61
58
●2. PMCR instruction execution management
Precautions for Safe Use
Precautions for Correct Use
No. Name Description
2.1. PMCR instruc tion executing
2.2. PMCR instruct i on execution processing
Enters the PMCR instruction executing status. The executing state is reset at a normal end or an error end of the send/receive processing. Executes the PMCR instruction under the following conditions.
- Communications port No.7 can be used.
- Protocol macro is not being executed.
9.Program
Thoroughly check the overall program before specifying an area to store the data that is received after the PMCR instruction. Otherwise, the dat a m ay be written to an unintended memory area.
The communications port No. 7 is used in this program. Do not use the communications port No.7 for other purpos es. If you have no choice but to use the communications port No. 7, chec k that Comm unicati ons Port Enabled Flag (A202.07) is ON.
Page 62
9.Program
59
No. Name Description
2.3. Normal/error detection processing
Detects a normal end or an error end, based on the results of send/receive processing. It is considered as a normal end when all the following conditions are met. (1)Normal end of PMCR instruction
(No PMCR instruction error)
(2)Normal end of communications sequence
(No communications error)
(3)Normal message received from the Destination Devi ce
(No Destination Device error) If any of these conditions is not met and an error occurs, the corresponding error flag will turn ON.
Page 63
60
●3. Normal end state management
No. Name Description
3.1. Normal end processing
3.2. Response code setting
9.Program
Turns ON the normal end flag if a normal end of the send/receive processing is detected in 2.3. Normal/error detection processing. Sets response code "#0000" for a normal end in the response code storage areas.
Page 64
61
●4. Error end state management
9.Program
No. Name Description
4.1. Error end processing T urns ON the error end flag if an error end of the send/receive
processing is detected in 2.3. Normal/error detection processing.
4.2. Response code setting
Additional Information
Refer to 9.8 Error Processing for informati on on the response codes.
Sets the response code corresponding to the error in the response code storage area when an error occurs.
Page 65
62

9.6. Protocol Data

・ ・
・ ・ ・
The protocol data consists of sequence, step, send/receive message and matrix. The protocol data structure is described as fol l ows:
●When there is only one receive message for a step (s end/receive once) One each of receive and send messages is set for a step.
Sequence No. 618 Step No. 00 Send message 00 Receive message 00
9.Program
Sequence No. xxx xxx: 999 max., yy: 15 max.
Step No. yy Send message yy Receive message yy
●When there is more than one receive message for a step (send/receive once)
・The send message and matrix are set for a step. ・More than one receive message is set in the case numbers 00 to 14 of matrix.
("Other" is automatically set in the case number 15.)
Sequence No. 900 Step No. 00 Send message 00 < Matrix >
Sequence No. xxx xxx: 999 max. Automatic setting in case No. 15 Case No.15 Other
yy: 15 max. zz: 14 max. Case No. zz Receive message zz
Case No. 00 Receive message 00
Step No. yy

Protocol Data Structure 9.6.1.

The protocol data in this guide uses a modified standard system protocol. There are three different receive messages (one normal message and two error messages) for the send message (SD PRO_R), and those messages are set in the matrix (MX PRO_R). The protocol data structure used in this guide is shown below.
(Standard system protocol before modification)
Sequence No. 618 Step No. 00 SD PRO_R RV PRO_R
(After modification)
Sequence No. 618 Step No. 00 SD PRO_R <MX PRO_R>
Case No. 00 RV PRO_R Case No. 01 RV FINSERR Case No. 02 RV COMFERR Case No. 15 Other
RV PRO_R for receiving a normal message RV FINSERR, RV COMFERR and Other for receiving an error message (Refer to 9.6.6. Receive Message Settings f or details.)
Page 66
9.Program
63
(End) ↓ (End)

Procedure of Protocol Data Processing 9.6.2.

The procedure of protocol data processing is shown bel ow.
1. [Step No. 00]
Sending the send message (SD PRO_R)
2. When step No.00 ends no rm ally When step No.00 ends in error
3. Next Process: Matrix
Executes the case No. 00, 01, 02 and
15, and terminates the
communications sequence as an
End.
Error Process: Abort
Aborts the step and ends the
communications sequence.
Page 67
9.Program
64
Additional Information
Item
Name
Description
Monitors the time from when the receive comm and of the step in
in this guide.
Receive
time
Monitors the time from reception of the first byte to reception of
guide.
Send finish
time
Monitors the time from transmission of the header to seconds in the protocol data used in this guide.

Sequence Settings 9.6.3.

The Destination Device executes the "Properties Read" command corresponding to the communications sequence No. 618 that is used in the protoc ol data in this guide. The communications sequence settings include the time for monitoring the send and receive processing (monitoring time).
For details on communications sequence sett ings, refer to 5-2 Creating Sequences and Steps of the CX-Protocol OPERATION MANUAL (Cat. No. W344).
●Monitoring time The monitoring time (Timer Tr, Tfr, and Tfs) that is set for the communications sequence is described below.
[Screenshot of the communications sequence settings]
[Settings]
Receive wait
Timer Tr
Timer Tfr
Timer Tfs
Additional Information
For information on the calculation method of monitori ng tim e, ref er to 4-5 Calculation Method of Monitoring Time of the CX-Protocol OPERATION MANUAL (Cat. No. W344).
monitoring
time
finish
monitoring
monitoring
the sequence is recognized until the first byte (header) i s received. This timer is set to 3 seconds in the protocol data us ed
the last byte of the data in the step in the sequence. This timer is set to 3 seconds in the protocol data used i n this
transmission of the last byte of the data. This timer is set to 3
Page 68
9.Program
65
Additional Information
Step No.
Retry count

Step Settings 9.6.4.

The step that is set for the communications sequence No. 618 is described below. The step settings include retry count, send/receive messages (message names), next process and error process. The sequence of the protocol data used in this guide consists of the step No. 00 only.
For details on the step settings, refer to 3-3 Step Attributes of the CX-Protocol OPERATION MANUAL (Cat. No. W344).
●Retry count The retry count that is set for the step is shown below. The step is repeated the number of designated times (0 to 9 times) when an error occurs. If the error still remains after the designated number of retry repetitions, the system goes to the error process. The retry count can be set only for steps in which the Send& Receive command is set.
[Screenshot of the step settings]
[Settings]
00 3
●Send/Receive messages (message names) The send/receive messages that are set for the step are shown below. Here, the registered send message name and matrix name are selected.
[Screenshot of the step settings]
[Settings]
Step No. Send message Receive message
00 SD PRO_R <MX PRO_R> The matrix is indicated with a pair of marks < > at t he beginning and end of a receive message. The matrix is used when more than one receive message exist s.
Page 69
9.Program
66
Process
Description
●Next process and error process The next process and error process that are both set for the step are shown below. The process set in the Next Column is executed when execution of the step ends normally. If a communications error occurs, the process set in the Error Column is executed.
[Screenshot of the step settings]
[Settings]
Step No. Next process Error process
00 Matrix Abort
[Process list]
End E nds the communications sequence.
Next Goes to the next step number.
Abort Aborts the step and ends the communications sequence.
Goto Goes to a designated step number.
Matrix Follows the next process that is set for each receive
message in the matrix.
Page 70
9.Program
67
Additional Information
(R(1),2): Converts 2-byte data and sends it from the word
(3)
“00”, “0”, “0503”
Constant ASCII

Send Message Settings 9.6.5.

The send message that is set in this guide is described belo w.
For details on the send message settings, refer to 3-4 Communication Message At tributes of the CX-Protocol OPERATION MANUAL (Cat. No. W344).
[Screenshot of the send message settings]
●[Send message (SD PRO_R)] [Settings]
<h>+<a>+”00”+”0”+”0503”+<t>+<c>
(1) (2) (3) (4) (5)
No. Code Description (1) <h > (Header) Type: Code, Data: 02 hex (2) <a > (Address)
$(R(1),2)
(4) <t > (Terminator) Type: Code, Data: 03 hex (5) <c> (Check code) Type: LRC (horizontal parity) (0) (1-byte BIN)
(first send word specified with the PMCR instruction operand + 1). $: Forward direction ASCII conversion (Converts the send message from hexadecimal code t o ASCII code, and outputs the send data from the lower byte.)
(S+1 word Local_SendDataNodeNo)
Setting range: 2 to 6
Page 71
9.Program
68
FINS-mini Command
Byte
[Send message command frame]
This is the command frame of the message that is sent by the SCU to the Destination Device according to the settings of the send message (SD PRO_R).
STX Node No. Subaddress
Text
Data
Command Number
Remarks
of bytes
STX 1 Fixed: STX
(This code indicates the beginning of the comm uni cations frame.)
Node No. 2 Variable: The value between 01 and 99 can be set.
(“XX” for a broadcast transmission)
01 is set in the protocol data used in this guide. Subaddress 2 Fixed: 00 SID 1 Fixed: 0 MRC 2 05 is set in the protocol data used in this guide.
(Reads the properties of the Destination Device.) SRC 2 03 is set in the protocol data used in this guide.
(Reads the properties of the Destination Device.) Data* From 0
This is not used for the "Properties Read" command.
onwards ETX 1 Fixed: ETX (This code indicates the end of the text.) BCC 1 Abbreviation of B l ock Check Character
Stores the result of the BCC calculation from Node No. up t o ETX.
* When Data is not used, it is removed from the frame, and ETX is shifted next to SRC.
Page 72
9.Program
69
Additional Information

Receive Message Settings 9.6.6.

The receive message that is set in this guide is desc ribed below, which corresponds to the response frame of normal or error message.
For details on the receive message settings, ref er to 3-4 Communication Message Attributes of the CX-Protocol OPERATION MANUAL (Cat. No. W344).
[Screenshot of the receive message settings]
●Normal or error message detection In this guide, the normal or error message can be detect ed by the end code of the receive message in the protocol data.
●Receive message (RV PRO_R) (normal message) [Settings]
<h>+<a>+”00”+&(W(1),2)+”0503”+&(W(2),4)+(W(3),10)+&(W(8),4)+<t>+<c>
(1) (2) (3) (4) (3) (5) (6) (7) (8) (9)
In the standard system protocol RV PRO_R, a CompoWay/F communications error is read and discarded by the code "(*,2)"; however, in the protocol data used in this guide, the end code from the Destination Device is converted and stored by the code "&(W(1),2)" as shown in (4), to detect whether there is an error or not.
●Message name (RV FINSERR) (error message)
[Settings] (FINS-mini protocol error detection)
<h>+<a>+”00”+&(W(1),2)+”0503”+&(W(2),4)+<t>+<c>
(1) (2) (3) (4) (3) (5) (8) (9)
●Message name (RV COMFERR) (error mess age) [Settings] (CompoWay/F protocol error detection)
<h>+<a>+”00”+&(W(1),2)+<t>+<c>
(1) (2) (3) (4) (8) (9)
Page 73
9.Program
70
No. Code Description (1) <h > (Header) Type: Code, Data: 02 hex (2) <a > (Address)
$(R(1),2)
(3) “00”, “0503” Constant ASCII (4) &(W(1),2) (W(1),2): Converts 2-byte data and stores it in the word (first
(5) &(W(2),4) (W(2),4): Converts 4-byte data and stores it in the word (first
(6) (W(3),10) (W(3),10): Converts 10-byte data and stores it in the word (first
(7) &(W(8),4) (W(8),4): Converts 4-byte data and stores it in the word (first
(8) <t> (Terminator) Type: Code, Data: 03 hex (9) <c> (Check code) Type: LRC (horizontal parity) (0) (1-byte BI N)
(R(1),2): Converts 2-byte data and compares t he receive data with the word (first send word specified wit h the PMCR instruction operand + 1). $: Forward direction ASCII conversion (Converts the send message from hexadecimal code t o ASCII code, and outputs the send data from the lower byte.)
receive word specified with the PMCR instruction operand + 1). &: Forward direction hexadecimal conversion (Converts the receive message from ASCII code to
hexadecimal code, and stores the receive data from the lower byte.)
receive word specified with the PMCR instruction operand + 2). &: Forward direction hexadecimal conversion (Converts the receive message from ASCII code to
hexadecimal code, and stores the receive data from the rightmost byte.)
receive word specified with the PMCR instruction operand +3).
receive word specified with the PMCR instruction operand + 8). &: Forward direction hexadecimal conversion (Converts the receive message from ASCII code to
hexadecimal code, and stores the receive data from the rightmost byte.)
Setting range: RV PRO_R = 2 to 9
RV FINSERR=2 to 7 RV COMFERR=2 to 5
Page 74
9.Program
71
communications frame.)
01 is set in the protocol data used in this guide.
(Refer to 9.8 Error Processing.)
*1 *2
Text
Byte
[Response frame of receive message] This is the response frame of the receive message that is received by the SCU from the Destination Device.
STX Node No.Subaddress End code
Command Number
of bytes
STX 1 Fixed: STX (This code indicat es the beginning of the
FINS-mini Response
Data
Remarks
Node number 2 Variable: Between 01 and 99
The unit number of the Destination Device that returns the response.
Subaddress 2 Fixed: 00 End code 2 Destination Device error code[0] (CompoWay/F)
(Refer to 9.8 Error Processing.)
MRC *1 2 Returns the send command value.
05 is returned in the protocol data used in thi s guide. (Reads the properties of the Destination Device.)
SRC *1 2 Returns the send command value.
03 is returned in the protocol data used in this guide. (Reads the properties of the Destination Device.)
MRES *1 2 Destination Device error code [ 1] (FINS-mini)
(Refer to 9.8 Error Processing.)
SRES *1 2 Destination device error c ode [1] (FINS-mini)
Data
From 0
onwards
Reads the model (fixed to 10 bytes) and communications
buffer size with the "Properties Read" command. ETX 1 Fixed: ETX (This code indicat es the end of the text.) BCC 1 Abbreviation of Block Check Character
Stores the result of the BCC calculation from the node
number up to ETX.
*1 If the CompoWay/F command cannot be executed, these commands are removed from the
frame, and ETX is shifted next to End code. In this case, onl y the end code is returned.
*2 If the response does not use Data or if the specified FINS-mini command cannot be
executed, Data is removed from the frame, and ETX is s hifted next to SRES.
Page 75
9.Program
72
Additional Information
Case No.
Receive message
Next process

Matrix Settings 9.6.7.

The matrix (MX PRO_R) that is set in this guide is described below.
For details on matrix settings, refer to 3-5 Creati ng M atri ces of the CX-Protocol OPERATION MANUAL (Cat. No. W344).
[Screenshot of the matrix setting]
*The above screenshot shows that four cases are set in the matrix (MX PRO_R).
●Receive matrix (MX PRO_R) The following shows that four cases (cas e No. 00, 01, 02 an d 15) are s et in the matrix (MX PRO_R).
[Screenshot of the case number setting]
[Settings]
The table below shows the receive message and next proc ess for each case number.
00 RV PRO_R End 01 RV FINSERR End 02 RV COMFERR End
15 Other End An actually received message is compared with each of the following expected receive messages set in the matrix: "RV PRO_R" (normal message), "RV FINSERR" and "RV COMFERR" (error messages) and "Other" (other recei ve m essage) in that order. If the actually received message is mat ched with either the normal or error message, control will be passed to the next process as requir ed. If not matched, control will be passed to the next process designated with "Other". The ladder program checks the received result to detect an error in the Destination Devi ce.
Page 76
73

9.7. Timing Charts

Local_PMCRExecuting
(5000.01)
Receive data storage area
(5501 to 5506)
Output_NormalEnd
(5000.02)
Input_Start
(5000.00)
Output_ErrorEnd
(5000.03)
Normal end
Output_PMCR_ErrorCode
(H400)
Output_DestinationDeviceErrorCode
(H402)
#0000
#0000
Normal resoponse
Normal resoponse
Local_PMCRExecuting
(5000.01)
Receive data storage area
(5501 to 5506)
Output_NormalEnd
(5000.02)
Input_Start (5000.00)
Output_ErrorEnd
(5000.03)
Output_PMCR_ErrorCode
(H400)
Output_DestinationDeviceErrorCode
(H402)
Error end (1)
PMCR error
#0002 to 4
#0000
Error end (3)
Destination device error
#0000
Error response
#0010
Error end (2)
Communications error
#000F
#0000
The timing charts are shown below.
9.Program
Page 77
9.Program
74
Error code
Name
Classification
Description
The sequence number specified for in the Unit.
Data read/write error
When data is written or read to/from range is exceeded.
A code that cannot be executed
after a delimiter.)
Transmission error
(2)Communications
error
Communications cannot perform due to an error in the transmission path.
Additional Information

9.8. Error Processing

The errors that may occur during the program exec ution are described below.

Protocol Macro Error Codes 9.8.1.

The SCU detects these errors by monitoring the macro operation. The error codes include either (1) PMCR instructi on error or (2) Communications error (e .g., transmission error), and are stored in H400 (Output_PMCR_ErrorCode).
[Error code list]
#0002
#0003
#0004
#000F
For details and troubleshooting on the protocol macro errors, refer to 12-3 Troubleshooting of the CJ Series Serial Communications Units OPERATION MANUAL (Cat. No. W336).
Sequence No. error
area exceeded
Protocol data syntax error
(1)PMCR
instruction error
(1)PMCR
instruction error
(1)PMCR
instruction error
the PMCR instruction does not exist
the CPU Unit, the specified area
occurs while the protocol macro is executed. (Example: A header occurs
Page 78
9.Program
75

Destination Device Error Codes 9.8.2.

A Destination Device error is detected by monitoring communications of the Destinati on Device when the SCU sends a command. The error code of the CompoWay/F error is stored in H402 (Output_DestinationDeviceErrorCode[0]), and the error code of the Fins-mini error in the Destination Device is stored in H403 (Output_DestinationDeviceErrorCode[1]).
[Frame] ([H402])
Bit 15 8 7 0
#Always #00 “**" End code
[Error code list]
End code Name Description Priority
00 Normal completion The command ended normally without error. None
The specified FINS command could not be
0F
FINS command error
10 Parity error
11 Framing error Stop bit is "0". 1
12 Overrun error
13 BCC error
14 Format error
16 Subaddress error
18 Frame length error
executed. The FINS response code should indicate why the command could not be executed. The sum total of bits whose received data is "1" does not match the set value of the "communications parity" bit.
An attempt was made to transfer new data when the reception data buffer was already full. The calculated BCC value is different from the received BCC value.
-The command text contains characters other than 0 to 9, and A to F.
-There was no SID and command text, or there was no command text.
-"MRC/SRC" not included in command text .
-Illegal (unsupported) subaddress
-There was no subaddress, SID and command text.
-Subaddress was less than two characters, and there was no SID and command text
The received frame exceeds the specified (supported) number of bytes.
8
2
3
5
7
6
4
Page 79
76
[Frame] ([H403])
Response code
Error name
Priority
0000
Normal completion
None
0401
Unsupported command
1
1001
Command too long
2
1002
Command too short
3
error
error
Number of elements/data
110B
Response too long
8
1100
Parameter error
9
3003
Read-only error
10
2203
Operation error
11
Additional Information
Bit 15 8 7 0
#**** Response code
[Response code list]
1101 Area type error 4
Start address out-of-range
1103
9.Program
5
1104
1003
For details on the Destination Device errors an d troubleshooting, refer to the Digital
Temperature Controllers User's Manual (Cat. No. H224/H174/H185) and the Digital Temperature Controllers Communications Manual (Cat. No. H225/H175/H186).
End address out-of-range
6
7
mismatch
Page 80
77

10. Revision History

code
Revision
01 June 2018 First edition
Date of revision Description of revision
10.Revision History
Page 81
Page 82
2018
P704-E1-01
0618-(0618)
Loading...