beautypg.com

Command execution procedure example – KEYENCE CV-X Series User Manual

Page 14

background image

KEYENCE CORPORATION. Vision System Division

‐ 14 ‐

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
complete flag, and "0" into Command result.

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