Omron ZFX-C COMMAND REFERENCE

Cat. No. Z265-E1-05
Smart Sensor ZFX-C
Serial Communication
COMMAND REFERENCE
Introduction
Thank you for purchasing the ZFX-C. This manual provides information regarding functions, performance and operating methods that are required for using the ZFX-C. When using the ZFX-C, be sure to observe the following:
• The ZFX-C must be operated by personnel knowledgeable in electrical engineering.
• To ensure correct use, please read this manual thoroughly to deepen your understanding of the product.
• Please keep this manual in a safe place so that it can be referred to whenever necessary.
Manuals Provided with this Product
Smart Sensor
Vision Sensor with built-in LCD monitor
ZFX-C
User's Manual
Smart Sensor
Vision Sensor with built-in LCD monitor
ZFX-C
Serial Communication Command Reference
Cat. No.
XXXX-XX-XX
Cat. No.
XXXX-XX-XX
User's Manual
This manual describes basic operations, such as installation and connections, and information on settings and specifications to ensure safe and correct use of this product.
Serial Communication Command Reference (this document)
This manual provides reference information for when this product performs communications with an external device, such as a PC or a programmable controller, via the serial interface.

Contents

Communication Interface Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Connection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Connecting a PC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Connecting a PLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
About Communication Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Command/Response Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Available Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Bank Control Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Measurement Control/Measurement Value Acquisition Commands . . . . . . . . . . . 14
Setting Acquisition/Change Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Backup/Restore Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Utility Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
Parameter List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Example of Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Version Upgrade Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
ZFX-C Serial Communication Command Reference
1
Difference between the ZFX-C20/C25, ZFX-C10H/C15H and ZFX-C10/C15
This manual is intended for the ZFX-C20/C25, ZFX-C10H/C15H and ZFX-C10/C15 Controllers. Unless otherwise specified, explanations are given for the ZFX-C20/C25. The following table summarizes the main differences.
Item ZFX-C20/C25 ZFX-C10H/C15H ZFX-C10/C15
Number of connected cameras 2 1 1
Available measurement items All available Only the following items are available:
Pattern search Sensitive search Area Position Width Count Bright Hue Defect
Available position correction items All available Only the following items are available:
Edge position Area 1 model 2 model
Number of measurement items that can be measured simultaneously
Logging monitor function Available Not available
Max. 128 items/bank Max. 32 items/bank
2
ZFX-C Serial Communication Command Reference

Communication Interface Specifications

You can use the USB port or RS-232C/422 connector of the Controller to perform serial communication with external devices such as a personal computer or programmable controller. Serial communication functions in the RUN mode. Communication cannot be performed in the ADJ or MENU modes.
<USB>
This interface allows Full speed (12 Mbps) communications compliant with USB2.0 with a PC equipped with the same USB interface.
Synchronization method Start-stop
Transmission code ASCII (Binary format can be selected only when outputting measurement values set at
[Setup] - [Support] - [Calculation] - [Data].)
Communication speed USB2.0-compliant
Data length -
Parity -
Stop bit -
Delimiter CR, LF, CR+LF
Transmission protocol Normal (Note, however, that XMODEM protocol is used when sending image data, system
data and other data.)
<RS-232C/422>
This interface allows data communications compliant with the EIA RS-232C/422 standards up to a maximum speed of 115200 bps.
Synchronization method Start-stop
Transmission code ASCII (Binary format can be selected only when outputting measurement values set at
[Setup] - [Support] - [Calculation] - [Data].)
Communication speed 9600, 19200, 38400, 57600, 115200
Data length 7 bits, 8 bits
Parity None, even, odd
Stop bit 1 bit, 2 bits
Delimiter CR, LF, CR+LF
Transmission protocol Normal (Note, however, that XMODEM protocol is used when sending image data, system
data and other data.)
For details on how to set the communication specifications, refer to the User's Manual.
<Ethernet>
Communication protocol TCP/IP
Transmission mode Peer to Peer
ZFX-C Serial Communication Command Reference
Communication Interface Specifications
3

Connection

Ferrite cores
Note

Connecting a PC

<USB>
Use a USB cable (ZFX-XUSB) to connect the Controller to the PC.
Important
• When connecting the PC, refer to the Instruction Manual for the PC.
• Attach the ferrite cores supplied to both ends of the USB cable.
Installation of the USB driver is necessary only when connecting an external device to the USB interface for the first time. For the USB driver, please contact your OMRON representative.
<Ethernet>
Use a commercially available LAN cable to connect the Controller to the PC.
There are two ways of making the LAN connection to the PC, directly to the PC or via a hub.
Important
The following communications are not possible:
• Communications with the Controller from outside the LAN
• Communications between the Controller and two or more PCs
• Communications between Controllers
• Communications between the Controller and the PLC
4
Connection
ZFX-C Serial Communication Command Reference
1:1 Connection
If communications software for a TELNET connection is activated on the PC to access the Controller, the Controller will automatically switch to the Ethernet connection.
The parallel interface's ENABLE signal will be OFF during measurement.
To end the Ethernet connection, input the EXIT command.
Input command.
Execute measurement.
Output the processing result.
Receive the measurement result.
MEASURE
IP address
192.168.250.010
Start the TELNET communications software on the PC, and specify individual IP addresses to access each Controller. The method for inputting commands is the same as for a 1:1 connection.
HUB
IP address
192.168.250.100
IP address
192.168.250.101
IP address
192.168.250.102
When connecting the Controller directory to the PC, use a 10BASE-T or 100BASE-TX cross cable (Category 5 or higher). Limit the cable length to 30 m.
Example: A measurement command is input and the result is acquired.
1:N Connection
When connecting two or more Controllers to one PC via a hub, use a 10BASE-T or 100BASE-TX straight cable (Category 5 or higher). Also, limit the cable lengths between the PC and the hub, and the Controllers and the hub to 30 m, respectively. Be sure to set unique IP addresses to each Controller. Do not set duplicate IP addresses to Controllers.
Example:
ZFX-C Serial Communication Command Reference
Connection
5

Connecting a PLC

Use the exclusive RS-232C cable (ZFX-XPT2A) / RS-422 cable (ZFX-XPT2B) to connect the Controller to a PLC.
Important
When connecting to a PLC, refer to the Instruction Manual for the PLC.
6
Connection
ZFX-C Serial Communication Command Reference

About Communication Commands

Command data Delimiter
Response data
Record separator
Record separator
Record separator
KO
RE
When processing ends successfully
When processing fails

Command/Response Format

< Command >
< Response >
Command data Specifies the command and parameters in ASCII code.
Response data Stores the acquired data.
Delimiter This control code indicates the end of the data.
Record separator This delimiter is appended to one session's worth of output data. (default delimiter: CR)
ZFX-C Serial Communication Command Reference
About Communication Commands
7
Configuration of Measurement Value Data
Note
Field separator Number of digits past the decimal point: max. 3
Decimal separator: 1 digit
Sign + number of digits of integer section: max. 8 digits (Insert "0" for spaces.)
Record separator
Measurement value of data 0 Measurement value of data 1 Measurement value of data 31
23456 . 789
C
R
01
04567 . 800
C
R
00
04567 . 800
C
R
-0
123456.789
4567.8
-4567.8
< Measurement value > < Data structure >
Example: Number of digits of integer section: 7, number of digits past the decimal point: 3,
decimal separator: period
The following explains the output format of measurement values. To output measurement values by serial communication, the following items must be set.
Output content
Set the output content as an expression. Set the output content at [Setup] - [Support] - [Calculation] - [Data].
Output destination
Specify [RS-232C/422] or [USB] at [System] - [Output] - [Data output].
Output format
Set the output format at [System] - [Output] - [Serial output].
For detailed settings, refer to the User's Manual.
ASCII Format
Up to 32 results are output as a data structure of fixed length of up to 12 characters including the sign.
Sign The sign of the measurement value is stored. Plus: 0/Minus: -
Number of digits of integer section "0" is inserted in spaces in the integer section and digits past the decimal
Number of digits past the decimal point
Decimal separator
Field separator
Record separator
8
About Communication Commands
point. When a value is greater than the preset number of digits, all digits other than the sign digit become "9". Output range: -9999999.999 to 09999999.999
ZFX-C Serial Communication Command Reference
Binary Format
4 bytes
Measurement value of data 0 x 1000
Measurement value of data 1 x 1000
Measurement value of data 31 x 1000
4 bytes 4 bytes
Example: Data 0 "256.324" and data 1 "-1.000"
Data 0: 256324 (256.324 x 1000)
Data 1: -1000 (-1.000 x 1000)
Note
The value obtained by multiplying the measurement value by 1000 is output continuously as four bytes per single data item. Minus values are output as 2's complement. Up to 32 results can be output. The binary format differs from the ASCII format in that data separators, such as field separator or record separator, do not exist.
Output range: -2147483.648 to 2147483.647
$00 $44$03 $FF$E9 $FF $FC $18
• A value obtained by multiplying by 1000 also is output as the judgment result (JG).
OK: 0
NG: -1000 (-1 x 1000)
• When the measurement value is less than -2147483.648, "-2147483.648" is output.
When the measurement value is greater than 2147483.647, "2147483.647" is output.
ZFX-C Serial Communication Command Reference
About Communication Commands
9

Available Commands

Bank Control Commands
Command name Description Page
BANK (or BK) This command acquires the current bank No. p.12
This command switches the bank to be used. p.12
BANKGROUP (or BG) This command acquires the current bank group No. p.13
This command switches the bank group to be used. p.13
Measurement Control/Measurement Value Acquisition Commands
Command name Description Page
MEASDATA (or MD) This command acquires the measurement result of the measurement item. p.14
MEASURE (or M) This command executes a single measurement. p.15
This command starts continuous measurement. p.16
This command ends continuous measurement. p.16
This command performs re-measurement using saved images. p.16
Setting Acquisition/Change Commands
Command name Description Page
DATE (or DT) This command acquires the date and time of the calendar timer incorporated
into the Controller.
This command changes the date and time of the calendar timer incorporated into the Controller.
MODELSET (or MS) This command re-registers the model of the specified item. It does not reset
filters, etc.
MEASPARA (or MP) This command acquires the detailed conditions and thresholds of specified
measurement items.
This command sets the detailed conditions and thresholds of specified measurement items.
POSIPARA (or PP) This command acquires the detailed conditions and the threshold value of
position shift correction.
This command sets the detailed conditions and the threshold value of position shift correction.
PASSWORD (or PW) This command acquires the currently set password. p.23
It sets and changes the password character string. p.23
VERGET (or VR) This command acquires the version information of the Controller. p.24
p.17
p.17
p.18
p.19
p.19
p.21
p.21
Backup/Restore Commands
Command name Description Page
BGRLOAD (or GL)
BGRSAVE (or GS)
BNKLOAD (or BL) This command uploads bank data to the Controller from an external device. p.27
10
About Communication Commands
This command uploads bank group data to the Controller from an external device.
This command uploads bank group data to the Controller from an SD card. p.25
This command backs up bank group data to an external device from the Controller.
This command backs up bank group data to an SD card from the Controller. p.26
This command uploads bank data to the Controller from an SD card. p.27
ZFX-C Serial Communication Command Reference
p.25
p.26
Command name Description Page
BNKSAVE (or BS) This command backs up bank data to an external device from the Controller. p.28
This command backs up bank data to an SD card from the Controller. p.28
DATASAVE (or SV) This command saves the current settings to the Controller. p.29
IMGLOAD (or IL) This command uploads image data to the Controller from an external device. p.29
This command uploads image data to the Controller from an SD card. p.30
IMGSAVE (or IS) This command backs up image data to an external device from the Controller. p.31
This command backs up image data to an SD card from the Controller. p.32
SYSLOAD (or SL) This command uploads system data to the Controller from an external device. p.33
This command uploads system data to the Controller from an SD card. p.33
SYSSAVE (or SS) This command backs up system data to an external device from the Controller. p.34
This command backs up system data to an SD card from the Controller. p.34
Utility Commands
Command name Description Page
CLRMEAS (or CM) Clears measurement results. p.35
CLRERR (or CE) Clears error output results. p.35
ERRHISTORY (or EH) Outputs a history of up to five of the latest errors. p.36
CAPTURE(CP) Executes display capture, and outputs this to the host or SD card as an image. p.37
RESET (or RS) This command restarts the Controller. p.38
EXIT This command ends the TELNET connection for Ethernet communications and
disconnects the line.
p.38
ZFX-C Serial Communication Command Reference
About Communication Commands
11

Bank Control Commands

BANK
C
R
BK
C
R
or
C
R
ER
C
R
OK
C
R
When processing ends successfully
When processing fails
Bank No. (max. 2 digits)
BANK
C
R
BK
C
R
Bank No. (max. 2 digits)
or
Bank No. (max. 2 digits)
OK
C
R
ER
C
R
When processing ends successfully
When processing fails
Acquiring/Switching the Bank No. < BANK command >
Acquiring a bank No.
This command acquires the current bank No.
< Command format >
< Response format >
< Explanation of parameters >
Bank No. The acquired bank No. is returned. (0 to 31)
Switching to another bank
This command switches the bank to be used.
< Command format >
< Response format >
< Explanation of parameters >
Bank No. Specifies the bank No. after the bank is switched. (0 to 31)
12
About Communication Commands
ZFX-C Serial Communication Command Reference
Acquiring/Switching the Bank Group No. < BANKGROUP command >
BA
C
R
B G
C
R
NKGROUP
or
C
R
ER
C
R
OK
C
R
When processing ends successfully
When processing fails
Bank group No. (max. 2 digits)
BA
C
R
B G
C
R
NKGROUP
Bank group No. (max. 2 digits)
or
Bank group No. (max. 2 digits)
OK
C
R
ER
C
R
When processing ends successfully
When processing fails
Acquiring a bank group No.
This command acquires the current bank group No.
< Command format >
< Response format >
< Explanation of parameters >
Bank group No. The acquired bank group No. is returned. (0 to 31)
Switching bank group Nos.
This command switches the bank group to be used.
< Command format >
< Response format >
< Explanation of parameters >
Bank group No. Specifies the bank group No. after the bank group is switched. (0 to 31)
ZFX-C Serial Communication Command Reference
About Communication Commands
13
Measurement Control/Measurement Value Acquisition
MEA S
C
R
MD
C
R
D A T A
or
Data No. (max. 3 digits)
Data No. (max. 3 digits)
Measurement item No. (max. 3 digits)
Measurement item No. (max. 3 digits)
O K
C
R
E R
C
R
C
R
When processing ends successfully
When processing fails
Measurement value
Commands
Acquiring the Measurement Result of the Measurement Item < MEASDATA command >
This command acquires the measurement result of the measurement item.
< Command format >
< Response format >
< Explanation of parameters >
Measurement item No. Specifies the measurement item No. (0 to 127 (ZFX-C20/C25/C10H/C15H), 0 to 31 (ZFX-
C10/C15))
Data No. Specifies the data No. (0 to 127)
For details, see "Parameter List (p.39)."
Measurement value The acquired measurement value is returned in ASCII code.
The measurement value is not dependent on the format (ASCII/binary) specified in the output conditions.
• Minus sign: -, plus sign: none
• The size of the integer section is variable.
• The decimal point is indicated by a period ".".
• The maximum number of digits past the decimal point is three.
14
About Communication Commands
ZFX-C Serial Communication Command Reference
Executing Measurement < MEASURE command >
M EAS
C
R
M
C
R
URE
or
O K
C
R
E R
C
R
C
R
When processing ends successfully
When processing fails
Measurement value
Executing a Single Measurement
This command executes a single measurement.
< Command format >
< Response format >
< Explanation of parameters >
Measurement value The acquired measurement value is returned. The measurement value is output in the
format (ASCII/binary) specified in the output conditions.
Configuration of Measurement Value Data p.8
Important
Measurement values are output only when an expression is set at [Setup] - [Support] - [Calculation] - [Data], and [RS­232C/422] or [USB] is specified at [System] - [Output] - [Data output].
ZFX-C Serial Communication Command Reference
About Communication Commands
15
Starting Continuous Measurement
MEA S
C
R
M/C
C
R
URE / C
or
O K
C
R
E R
C
R
C
R
When processing ends successfully
When processing fails
Measurement value
(for number of continuous measurements)
MEA S
C
R
M/E
C
R
URE / E
or
OK
C
R
ER
C
R
When processing ends successfully
When processing fails
M EAS
C
R
M /
C
R
URE/I I
or
Save memory No. (max. 2 digits)
Save memory No. (max. 2 digits)
O K
C
R
E R
C
R
C
R
When processing ends successfully
When processing fails
• Measurement images are not stored in the specified save memory No.
• [Image storage] option is set to OFF
Measurement value
< Command format >
< Response format >
Ending Continuous Measurement
< Command format >
< Response format >
Performing re-measurement using saved images
< Command format >
< Response format >
< Explanation of parameters >
Measurement value The re-measurement value for the saved image of specified save memory No. is returned.
When the save memory No. is omitted, the re-measurement value for the latest saved
16
About Communication Commands
image is returned.
Configuration of Measurement Value Data p.8
ZFX-C Serial Communication Command Reference

Setting Acquisition/Change Commands

D ATE
C
R
D T
C
R
or
C
R
O K
C
R
E R
C
R
When processing ends successfully
When processing fails
Year/hour/day/hour/minute/second
D ATE
C
R
D T
C
R
Year/hour/day/hour/ minute/second
or
Year/hour/day/hour/ minute/second
OK
C
R
ER
C
R
When processing ends successfully
When processing fails
Acquiring/Changing the Date Setting < DATE command >
Acquiring the date setting
This command acquires the date and time of the calendar timer incorporated into the Controller.
< Command format >
< Response format >
< Explanation of parameters >
Year/hour/day/hour/ minute/second
The acquired date and time are returned as numerical values of two digits each. Example: 060301120020 12:00:20 on March 1st, 2006
.
Changing the Date Setting
This command changes the date and time of the calendar timer incorporated into the Controller.
< Command format >
< Response format >
< Explanation of parameters >
Year/hour/day/hour/ minute/second
ZFX-C Serial Communication Command Reference
Specifies the date and time. Example: 060301120020 12:00:20 on March 1st, 2006
About Communication Commands
17
Re-registering the Model of the Specified Item < MODELSET command >
MOD E
C
R
MS
C
R
LSET
or
Attribute
Measurement item No. (max. 3 digits)
Attribute Measurement
item No. (max. 3 digits)
OK
C
R
ER
C
R
When processing ends successfully
When processing fails
This command re-registers the model of the specified item. It does not reset filters, etc.
Important
The execution of this command does not re-register any model for the flexible search, graphic search and grouping items.
< Command format >
< Response format >
< Explanation of parameters >
Measurement item No. Specifies the measurement item No.
Measurement items: 0 to 127 (ZFX-C20/C25/C10H/C15H), 0 to 31 (ZFX-C10/C15) Position correction items: 0 to 3 0: Position correction 0 of camera 0 1: Position correction 1 of camera 0 2: Position correction 0 of camera 1 3: Position correction 1 of camera 1
Attribute Specifies measurement item or position correction item.
0: Measurement item 1: Position correction item Default is measurement item.
18
About Communication Commands
ZFX-C Serial Communication Command Reference
Loading...
+ 46 hidden pages