Serial Communication Command Reference: Smart Sensor
Serial Communication Command Reference: Smart Sensor
Serial Communication Command Reference: Smart Sensor
ZFX-C10
Serial Communication
Command Reference
User's Manual
Smart Sensor
Vision Sensor with built-in LCD monitor
ZFX-C10
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.
Smart Sensor
Vision Sensor with built-in LCD monitor
<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].)
Data length -
Parity -
Stop bit -
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
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
2
Communication Interface Specifications ZFX-C Serial Communication Command Reference
Connection
Connecting a PC
<USB>
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.
Ferrite cores
Note
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
3
ZFX-C Serial Communication Command Reference Connection
• 1:1 Connection
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.
Input command.
Execute
measurement. MEASURE
The parallel interface's ENABLE signal will be OFF during measurement.
Output the
processing result.
• 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:
IP address
192.168.250.010
HUB
4
Connection ZFX-C Serial Communication Command Reference
Connecting a PLC
Use the exclusive RS-232C cable (ZFX-XPT2A) / RS-422 cable
(ZFX-XPT2B) to connect the Controller to a PLC.
Important
5
ZFX-C Serial Communication Command Reference Connection
About Communication Commands
Command/Response Format
< Command >
Record
O K separator
Record separator This delimiter is appended to one session's worth of output data. (default delimiter: CR)
6
About Communication Commands ZFX-C Serial Communication Command Reference
Configuration of Measurement Value Data
The following explains the output format of measurement values.
To output measurement values by serial communication, the following items must be set.
Note
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].
ASCII Format
Up to 32 results are output as a data structure of fixed length of up to 12 characters including the sign.
Number of digits of integer section "0" is inserted in spaces in the integer section and digits past the decimal
point.
Number of digits past the decimal point
When a value is greater than the preset number of digits, all digits other
Decimal separator than the sign digit become "9".
Output range: -9999999.999 to 09999999.999
Field separator
Record separator
Example: Number of digits of integer section: 7, number of digits past the decimal point: 3,
decimal separator: period
7
ZFX-C Serial Communication Command Reference About Communication Commands
Binary Format
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
Note
• 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.
8
About Communication Commands ZFX-C Serial Communication Command Reference
Available Commands
Bank Control Commands
Command name Description Page
BANK (or BK) This command acquires the current bank No. p.11
BANKGROUP (or BG) This command acquires the current bank group No. p.12
MODELSET (or MS) This command re-registers the model of the specified item. It does not reset p.17
filters, etc.
PASSWORD (or PW) This command acquires the currently set password. p.17
It sets and changes the password character string. p.18
VERGET (or VR) This command acquires the version information of the Controller. p.18
Backup/Restore Commands
Command name Description Page
BGRLOAD (or GL) This command uploads bank group data to the Controller from an external p.19
device.
This command uploads bank group data to the Controller from an SD card. p.19
BGRSAVE (or GS) This command backs up bank group data to an external device from the p.20
Controller.
This command backs up bank group data to an SD card from the Controller. p.20
BNKLOAD (or BL) This command uploads bank data to the Controller from an external device. p.21
This command uploads bank data to the Controller from an SD card. p.21
BNKSAVE (or BS) This command backs up bank data to an external device from the Controller. p.22
This command backs up bank data to an SD card from the Controller. p.22
DATASAVE (or SV) This command saves the current settings to the Controller. p.23
IMGLOAD (or IL) This command uploads image data to the Controller from an external device. p.23
This command uploads image data to the Controller from an SD card. p.24
9
ZFX-C Serial Communication Command Reference About Communication Commands
Command name Description Page
IMGSAVE (or IS) This command backs up image data to an external device from the Controller. p.25
This command backs up image data to an SD card from the Controller. p.26
SYSLOAD (or SL) This command uploads system data to the Controller from an external device. p.27
This command uploads system data to the Controller from an SD card. p.27
SYSSAVE (or SS) This command backs up system data to an external device from the Controller. p.28
This command backs up system data to an SD card from the Controller. p.28
Utility Commands
Command name Description Page
RESET (or RS) This command restarts the Controller. p.29
EXIT This command ends the TELNET connection for Ethernet communications and p.29
disconnects the line.
10
About Communication Commands ZFX-C Serial Communication Command Reference
Bank Control Commands
Acquiring/Switching the Bank No. < BANK command >
B A N K CR or B K CR
< Response format >
When processing ends successfully
CR
BANK CR or B K CR
11
ZFX-C Serial Communication Command Reference About Communication Commands
Acquiring/Switching the Bank Group No. < BANKGROUP command >
B A N K G R O U P CR or B G CR
BANKGROUP CR or BG CR
12
About Communication Commands ZFX-C Serial Communication Command Reference
Measurement Control/Measurement Value Acquisition
Commands
Acquiring the Measurement Result of the Measurement Item < MEASDATA command >
This command acquires the measurement result of the measurement item.
< Command format >
MEASDA T A CR or MD CR
O K CR
13
ZFX-C Serial Communication Command Reference About Communication Commands
Executing Measurement < MEASURE command >
M E A S U R E CR or M CR
O K CR
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].
14
About Communication Commands ZFX-C Serial Communication Command Reference
Starting Continuous Measurement
MEASURE / C CR or M / C CR
O K CR
MEASURE / E CR or M / E CR
15
ZFX-C Serial Communication Command Reference About Communication Commands
Setting Acquisition/Change Commands
Acquiring/Changing the Date Setting < DATE command >
This command acquires the date and time of the calendar timer incorporated into the Controller.
< Command format >
D A T E CR or D T CR
< Response format >
When processing ends successfully
CR
Year/hour/day/hour/minute/second
O K CR
This command changes the date and time of the calendar timer incorporated into the Controller.
< Command format >
DA T E CR or D T CR
Year/hour/day/hour/ Year/hour/day/hour/
minute/second minute/second
< Response format >
When processing ends successfully
O K CR
16
About Communication Commands ZFX-C Serial Communication Command Reference
Re-registering the Model of the Specified Item < MODELSET command >
This command re-registers the model of the specified item. It does not reset filters, etc.
< Command format >
MOD E L S E T CR or MS CR
Attribute Attribute
Measurement Measurement
item No. item No.
(max. 2 digits) (max. 2 digits)
P A S S W O R D CR or P W CR
< Response format >
When processing ends successfully
CR
Password
O K CR
17
ZFX-C Serial Communication Command Reference About Communication Commands
Setting/Changing the password
P A S SWO R D CR or PW CR
Password Password
V E R G E T CR or V R CR
< Response format >
When processing ends successfully
Z FX - V e r X . X X CR
Version No.
Model information
O K CR
18
About Communication Commands ZFX-C Serial Communication Command Reference
Backup/Restore Commands
Uploading Bank Group Data < BGRLOAD command >
This command uploads the bank group data to the Controller by XMODEM protocol. The bank group data is
loaded to the specified bank group No.
< Command format >
BGR LOAD 0 CR or G L 0 CR
R E A D Y CR
This command uploads bank group data to the Controller from an SD card.
< Command format >
BGR LOAD 1 CR or G L 1 CR
File name Specifies the file name within eight alphanumeric characters. (An extension is not required.)
19
ZFX-C Serial Communication Command Reference About Communication Commands
Backing up Bank Group Data < BGRSAVE command >
This command backs up the bank group data from the Controller by XMODEM protocol.
< Command format >
BGRSAVE 0 CR or GS 0 CR
R E A D Y CR
This command backs up bank group data to an SD card from the Controller.
< Command format >
BGRSAVE 1 CR or GS 1 CR
File name The file can be given any name within eight alphanumeric characters. (An extension is not
required.)
20
About Communication Commands ZFX-C Serial Communication Command Reference
Uploading Bank Data < BNKLOAD command >
This command uploads the bank data to the Controller by XMODEM protocol.
< Command format >
BNK LOAD 0 CR or B L 0 CR
R E A D Y CR
BNK LOAD 1 CR or B L 1 CR
File name Specifies the file name within eight alphanumeric characters. (An extension is not
required.)
21
ZFX-C Serial Communication Command Reference About Communication Commands
Backing up Bank Data < BNKSAVE command >
This command backs up the bank data from the Controller by XMODEM protocol.
< Command format >
BNKSAVE 0 CR or B S 0 CR
R E A D Y CR
BNKSAVE 1 CR or B S 1 CR
File name The file can be given any name within eight alphanumeric characters. (An extension is not
required.)
22
About Communication Commands ZFX-C Serial Communication Command Reference
Saving the Current Settings to the Controller < DATASAVE command >
This command saves the current settings to the Controller.
No parameters are provided for this command.
< Command format >
D A T A S A V E CR or S V CR
< Response format >
When processing ends successfully
O K CR
I MG L O A D 0 CR or I L 0 CR
Save Save
memory No. memory No.
(max. 2 digits) (max. 2 digits)
R E A D Y CR
23
ZFX-C Serial Communication Command Reference About Communication Commands
Uploading image data to the Controller from an SD card
I MG L O A D 1 CR or I L 1 CR
Save Save
memory No. memory No.
(max. 2 digits) (max. 2 digits)
< Response format >
When processing ends successfully
O K CR
File name Specifies the file name (within 8 characters, excluding the file extension). File extensions
".GRY" (image captured by a monochrome camera) or ".BYR" (image captured by a color
camera) are allowed.
24
About Communication Commands ZFX-C Serial Communication Command Reference
Backing up Image Data < IMGSAVE command >
This command backs up image data from the Controller by XMODEM protocol.
< Command format >
I MG S A V E 0 CR or I S 0 CR
Save Save
memory No. memory No.
(max. 2 digits) (max. 2 digits)
< File transfer >
The image data is transferred by XMODEM (-CRC or SUM) after READY is received. XMODEM (-1K) is not
supported.
< Response format >
R E A D Y CR
25
ZFX-C Serial Communication Command Reference About Communication Commands
Backing up image data from the Controller to an SD card
I MG S A V E 1 CR or I S 1 CR
Save Save
memory No. memory No.
(max. 2 digits) (max. 2 digits)
< Response format >
When processing ends successfully
O K CR
File name Files can be given any file name up to 5 characters long. (Entry of a file extension is not
necessary.)
26
About Communication Commands ZFX-C Serial Communication Command Reference
Uploading System Data < SYSLOAD command >
This command uploads the system data to the Controller by XMODEM protocol.
No parameters are provided for this command.
< Command format >
SYS LOAD 0 CR or S L 0 CR
< File transfer >
The system data is transferred by XMODEM (-CRC or SUM) after READY is received. XMODEM (-1K) is not
supported.
< Response format >
R E A D Y CR
SYS LOAD 1 CR or S L 1 CR
27
ZFX-C Serial Communication Command Reference About Communication Commands
Backing up System Data < SYSSAVE command >
This command backs up the system data from the Controller by XMODEM protocol.
No parameters are provided for this command.
< Command format >
SYSSAVE 0 CR or S S 0 CR
< File transfer >
The system data is transferred by XMODEM (-CRC or SUM) after READY is received. XMODEM (-1K) is not
supported.
< Response format >
R E A D Y CR
SYSSAVE 1 CR or S S 1 CR
28
About Communication Commands ZFX-C Serial Communication Command Reference
Utility Commands
Restarting the Controller < RESET command >
This command restarts the Controller.
No parameters are provided for this command.
< Command format >
R E S E T CR or R S CR
< Response format >
When processing ends successfully
None
E X I T CR
29
ZFX-C Serial Communication Command Reference About Communication Commands
Parameter List
MEASDATA Command
Pattern search
Data No. Parameter Output Range
0 Judgment result 0: OK
-1: NG
-2: not measured
1 Correlation 0 to 100
5 Search number 0 to 99
Sensitive search
Data No. Parameter Output Range
0 Judgment result 0: OK
-1: NG
-2: not measured
1 Correlation 0 to 100
30
About Communication Commands ZFX-C Serial Communication Command Reference
Size inspection parameters
Area
Data No. Parameter Output Range
0 Judgment result 0: OK
-1: NG
-2: not measured
1 Area 0 to 9999999.999
Position
Data No. Parameter Output Range
0 Judgment result 0: OK
-1: NG
-2: not measured
Width
Data No. Parameter Output Range
0 Judgment result 0: OK
-1: NG
-2: not measured
1 Edge width 0 to 9999.999
31
ZFX-C Serial Communication Command Reference About Communication Commands
Data No. Parameter Output Range
3 Edge position Y1 -9999.999 to 9999.999
Count
Data No. Parameter Output Range
0 Judgment result 0: OK
-1: NG
-2: not measured
9 Width 1 0 to 9999.999
10 Pitch 2 0 to 9999.999
11 Width 2 0 to 9999.999
: : 0 to 9999.999
Angle
Data No. Parameter Output Range
0 Judgment result 0: OK
-1: NG
-2: not measured
32
About Communication Commands ZFX-C Serial Communication Command Reference
Data No. Parameter Output Range
3 Edge position Y1 -9999.999 to 9999.999
Brightness
Data No. Parameter Output Range
0 Judgment result 0: OK
-1: NG
-2: not measured
Hue
Data No. Parameter Output Range
0 Judgment result 0: OK
-1: NG
-2: not measured
1 Hue 0 to 360.0
2 Saturation 0 to 100.0
3 Value 0 to 100.0
33
ZFX-C Serial Communication Command Reference About Communication Commands
Data No. Parameter Output Range
8 Reference saturation 0 to 100.0
Defect
Data No. Parameter Output Range
0 Judgment result 0: OK
-1: NG
-2: not measured
1 Defect 0 to 255
34
About Communication Commands ZFX-C Serial Communication Command Reference
Example of Usage
The following describes an example procedure to communicate by non-procedural commands using Windows
standard tool HyperTerminal.
1 Start up HyperTerminal.
HyperTerminal is located under [Program]-[Accessory]-[Communication].
1-2 Select the COM port connected to the ZFX-C in the Connect using field.
35
ZFX-C Serial Communication Command Reference Example of Usage
1-3 Set the communication conditions.
36
Example of Usage ZFX-C Serial Communication Command Reference
2-2 Select the Settings tab, and then [ASCII Setup].
2-3 Mark the following checkboxes, and click OK to complete the setting.
For details on how to set the communication specifications, refer to the User's Manual.
ADJ
MENU RUN
Mode switch
37
ZFX-C Serial Communication Command Reference Example of Usage
5 Execute non-procedural communication.
5-2 The returned value corresponding to the command is returned from the Controller.
38
Example of Usage ZFX-C Serial Communication Command Reference
Version Upgrade Information
The following describes the content of the software version upgrade.
Ver1.00 to Ver1.10
Changes
The following backup and restore commands can now be used in Ethernet communications, too:
BGRLOAD, BGRSAVE, BNKLOAD, BNKSAVE, SYSLOAD, SYSSAVE
Ver1.10 to Ver1.20
Changes
The following image data backup/restore commands have been newly added:
IMGLOAD, IMGSAVE
Ver1.20 to Ver1.30
Changes
"Angle" has been newly added to the edge inspection parameters of the MEASDATA command.
39
ZFX-C Serial Communication Command Reference Version Upgrade Information
Revision History
A manual revision code appears as a suffix to the catalog number at the bottom of the front and back covers of
this manual.
Revision code
40
Revision History ZFX-C Serial Communication Command Reference
OMRON Corporation
Industrial Automation Company
Regional Headquarters
OMRON EUROPE B.V.
Sensor Business Unit,
Carl-Benz-Str. 4, D-71154 Nufringen,
Germany
Tel: (49)7032-811-0/Fax: (49)7032-811-199
Authorized Distributor: