You are on page 1of 28

366GB

High-speed, High-capacity Machine Vision System

CV-X Series
Easy Setup Guide
Control/Communication EtherNet/IP
(OMRON CJ Series)
Contents

Easy Setup Guide: Control/Communication EtherNet/IP (OMRON CJ Series)

1. Before Connecting EtherNet/IP Page 3

2. Outputting the Measured Value/Judged Value Page 14

3. Controlling the Controller Page 17

4. Data Allocation Page 23

5. Troubleshooting Page 25

Trademarks
Product names, etc. noted in this document are registered trademarks or trademarks of their respective companies.
The ™ mark and ® mark have been omitted in this manual.

KEYENCE CORPORATION. Vision System Division ‐2‐ www.keyence.com


1. Before Connecting EtherNet/IP (EtherNet/IP) [OMRON CJ Series]

This section describes how to establish EtherNet/IP. 3 From "Global", select "Communications & I/O" -
"EtherNet/IP".
[Important]
If it fails, establish a one-to-one connection between the 4 Change the EtherNet/IP settings and then left-
PLC and CV-X, and follow this manual to configure the click "OK".
settings and check the operations.
Confirm that it operates properly, and change settings if
necessary.

1. Checking the Global Settings of the CV-X100 Series

1 From "Global", select "Communications & I/O" -


"Network".

2 Change the Ethernet settings and then left-click


"OK".

In this section, the set values below will be


configured as an example (change the settings
according to the target device).
•Enable EtherNet/IP: Check this box.
•Data Size: 496 bytes
•Data Configurations: Set the desired data
allocations and allocation offset for the bit
address and byte address.
•Decimal Point: Fixed‐point
•Process Priority: Image First

5 Restart the controller.

In this section, the set values below will be


configured as an example (change the settings
according to the target device).
•IP Address: 192.168.0.10
•Subnet Mask: 255.255.255.0

366GB
KEYENCE CORPORATION. Vision System Division ‐3‐ www.keyence.com
2. Changing the CJ-Series settings

Configure the OMRON CJ settings.

1. Set the CJ unit node address.


Use the rotary switches on the unit to set the node address. Set it to the last number in the IP Address to be
set.
For example, if the CJ IP Address is "192.168.0.1", set it to "1".

Setting Range
10 - FE (decimal - 254)

2. Set up the OMRON CX-Programmer and Network Configurator


The CX-Programmer and Network Configurator must be set up in order to set up EtherNet/IP
communication.
Software version to use: CX-Programmer Ver. 9.11 / Network Configurator Ver. 3.20

2-1
Create a new project in CX-Programmer, and select the CPU unit to be used.

2-2
Click "IO Table and Unit Setup" in the project workspace. Then, in the "PLC IO Table" dialog box, right-click
the unit you will use and click "Unit Setup" in the right click menu.

KEYENCE CORPORATION. Vision System Division ‐4‐ www.keyence.com


In the "Edit Parameters" window, set the IP Address to "192.168.0.1", and set the Subnet Mask to "255.255.255.0".

2-3
Start up Network Configurator. In the "PLC IO Table" dialog box, right-click the unit you will use and click "Start
Special Application" in the right click menu. Then click "Start with Settings Inherited" (or "Start Only").

Select "Network Configurator" and click "OK" to start Network Configurator.

KEYENCE CORPORATION. Vision System Division ‐5‐ www.keyence.com


2-4
Install the CV-X Series EDS file in Network Configurator. (First time only)
Create EDS files for the CV-X Series by clicking "Global"-> "Communications & I/O"-> "EtherNet/IP" -> "Create EDS
File" in the CV-X Controller. Alternatively, EDS files can be obtained from the CV-X Series Simulation Software.

Select "EDS File" → "Install"

Select "Keyence_5002_0101.eds"

The installation is complete. The CV-X Series can now be selected as a device.

KEYENCE CORPORATION. Vision System Division ‐6‐ www.keyence.com


2-5
Drag and drop OMRON CJ2B-EIP21 (CJ2H-CPU□□-EIP) and CV-X from "EtherNet/IP Hardware".

2-6
Right-click OMRON CJ2B-EIP21 (CJ2H-CPU□□-EIP) and CV-X, and click "Change Node Address" in the right
click menu. Then set the IP Address.

CJ (192.168.0.1)

CV-X (192.168.0.10)

KEYENCE CORPORATION. Vision System Division ‐7‐ www.keyence.com


2-7
Set up the input tags.
Double-click the CJ2B-EIP21 icon and open "Edit Device Parameters".
Then click the "In - Consume" tab in the "Tag Sets" tab.

Press the "New" button and open "Edit Tags".

KEYENCE CORPORATION. Vision System Division ‐8‐ www.keyence.com


In "Edit Tags", set "In - Consume" to "Name : D00000, Size : 496 Byte", and set "Out - Produce"
to "Name : D00500, Size : 496 Byte".

Click "OK", and select "Yes" in the dialog box that appears asking if you want to automatically create a tag set.

KEYENCE CORPORATION. Vision System Division ‐9‐ www.keyence.com


2-8
Set up the connection with the CV-X Series.
Select "CV-X100 Series" from the "Unregister Device List" in the "Connections" tab. Press the "↓" button to
move it to the "Register Device List".

Next, double-click "CV-X100 Series", and open "CV-X100 Series Edit Connection".

KEYENCE CORPORATION. Vision System Division ‐ 10 ‐ www.keyence.com


Assign "D00000" to "Input Tag Set", and "D00500" to "Output Tag Set".

When the assignment is complete, click "OK" to confirm.

Now all of the necessary basic setup for the EtherNet/IP connection to CX Programmer and Network Configurator
is complete.

Next, the settings for both pieces of software must be forwarded to CJ2H-CPU□□-EIP.
The example is this manual is for connecting a computer and CJ2H-CPU□□-EIP using a USB cable, and sending
setting data from Network Configurator.
* For information on other ways of sending the data, and sending data from CX Programmer, please refer to the
appropriate OMRON manual.

KEYENCE CORPORATION. Vision System Division ‐ 11 ‐ www.keyence.com


2-9
Select "CJ2USB/SerialPort" from "Option" - "Select Interface".

2 - 10 Select "Network" -"Connect".


Select "USB" in "Select Interface" and click "OK".

2 - 11 Use the following procedure to select the network port to connect to in "Select Connect Network Port".
1. Select "BackPlane", and click the "Refresh" button.

2. The EtherNet/IP unit's TCP port will appear. Select it and click "OK".

3. If the connection is successful, "On-Line" will be displayed in the status bar.

2 - 12
Select "Network" -> "Download" to send the settings.

KEYENCE CORPORATION. Vision System Division ‐ 12 ‐ www.keyence.com


3. When the settings have been downloaded, the CV-X Series and the PLC will automatically restart. Then
EtherNet/IP communication will begin.

When the EtherNet/IP connection is successful, the NS LED (orange) will light up, and the LINK LED (green)
will start flashing on the CV-X Series Ethernet port. (The connection can also be confirmed on the CV-X
Series via "Utility" -> "EtherNet/IP Memory Monitor" -> "Cyclic Communication Status".)
- If the LINK LED is not lighted at all, the cable may not be connected properly, or the equipment may not
have started up. Check the connection equipment (for example, if the HUB is working properly, if a
crossover cable is being used as a LAN cable when connection is one-to-one, etc.)

KEYENCE CORPORATION. Vision System Division ‐ 13 ‐ www.keyence.com


2. Outputting the Measured Value/Judged Value (EtherNet/IP) [OMRON CJ Series]

Outputting the Measured Value/Judged 2. Checking the format for output to the byte
address, and the relationship between the byte
address and the link register (W)
1. Setting the output data (Output Settings)
Use the output settings to output the measured values 1 Check an example of result data stored to the
and judged values. This section explains how to byte address.
allocate the measured/judged values below as an The EtherNet/IP output settings are set so that the
example. result data shown below is output.
•Total Status Value •Total Status Value
•T100: Position Adjustment with Shading Pattern •T100: Position Adjustment with Shading Pattern
(position X) (position X)
•T100: Position Adjustment with Shading Pattern •T100: Position Adjustment with Shading Pattern
(position XY) (position XY)
•T101: Area •T101: Area
•T102: OCR (Recognize Strings) •T102: OCR (Recognize Strings)
•T100: Position Adjustment with Shading Pattern •T100: Position Adjustment with Shading Pattern
(tool judgment value) (tool judgment value)
•T101: Area (tool judgment value) •T101: Area (tool judgment value)
•Program Time •Program Time
•Date & Time •Date & Time

1 From the "Output Settings" screen, left-click 2 From "Global", select "Communications & I/O" -
"EtherNet/IP". "EtherNet/IP", and left-click "Set" in "Data
The EtherNet/IP output settings screen appears. Settings".
The "EtherNet/IP Communication Data Structure"
2 Left-click the "Byte Allocation Area" tab.
screen appears.

3 Left-click "View List" in "Send-Data".


The contents that are allocated to the controller send
address can be checked.

3 Left-click "Select Data", select the items to output,


and then left-click "Add".

4 Check the byte address for output.


•By default, "Result Data1" (first result output) is
set for byte address 0048, and the result data is
•When allocating output data, the destination byte allocated there.
address is automatically displayed in "Address". •As result data is output in 32-bit units, 4-byte
•The byte address starting position is the position addresses are used for each piece of result data
allocated to "Result Data1" on the "Data (1 character in the case of text).
Configurations" - "Send-Data" - "View List" screen.
(In the example above, it is byte address 048.)
4 Restart the controller.

KEYENCE CORPORATION. Vision System Division ‐ 14 ‐ www.keyence.com


5 Input the trigger to the CV-X Series, then check
the CX-Programmer watch window output results.
Check the current value beginning with device
D024.

•Judged value OK=0, NG=1 is stored using 2 words.


•Decimal fraction data is multiplied by 1000 and
stored using 2 words: 124.121 → 124121
•When XY data is output, it is stored in order XY
using 2 words each.
•Integer data is stored unchanged using 2 words
•Text data is stored in ASCII code using 2 words
per character
- When outputting with "String", the number of
devices used varies depending on the set
character string. In this example, because the
OCR unit "Detected String" is output, the character
string is "KEYENCE" (7 characters). However
because 10 is set for "Characters" in "Block Set",
the 20 words (for 10 characters) from W042 to
W054 are used.
- When the characters setting is changed, the device
used changes. If there is a possibility that it might
be changed, it is recommended that it be set at
the end of the output data.
•Judged value OK=0, NG=1 is stored using 2 words.
•System variable: Integer type: Stored using 2 words
as is
Decimal type: Multiplied by 1,000 and stored using
2 words

KEYENCE CORPORATION. Vision System Division ‐ 15 ‐ www.keyence.com


KEYENCE CORPORATION. Vision System Division ‐ 16 ‐ www.keyence.com
3. Controlling the Controller (EtherNet/IP) [OMRON CJ Series]

Controlling the Controller 4 Click "OK".


The changed settings are saved.
1. Checking the Global Settings of the CV-X100 Series
5 Restart the controller.
1 From "Global", select "Communications & I/O" -
"EtherNet/IP".

2 Click "Set" in "Data Settings".


The "EtherNet/IP Communication Data Structure"
screen appears.

3 Left-click "View List" in "Send-Data" and


"Receive-Data" to check the status of byte
address and bit address allocation for the items
that are required for controller control.

Receive-Data (PLC to Controller: OUT)


•Command request flag: Turns OFF→ON when a
command is executed (bit).
•Command Number: Sets the command No. of the
command to execute (double word).
•Command Parameter#: Sets the No. # argument
for the command (word). (Whether or not there
are arguments depends on the command.)

Send-Data (Controller to PLC: IN)


•Command complete flag: Turns ON when the
command process is completed (bit).
•Command error flag: Turns OFF when the
command process is completed, and ON when
a failure occurs (bit).
•Command ready flag: Turns ON when ready to
receive the command process (bit).
•Command Result: Sets the command execution
results (0: Success, <Error code>: Failure)
(double word).
•Command Data#: Sets the command No. #
response data (word). (Whether or not there is
response data depends on the command.)

KEYENCE CORPORATION. Vision System Division ‐ 17 ‐ www.keyence.com


KEYENCE CORPORATION. Vision System Division ‐ 18 ‐ www.keyence.com
✎ Command Execution Procedure Example Save Settings (SS)
Here is an example of a command execution procedure. This section shows an example of executing the SS (Save Settings)
command which does not use a command parameter. The screens with blue frames show when the "Watch Window" in
CX-Programmer is used for confirmation.

Check the SS (Save Settings) command operation.

1. Enter "12", the SS command No., in the device


corresponding to the PLC Command Number (D508 in
this example).

2. Enter "1" in the device corresponding to the PLC


Command request flag (D500(0) in this example).

3. The command is executed.

4.Check if the values of the devices corresponding to When the command is successful: CV-X writes "1" into Command complete
the PLC Command complete flag and Command flag, and "0" into Command result.
result (D0(0) and D10 respectively in this example)
have changed.

When the command fails: CV-X writes "1" into Command complete flag,
and an error code into Command result.

KEYENCE CORPORATION. Vision System Division ‐ 19 ‐ www.keyence.com


✎Command Execution Procedure Example Switch Program Setting No. (PW)
Here is an example of a command execution procedure. This section shows an example of executing the PW (Switch Program
Setting No.) command which uses command parameters. The screens with blue frames show when the "Watch Window" in CX-
Programmer is used for confirmation.

Check the PW (Switch Program Setting No.) command operation.

1. Enter "24", the PW command No., in the device


corresponding to the PLC Command number (D508 in
this example), and enter the switch target SD drive No.
and program number in the devices corresponding to
Command Parameter (D510 and D512 in this
example).
The figure on the right shows an example of switching
to program number "11" on "SD1".

2. Enter "1" in the device corresponding to the PLC


Command request flag (D500(0) in this example).

3. The command is executed.

4. Check if the values of the devices corresponding to When the command is successful: CV-X writes "1" into Command complete
the PLC Command complete flag and Command flag, and "0" into Command result.
result (D0(0) and D10 respectively in this example)
have changed.

When the command fails: CV-X writes "1" into Command complete flag,
and an error code into Command result.

KEYENCE CORPORATION. Vision System Division ‐ 20 ‐ www.keyence.com


✎ Command Execution Procedure Example Rewrite Judgment Conditions (DW)
Here is an example of a command execution procedure. This section shows an example of executing the DW (Rewrite
Judgment Conditions) command which uses command parameters and specifies integer and fractional values. The screens
with blue frames show when the "Watch Window" in CX-Programmer is used for confirmation.

Check the DW (Rewrite Judgment Conditions) command operation.

1. Enter "45", the DW command No., in the device


corresponding to the PLC Command number (D508 in
this example), and enter the parameters in order in the
devices corresponding to the Command parameter
(D510 to D516 in this example).

The figure on the right shows an example of rewriting


the lower limit of the area of "T101" to "900".
- Parameter 1 101 (Tool ID: 101)
- Parameter 2 105 (judgment condition item ID for
"Area")
→For information about the judgment condition item
ID, refer to the CV-X Series user's manual.
- Parameter 3 1 (lower limit)
- Parameter 4 900000 (value)
→If "Decimal Point" is set to "Fixed- point", specify the
value multiplied by 1000 (900000)
→If "Decimal Point" is set to "Floating- point", specify
a single precision floating point number (900.000).

2. Enter 1 in the device corresponding to the PLC


Command request flag (D500(0) in this example).

3. The command is executed.

4. Check if the values of the devices corresponding to the


PLC Command complete flag and Command result (D0(0)
and D10 respectively in this example) have changed.

When the command is successful: CV-X writes "1" into Command complete When the command fails: CV-X writes "1" into Command complete flag,
flag, and "0" into Command result. and an error code into Command result.

KEYENCE CORPORATION. Vision System Division ‐ 21 ‐ www.keyence.com


✎Command Execution Procedure Example Rewrite Registered String (CW)
Here is an example of a command execution procedure. This section shows an example of executing the CW (Rewrite Registered
String) command which uses command parameters and specifies a string. The screens with blue frames show when the "Watch
Window" in CX-Programmer is used for confirmation.

Check the CW (Rewrite Registered String) command operation.

1. Enter "43", the CW command No., in the device


corresponding to the PLC Command number (D508
in this example), and enter the parameters in order
in the devices corresponding to the Command
parameter (D510 to D526 in this example).

T102: To rewrite the registered string of the OCR


tool to "ABCDE", specify the following.
- Parameter 1 102 (Tool ID: 102)
- Parameter 2 1 (In the case of "OCR": Always 1)
- Parameter 3 1 (When specifying characters on the
PLC side: "1")
- Parameter 4 65 (ASCII code for "A")
- Parameter 5 66 (ASCII code for "B")
- Parameter 6 67 (ASCII code for "C")
- Parameter 7 68 (ASCII code for "D")
- Parameter 8 69 (ASCII code for "E")
- Parameter 9 0 (0 at the end of the string)

2. Enter "1" in the device corresponding to the PLC


Command request flag (D500(0) in this example).
* The device to use is 1 word.

3. The command is executed.

4. Check if the values of the devices corresponding to


the PLC Command complete flag and Command result
(D0(0) and D10 respectively in this example) have
changed.

When the command is successful: CV-X writes "1" into Command When the command fails: CV-X writes "1" into Command complete
complete flag, and "0" into Command result. flag, and an error code into Command result.

KEYENCE CORPORATION. Vision System Division ‐ 22 ‐ www.keyence.com


4. Data Allocation

KEYENCE CORPORATION. Vision System Division ‐ 23 ‐ www.keyence.com


KEYENCE CORPORATION. Vision System Division ‐ 24 ‐ www.keyence.com
5. Troubleshooting

KEYENCE CORPORATION. Vision System Division ‐ 25 ‐ www.keyence.com


from [Image First]

KEYENCE CORPORATION. Vision System Division ‐ 26 ‐ www.keyence.com


Copyright (c) 2014 KEYENCE CORPORATION. All rights reserved. 124295E 1084-1 366GB Printed in Japan

You might also like