Setting of double-color mixed data instruction and double-color thermal printing method

By setting two-color mixed data instructions and adjusting heating strategies in the thermal printer, the problem of poor dual-color mixed printing and printing results cannot be achieved in two-color thermal printing, and an efficient and pure dual-color printing effect is achieved.

CN119427949AActive Publication Date: 2025-02-14ZHUHAI XPRINTER ELECTRONICS TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411645693.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-02-14
Estimated Expiration
2044-11-18

AI Technical Summary

Technical Problem

Existing thermal printers cannot achieve dual-color mixed printing in two-color thermal printing, and the printing effect is poor and the printing speed is slow.

Method used

By setting the two-color mixed data instruction, 2 digits represent 1 heating point attribute, and adding the corresponding heating point color attributes to achieve accurate switching of the printed color. At the same time, by changing the data gate signal status multiple times, multiple heating of the corresponding color attribute heating points is achieved to ensure that the temperature is stable in the range presented by different colors.

Benefits of technology

Two-color mixed printing is realized, which improves printing speed and printing effect, ensuring that the color of the printed content is pure and without string colors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119427949A_ABST
    Figure CN119427949A_ABST
Patent Text Reader

Abstract

The invention provides a double-color mixed data instruction setting and double-color thermal printing method. The double-color mixed data instruction setting and double-color thermal printing method comprises the steps that an instruction header is selected according to the format of a double-color mixed data instruction; selecting a bitmap mode of the thermal printer, wherein the bitmap mode comprises a plurality of different multiple height and multiple width modes based on a normal size; setting the number of bytes of the bitmap in the horizontal direction, wherein the number of bytes is set as an even number according to a required heating point; setting the number of bitmap points in the vertical direction; bitmap data are set, the bitmap data comprise heating point attributes and color attribute setting, two bits represent one heating point attribute, each heating point attribute comprises one heating point and the corresponding color attribute, and the heating point and the corresponding color attribute of the heating point are adjacently set in one byte. According to the method, the attribute of one heating point is represented by two bits, and the color attribute of the corresponding heating point is added, so that the printing color is accurately switched to the heating point, and the effect of a double-color mixed printing function is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of thermal printing, and in particular to a setting of a two-color mixed data instruction and a two-color thermal printing method. Background Art

[0002] With the continuous development of the manufacturing industry, ordinary monochrome thermal printing can no longer meet the public's demand for thermal printing, and two-color thermal printing has been born. The principle of this technology is to use two different colors of thermal coatings on thermal paper and combine them with corresponding printing settings. When the print head is heated, different colors of coatings will produce different chemical reactions, so two different colors of text or patterns are printed on the thermal label. Two-color thermal printing technology makes the printed labels or tickets richer and more diverse, and can meet the needs of more scenarios. However, the application of two-color paper by existing thermal printers is still imperfect, and there are the following disadvantages:

[0003] 1. Only one color can be printed at a time, so when printing in two colors, you often need to use commands frequently to switch the printing color;

[0004] 2. The switching of printing colors cannot be accurate to the heating point, so there is no mixed printing method for two-color images such as red and black;

[0005] 3. Due to the above defects, the content printed by two-color thermal printing is impure in color, the printing effect is poor, and the printing speed is very slow, which is only about 20mm / s.

[0006] Therefore, it is necessary to design a two-color mixed data instruction setting and a two-color thermal printing method that can achieve two-color mixed printing, improve printing speed and printing effect. Summary of the invention

[0007] The present invention provides a two-color mixed data instruction setting and a two-color thermal printing method, which are mainly used to solve the problems that the existing two-color thermal printing cannot achieve two-color mixed printing, the printing effect is poor and the printing speed is slow, so as to achieve the purpose of achieving two-color mixed printing and improving the printing speed and printing effect.

[0008] The present invention achieves the above-mentioned purpose through the following technical solutions:

[0009] A method for setting a two-color mixed data instruction, comprising:

[0010] An instruction header is selected according to the format of the two-color mixed data instruction.

[0011] Select the bitmap mode of the thermal printer, which includes several different double-height and double-width modes based on the normal size.

[0012] Set the horizontal bitmap byte number, which is set to an even number based on the required heating points.

[0013] Set the number of vertical bitmap dots.

[0014] Set bitmap data, the bitmap data including heating point attributes and color attribute settings, wherein 2 bits represent 1 heating point attribute, each of the heating point attributes includes a heating point and its corresponding color attribute, and the heating point and the color attribute corresponding to the heating point are adjacently set in 1 byte.

[0015] A further solution is that the two-color mixed data instruction uses a serial port for data transmission, and the instruction is sent in hexadecimal format, and its corresponding instruction header is 1D 75 30.

[0016] A further solution is that the two-color mixed data instruction is expressed as:

[0017] 1D 75 30m xL xH yL yH d1...dk

[0018] Among them, m represents the bitmap mode, xL xH represents the number of horizontal bitmap bytes, yL yH represents the number of vertical bitmap dots, and d1...dk represents the bitmap data.

[0019] A further solution is that the parameter value range of the bitmap mode is: 0≤m≤3, 48≤m≤51.

[0020] Among them, m=0, 48 represents the normal mode, m=1, 49 represents the double-width mode, m=2, 50 represents the double-height mode, and m=3, 51 represents the double-height and double-width mode.

[0021] A further solution is that when the bitmap mode is the normal mode, the vertical and horizontal resolutions of the thermal printer are consistent, both of which are 200 dpi.

[0022] When the bitmap mode is the double-width mode, the lateral resolution of the thermal printer is 100 dpi.

[0023] When the bitmap mode is the double-height mode, the vertical resolution of the thermal printer is 100 dpi.

[0024] When the bitmap mode is the double-height-double-width mode, the longitudinal and lateral resolutions of the thermal printer are consistent, both of which are 100 dpi.

[0025] A further solution is that, in the horizontal bitmap byte number, xL represents the lower 16 bits, and xH represents the upper 16 bits, and the value range thereof is: 0≤xL, xH≤255.

[0026] The number of bytes of the horizontal bitmap is equal to xL+xH*256.

[0027] In the vertical bitmap dots, yL represents the lower 16 bits, and yH represents the upper 16 bits, and the value range is: 0≤yL, yH≤255.

[0028] The number of bitmap dots in the vertical direction is equal to yL+yH*256.

[0029] A further solution is that in the bitmap data, k=(xL+xH*256)*(yL+yH*256).

[0030] A further solution is that the bits in a byte of the bitmap data where the heating points are set are: 1, 3, 5, 7, and then bits 2, 4, 6, and 8 in the byte are used to set the color attributes corresponding to the heating points on bits 1, 3, 5, and 7 respectively.

[0031] A two-color thermal printing method, using the method for setting a two-color mixed data instruction to set a two-color mixed data instruction, comprises:

[0032] S1: using the two-color mixed data instruction to parse the two-color content and generate two-color mixed data.

[0033] S2: Processing the two-color mixed data in steps according to the printing settings of the thermal printer, and sending the two-color mixed data of the first STEP to the buffer area of ​​the thermal printer head through the serial port.

[0034] S3: sending a latch signal to the thermal printer head, and the thermal printer head latches the two-color mixed data in the buffer area into the heating dot matrix of the thermal printer according to the latch signal.

[0035] S4: The state of the data selection signal of the thermal printer is raised to start heating, and during the heating period, the state of the data selection signal of the thermal printer is changed multiple times to achieve multiple heating of the first color content, thereby completing the printing of the first color content and preheating of the heating points corresponding to the second color content.

[0036] S41: When the state of the data strobe signal is pulled high, the second color data in the current STEP is sent in advance to the buffer area of ​​the thermal printer head.

[0037] S5: Continue heating the heating points corresponding to the second color content by changing the state of the data selection signal multiple times, thereby completing printing of the second color content.

[0038] S51: When the state of the data strobe signal is pulled high, the two-color mixed data of the next STEP is sent in advance to the buffer area of ​​the thermal printer head.

[0039] S6: Repeat steps S3-S5 until all the two-color mixed data are printed.

[0040] A further solution is that the two-color mixing data of each STEP contains 8 heating points and their corresponding color attributes, wherein in step S4, 6 heatings are achieved by changing the state of the data selection signal, and in step S5, 2 heatings are achieved by changing the state of the data selection signal.

[0041] It can be seen that the present invention has the following beneficial effects:

[0042] 1. The present invention sets a two-color mixed data instruction, uses 2 bits to represent the attributes of one heating point, and adds the color attributes of the corresponding heating point. Compared with the traditional solution that can only print one color each time and switch the printed color by frequently using instructions, the two-color mixed data instruction setting solution designed by the present invention can accurately switch the printing color to the heating point, thereby realizing the two-color mixed printing function.

[0043] 2. The present invention realizes multiple heating of the heating points of corresponding color attributes by repeatedly changing the state of the data selection signal, and when processing the two-color heating of red and black paper, the red content is first heated multiple times to ensure that the temperature is stable in the interval where the red is presented, and at the same time, the heating points corresponding to the black content are preheated; then the black content is continued to be heated to ensure that the temperature is stable in the interval where the black is presented, thereby realizing the heating processing of the two-color content. In particular, for the problem that most of the two-color papers on the market are more sensitive to temperature changes, the heating temperature is stabilized by the above heating method, thereby improving the printing effect, making the printed content color distinct and preventing the problem of cross-color.

[0044] 3. The present invention sets the switching time of the data selection signal state, such as the data selection signal is pulled high for 25 microseconds and then pulled low for 10 microseconds each time, so as to meet the necessary heating time for each color content. Compared with the existing solution of switching the printing color by frequently using instructions, the present invention ensures that the color of the printed content is pure and improves the printing effect.

[0045] 4. Compared with the traditional scheme of switching printing colors by frequently using instructions, the hybrid two-color hybrid printing designed by the present invention does not need to frequently use switching instructions when switching colors, thereby greatly saving printing time. In addition, the present invention sends the next data to be heated to the cache area of ​​the thermal printer head in advance while pulling up the data selection signal, thereby streamlining the total processing time of each STEP as much as possible, achieving the maximum improvement of the printing speed of two-color printing, and greatly reducing the problem of serious tailing caused by excessive heating of the head chip at a slow speed.

[0046] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It is a schematic diagram of the heating points and their corresponding color attributes in each byte in an embodiment of the present invention.

[0048] Figure 2 It is a schematic diagram of a heating frame for printing each dot row according to an embodiment of the present invention.

[0049] Figure 3 It is a schematic diagram of a heating framework for printing each STEP according to an embodiment of the present invention.

[0050] Figure 4 This is an embodiment of the present invention that prints a heating timing logic diagram for each STEP.

[0051] Figure 5 It is a flow chart of a two-color thermal printing method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] A method for setting a dual-color mixed data instruction

[0054] A method for setting a dual-color mixed data instruction involved in the present invention includes:

[0055] An instruction header is selected according to the format of the two-color mixed data instruction.

[0056] Select the bitmap mode of the thermal printer, which includes several different double-height and double-width modes based on the normal size.

[0057] Set the horizontal bitmap byte number, which is set to an even number based on the required heating points.

[0058] Set the number of vertical bitmap dots.

[0059] Set bitmap data, the bitmap data including heating point attributes and color attribute settings, wherein 2 bits represent 1 heating point attribute, each of the heating point attributes includes a heating point and its corresponding color attribute, and the heating point and the color attribute corresponding to the heating point are adjacently set in 1 byte.

[0060] Specifically, the format of the two-color mixed data instruction described in this embodiment includes but is not limited to ASCII code, hexadecimal code and decimal code. If the ASCII code is used, the corresponding instruction header is GS v 0; if the hexadecimal code is used, the corresponding instruction header is 1D 75 30; if the decimal code is used, the corresponding instruction header is 29 118 48.

[0061] In this embodiment, the two-color mixed data instruction uses a serial port for data transmission, and the instruction is sent in hexadecimal format, and its corresponding instruction header is 1D 75 30.

[0062] In this embodiment, the two-color mixed data instruction is expressed as:

[0063] 1D 7530m xL xH yL yH d1...dk

[0064] Among them, m represents the bitmap mode, xL xH represents the number of horizontal bitmap bytes, yL yH represents the number of vertical bitmap dots, and d1...dk represents the bitmap data.

[0065] In this embodiment, the parameter value range of the bitmap mode is: 0≤m≤3, 48≤m≤51.

[0066] Among them, m=0, 48 represents the normal mode, m=1, 49 represents the double-width mode, m=2, 50 represents the double-height mode, and m=3, 51 represents the double-height and double-width mode.

[0067] Table 1 Bitmap mode selection table

[0068] m model Vertical resolution (DPI) Horizontal resolution (DPI) 0,48 normal 200 200 1,49 Double width 200 100 2,50 Double High 100 200 3,51 Double width, double height 100 100

[0069] Referring to Table 1, the m value is related to the resolution of the thermal printer, wherein when the bitmap mode is the normal mode, the longitudinal and lateral resolutions of the thermal printer are consistent, both being 200 dpi.

[0070] When the bitmap mode is the double-width mode, the lateral resolution of the thermal printer is 100 dpi.

[0071] When the bitmap mode is the double-height mode, the vertical resolution of the thermal printer is 100 dpi.

[0072] When the bitmap mode is the double-height-double-width mode, the longitudinal and lateral resolutions of the thermal printer are consistent, both of which are 100 dpi.

[0073] Specifically, this embodiment uses a 203dpi thermal printer, whose horizontal and vertical resolutions are consistent, and m is usually 0, so as to ensure the clarity of the printed image.

[0074] In this embodiment, in the horizontal bitmap byte number, xL represents the lower 16 bits, and xH represents the upper 16 bits, and the value range thereof is: 0≤xL, xH≤255.

[0075] The number of bytes of the horizontal bitmap is equal to xL+xH*256.

[0076] In the vertical bitmap dots, yL represents the lower 16 bits, and yH represents the upper 16 bits, and the value range is: 0≤yL, yH≤255.

[0077] The number of bitmap dots in the vertical direction is equal to yL+yH*256.

[0078] Specifically, in this embodiment, xL xH and yL yH refer to the width and height of the data bitmap to be sent. Since a byte is at most 255, two bytes are used to represent the width and height respectively, and the width and height are at most 65535 respectively.

[0079] The calculation method of xL xH is as follows:

[0080] Using bit operation: xL=W&0xFF, xH=W>>16&0xFF

[0081] Use division: xL = W% 256, xH = W% 256

[0082] Where W represents width. The calculation method of yL and yH is similar and will not be repeated here.

[0083] In this embodiment, in the bitmap data, k=(xL+xH*256)*(yL+yH*256).

[0084] See also Figure 1 In this embodiment, the bits in one byte of the bitmap data in which the heating points are set are: 1, 3, 5, and 7, and the 2, 4, 6, and 8 bits in the byte are respectively used to set the color attributes corresponding to the heating points on the above 1, 3, 5, and 7 bits.

[0085] Specifically, in each byte of the bitmap data described in this embodiment, the corresponding bit of the heating point is 1, indicating that the corresponding bit of the point is heated, and is 0, indicating that the corresponding bit of the point is not heated; the corresponding bit of the color attribute is 1, indicating that the point is the corresponding bit of the first color, and is 0, indicating that the point is the corresponding bit of the second color.

[0086] Specifically, this embodiment takes red and black two-color thermal printing as an example, where the corresponding bit of the color attribute is 1 to indicate that the dot is red, and 0 to indicate that the dot is black. 8 bits in 1 byte represent 8 dots, of which 4 dots are set as heating dots to indicate whether the corresponding bits of the corresponding color attributes are heated. For example:

[0087] Hexadecimal 0xFF is converted to binary: 1111 1111 means heating 4 red dots;

[0088] Hexadecimal 0xAA is converted to binary: 1010 1010 means heating 4 black dots;

[0089] Hexadecimal 0x00 is converted to binary: 0000 0000 means 4 black but none of them are heated;

[0090] Hexadecimal 0x55 converted to binary: 0101 0101 means 4 reds but none of them are heated.

[0091] A two-color thermal printing method embodiment

[0092] See also Figure 5 The present invention relates to a two-color thermal printing method, which uses the two-color mixed data instruction setting method to set the two-color mixed data instruction. This embodiment takes heating red and black paper as an example, and includes:

[0093] S1: using the two-color mixed data instruction to parse the two-color content and generate two-color mixed data.

[0094] S2: Processing the two-color mixed data in steps according to the printing settings of the thermal printer, and sending the two-color mixed data of the first STEP to the buffer area of ​​the thermal printer head through the serial port SPI.

[0095] S3: sending a latch signal LATCH to the thermal printer head, and the thermal printer head latches the two-color mixed data in the buffer area into the heating dot matrix of the thermal printer according to the latch signal LATCH.

[0096] See also Figure 2 Specifically, in this embodiment, when the motor of the thermal printer just starts, the data is latched 100 microseconds after the two-color mixed data of the first STEP is sent, thereby ensuring that there is enough time for data transmission.

[0097] S4: The state of the data selection signal STB of the thermal printer is pulled high to start heating, and during the heating period, the state of the data selection signal STB of the thermal printer is changed multiple times to achieve multiple heating of the first color content, thereby completing the printing of the first color content and preheating of the heating points corresponding to the second color content.

[0098] Specifically, in this embodiment, the data selection signal STB is pulled high for 25 microseconds and then pulled low for 10 microseconds each time. During the heating period, the state of the data selection signal STB will be changed 6 times, that is, 6 heatings are performed to ensure that the temperature is stable in the range where the red content is presented, and the heating point of the black content is preheated to the temperature critical point where black is about to be presented.

[0099] S41: When the state of the data strobe signal STB is pulled high, the second color data in the current STEP is sent in advance to the buffer area of ​​the thermal printer head.

[0100] Specifically, this embodiment starts heating when the data selection signal STB of the thermal printer head is pulled high. In order to shorten the processing time of the current STEP, the black data Data_Black of the current STEP is pre-sent to the buffer of the high thermal printer head storage area, that is, the cache area.

[0101] S5: Continue heating the heating points corresponding to the second color content by changing the state of the data selection signal STB multiple times, thereby completing printing of the second color content.

[0102] Specifically, in this embodiment, the data selection signal STB is pulled high for 50 microseconds and then pulled low for 10 microseconds. During the heating period, the state of the data selection signal STB will be changed twice, that is, the remaining two heatings are performed to ensure that the temperature is stable in the range where black content is presented.

[0103] S51: When the state of the data strobe signal STB is pulled high, the two-color mixed data of the next STEP is sent in advance to the buffer area of ​​the thermal printer head.

[0104] Specifically, in this embodiment, when the data selection signal STB of the thermal printer head is pulled high, the heating point of the black content continues to be heated. In order to further shorten the heating process time, the two-color mixed data of the next STEP is sent in advance to the buffer area of ​​the thermal printer head.

[0105] S6: Repeat steps S3-S5 until all the two-color mixed data are printed.

[0106] Specifically, the two-color thermal printing method of this embodiment further includes:

[0107] S61: Repeat steps S3-S5, and after the heating process is completed for the two-color mixed data of one dot line, paper feeding process is performed.

[0108] S62: After the paper feed setting time is reached, steps S2-S61 are repeated to print the next dot-line data until all the two-color mixed data are printed.

[0109] See also Figure 4 Specifically, in this embodiment, it takes time for the serial port SPI to send point data, for example:

[0110] The operating frequency is 36MHz, 4STEP prints 1 dot row, then 1 dot row is 640dots (bits), and the time required for data transmission is:

[0111] 640×(1 / 32 000 000) seconds = 20 microseconds

[0112] It can be seen that at least 20 microseconds are required between two latches to send data.

[0113] In this embodiment, the two-color mixing data of each STEP includes 8 heating points and their corresponding color attributes, wherein 6 heatings are achieved by changing the state of the data selection signal STB in step S4, and 2 heatings are achieved by changing the state of the data selection signal STB in step S5.

[0114] Specifically, the stepper motor of the thermal printer in this embodiment adopts a 4-step mode, that is, one dot row is printed every 4 steps, each step is heated 8 times, and the heating logic is the same. The heating process of each step is as follows:

[0115] In step S4, the mixed data Data_All of red and black is sent to the thermal printer head buffer through the serial port SPI, and then a latch signal pulse LATCH of 1 microsecond is sent to the thermal printer head. After receiving the data, the thermal printer head latches the buffer data into the heated dot matrix, and then pulls up the data strobe signal STB line state of the thermal printer head to start heating. In order to save the processing time of STEP, the black data Data_Black of the current STEP will be sent to the thermal printer head buffer in advance while the data strobe signal STB is pulled up. During the heating period, the state of the data strobe signal STB will be changed 6 times, that is, the part is heated 6 times, so as to print out the red content and preheat the heating point corresponding to the black content.

[0116] In step S5, the black data Data_Black has been sent to the buffer of the thermal printer head in step S4, and the heating point of the black content has been preheated to the critical temperature point that will show black, so the heating point of the black content can be heated to print black. At this time, the heating is also to pull up the data strobe signal STB, and at the same time as the data strobe signal STB is pulled up, the Data_All data of the next STEP is sent to the buffer of the thermal printer head in advance to save the processing time of the STEP. During the heating period, the state of the data strobe signal STB will be changed twice, that is, the part is heated for the remaining 2 times, so as to print out the black content. The two-color content printing of the dot row is completed.

[0117] The above-mentioned embodiments are only preferred embodiments of the present invention and cannot be used to limit the scope of protection of the present invention. Any non-substantial changes and substitutions made by technicians in this field on the basis of the present invention shall fall within the scope of protection required by the present invention.

Claims

1. A method for setting a two-color mixed data instruction, characterized in that: include: Selecting an instruction header according to the format of the two-color mixed data instruction; Selecting a bitmap mode of the thermal printer, the bitmap mode comprising a plurality of different double-height and double-width modes based on a normal size; Set the horizontal bitmap byte number, which is set to an even number according to the required heating points; Set the number of vertical bitmap dots; Set bitmap data, the bitmap data including heating point attributes and color attribute settings, wherein 2 bits represent 1 heating point attribute, each of the heating point attributes includes a heating point and its corresponding color attribute, and the heating point and the color attribute corresponding to the heating point are adjacently set in 1 byte.

2. The method for setting a dual-color mixed data instruction according to claim 1, characterized in that: The two-color mixed data instruction uses a serial port for data transmission, and the instruction is sent in hexadecimal format, and its corresponding instruction header is 1D 75 30.

3. The method for setting a dual-color mixed data instruction according to claim 2, characterized in that: The two-color mixed data instruction is expressed as: 1D 75 30m xL xH yL yH d1...dk Among them, m represents the bitmap mode, xL xH represents the number of horizontal bitmap bytes, yL yH represents the number of vertical bitmap dots, and d1...dk represents the bitmap data.

4. The method for setting a dual-color mixed data instruction according to claim 3, characterized in that: The parameter value range of the bitmap mode is: 0≤m≤3, 48≤m≤51; Among them, m=0, 48 represents the normal mode, m=1, 49 represents the double-width mode, m=2, 50 represents the double-height mode, and m=3, 51 represents the double-height and double-width mode.

5. The method for setting a dual-color mixed data instruction according to claim 4, characterized in that: When the bitmap mode is the normal mode, the vertical and horizontal resolutions of the thermal printer are consistent, both of which are 200 dpi; When the bitmap mode is double-width mode, the horizontal resolution of the thermal printer is 100 dpi; When the bitmap mode is the double-height mode, the vertical resolution of the thermal printer is 100 dpi; When the bitmap mode is the double-height-double-width mode, the longitudinal and lateral resolutions of the thermal printer are consistent, both of which are 100 dpi.

6. The method for setting a dual-color mixed data instruction according to claim 3, characterized in that: In the horizontal bitmap byte number, xL represents the lower 16 bits, and xH represents the higher 16 bits, and the value range is: 0≤xL, xH≤255; Wherein, the number of bytes of the horizontal bitmap is equal to xL+xH*256; In the vertical bitmap point number, yL represents the lower 16 bits, and yH represents the upper 16 bits, and the value range is: 0≤yL, yH≤255; The number of bitmap dots in the vertical direction is equal to yL+yH*256.

7. The method for setting a dual-color mixed data instruction according to claim 3, characterized in that: In the bitmap data, k=(xL+xH*256)*(yL+yH*256).

8. The method for setting a dual-color mixed data instruction according to claim 1, characterized in that: The bits in one byte of the bitmap data where the heating points are set are: 1, 3, 5, and 7. Then, bits 2, 4, 6, and 8 in the byte are used to set the color attributes corresponding to the heating points on bits 1, 3, 5, and 7, respectively.

9. A two-color thermal printing method, characterized in that: The method for setting a two-color mixed data instruction according to any one of claims 1 to 8 is used to set a two-color mixed data instruction, comprising: S1: using the two-color mixed data instruction to parse the two-color content and generate two-color mixed data; S2: Processing the two-color mixed data in steps according to the printing settings of the thermal printer, and sending the two-color mixed data of the first STEP to the buffer area of ​​the thermal printer head through the serial port; S3: sending a latch signal to the thermal printer head, and the thermal printer head latches the two-color mixed data in the buffer area into the heating dot matrix of the thermal printer according to the latch signal; S4: pulling up the state of the data strobe signal of the thermal printer to start heating, and during the heating period, the state of the data strobe signal of the thermal printer is changed multiple times to achieve multiple heating of the first color content, thereby completing the printing of the first color content and preheating of the heating point corresponding to the second color content; S41: when the state of the data strobe signal is pulled high, the second color data in the current STEP is sent in advance to the buffer area of ​​the thermal printer head; S5: continuously heating the heating points corresponding to the second color content by changing the state of the data strobe signal multiple times, thereby completing printing of the second color content; S51: when the state of the data strobe signal is pulled high, the two-color mixed data of the next STEP is sent in advance to the buffer area of ​​the thermal printer head; S6: Repeat steps S3-S5 until all the two-color mixed data are printed.

10. The two-color thermal printing method according to claim 9, characterized in that: The two-color mixing data of each STEP includes 8 heating points and their corresponding color attributes, wherein 6 heatings are achieved by changing the state of the data selection signal in step S4, and 2 heatings are achieved by changing the state of the data selection signal in step S5.

Citation Information

Patent Citations

  • Printing method and device of heat-sensitive printer

    CN101923450A

  • Double-color digital printing device and method

    CN106125525A

  • Thermal sensitive printer and hot control method

    CN1282014A

  • Method and apparatus for two-color thermal point of sale (POS) printing

    CN1502092A

  • Method for creating control data for multi-color direct thermal printing

    US20220203703A1