Sei sulla pagina 1di 26

657GB

Control/Communication I/O
(for all PLC models) (CV-X400)

This manual has been written for the CV-X400 Series.


For details on the CV-X100 Series or CV-X200 Series,
see their respective manuals.

Documentation for the installation and configuration methods


of the controller, and CAD data can be downloaded from the
following URL. www.keyence.co.jp/gazo
http://www.keyence.com/cvx_support Copyright© KEYENCE CORPORATION. All rights reserved.
Contents

Easy Setup Guide: Control/Communication I/O


(for all PLC models) (CV-X400)

1. Outputting the Total Status Page 3


2. Outputting the individual status of each tool (parallel I/O) Page 11
3. Terminal command control Page 17

KEYENCE CORPORATION. Vision System Division 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" "UT23:OR" to a PLC or relay.
(The terminal block is attached to the main unit)

This manual has been written for the CV-X400.


When wiring the CV-X100 Series or CV-X200 Series, see their respective manuals.

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 N.C.
9 COMOUT_F(COMF)

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


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

KEYENCE CORPORATION. Vision System Division www.keyence.com

3
This manual has been written for the CV-X400.
When wiring the CV-X100 Series or CV-X200 Series, see their respective manuals.

Output circuit diagram


The output of this controller can be connected to either NPN input or PNP input.

(No.1, 2) • Maximum applied voltage: 30 V


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

COMOUT1

Example of connections (connecting the controller to positive common)

Use this example of connections as a reference when the input device supports NPN open collector output.

When connecting the output from the controller to a PLC

PLC input circuit (supporting NPN input) Output circuit on controller

When connecting the output from the controller to a relay

Relay Output circuit on controller

KEYENCE CORPORATION. Vision System Division www.keyence.com

4
This manual has been written for the CV-X400.
When wiring the CV-X100 Series or CV-X200 Series, see their respective manuals.

Example of connections (connecting the controller to negative common)

Use this example of connections as a reference when the input device supports NPN open collector output.

When connecting the output from the controller to a PLC

PLC input circuit (supporting PNP input) Output circuit on controller

When connecting the output from the controller to a relay

Relay Output circuit on controller

KEYENCE CORPORATION. Vision System Division www.keyence.com

5
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 www.keyence.com

6
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 www.keyence.com

7
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 www.keyence.com

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

• Update Every Judge

Image Image Image


processing processing processing
NG Status NG Status OK Status

OR

STO

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


B: Output time (1 to 999 ms)
C: Output change time (2 to 1000 ms)
C 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 www.keyence.com

9
• Hold Status

Image Image Image Image


processing processing processing 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 Image Image


processing processing 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 www.keyence.com

10
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)

This manual has been written for the CV-X400.


When wiring the CV-X100 Series or CV-X200 Series, see their respective manuals.

Controller (parallel I/O interface)


Input
No. Terminal name Color
17 COMOUT2 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

COMOUT2 is the same for numbers 17 and 40.

KEYENCE CORPORATION. Vision System Division www.keyence.com

11
This manual has been written for the CV-X400.
When wiring the CV-X100 Series or CV-X200 Series, see their respective manuals.

Output circuit diagram


The output of this controller can be connected to either NPN input or PNP input.

(No.24 to 39) • Maximum applied voltage: 30 V


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

Example of connections (connecting the controller to positive common)

Use this example of connections as a reference when the input device supports NPN open collector output.

When connecting the output from the controller to a PLC

PLC input circuit (supporting NPN input) Output circuit on controller

When connecting the output from the controller to a relay

Relay Output circuit on controller

KEYENCE CORPORATION. Vision System Division www.keyence.com

12
This manual has been written for the CV-X400.
When wiring the CV-X100 Series or CV-X200 Series, see their respective manuals.

Example of connections (connecting the controller to negative common)

Use this example of connections as a reference when the input device supports PNP open collector output.

When connecting the output from the controller to a PLC

PLC input circuit (supporting PNP input) Output circuit on controller

When connecting the output from the controller to a relay

Relay Output circuit on controller

KEYENCE CORPORATION. Vision System Division www.keyence.com

13
2. Checking the connection status of the external terminal (I/O Monitor)
The wiring connection of the external terminal of the CV-X400 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 www.keyence.com

14
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 www.keyence.com

15
4. Outputting the camera execution status (when setting random triggers)
When setting random triggers, which can be used to process multiple cameras with individual timing,
set "CAM Execute Status", which is used to check from which camera the individual status result was
processed and output, to be output together with the individual status.

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 "OUT7" (an arbitrary number) - "CAM 1 Execute Status".


(Select a camera number from 1 to 4 according to the settings.)

* If you have not selected "Camera Settings" - "Random Trigger from Applied Settings",
you will not be able to select the camera execution status item.

KEYENCE CORPORATION. Vision System Division www.keyence.com

16
Terminal command control

1. Performing the 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 and outputs: ACK, NACK,
CMD, CMD_READY) wiring for command control via the I/O terminal.

This manual has been written for the CV-X400.


When wiring the CV-X100 Series or CV-X200 Series, see their respective manuals.

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
13 IN11(CMD_CODE3) Orange
*1 COMOUT2 is the same for numbers 17 and 40.
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
40 COMOUT2(COMOUT2)*1 Black

KEYENCE CORPORATION. Vision System Division www.keyence.com

17
This manual has been written for the CV-X400.
When wiring the CV-X100 Series or CV-X200 Series, see their respective manuals.

Input circuit diagram

(No.2 to 14)
IN

• Maximum applied voltage: 26.4 V


(No.1) • ON voltage: 19 V or higher
• ON current: 2 mA or higher
COMIN2 • OFF voltage: 3 V or less
• OFF current: 0.3 mA or less

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)

KEYENCE CORPORATION. Vision System Division www.keyence.com

18
This manual has been written for the CV-X400.
When wiring the CV-X100 Series or CV-X200 Series, see their respective manuals.

Output circuit diagram

The output of this controller can be connected to either NPN input or PNP input.

(No.18,19,21) • Maximum applied voltage: 30 V


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

Example of connections (connecting the controller to positive common)

Use this example of connections as a reference when the input device supports NPN open collector output.

When connecting the output from the controller to a PLC

PLC input circuit (supporting NPN input) Output circuit on controller

When connecting the output from the controller to a relay

Relay Output circuit on controller

KEYENCE CORPORATION. Vision System Division www.keyence.com

19
This manual has been written for the CV-X400.
When wiring the CV-X100 Series or CV-X200 Series, see their respective manuals.

Example of connections (connecting the controller to negative common)

Use this example of connections as a reference when the input device supports PNP open collector output.

When connecting the output from the controller to a PLC

PLC input circuit (supporting PNP input) Output circuit on controller

When connecting the output from the controller to a relay

Relay Output circuit on controller

KEYENCE CORPORATION. Vision System Division www.keyence.com

20
2. Checking the connection status of the I/O terminal (I/O Monitor)
The wiring connection of the I/O terminal of the CV-X400 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 www.keyence.com

21
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 www.keyence.com

22
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 www.keyence.com

23
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 www.keyence.com

24
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 www.keyence.com

25
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 www.keyence.com


124363E 1116-1

26