CommunicationCommand English

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Communication Commands for

Industrial Code Reader

Operation Manual
Communication Commands for Industrial Code Reader • Operation Manual

Legal Information
© 2023 Hangzhou Hikrobot Co., Ltd. All rights reserved.
About This Manual
The Manual includes instructions for using and managing the Product. Pictures, charts,
images and all other information hereinafter are for description and explanation only. The
information contained in the Manual is subject to change, without notice, due to firmware
updates or other reasons. Please find the latest version of this Manual at the Hikrobot
website (https://en.hikrobotics.com/). Please use this Manual with the guidance and
assistance of professionals trained in supporting the Product.
Trademarks
and other Hikrobot's trademarks and logos are the properties of
Hikrobot in various jurisdictions. Other trademarks and logos mentioned are the properties
of their respective owners.
Disclaimer
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS MANUAL AND THE
PRODUCT DESCRIBED, WITH ITS HARDWARE, SOFTWARE AND FIRMWARE, ARE
PROVIDED "AS IS" AND "WITH ALL FAULTS AND ERRORS". HIKROBOT MAKES NO
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION,
MERCHANTABILITY, SATISFACTORY QUALITY, OR FITNESS FOR A PARTICULAR
PURPOSE. THE USE OF THE PRODUCT BY YOU IS AT YOUR OWN RISK. IN NO EVENT WILL
HIKROBOT BE LIABLE TO YOU FOR ANY SPECIAL, CONSEQUENTIAL, INCIDENTAL, OR
INDIRECT DAMAGES, INCLUDING, AMONG OTHERS, DAMAGES FOR LOSS OF BUSINESS
PROFITS, BUSINESS INTERRUPTION, OR LOSS OF DATA, CORRUPTION OF SYSTEMS, OR
LOSS OF DOCUMENTATION, WHETHER BASED ON BREACH OF CONTRACT, TORT
(INCLUDING NEGLIGENCE), PRODUCT LIABILITY, OR OTHERWISE, IN CONNECTION WITH
THE USE OF THE PRODUCT, EVEN IF HIKROBOT HAS BEEN ADVISED OF THE POSSIBILITY
OF SUCH DAMAGES OR LOSS.
YOU ACKNOWLEDGE THAT THE NATURE OF INTERNET PROVIDES FOR INHERENT
SECURITY RISKS, AND HIKROBOT SHALL NOT TAKE ANY RESPONSIBILITIES FOR
ABNORMAL OPERATION, PRIVACY LEAKAGE OR OTHER DAMAGES RESULTING FROM
CYBER-ATTACK, HACKER ATTACK, VIRUS INFECTION, OR OTHER INTERNET SECURITY
RISKS; HOWEVER, HIKROBOT WILL PROVIDE TIMELY TECHNICAL SUPPORT IF REQUIRED.
YOU AGREE TO USE THIS PRODUCT IN COMPLIANCE WITH ALL APPLICABLE LAWS, AND
YOU ARE SOLELY RESPONSIBLE FOR ENSURING THAT YOUR USE CONFORMS TO THE
APPLICABLE LAW. ESPECIALLY, YOU ARE RESPONSIBLE, FOR USING THIS PRODUCT IN A
MANNER THAT DOES NOT INFRINGE ON THE RIGHTS OF THIRD PARTIES, INCLUDING
WITHOUT LIMITATION, RIGHTS OF PUBLICITY, INTELLECTUAL PROPERTY RIGHTS, OR
DATA PROTECTION AND OTHER PRIVACY RIGHTS. YOU SHALL NOT USE THIS PRODUCT
FOR ANY PROHIBITED END-USES, INCLUDING THE DEVELOPMENT OR PRODUCTION OF
WEAPONS OF MASS DESTRUCTION, THE DEVELOPMENT OR PRODUCTION OF
CHEMICAL OR BIOLOGICAL WEAPONS, ANY ACTIVITIES IN THE CONTEXT RELATED TO

i
Communication Commands for Industrial Code Reader • Operation Manual

ANY NUCLEAR EXPLOSIVE OR UNSAFE NUCLEAR FUEL-CYCLE, OR IN SUPPORT OF


HUMAN RIGHTS ABUSES.
THE PERFORMANCE DATA IN THIS PUBLICATION IS BASED ON HIKROBOT'S INTERNAL
RESEARCH/EVALUATION. ACTUAL DATA MAY VARY DEPENDING ON SPECIFIC
CONFIGURATIONS AND OPERATING CONDITIONS AND HIKROBOT SHALL NOT BEAR THE
CONSEQUENCES ARISING THEREFROM.
IN THE EVENT OF ANY CONFLICTS BETWEEN THIS MANUAL AND THE APPLICABLE LAW,
THE LATTER PREVAILS.

Symbol Conventions
The symbols that may be found in this document are defined as follows.
Symbol Description
Indicates a hazardous situation which, if not avoided, will or
Danger
could result in death or serious injury.
Indicates a potentially hazardous situation which, if not avoided,
Caution could result in equipment damage, data loss, performance
degradation, or unexpected results.
Provides additional information to emphasize or supplement
Note
important points of the main text.

Available Model
This manual is applicable to the industrial code reader.

Contact Information
Hangzhou Hikrobot Co., Ltd.
E-mail: tech_support@hikrobotics.com
Website: https://en.hikrobotics.com/

ii
Communication Commands for Industrial Code Reader • Operation Manual

Contents
Chapter 1 Communication Commands ......................................................................................... 1
1.1 Overview............................................................................................................................... 1
1.2 Command Type ................................................................................................................... 1
1.3 Command Format............................................................................................................... 1
1.4 Communication Protocol .................................................................................................. 2
Chapter 2 Communication Settings ............................................................................................... 3
2.1 TCP Communication .......................................................................................................... 3
2.1.1 Client Software Settings ........................................................................................ 3
2.1.2 Debugging Tool Settings ....................................................................................... 3
2.2 UDP Communication.......................................................................................................... 4
2.2.1 Client Software Settings ........................................................................................ 4
2.2.2 Debugging Tool Settings ....................................................................................... 5
2.3 Serial Communication ....................................................................................................... 5
2.3.1 Client Software Settings ........................................................................................ 5
2.3.2 Debugging Tool Settings ....................................................................................... 6
Appendix A Communication Command List ................................................................................. 7

iii
Communication Commands for Industrial Code Reader • Operation Manual

Chapter 1 Communication Commands

1.1 Overview
The communication commands mentioned in this manual refer to the communication
commands provided by communication methods of TCP, UDP, and Serial. After the device
receives the command, it can perform functions of device control, user parameters, trigger
and I/O, parameter settings, etc.

1.2 Command Type


The communication commands mentioned in this manual includes three types:
● Get commands: Get parameter commands. Get the device’s current parameters by
returned results.
● Set commands: Set parameter commands. Configure the device’s current parameters.
● Exec commands: Execution commands. Reset device, etc.

Note
Refer to Appendix A Communication Command List for specific commands.

1.3 Command Format


The format of different commands is shown below.
Table 1-1 Command Format
Command Type Command Type

Send: < Get , cmdStr >


Get Commands
Return: < Get , cmdStr , param/errno >

Send: < Set , cmdStr , param >


Set Commands
Return: < Set , cmdStr , OK/errno >

1
Communication Commands for Industrial Code Reader • Operation Manual

Command Type Command Type

Send: < Exec , cmdStr >


Exec Commands
Return: < Exec , cmdStr , OK/errno >

Note
When the input commands do not conform to the common format and cannot parse the
corresponding fields, invalid will be returned. Examples are as follows:<cmdType, cmdstr,
param> invalid.

1.4 Communication Protocol


The device supports setting communication commands via following communication
protocols.
Table 1-2 Communication Protocol
No. Communication Protocol Description
It is a transmission control protocol/internetwork
protocol. It standardizes the data format and
1 TCP transmission method of all communication devices on
the network, and is a reliable connection-oriented
transmission protocol.
It is a user datagram protocol, providing application
programs with a data communication method without
2 UDP establishing a connection. This protocol is suitable for
scenarios with high transmission efficiency
requirements.
It is a communication method in which external
communication device and computer transmit data bit
3 Serial by bit through serial port. This protocol uses fewer data
cables and is suitable for long-distance communication
scenarios.

2
Communication Commands for Industrial Code Reader • Operation Manual

Chapter 2 Communication Settings


Before setting parameters via communication commands, you should configure
communication parameters of the client software and debugging tools to realize data
intercommunication between the device and the PC.

2.1 TCP Communication


The device supports communication via the TCP protocol. Before using it, you should
configure related communication parameters.

2.1.1 Client Software Settings


Steps
1. Right click the device in Device Connection, and click Feature Tree.
2. Go to External Command Control, and select TCP as External Command Protocols.
3. Enable TCP Command Enable, and enter TCP Command Port.

Figure 2-1 TCP Communication

Note
● Refer to the user manual of the client software for detailed installation and operation.
● You need to set the device’s mode to Normal before specific parameter settings.

2.1.2 Debugging Tool Settings


Run TCP debugging tool and configure communication parameters.

Note
● Contact technical support to get the installation package of the TCP debugging tool.
● Parameters configured in debugging tool should be the same with those in IDMVS client
software.

3
Communication Commands for Industrial Code Reader • Operation Manual

Before You Start


The device’s communication parameters have been configured.
Steps
1. Select TCP Server as Protocol.
2. Set local host IP and local host port.
● Local host IP: Make sure that the host’s IP address is same with the device.
● Local host port: Make sure that the host’s port is same with configured TCP’s port.
3. (Optional) Set data format, storage, and sending and receiving method in receive and
send options area.
4. Click Connect to finish.
5. (Optional) Click Disconnect to disconnect communication.

Note
Send communication commands in sending area to configure the device correspondingly.
Refer to Appendix A for detailed commands.

2.2 UDP Communication


The device supports communication via the UDP protocol. Before using it, you should
configure related communication parameters.

2.2.1 Client Software Settings


Steps
1. Right click the device in Device Connection, and click Feature Tree.
2. Go to External Command Control, and select UDP as External Command Protocols.
3. Enable UDP Command Enable, and enter UDP Command Port.

Figure 2-2 UDP Communication

Note
● Refer to the user manual of the client software for detailed installation and operation.
● You need to set the device’s mode to Normal before specific parameter settings.

4
Communication Commands for Industrial Code Reader • Operation Manual

2.2.2 Debugging Tool Settings


Run UDP debugging tool and configure communication parameters.

Note
● Contact technical support to get the installation package of the UDP debugging tool.
● Parameters configured in debugging tool should be the same with those in IDMVS client
software.

Before You Start


The device’s communication parameters have been configured.
Steps
1. Select UDP as Protocol.
2. Set local host IP and local host port.
● Local host IP: Make sure that the host’s IP address is same with the device.
● Local host port: Make sure that the host’s port is same with configured UDP’s port.
3. (Optional) Set data format, storage, and sending and receiving method in receive and
send options area.
4. Click Connect to finish.
5. (Optional) Click Disconnect to disconnect communication.

Note
Send communication commands in sending area to configure the device correspondingly.
Refer to Appendix A for detailed commands.

2.3 Serial Communication


The device supports communication via the serial protocol. Before using it, you should
configure related communication parameters.

2.3.1 Client Software Settings


Steps
1. Right click the device in Device Connection, and click Feature Tree.
2. Go to External Command Control, and select Serial as External Command Protocols.
3. Enable Serial Command Enable, set Serial Baudrate, Serial Data Bits, Serial Parity, and
Serial Stop Bits.

5
Communication Commands for Industrial Code Reader • Operation Manual

Figure 2-3 Serial Communication

Note
● Refer to the user manual of the client software for detailed installation and operation.
● You need to set the device’s mode to Normal before specific parameter settings.

2.3.2 Debugging Tool Settings


Run serial debugging tool and configure communication parameters.

Note
● Contact technical support to get the installation package of the serial debugging tool.
● Parameters configured in debugging tool should be the same with those in IDMVS client
software.

Before You Start


● The device’s communication parameters have been configured.
● Make sure that the device and the PC have been connected via serial port cable.
Steps
1. Select Serial as Protocol.
2. Set serial baudrate, serial data bits, serial parity, and serial stop bits.
3. (Optional) Set data format, storage, and sending and receiving method in receive and
send options area.
4. Click Connect to finish.
5. (Optional) Click Disconnect to disconnect communication.

Note
Send communication commands in sending area to configure the device correspondingly.
Refer to Appendix A for detailed commands.

6
Communication Commands for Industrial Code Reader • Operation Manual

Appendix A Communication Command List

Table Appendix A-1 Communication Command List


Category Command Name Command Returned Result Parameter Description Remark
Device Reset <Exec,Reboot> <Exec,Reboot,OK> -
<Set,RunMode,0-2> <Set,RunMode,OK/errno> 0: Normal
Run Mode 1: Raw
Device Control <Get,RunMode> <Get,RunMode,0-2/errno> 2: Test
<Set,Acq,0/1> <Set,Acq,OK/errno> 0: Stop acquisition
Acquisition Mode
<Get,Acq> <Get,Acq,0-2/errno> 1: Start acquisition
<Set,UserCur,0/1> <Set,UserCur,OK/errno> 0: Default parameter After settings,
<Get,UserCur> <Get,UserCur,0-3/errno> 1: Parameter 1 current parameters
Current Parameter Set
2: Parameter 2 will be loaded
3: Parameter 3 automatically.
<Set,UserStart,0/1> <Set,UserStart,OK/errno> 0: Default parameter
1: Parameter 1
Start Parameter Set
User Parameter <Get,UserStart> <Get,UserStart,0-3/errno> 2: Parameter 2
3: Parameter 3
Save User Parameter <Exec,UserSave> <Exec,UserSave,OK> -
<Set,Burst,1-1023> <Set,Burst,OK/errno> Configure it according
to actual demands and
Burst
<Get,Burst> <Get,Burst,1-1023/errno> its range is from 1 to
1023.
1D Code Number <Set,1DNum,1-200> <Set,1DNum,OK/errno> Configure it according The range of ID2000

7
Communication Commands for Industrial Code Reader • Operation Manual

Category Command Name Command Returned Result Parameter Description Remark


to actual demands and device is 1 to 20.
<Get,1DNum> <Get,1DNum,1-200/errno> its range is from 1 to
200.

<Set,2DNum,1-200> <Set,2DNum,OK/errno> Configure it according


to actual demands and The range of ID2000
2D Code Number
<Get,2DNum> <Get,2DNum,1-200/errno> its range is from 1 to device is 1 to 20.
200.
<Set,TriMode,0/1> <Set,TriMode,OK/errno> 0: Non-trigger mode
Trigger Mode
1: Trigger mode
<Get,TriMode> <Get,TriMode,0-1/errno>
<Set,TriSrc,0-11> <Set,TriSrc,OK/errno> 0: LinIn0
1: LinIn1
2: LinIn2 Non-trigger mode
3: LinIn3 returns -1.
4: Counter0 Supported command
5: TCP settings return OK.
Trigger Source Selection
<Get,TriSrc> <Get,TriSrc,0-11/errno> 6: UDP Not supported
7: Software trigger commands
Trigger and I/O
8: Serial return not supported.
9: SelfTri
10: MainSub
11: UsbStart
<Get,TriTcpPort> <Get,TriTcpPort,value/errno> Configure port number
according to actual
TCP Trigger Port No. <Set,TriTcpPort,
<Set,TriTcpPort,OK/errno> demands and its range
1-65535> is from 1 to 65535.
<Get,TriTcpStopEnable> <Get,TriTcpStopEnable,0/1/errno>
0: Disable
TCP Trigger End Enable <Set,TriTcpStopEnable,0
<Set,TriTcpStopEnable,OK/errno> 1: Enable
/1>

8
Communication Commands for Industrial Code Reader • Operation Manual

Category Command Name Command Returned Result Parameter Description Remark


<Get,TriTcpStart> <Get,TriTcpStart,string> Configure string length
according to actual
TCP Trigger Start
<Set,TriTcpStart,string> <Set,TriTcpStart,OK/errno> demands and its range
is from 1 to 31. The string length of
Configure string length TCP trigger start and
according to actual TCP trigger end
<Get,TriTcpStop> <Get,TriTcpStop,string> cannot be the same.
TCP Trigger End demands and its range
is from 1 to 31.
<Set,TriTcpStop,stop> <Set,TriTcpStop,OK/errno>
<Get,TriUdpPort> <Get,TriUdpPort,value/errno> Configure port number
according to actual
UDP Trigger Port No. <Set,TriUdpPort,
<Set,TriUdpPort,OK/errno> demands and its range
1-65535> is from 1 to 65535.
<Get,TriUdpStopEnable> <Get,TriUdpStopEnable,0/1/errno>
0: Disable
UDP Trigger End Enable <Set,TriUdpStopEnable,0
<Set,TriUdpStopEnable,OK/errno> 1: Enable
/1>
<Get,TriUdpStart> <Get,TriUdpStart,string> Configure string length
according to actual
UDP Trigger Start
<Set,TriUdpStart,start> <Set,TriUdpStart,OK/errno> demands and its range The string length of
is from 1 to 31. UDP trigger start and
<Get,TriUdpStop> <Get,TriUdpStop,string> Configure string length UDP trigger end
according to actual cannot be the same.
UDP Trigger End
<Set,TriUdpStop,stop> <Set,TriUdpStop,OK/errno> demands and its range
is from 1 to 31.
<Get,TriSeriBaud> <Get,TriSeriBaud,value/errno> 2: 4800
3: 9600
4: 19200
Serial Trigger Baudrate
<Set,TriSeriBaud,2-7> <Set,TriSeriBaud,OK/errno> 5: 38400
6: 57600
7: 115200

9
Communication Commands for Industrial Code Reader • Operation Manual

Category Command Name Command Returned Result Parameter Description Remark


<Get,TriSeriStopEnable> <Get,TriSeriStopEnable,0/1/errno>
0: Disable
Serial Trigger End Enable <Set,TriSeriStopEnable,0
<Set,TriSeriStopEnable,OK/errno> 1: Enable
/1>
<Get,TriSeriStart> <Get,TriSeriStart,string> Configure string length
according to actual
Serial Trigger Start
<Set,TriSeriStart,start> <Set,TriSeriStart,OK/errno> demands and its range The string length of
is from 1 to 31. serial trigger start
<Get,TriSeriStop> <Get,TriUdpStop,string> Configure string length and serial trigger end
according to actual cannot be the same.
Serial Trigger End
<Set,TriSeriStop,stop> <Set,TriSeriStart,OK/errno> demands and its range
is from 1 to 31.
Software Trigger <Exec,TriSoft> <Exec,TriSoft,OK> -

<Get,ReadAll> <Get,ReadAll,0/1/errno> 0: Disable


All Symbologies Enable
<Set,ReadAll,0/1> <Set,ReadAll,OK/errno> 1: Enable

<Get,Code39> <Get,Code39,0/1/errno> 0: Disable


Code 39 Enable
<Set,Code39,0/1> <Set,Code39,OK/errno> 1: Enable

<Get,Code128> <Get,Code128,0/1/errno> 0: Disable


Code Reading Code 128 Enable
<Set,Code128, 0/1> <Set,Code128,OK/errno> 1: Enable
Enable
<Get,Code93> <Get,Code93,0/1/errno> 0: Disable
Code 93 Enable
<Set,Code93,0/1> <Set,Code93,OK/errno> 1: Enable

<Get,ITF14> <Get,ITF14,0/1/errno> 0: Disable


ITF 14 Enable
<Set,ITF14, 0/1> <Set,ITF14,OK/errno> 1: Enable

ITF 25 Enable <Get,ITF25> <Get,ITF25,0/1/errno> 0: Disable

10
Communication Commands for Industrial Code Reader • Operation Manual

Category Command Name Command Returned Result Parameter Description Remark


<Set,ITF25, 0/1> <Set,ITF25,OK/errno> 1: Enable

<Get,EAN8> <Get,EAN8,0/1/errno> 0: Disable


EAN 8 Enable
<Set,EAN8, 0/1> <Set,EAN8,OK/errno> 1: Enable

<GetEAN13> <GetEAN13,0/1/errno> 0: Disable


EAN 13 Enable
<Set,EAN13, 0/1> <Set,EAN13,OK/errno> 1: Enable

<Get,UPCA> <Get,UPCA,0/1/errno> 0: Disable


UPCA Enable
<Set,UPCA, 0/1> <Set,UPCA,OK/errno> 1: Enable

<Get,UPCE> <Get,UPCE,0/1/errno> 0: Disable


UPCE Enable
<Set,UPCE, 0/1> <Set,UPCE,OK/errno> 1: Enable

<Get,Codebar> <Get,Codebar,0/1/errno> 0: Disable


CodeBar Enable
<Set,Codebar, 0/1> <Set,Codebar,OK/errno> 1: Enable

<Get,MSI> <Get,MSI,0/1/errno> 0: Disable


MSI Enable
<Set,MSI, 0/1> <Set,MSI,OK/errno> 1: Enable

<Get,CNPOST> <Get,CNPOST,0/1/errno> 0: Disable


China Post Enable
<Set,CNPOST, 0/1> <Set,CNPOST,OK/errno> 1: Enable

<Get,Code11> <Get,Code11,0/1/errno> 0: Disable


Code 11 Enable
<Set,Code11, 0/1> <Set,Code11,OK/errno> 1: Enable

<Get,IND25> <Get,IND25,0/1/errno> 0: Disable


Industrial 25 Enable
<Set,IND25, 0/1> <Set,IND25,OK/errno> 1: Enable

11
Communication Commands for Industrial Code Reader • Operation Manual

Category Command Name Command Returned Result Parameter Description Remark


<Get,PDF417> <Get,PDF417,0/1/errno> 0: Disable
PDF 417 Enable
<Set,PDF417, 0/1> <Set,PDF417,OK/errno> 1: Enable

<Get,QR> <Get,QR,0/1/errno> 0: Disable


QE Code Enable
<Set,QR, 0/1> <Set,QR,OK/errno> 1: Enable

<Get,DM> <Get,DM,0/1/errno> 0: Disable


Data Matrix Enable
<Set,DM,0/1> <Set,DM,0/1> 1: Enable

<Get, Matrix25> <Get, Matrix25,0/1/errno> 0: Disable


Matrix 25 Enable
<Set,Matrix25,0/1> <Set, Matrix25,0/1> 1: Enable

Enable Smart Adjustment


Smart Adjustment <Exec,Tune> <Exec,Tune,OK/errno> -
of Parameters

Note
Here we list some error code:
● EXT_CMD_ERR_OK= 0, the commands is executed.
● EXT_CMD_ERR_NOT_SUPPORT = -1, the command is not supported.
● EXT_CMD_ERR_PARAM_INVALID= -2, the input parameters are invalid.
● EXT_CMD_ERR_CMD_INVALID= -3, the input command strings are invalid.
● EXT_CMD_ERR_DEV_BUZY= -4, the device is busy.
● EXT_CMD_ERR_EXEC_TIMEOUT= -5, executing commands is timed out.
● EXT_CMD_ERR_UNKNOWN = -6, other unknown error.

12
UD30926B

You might also like