You are on page 1of 24

369GB

High-speed, High-capacity Machine Vision System

CV-X Series
Easy Setup Guide
Control/Communication I/O
(for all models)
Contents

Easy Setup Guide: Control/Communication I/O (for all PLC models)

1. Outputting the Total Status Page 3

2. Outputting the individual status of each tool (parallel I/O) Page 10

3. Terminal command control Page 14

4. I/O terminal control (PW: Change Programs) Page 19

5. I/O terminal control (EXW: Write execute condition) Page 20

6. I/O terminal control (SS: Save Settings) Page 21

7. I/O terminal control (BS: Register Image) Page 22

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


Outputting the Total Status

1. Wiring
Perform the following wiring to output the total status of inspections.
This section explains how to wire the terminal block "OUT22:STO" "OUT23:OR" to a PLC or relay.
(The terminal block is attached to the main unit)

Controller terminal block (OUT connector)


No. Terminal name *1
1 OUT22 (STO)
2 OUT23 (OR)
3 F_OUT2 (ERR)
4 F_OUT3 (RUN)
5 COMOUT1 (COMOUT)
6 F_OUT0 (FLS1)
7 F_OUT1 (FLS2)
8 COMOUT_F+ (COM1F+)
9 COMOUT_F‐ (COM1F‐)

Suitable wire: AWG 16 to 28 Terminal block screw torque: 0.25 Nm or less


*1 The characters in brackets in the terminal name are the characters written on the supplied terminal blocks when shipped.

Output circuit diagram (NPN output type)

• Maximum applied voltage: 30 V


• Maximum sink current: 50 mA
(No. 1, 2)
• Leakage current: 0.1 mA or less
• Residual voltage:
1.4 V or less (50 mA)
1.0 V or less (20 mA)

(No. 5)

Output circuit diagram (PNP output type, controllers with a "P" at the end of the part number)

• Maximum applied voltage: 30 V


• Maximum sink current: 50 mA
(No. 5)
• Leakage current: 0.1 mA or less
• Residual voltage:
1.4 V or less (50 mA)
1.0 V or less (20 mA)

(No. 1, 2)

369GB
KEYENCE CORPORATION. Vision System Division ‐3‐ www.keyence.com
Example of connections (NPN output)
When connecting an NPN output from the controller to a PLC with a positive common

PLC input circuit positive common Output circuit on controller

When connecting an NPN output from the controller to a relay

Relay Output circuit on controller

Example of connections (PNP output type, controllers with a "P" at the end of the part number)
When connecting a PNP output from the controller to a PLC with a negative common

PLC input circuit negative common Output circuit on controller

When connecting a PNP output from the controller to a relay

Relay Output circuit on controller

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


2. Checking the connection status of the external terminal (I/O Monitor)
The wiring connection of the external terminal of the CV-X100 Series can be checked.

Click the button at the top right of the screen to switch to Setup Mode.

Select "Utility" > "I/O Monitor" to open the I/O Monitor.

Check the "Manual Output" box to forcefully turn selected output terminals ON, in order to confirm the signal on
the target.
Check the "OUT22 (STO)" and "OUT23 (OR)" boxes, and confirm that the ON/OFF status of the signal can be
detected on the target (PLC, relay, etc.). Check the box to set to ON (short circuit), and uncheck it to set to OFF
(open).

Manual Output can only be used in Setup Mode.

Check the box to set to ON (short circuit), and


uncheck it to set to OFF (open).

If proper ON/OFF status in conjunction with checking/unchecking the box cannot be confirmed, check the wiring
again.

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


3. Setting the tools to be included in total status

Tools to include in the Total Status can be selected. This is useful when you wish to perform an overall judgment
using only the judgment results of specified tools.

Click the button at the top right of the screen to switch to Setup Mode.

Click "Output".

Select "Judgment Settings" > "CAM Judgment".


In the "Select Candidate List", confirm that the boxes for the tools to be included in total status are checked (when using
multiple cameras, confirm the settings for each camera tab).

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


4. Setting the OR Terminal Output Mode

Select the terminal output mode for outputting Total Status from the OR Terminal.

Select "OR Terminal", and then set the "OR Terminal Output Mode" and "OR Terminal Output Timing".

OR Terminal Output Mode


•Update Every Judge: The terminal output state of the OR terminal is updated every time judgment is performed,
and is in accordance to the judgment result. It is synchronized with the leading edge of STO that is output every
time a judgment is finalized, and reads.
•Hold Status: When an NG Status is output, the NG status is retained, regardless of further judgment results.
•One Shot Output: The OR terminal turns on for the amount of time specified in "One Shot Time" and then turns
off.

OR Terminal Output Timing


•Output on NG Status
•Output on OK Status

Refer to the timing charts for each output mode on the following pages.

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


5. Timing Charts
This section includes a time chart for each OR Terminal Output Mode

•Update Every Judge


Image processing Image processing Image processing
NG Status NG Status OK Status

OR

STO

A B A: Output rise time (1 to 999 ms)


C B: Output time (1 to 999 ms)
C: Output change time (2 to 1000 ms)
However, ensure that "A + B ≦ C".

When judgment is finalized, STO (OUT22) rises and the ON/OFF status of OR (OUT23) is checked simultaneously.
Adjust the output time for STO (A/B/C in the time chart) in global settings so that there is time for the target PLC to
detect the status.

Changing the STO output time

Select "Global" > "Communications & I/O" > "External Terminal".

Adjust A: Output rise time (1 to 999 ms), B: Output time (1 to 999 ms) and C: Output change time (2 to 1000 ms) so
that there is time for the target PLC to detect the status. However, ensure that "A + B ≦ C".

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


•Hold Status
Image processing Image processing Image processing Image processing
NG Status OK Status NG Status NG Status

OR

TEST

A: TEST minimum input time (1 ms or more) A

The status condition is normally updated for each trigger. However, if the status is NG, the condition is unchanged
until input such as TEST is executed.
If one NG is detected, the OR output status remains NG from that point, regardless of the actual judgment results.
When the TEST input is turned on/off, the hold status is canceled and all terminals are reset to the normal state. The
OR output condition will be updated when the result for the next OR output is output.

•One Shot Output


Image processing Image processing Image processing
NG Status NG Status OK Status

OR

A A: One shot time (1 to 9999 ms)

The OR output holds the NG state for the specified period of time, and then resets the NG state.
If image processing is continuously performed with One Shot Output enabled, the previous NG state may still be
remaining at the time the image processing judgment result is finalized by the STO.

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


Outputting the individual status of each tool (parallel I/O)

1. Wiring

Perform the following wiring to output the individual status of tools from the I/O terminal (parallel I/O interface).
This section describes the necessary terminal (outputs: OUT6 to 21 (OUT_DATA0 to 15), COMOUT2) wiring for
outputting the individual status of tools from the I/O terminal. (The parallel I/O cable, OP-51657, is sold
separately)

Controller (parallel I/O interface)


Input
No. Terminal name Color
17 COMIN2 (COMIN2) Purple
24 OUT6 (OUT_DATA0) Yellow
25 OUT7 (OUT_DATA1) Green
26 OUT8 (OUT_DATA2) Blue
27 OUT9 (OUT_DATA3) Purple
28 OUT10 (OUT_DATA4) Gray
29 OUT11 (OUT_DATA5) White
30 OUT12 (OUT_DATA6) Black

36 OUT18 (OUT_DATA12) Blue
37 OUT19 (OUT_DATA13) Purple
38 OUT20 (OUT_DATA14) Gray
Suitable wire: AWG 16 to 28
39 OUT21 (OUT_DATA15) White
Terminal block screw torque: 0.25 Nm or less
40 COMOUT2 Black

Output circuit diagram (NPN output type)

- Maximum applied voltage: 30 V


(No. 1, 2) - Maximum sink current: 50 mA
- Leakage current: 0.1 mA or less
- Residual voltage:
1.4 V or less (50 mA)
1.0 V or less (20 mA)

(No. 5)

Output circuit diagram (PNP output type, controllers with a "P" at the end of the part number)

- Maximum applied voltage: 30 V


(No. 5) - Maximum sink current: 50 mA
- Leakage current: 0.1 mA or less
- Residual voltage:
1.4 V or less (50 mA)
1.0 V or less (20 mA)

(No. 1, 2)

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


Example of connections (NPN output)
When connecting an NPN output from the controller to a PLC with a positive common

PLC input circuit positive common Output circuit on controller

When connecting an NPN output from the controller to a relay

Relay Output circuit on controller

Example of connections (PNP output type, controllers with a "P" at the end of the part number)
When connecting a PNP output from the controller to a PLC with a negative common

PLC input circuit negative common Output circuit on controller

When connecting a PNP output from the controller to a relay

Relay Output circuit on controller

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


2. Checking the connection status of the external terminal (I/O Monitor)
The wiring connection of the external terminal of the CV-X100 Series can be checked.

Click the button at the top right of the screen to switch to Setup Mode.

Select "Utility" > "I/O Monitor" to open the I/O Monitor.

Check the "Manual Output" box to forcefully turn selected output terminals ON, in order to confirm the signal on the
target. Manual Output can only be used in Setup Mode.

Check the "OUT6 (OUT_DATA0)" and "OUT7 (OUT_DATA1)" boxes, and confirm that the ON/OFF status of the signal can
be detected on the target (PLC, relay, etc.). Check the box to set to ON (short circuit), and uncheck it to set to OFF (open).

If proper ON/OFF status in conjunction with checking/unchecking the box cannot be confirmed, check
the wiring again.

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


3. Setting the items to output for the individual tool status
Click the button at the top right of the screen to switch to Setup Mode.

Click "Output".

Select "OUT Terminal".


In the "Count" box, set an output count between 1 and 8. If there are 16 items or less, select 1 time (the default setting).

Select "OUT6" - "Tool Judgment" and then select a tool.

As necessary, assign a Tool Judgment to an OUT terminal between OUT6 and 21.

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


Terminal command control

1. Wiring

Perform the following wiring to control the controller via the I/O terminal (parallel I/O interface). This section
describes the necessary terminal (Inputs: CMD_PARAM0 to 7, CMD_CODE0 to 3, CST. Outputs: ACK, NACK) wiring
for command control via the I/O terminal. (The parallel I/O cable, OP-51657, is sold separately)

Controller (parallel I/O interface)


Input
No. Terminal name Color
1 COMIN2 (COMIN2) Brown
2 IN0 (CMD_PARAM0) Red
3 IN1 (CMD_PARAM1) Orange
4 IN2 (CMD_PARAM2) Yellow
5 IN3 (CMD_PARAM3) Green
6 IN4 (CMD_PARAM4) Blue
7 IN5 (CMD_PARAM5) Purple
8 IN6 (CMD_PARAM6) Gray
9 IN7 (CMD_PARAM7) White
10 IN8 (CMD_CODE0) Black
11 IN9 (CMD_CODE1) Brown
12 IN10 (CMD_CODE2) Red
*1 COMOUT2 is the same for 17 pin and 40 pin 13 IN11 (CMD_CODE3) Orange
connectors. 14 IN12 (CST) Yellow
15 IN13 (RESET) Green
16 IN14 (PST) Blue
Output
No. Terminal name Color
17 COMOUT2 (COMOUT2)*1 Purple
18 OUT0 (ACK) Gray
19 OUT1 (NACK) White
20 OUT2 (BUSY) Black
21 OUT3 (CMD_READY) Brown

Input circuit diagram

• Maximum applied voltage: 26.4 V


• ON voltage: 10.8 V or higher
(No. 2-14) • ON current: 2 mA or higher
• OFF voltage: 3 V or less
• OFF current: 0.3 mA or less

(No. 1)

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


Example of connections
When connecting an NPN output PLC to the controller input

PLC (NPN output) Input circuit on controller

When connecting a PNP output PLC to the controller input

Input circuit on controller

PLC (PNP output)

Output circuit diagram (NPN output type)

• Maximum applied voltage: 30 V


(No. 18, 19, 20) • Maximum sink current: 50 mA
• Leakage current: 0.1 mA or less
• Residual voltage:
1.4 V or less (50 mA)
1.0 V or less (20 mA)

(No. 17)

Output circuit diagram (PNP output type, controllers with a "P" at the end of the part number)

• Maximum applied voltage: 30 V


• Maximum sink current: 50 mA
• Leakage current: 0.1 mA or less
• Residual voltage:
1.4 V or less (50 mA)
1.0 V or less (20 mA)

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


Example of connections (NPN output)
When connecting an NPN output from the controller to a PLC with a positive common

PLC input circuit positive common Output circuit on controller

When connecting an NPN output from the controller to a relay

Relay Output circuit on controller

Example of connections (PNP output type, controllers with a "P" at the end of the part number)
When connecting a PNP output from the controller to a PLC with a negative common

PLC input circuit negative common Output circuit on controller

When connecting a PNP output from the controller to a relay

Relay Output circuit on controller

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


2. Checking the connection status of the I/O terminal (I/O Monitor)
The wiring connection of the I/O terminal of the CV-X100 Series can be checked.

Click the button at the top right of the screen to switch to Setup Mode.

Select "Utility" > "I/O Monitor" to open the I/O Monitor.

[Input terminal]
Turn ON the terminals corresponding to "IN0 to 7 (CMD_PARAM0 to 7)", "IN8 to 11 (CMD_CODE0 to 3)" and "IN12 (CST)" from the
connected PLC. When the boxes for the terminals that were turned ON become checked, it can be confirmed that the wiring is correct.

When the corresponding terminal is turned ON from the PLC, the


box becomes checked.

[Output Terminal]
Check the "Manual Output" box to forcefully turn selected output terminals ON. Check the "OUT0 (ACK)", "OUT1 (NACK)" and
"OUT3 (CMD_READY)" boxes, and confirm that the ON/OFF status of the signal can be detected on the target PLC.

Manual Output can only be used in Setup Mode.

Check the box to set to ON (short circuit), and uncheck it to set to


OFF (open).

If proper ON/OFF status in conjunction with checking/unchecking the box cannot be confirmed, check the wiring again.

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


3. Command input timing
Basic flow when controlling via command input from the I/O terminal.

CMD_CODE

CMD_PARAM

CST
D A

CMD_READY
C C

ACK
execution successful B

NACK
execution failed B

A: 1 msec or more B: Same as the STO output time C: Within 500 μsec D: 500 μsec or more

The command is executed when the CMD_CODE and CMD_PARAM of the command you wish to execute (some
commands do not use CMD_PARAM) are input, and then the CST input is turned ON (leading edge is detected).
After the command is executed, ACK (execution successful) or NACK (execution failed) turns ON.
CST input when CMD_READY is OFF is ignored. In this case, neither ACK nor NACK is returned for CST.

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


I/O terminal control (PW: Change Programs)

PW command: Change Programs


Closes all open dialog boxes and changes the program setting to the No. specified.
The CMD_CODE to specify differs according to whether the program setting to change to is in SD1 or SD2.

Change Programs (SD Card 1)


CST CMD_CODE CMD_PARAM
IN12 IN11 IN10 IN9 IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1 IN0
0 0 1 0 Program Setting No. to change to (0 to 255)
1: ON (short circuit), 0: OFF (open)

Change Programs (SD Card 2)


CST CMD_CODE CMD_PARAM
IN12 IN11 IN10 IN9 IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1 IN0
0 0 1 1 Program Setting No. to change to (0 to 255)
1: ON (short circuit), 0: OFF (open)

Sample PW command execution procedure: Changing to setting 088 of SD Card 2


1. Turn IN8 and IN9 ON, and enter "88" in binary into CMD_PARAM (IN7 to 0).

CST CMD_CODE CMD_PARAM


IN12 IN11 IN10 IN9 IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1 IN0
0 0 0 1 1 0 1 0 1 1 0 0 0
1: ON (short circuit), 0: OFF (open)

2. Set CST (IN12) to ON.

CST CMD_CODE CMD_PARAM


IN12 IN11 IN10 IN9 IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1 IN0
1 0 0 1 1 0 1 0 1 1 0 0 0
1: ON (short circuit), 0: OFF (open)

3. CMD_READY (OUT3) turns OFF, and the setting change starts.

4. When the setting has been changed, ACK (OUT0) turns ON for the specified amount of time (set in "Global" > "Communications
& I/O" > "External Terminal"). When ACK turns off, CMD_READY (OUT3) turns ON.

* If the command execution fails, NACK (OUT1) turns on for the specified amount of time instead of ACK. Ensure that the wiring
and CMD_CODE/CMD_PARAM specifications are correct.
When NACK turns ON (the setting will not change) despite correct wiring etc., check whether the program setting to change to
exists or not.

* To specify Program Setting No. 256 to 999, use the "Specify parameter in upper 8 bits" command and specify 15 to 8 bits.

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


I/O terminal control (EXW: Write execute condition)

EXW command: Write execute condition


Sets the Currently Valid Execute No. to the specified execute No.

Write execute condition


CST CMD_CODE CMD_PARAM
IN12 IN11 IN10 IN9 IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1 IN0
0 1 1 1 Execute No. to rewrite to (0 to 99)
1: ON (short circuit), 0: OFF (open)

Sample EXW command execution procedure: Writing 7 in Execute No.


1. Turn IN8, IN9 and IN10 ON, and enter "7" in binary into CMD_PARAM (IN7 to 0).

CST CMD_CODE CMD_PARAM


IN12 IN11 IN10 IN9 IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1 IN0
0 0 1 1 1 0 0 0 0 0 1 1 1
1: ON (short circuit), 0: OFF (open)

2. Set CST (IN12) to ON.

CST CMD_CODE CMD_PARAM


IN12 IN11 IN10 IN9 IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1 IN0
1 0 1 1 1 0 0 0 0 0 1 1 1
1: ON (short circuit), 0: OFF (open)

3. CMD_READY (OUT3) turns OFF, and the Currently Valid Execute No. changes to the specified No.

4. When the Execute No. has been written, ACK (OUT0) turns ON for the specified amount of time (set in "Global" >
"Communications & I/O" > "External Terminal"). When ACK turns off, CMD_READY (OUT3) turns ON.

* If the command execution fails, NACK (OUT1) turns on for the specified amount of time instead of ACK. Ensure that the
wiring and CMD_CODE/CMD_PARAM specifications are correct.

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


I/O terminal control (SS: Save Settings)

SS command: Save Settings


Saves the current Program Setting and Global Settings.

Save Settings
CST CMD_CODE CMD_PARAM
IN12 IN11 IN10 IN9 IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1 IN0
0 0 0 0 None
1: ON (short circuit), 0: OFF (open)

Sample SS command execution procedure


1. Set IN0 to 11 to OFF (open).

CST CMD_CODE CMD_PARAM


IN12 IN11 IN10 IN9 IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1 IN0
0 0 0 0 0 0 0 0 0 0 0 0 0
1: ON (short circuit), 0: OFF (open)

2. Set CST (IN12) to ON.

CST CMD_CODE CMD_PARAM


IN12 IN11 IN10 IN9 IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1 IN0
1 0 0 0 0 0 0 0 0 0 0 0 0
1: ON (short circuit), 0: OFF (open)

3. CMD_READY (OUT3) turns OFF, and the settings are saved.

4. When the settings are saved, ACK (OUT0) turns ON for the specified amount of time (set in "Global" >
"Communications & I/O" > "External Terminal"). When ACK turns off, CMD_READY (OUT3) turns ON.

* If the command execution fails, NACK (OUT1) turns on for the specified amount of time instead of ACK. Ensure that the
wiring and CMD_CODE/CMD_PARAM specifications are correct.

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


I/O terminal control (BS: Register Image)

BS command: Register Image


The Current Image is saved as Reference Image of the specified number, and the saved Reference Image is used to
calculate the Reference Value.

Register Image
CST CMD_CODE CMD_PARAM
IN12 IN11 IN10 IN9 IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1 IN0
IN7 to 6: Camera number (specified with 0 to 3)
0 1 0 0 IN5 to 0: Destination number
1: ON (short circuit), 0: OFF (open)

Sample BS command execution procedure: Registering CAM 2 Reference Image 005 (2-005)
1. Turn IN10 ON. Then enter "1" in binary into CMD_PARAM (IN7 to 6) and "5" in binary into (IN5 to 0).
(0: CAM 1, 1: CAM 2, 2: CAM 3, 4: CAM 4)

CST CMD_CODE CMD_PARAM


IN12 IN11 IN10 IN9 IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1 IN0
0 0 1 0 0 0 1 0 0 0 1 0 1
1: ON (short circuit), 0: OFF (open)

2. Set CST (IN12) to ON.

CST CMD_CODE CMD_PARAM


IN12 IN11 IN10 IN9 IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1 IN0
1 0 1 0 0 0 1 0 0 0 1 0 1
1: ON (short circuit), 0: OFF (open)

3. CMD_READY (OUT3) turns OFF, and the image is registered.

4. When the reference image has been registered, ACK (OUT0) turns ON for the specified amount of time (set in
"Global" > "Communications & I/O" > "External Terminal"). When ACK turns off, CMD_READY (OUT3) turns ON.

* If the command execution fails, NACK (OUT1) turns on for the specified amount of time instead of ACK. Ensure
that the wiring and CMD_CODE/CMD_PARAM specifications are correct.

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


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

You might also like