In order to realize the human-machine dialogue, a human-machine interface is needed. Since the production process is different, the content required for management and control is also not the same, so the operation console (panel) is generally designed by the user according to the process requirements. The article introduces human-machine interface control printers.
First, the printer type: miniature thermal printer (with RS232 / RS485 serial port)
Second, Gu Mei touch screen (touch screen PLC integrated machine touch screen optional) comes with RS232 / RS485 serial port
Third, the touch screen software communication parameter settings
Note: When single screen uses RS232, communication port is set to COM1, and when RS485 is used, COM2 is set. On the touch screen of touch screen PLC, whether it is RS232 or RS485, the communication port is to set COM2 to communicate with the printer.
Fourth, the touch screen programming software to write the content of the need to print the program, the following is the printer routine description, please check with the routine. Case download address: Shenzhen Gumei Technology http://Download-74.html
The component settings added to the routines are explained as follows: 1. Registers D0, D1, and D2 are added to display data; 2. Variable text LW1074 is added to set the name of the tester to be printed. Variable text length is reserved. 10 (1 register = 2 characters / 1 Chinese); 3, added variable text LW1010, LW1030, LW1050, LW1070 for viewing the contents of the ready to print, variable text length reserved 30 (1 register = 2 Characters / 1 Chinese), the specific need to print the content set in the Clock macro; 4, added to execute the print macro program start button, the execution button address is also set in the Clock macro.
After setting up the screen and macro program, the print button on the touch screen shows the following effect:
V. Macro Write - Print Content Settings
The data frames sent by the above macro and serial debugging assistants are as follows:
The test and debugging typesetting can use the serial assistant software. After each sending instruction, a newline character of 0A 00 is added. If the effect is not printed when debugging, the serial debugging assistant can receive data to see if there is any newline character 0A 00.
Note: The relevant macro syntax used in connection with the printer
CHR → Convert text to ASCII, such as chr (A1, "A2")
Convert the text in A2 to ASCII The numeric code exists A1. The length of the string is a maximum of 50 characters.
(One Word = 2 characters / 1 Chinese).
STR → Integer to ASCII string conversion, such as STR (A1, A2, A3)
That is, the integers in the A2 address are converted into an ASCII character string and placed in the address specified by A1. The decimal point position is specified by A3. The data format is Word (1 Word = 2 characters/1 Chinese).
S.DATE → Take the system date string, such as A1 = Sys.DATE()
Take the current date of the system and convert it to a string and store it in the register address specified by A1. The format is “YYYY-MM-DD†and it takes 5 words.
S.TIME → take the system time string, such as A1 = Sys.TIME()
Take the current time of the system and convert it to a string and store it in the register address specified by A1. The format is “HH:MM:SS†and it takes 4 words.
TXD → Send data, such as TXD (A1, A2) < The communication protocol must be: Free Protocol >
It is to send data from A1 address to LINK1 to select the corresponding UART port and send A2 bytes in total. The data format is only Word (1 Word = 2 bytes).
RXD → Receive data, such as RXD (A1, A2) < The communication protocol must be: Free Protocol >
It is to select the corresponding UART port to receive data from LINK1 to the start address specified by A1. If A2 specifies K, specify to read K bytes. If A2 specifies LW, then read all bytes of the buffer, read the word. The number of sections is placed in the address specified by A2. The data format is only Word (1 Word = 2 bytes).
Sixth, example program printing effect:
Fuction:
1.Built-in BT, phonebook and BT music; 2. WIFI Built-in, support WIFI hotspot; 3. Support phonelink function 4. USB Function 5. Multi-format audio and video decoding, support 1080P full-format 6. Support rear view camera input; 7. Supports Internet APP download, install, uninstall 8. Mirror and link with Andriod Phone and IOS Phone 9. Audio:MP3 MP2 AAC OGG FLAC APE WMA WAV RM AC3 10. Vidio:AVI 3GP/MP4 MOV MPG MKV WMV RMVB 11. OSD Language: INDONESIA Melayu Denask Deutsch English Spain Filipino FRANCE Italiano POLSKI ,PORTUGUES ROMANA Svenska TURKCE PYCCKNN KOREA JAPAN Nederlands Brazil and many more
car android player, car android radio, car android player 7 inch, car android system, car android auto unit
Jiangmen soundrace electronics and technology co.,ltd. , https://www.soundracegroup.com