LC Communication Control Command V1.9 Instruction

in Ezcad Manual,

Revision

V1.1 Add serial number related commands (edit_snum, snum_index, edit_textdata);
V1.2 Add acquisition times related commands (getcount, get_textdata)
V1.3 Add command (get_currfile,get_filelist)
V1.4 Add command (set_systime)
V1.5 Add command (get_currtext)
V1.6 Add command (changeobj_size,changeobj_power,changeobj_marknum)
V1.7 Add command (reset_sernum)
V1.8 Add command (setfixeddata)
V1.9 Add command (setlimitcount)

Communication support and parameter

communication mode support serial communication and network communication to send data frames to realize data communication. Check bits can be set to check communication data.

Serial communication parameters: 115200,8,N,1

The network address can be set by yourself, the default is 192.168.1.158

The port number is 8050.

Sending data definition as follows

Start character: ASCII code bit 0x02 0x05 of STX
End character: ASCII code bit 0x03 of ETX

The frame of sending data frame is as follows:

STX Data sent ETX check code

Calculation of check code:

Remove all data in the middle of 0x02 and 0x03 and perform XOR(exclusive OR) operation to obtain an 8bit check code

The returned data definition as follows

Start character: ASCII code bit 0x02 0x06 of STX
End character: ASCII code bit 0x03 of ETX

The frame of the returned data frame is as follows:
STX returned data ETX

Special data transmission

After setting the sending request setting, if data can be sent to the system after sending data each time, the request data frame will be returned automatically: 02 06 system:1 03

Sending after marking is completed: 02 06 system:2 03
Sending when data verification fails: data_error

Commands Description

  1. Command Name: load

Function: load template files in the system
Format definition: STX load: filepath ETX
Return: 1 for successful loading and 0 for failure
STX load:1/0 ETX

Example: load a file named 123
STX load:123 ETX
02 05 6c 6f 61 64 3a 31 32 33 03
=>Return data: STX load:1 ETX
02 06 6c 6f 61 64 3a 31 03

  1. Command Name: seta

Function: send print data
Format definition: STX seta:data#v1= text+pos#x|y|r|ng ETX
data#v1=text means to set the content of variable V1 as text
pos#x|y|r|ng means to set the position information, offset of X and y, rotation angle
R (0-360 degrees), and “ng” is valid or invalid(0 valid, 1 invalid)
Return: 1 for setting success and 0 for failure
STX seta:1/0 ETX

Example: setting variable content V1=001a, V2=002
STX seta:data#v1=001A;v2=002 ETX
02 05 73 65 74 61 3A 64 61 74 61 23 76 31 3D 30 31 41 3B 76 32 3D 30 32 03
=> return data STX seta:1 ETX
02 06 73 65 74 61 3a 31 03

Send content and position, variable V1=001a, the angle of the first object rotates 45
degrees
STX seta:data#v1=001A+pos#1=0|0|45|0 ETX
02 05 73 65 74 61 3a 64 61 74 61 23 76 31 3d 30 30 31 41 2b 70 6f 73 23 31 3d 30
7c 30 7c 34 35 7c 30 03

Set all objects to rotate 45 degrees
STX seta:pos#0|0|45|0 ETX
02 05 73 65 74 61 3A 70 6F 73 23 30 7C 30 7C 34 35 7C 30 03

  1. Command Name: start

Function: start processing
Format definition: STX start: ETX
Return: 1 for successful startup and 0 for failure
STX start:1/0 ETX

Example: start processing
STX start: ETX
02 05 73 74 61 72 74 3a 03
=>Return data STX start: 1 ETX

  1. Command Name: stop

Function: stop processing
Format definition: STX stop: ETX
Return: 1 for successful stop and 0 for failure
STX stop:1/0 ETX

Example: stop processing
STX stop: ETX
02 05 73 74 6f 70 3a 03
=>Return data STX
stop:1 ETX

  1. Command Name: sys_sta

Function: get system status
Format definition: STX sys_sta:parameter ETX
Parameter form: whether to get errors and warnings (optional parameter)
get error and warning:errsta get both error and warning;

Return: get success return ismark=1,warn=0,err=0
STX 06 sys_sta:ismark=1,warn=0,err=0 ETX

Example: Get system status
STX sys_sta: ETX
02 05 73 79 73 5F 73 74 61 3A 03
=> Return data indicating that processing is in progress
STX 06 sys_sta:ismark=1 ETX

Get system status and error warning information
STX sys_sta:errsta ETX
02 05 73 79 73 5F 73 74 61 3A 65 72 72 73 74 61 03
=> returns data indicating that processing is in progress, warn represents the number of warnings and err represents the number of errors
STX 06 sys_sta:ismark=0,warn=0,err=0 ETX

  1. Command Name: geta

Function: get the number of buffers
Format definition: STX geta: ETX
Return: 1 for success and 0 for failure
STX geta:quantity ETX

Example:
STX geta: ETX
02 05 67 65 74 61 3a 03
=>Return data, 02 06 geta:100 03 indicates that there are 100 data in the buffer

  1. Command Name: edit_snum

Function: set current value of serial number
Format definition: STX edit_snum:parameter ETX
Parameter form: SN name, set SN value, whether to reset the SN to its initial value, whether it is in edit status.

SN Name: set in SN variable interface;
Set SN value: the current SN value to be set, the range needs to be between the start value and end value of the SN;
Whether to reset SN to its initial value: 1: reset, 0: not reset. If reset SN is set, the SN value does not need to be set;
Whether it is in edit status: 1: in editing status (default), 0: printing status

Return: modified successfully return status 1, failure return status 0
STX edit_snum:status ETX

Example: set the variable name as V1, the serial number value to be set is 8, don’t reset the serial number 0, it is in edit status when modifying
STX edit_snum:v1,8,0,1 ETX
02 05 65 64 69 74 5F 73 6E 75 6D 3A 76 31 2C 38 2C 30 2C 31 03
=>Return data, 02 06 edit_snum:1 03 indicates that the setting is successful.

  1. Command Name: snum_index

Function: get the current value of serial number
Format definition: STX snum_index:parameter ETX
Parameter form: SN name, whether it is in editing status

SN Name: set in SN variable interface;
Whether it is in edit status: 1: in editing status (default), 0: printing status

Return: returns the current SN value
STX snum_index:current value ETX

Example: set the variable name to V1 and it is in edit status when modifying
STX snum_index:v1,1 ETX
02 05 73 6E 75 6D 5F 69 6E 64 65 78 3A 76 31 2C 31 03
=>Return data, 02 06 snum_index:8 03 indicates that the current value of the current serial number is 8.

  1. Command Name: edit_textdata

Function: modify object content
Format definition: STX edit_textdata:parameter ETX
Parameter form: object name, setting content, whether it is in edit status

Object name: object name can be set in the object list;
Set content: set object content;
Whether it is in edit status: 1: in editing status(default), 0: printing status

Return: modified successfully return status 1, failure return status 0
STX edit_textdata:status ETX

Example: set the variable name as v-obj and the content as 001, it is in editing status when modifying
STX edit_textdata:v-obj,001,1 ETX
02 05 65 64 69 74 5F 74 65 78 74 64 61 74 61 3A 76 2D 6F 62 6A 2C 30 30 31 2C 31 03
=>Return data, 02 06 edit_textdata:1 03 indicates that the modification is successful.

  1. Command Name: get_textdata

Function: get object content
Format definition: STX get_textdata:parameter ETX
Parameter form: object name, whether it is in edit status

Object name: object name can be set in the object list;
Whether it is in edit status: 1: in editing status (default), 0: printing status

Return: the object content is returned after modified successfully, failure return status 0
STX get_textdata:object content ETX

Example: set the variable name to v-obj, to get the contents in printing status
STX get_textdata:v-obj,0 ETX
02 05 67 65 74 5F 74 65 78 74 64 61 74 61 3A 76 2D 6F 62 6A 2C 30 03
=>Return data, 02 06 get_textdata:ABC 03 indicates that the current content of the object v-obj is ABC.

  1. Command Name: getcount

Function: obtain processing times
Format definition: STX getcount:parameter ETX
Parameter form: optional parameter Tr: indicates the number of triggers to obtain
Return: returns the processing times
STX getcount:processing times ETX

Example: obtain processing times
STX getcount: ETX
02 05 67 65 74 63 6F 75 6E 74 3A 03
=>Return data, 02 06 getcount:23 03 indicates that the current processing times are 23.

  1. Command name: get_currfile

Function: Get the current file name
Format definition: STX get_currfile ETX
Parameter form: None

Return: return the file name
STX get_currfile:file name ETX

Example:
STX get_currfile ETX
02 05 67 65 74 5F 63 75 72 72 66 69 6C 65 03
=> return data, 02 06 get_currfile:xx 03 means the current file name is xx.

  1. Command name: get_filelist

Function: Get the file list
Format definition: STX get_filelist ETX
Parameter form: None

Return: return the file list
STX get_filelist:list ETX

Example:
STX get_filelist ETX
02 05 67 65 74 5F 66 69 6C 65 6C 69 73 74 03
=> return data, 02 06 get_filelist:xx;yy 03 means the file list is xx;yy.

  1. Command name: set_systime

Function: Modify the system time
Format definition: STX set_systime:parameter ETX
Parameter form: year-month-day hour:minute:second (such as 2020-01-08 13:16:07)

Return: Successful modification returns status 1, failure returns status 0
STX set_systime:state ETX

Example:
STX set_systime:2020-01-08 13:16:07 ETX
02 05 73 65 74 5F 73 79 73 74 69 6D 65 3A 32 30 32 32 30 2D 30 31 2D 30 38 20 31 33 3A 31 36 3A 30 37 03
=> return data, 02 06 set_systime:1 03

  1. Command name: clearbuf

Function: Clear the data in buffer
Format definition: STX clearbuf ETX
Parameter form: None

Return:
STX clearbuf:1 ETX

  1. Command name: get_currtext

Function: Get the current print content
Format definition: STX get_currtext ETX
Parameter form: None

Return: return all text and barcode object content
STX get_currtext:all content ETX

Example: Get the current print content.
STX get_currtext ETX
02 05 67 65 74 5F 63 75 72 72 74 65 78 74 03
=> return HEX: 02 06 67 65 74 5F 63 75 72 72 74 65 78 74 3A 54 31 3D 54 45 58 54 30 30 30 31 20 5B 31 5D 03
=> parse as text data: 02 06 get_currtext:T1=TEXT0001 [1] 03 means the first text object T1 current content is TEXT0001.
Note: [1] means that the sequence number 0001 is currently printed the first time. If there
are multiple text, use ” ** ” to separate, such as T1=TEXT0001 [1] ** T2=ABC0005 [1]

  1. Command name: changeobj_size

Function: Change the size of the object
Format definition: STX changeobj_size: parameter ETX
Parameter form: object name, width, height

object name: the name of the object can be set in the object list;
width: set the overall width of the object (set to -1 not change)
height: set the overall height of the object (set to -1 not change);

Return: modify successfully to return state 1, failure to return state 0
STX changeobj_size:state ETX

Example: set the variable name v-obj, width 10mm, height 10mm. STX changeobj_size:v-obj,10,10 ETX
02 05 63 68 61 6E 67 65 6F 62 6A 5F 73 69 7A 65 3A 76 2D 6F 62 6A 2C 31 30 2C 31 30 03
=> return data, 02 06 changeobj_size:1 03 means modify successfully.

  1. Command name: changeobj_power

Function: Modify the power of the object
Format definition: STX changeobj_power:parameter ETX
Parameter form: object name, power (0-100 percentage)

object name: the object name can be set in the object list;
power: set the printing power of the object (0-100);

Return: modify successfully to return state 1, failure to return state 0
STX changeobj_power:state ETX

Example: set the variable name v-obj, power 80%
STX changeobj_power:v-obj,80 ETX
02 05 63 68 61 6E 67 65 6F 62 6A 5F 70 6F 77 65 72 3A 76 2D 6F 62 6A 2C 38 30 03
=> Return data, 02 06 changeobj_power:1 03 means modify successfully.

  1. Command name: changeobj_marknum

Function: Modify object print count
Format definition: STX changeobj_marknum:parameter ETX
Parameter form: object name, print count

object name: the object name can be set in the object list;
print count: set the number of times the object is printed;

Return: modify successfully return state 1, failure return state 0
STX changeobj_marknum:state ETX

Example: Set the variable name v-obj, the number of printing times is 5
STX changeobj_marknum:v-obj,5 ETX
02 05 63 68 61 6E 67 65 6F 62 6A 5F 6D 61 72 6B 6E 75 6D 3A 76 2D 6F 62 6A 2C 35 03
=> Return data, 02 06 changeobj_marknum:1 03 means modify successfully.

  1. Command name: reset_sernum

Function: reset serial number
Format definition: STX reset_sernum ETX
Return: Return 1 for successful start, 0 for failure
STX reset_sernum:1/0 ETX

Example: Reset serial number
STX reset_sernum ETX
02 05 72 65 73 65 74 5F 73 65 72 6E 75 6D 03
=> return data STX reset_sernum:1 ETX

  1. Command name: setfixeddata

Function: Set the content of fixed mode variables
Format definition: STX setfixeddata:parameter ETX
Parameter form: variable name (variable name starting with FIXED), variable content, whether to be edited or not

variable name: add system variable, variable name starting with FIXED;
variable content: content information;
Whether the variable is edited or not: 1: in edit state, 0: print state (default state)

Return: 1 for start successfully, 0 for failure
STX setfixeddata:1/0 ETX

Example: Set the content of fixed mode variables
STX setfixeddata:FIXED-1,1234 ETX
02 05 73 65 74 66 69 78 65 64 64 61 74 61 3A 46 49 58 45 44 2D 31 2C 31 32 33 34 03
=> return data STX setfixeddata:1 ETX

  1. Command name: setlimitcount

Function: Set the conditional count
Format definition: STX setlimitcount:parameter ETX
Parameter form: maximum number, current number

maximum number: printing will stop after printing the maximum number;
current count: initial count, default is 0 when not set;

Return: 1 for successful start, 0 for failure
STX setlimitcount:1/0 ETX

Example: Set the conditional count to 50, the initial number is 0
STX setlimitcount:50 ETX
02 05 73 65 74 6C 69 6D 69 74 63 6F 75 6E 74 3A 35 30 03
=> return data STX setlimitcount:1 ETX

Leave a comment

Your email address will not be published. Required fields are marked *