Sie sind auf Seite 1von 16

370GB

High-speed, High-capacity Machine Vision System

CV-X Series
Easy Setup Guide
RS-232C
Non-procedural communication
Contents

Easy Setup Guide: RS-232C Non-procedural communication

1. Connecting to a PC using RS-232C Page 3

2. Executing Commands Page 9


3. Troubleshooting - Connection Problems Page 12
4. Connecting PLC and CV-X via RS-232C Page 14

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


Connecting CV-X to a PC using RS-232C

✎ Connecting to a PC using RS-232C


1 Select a cable and connector from the list below according to the PC's COM port connector, and connect.

For PCs with a D-SUB port, choose a 9


or 25 pin converter connector, and use
it in combination with OP-26487.

Connector: RJ-11
Standard: EIA RS-232 compliant modem definition

2 Configure the PC settings as necessary.

From Device Manager* select "Ports (COM & LPT)". Right-click on the COM to be connected,
and select "Properties" from the right-click menu.

Set the Baud Rate, Data Bits,


Parity, Stop Bit, etc.

* To open the device manager, right-click


"Computer" and select "Properties". Select
"Device Manager" in this window to open
the Device Manager.

Change the settings so


they are the same as the
CV-X settings.

To the left is part of the Device Manager window.


The COM5 port is used in this manual.
Right-click (COM5) and select "Properties" to display the above window.

370GB
KEYENCE CORPORATION. Vision System Division -3- www.keyence.com
3 Configure the CV-X communication settings.

Select
Global

Communications & I/O

RS‐232C

4 Configure settings so that communication with the PC is possible.

Configure each setting so


it is the same as the PC
setting.

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


5 Install Tera Term and start it up.

Tera Term is a free software that allows you to test non‐procedural communication. Refer to the
following website for more information. (As of December 2013)
http://www.vector.co.jp/soft/win95/net/se320973.html

This is the start‐up screen.

6 Select "Serial", and select the port connected to CV-X.

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


7 Select Setup → Terminal.

8 Configure the following 2 settings.

Change the following 2 settings.


‐ Change the receive delimiter to CR+LF
‐ Check the Local echo box

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


9 The connection will be established when the above settings have been configured. Communication via
commands is now possible.

As a rule, use CV‐X in Run Mode.

In the screenshot to the left:


A "T1" command was sent, and "T1" was received
from CV‐X.
An "SS" command was sent, and "SS" was received

10 When data needs to be output, select the required items for RS-232C (Non-Procedural) in Output Settings.

In this example, the following 2 items were set to


be output:
Edge Position X Position
Judged with Black/White Specific Area Area

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


11 Issue a T1 (Camera 1 trigger) command from Tera Term to output data.

T1 command is issued
T1 is received from CV‐X
Then data is output.
This example shows data for the following
measurements:
‐ Edge X Position of +0000.000
‐ Area of 120288
Data will be output according to the format set in
the CV‐X output settings, and the same number of
digits as in the preview will be output.

12 Communication content can be checked even in the CV-X using its RS-232C monitor.

Select "U lity" → "RS‐232C Monitor"

You can check the actual data that will be exchanged.

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


✎ Executing Commands
1 Executing Commands

There are 4 main types of commands.


This section describes a representative example of each of the 4 types.

1. Commands that can be executed using the command only (no parameter required)
Example) Save program (SS), Reset (RS)

2. Commands that require a parameter to be executed


Example) Change programs (PW), Change judgment condition (DW)

3. Commands that have data replies after they are executed


Example) Read programs (PR), Read execute condition (EXR)

4. Triggers executed using commands


Example) Trigger 1 (T1)

Use the following as a reference together with the "Control/data output via commands" section in the User's
Manual.

2 1. Commands that can be executed using the command only (no parameter required)

Example: The Reset (RS) command is executed in the following way.


As written in the manual, after the RS command is sent and reset is executed, CV‐X replies with "RS".

Written in the manual.

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


3 2. Commands that require a parameter to be executed

Example: The Change programs (PW) command is executed in the following way.
When PW, the SD Card No., and the Program Setting No. are sent as the
command, the Program Settings are changed. Then, CV‐X replies with PW.
The following is an example of changing to Program Setting No. 1 of SD1.

The SD Card number can


Written in the manual. be checked on the
screen.

4 3. Commands that have data replies after they are executed

Example: The Read execute condition (EXR) command is executed in the following way.
When EXR is sent, CV‐X replies with EXR and the execute condition No.

The reply shows that the


current execute condition
No. is "0".

Written in the manual.

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


5 4. Triggers executed using commands

Example: Triggers executed by commands are executed in the following way. Trigger 1 is executed in this example.
When no output items are set in RS‐232C (Non‐Procedural) in Output Settings and T1 is sent, a trigger is
input, and only T1 is received as a reply. When output items are set in Output Settings, T1 is received as a
reply, and then the required data are output.

When Output Settings


are not configured.

Written in the manual.

When Output Settings


are configured.

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


✎ Troubleshooting
1 The command fails ⇒ There is no reply from CV-X or the reply contains corrupted text.

If no reply (including an error) is received, or the reply


contains corrupted text when commands are sent from
Tera Term:
Example of no reply
The CV‐X and PC Baud Rate, Stop Bit, Parity, and other
settings may not be the same.
Have the Tera Term serial communication settings
checked, and confirm that they are the same as the
CV‐X settings.

Example of corrupted text

2 The command fails ⇒ An error reply is received.

When a reply including "ER,***" is received, an error


has occurred.

Check what the error is using the list of error causes on


the left.
The list on the left includes errors that can occur with all
of the commands. There are also causes of errors that
are unique to each individual command.
If an error code that is not listed on the left is received,
check the individual command errors.
There may be more detailed information on some of the
errors in the list on the left for each command.
Use the list of error codes as a reference together with
the "Control/data output via commands" section in the
User's Manual.

In the screenshot, the following command was sent:


T0
As this command does not exist, the following error was
received:
ER,T0,02
02 indicates a command error (the received command is
not available)

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


3 Error example details

When parameters are required for a command (E.g. the PW command), the parameters must be separated
using commas.
‐ In example A, the command is successful, as the commas separate the parameters correctly, and
correct parameters are specified.
‐ In example B, error code 02 (the received command is not available) has been received, as the command
contains no commas and could not be processed.
‐ In example C, error code 22 (parameter error) has been received, as 1000 was specified in the command
for a parameter with a specifiable range of 0 to 999, and the command could not be processed.

A
B
C

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


✎Connecting PLC and CV-X via RS-232C
1 Select a cable and connector from the list below according to the type of PLC, and connect.

- When connecting to the Keyence KV-L20 Series


 or MELSEC FX Series
OP-26486+OP-26487

- When connecting to SYSMAC CJ/CS1 We recommend using PLC-Link to communicate with PLC.
(for 9 pin connectors) OP-84384+OP-26487
What is PLC-Link?
PLC-Link is a function that allows commands to be
executed and results to be output by CV-X directly
reading from and writing to the PLC data memory
(data register).

Therefore, there is no need to create a ladder


program on the PLC suitable for the CV-X
communication format.

For more information, refer to the separate PLC-


Link Easy Setup Guide.

- When connecting to MELSEC AnN, Q/L Series


OP-86930+OP-26487

If you wish to make a communication cable


Making a communication cable cannot be
recommended as it can cause problems and
damage. However, if you wish to make a
communication cable, refer to the schematic on
the left.

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


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

Das könnte Ihnen auch gefallen