You are on page 1of 20

365GB

High-speed, High-capacity Machine Vision System

CV-X Series
Easy Setup Guide
Control/Communication EtherNet/IP
(KEYENCE KV Series)
Contents

Easy Setup Guide: Control/Communication EtherNet/IP (KEYENCE KV Series)

1. Before Connecting EtherNet/IP Page 3

2. Outputting the Measured Value/Judged Value Page 6

3. Controlling the Controller Page 9

4. Data Allocation Page 15

5. Troubleshooting Page 17

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


1. Before Connecting EtherNet/IP (EtherNet/IP) [Keyence KV Series]

This section describes how to establish EtherNet/IP. 3 From "Global", select "Communications & I/O" -
"EtherNet/IP".

4
[Important]
If it fails, establish a one-to-one connection between the Change the EtherNet/IP settings and then left-click
PLC and CV-X, and follow this manual to configure the "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

365GB
KEYENCE CORPORATION. Vision System Division ‐3‐ www.keyence.com
2. Changing the KV-Series settings 6 Click the icon in "Setup unit (2)" to open
"EtherNet/IP settings". Configure the CV-X100
1 Start KV STUDIO with the PLC connected to the Series and EtherNet/IP communication settings.
computer, and select "New project" from the
•Drag "CV-X100" from the "Unit list (1)" tab in
"File" menu.
"EtherNet/IP settings" and drop it into the scan list
2 Enter the "Project name", select the "PLC model", to add it.
•In the "Initial adapter settings" screen that is
and then press "OK".
displayed after start up, enter the CV-100 Series
IP Address (192.168.0.10) that was set in the
CV-X100 Series global settings.

A "Confirm unit setting information" dialog appears.


7 Save the changes and exit the "EtherNet/IP
3 Click "Read unit setting". settings" and Unit Editor.

8 Select "Device comment edit window" from the


"Display" menu in KV STUDIO.
The "Device comment edit" screen appears.

4 In the workspace, click the Ethernet/IP


communication unit or CPU unit that will be
connected to the CV-X100 Series to start "Unit
Editor". Set up the IP Address of the KV Series in
the "Setup unit (2)" tab.
•IP Address: 192.168.0.20
•Subnet Mask: 255.255.255.0

9 Click "Details".
The "Register unit device" screen appears.

10 Confirm that the box for "CV-X100" is checked in


the "Select unit" list, and then click "Register".

5 Select "Convert" - "Auto-assign relay/DM" in the


Unit Editor to allocate a device.
When automatically allocated, the bit device is
allocated to B (link relay) and the byte device is
allocated to W (link register).
Device comments regarding CV-X100 are
automatically registered.

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


11 Select "Transfer to PLC" from the
"Monitor/Simulator" menu in KV STUDIO.

12 Restart both the CV-X100 Series and the KV Series.


When the connection is successful, the LINK LED
(green) will start flashing on the KV Series Ethernet
port.
Successful connection can also be confirmed by
selecting "Communications & I/O" - "EtherNet/IP" in
"Global" on the CV-X100 Series, and checking the
"Cyclic Communication Status".

If the LINK LED on the KV Series Ethernet port stays lit


(does not flash) or does not light
The EtherNet/IP may not be set up correctly, the cables may
not be connected correctly, or the CV-X100 Series may not
be started up. Check the connection equipment (if a
crossover cable is being used as a LAN cable when
connected directly, if the HUB is working, etc.)

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


2. Outputting the Measured Value/Judged Value (EtherNet/IP) [Keyence KV 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 Check the relationship between the byte address
"EtherNet/IP". and the link register (W) in KV STUDIO.
The EtherNet/IP output settings screen appears. Open "EtherNet/IP settings" from the "Setup unit (2)"
tab in KV STUDIO Unit Editor, and click the plus sign
2 Left-click the "Byte Allocation Area" tab. (+) next to "Class1" for the registered CV-X100 to
check the allocation status of the device. (In the
notation, output from CV-X100 is treated as "IN
(input)".)

•Check the range (hexadecimal) of the link relay


(B)/link register (W) allocated to the registered

3
CV-X100 Series controller. (The range can also be
Left-click "Select Data", select the items to output, changed as desired by clicking "Edit".)
and then left-click "Add". •Byte addresses 0000-0011 are for the link relay
(from B0000 onwards), and byte addresses from

4
0012 onwards are for the link register. Allocation
Check the byte address for output. begins at the start from W0000, with 1 register
•When allocating output data, the destination byte used for each 2-byte address.
address is automatically displayed in "Address".
•The byte address starting position is the position
allocated to "Result Data1" on the "Data
Configurations" - "Send-Data" - "View List" screen.
(In the example above, it is byte address 048.)

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


3 From "Global", select "Communications & I/O" - 6 Input the trigger to the CV-X100 Series, then check
"EtherNet/IP", and left-click "Set" in "Data the output results in the KV STUDIO registration
Settings". monitor.
The "EtherNet/IP Communication Data Structure" Check the current value beginning with device W012.
screen appears.

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


The contents that are allocated to the controller send

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


•Decimal fraction data is multiplied by 1000 and
•By default, "Result Data1" (first result output) is stored using 2 words: 124.121 → 124121
set for byte address 0048, and the result data is •When XY data is output, it is stored in order XY
allocated there. using 2 words each.
•As result data is output in 32-bit units, 4-byte •Integer data is stored unchanged using 2 words
addresses are used for each piece of result data •Text data is stored in ASCII code using 2 words
(1 character in the case of text). per character
- When outputting with "String", the number of
5 Restart the controller. 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 ‐7‐ www.keyence.com


KEYENCE CORPORATION. Vision System Division ‐8‐ www.keyence.com
3. Controlling the Controller (EtherNet/IP) [Keyence KV 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 ‐9‐ www.keyence.com


KEYENCE CORPORATION. Vision System Division ‐ 10 ‐ 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 "Registration monitor"
function of KV STUDIO 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 (W0F4
in this example).

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


Command request flag (B060 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 (B00 and W04 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 ‐ 11 ‐ 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 "Registration monitor"
function of KV STUDIO 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 (W0F4 in
this example), and enter the switch target SD drive No.
and program number in the device corresponding to
Command Parameter (W0F6 and W0F8 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 (B060 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 (B00 and W04 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 ‐ 12 ‐ 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 "Registration monitor" function of KV STUDIO 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 (W0F4 in
this example), and enter the parameters in order in the
devices corresponding to the Command parameter
(W0F6, W0F8, W0FA and W0FC 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 (B060 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
(B00 and W04 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 ‐ 13 ‐ 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 "Registration monitor" function of KV STUDIO 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
(W0F4 in this example), and enter the parameters
in order in the devices corresponding to the
Command parameter (W0F6 to W0106 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 (B060 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 (B00 and W04
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 ‐ 14 ‐ www.keyence.com


4. Data Allocation

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


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

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


from [Image First]

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


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

You might also like