Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Instructions of HMI Connecting Printer

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

Instructions of Coolmay HMI connection printer

Instructions of Coolmay HMI


connection printer
Ⅰ. Printer type: miniature thermal printer (with RS232 or RS485 serial port)
Ⅱ. HMI comes with or HMI in HMI/PLC all in one the optional RS232 or RS485 serial port,
the pin definition is as follows:

1/7
Instructions of Coolmay HMI connection printer

2/7
Instructions of Coolmay HMI connection printer

Ⅴ. The communication parameters in HMI software are set as shown below:

Note: COM1 is used for single-screen RS232 communication port, COM2 is set with
RS485; RS232 or RS485 is optional for HMI of HMI/PLC all in one, communication port is
COM2 and printer communication.

Ⅳ. Write the content program that needs to be printed in HMI programming software. The
following is the description of the Rongda printer routine.

The component setting instructions added on the routine: 1. Added registers D0, D1, D2
3/7
Instructions of Coolmay HMI connection printer

for displaying data; 2. Added variable text LW1074 for setting the name of the tester to be
printed, variable text length reserved 10 (1 register = 2 characters / 1 Chinese); 3, Added
variable text LW1010, LW1030, LW1050, LW1070 for viewing the content to be printed,
the variable text length is reserved 30 respectively, the specific content to be printed Set in
the Clock macro; 4. Add a start button to execute the program in the print macro. The
execution button address is also set in the Clock macro.
After setting up the screen and the macro program, the effect of executing the print button
on the HMI is as follows:

Ⅴ. Macro writing - print content setting

4/7
Instructions of Coolmay HMI connection printer

The data frame sent by the above macro command and the serial port
debugging assistant is as follows. You can see that each line sends a new line
5/7
Instructions of Coolmay HMI connection printer

character of 0A 00. If the printout results in the debugging, there is no line


break. You can use the serial port debugging assistant to receive data to see if
there is a line break. Character 0A 00.

Note: The relevant macro syntax is used to connect the printer.


CHR → Convert text to ASCII, such as CHR (A1, "A2")
Convert the text in A2 to an ASCII code with A1. The length of the string is up
to 50 characters.
(1 Word = 2 characters / 1 Chinese).

STR → integer to ASCII string conversion, such as STR (A1, A2, A3)
The integer in the A2 address is converted to an ASCII string and placed at the
address specified by A1. The decimal point is specified by A3. The data format
is only Word (1 Word = 2 characters / 1 Chinese).

S.DATE → Take the system date string, such as A1 = Sys.DATE()


The current date of the system is converted to a string and stored in the
register address specified by A1. The format is "YYYY-MM-DD" which
occupies 5 Words.

S.TIME → Take the system time string, such as A1 = Sys.TIME()


The system current time is converted to a string and stored in the register
address specified by A1. The format is "HH:MM:SS" which occupies 4 Words.

TXD → Send data, such as TXD (A1, A2) < Communication protocol must be:
Free Protocol >
It is to send data from the A1 address to the corresponding UART port of
LINK1, and send A2 bytes in total. The data format is only Word (1 Word = 2
bytes).

RXD → Receive data, such as RXD (A1, A2) < Communication protocol must
be: Free Protocol >
That is, the corresponding UART port is selected from LINK1 to receive data to
the start address specified by A1. If A2 specifies K, it is specified to read K
bytes. If A2 specifies LW, all bytes of the buffer are read, and the read word is
6/7
Instructions of Coolmay HMI connection printer

read. The number of sections is placed in the address specified by A2. The
data format is only Word (1 Word = 2 bytes).

Ⅵ. the example program print effect

张力值:Tension value
毫牛:Milligram
液体:Liquid
相密度:Phase density
实验人:Tester
小明:Xiao Ming

7/7

You might also like