Share this

Design and Implementation of an I/O Server-Based Automated Monitoring System for Inkjet Printing

2026-04-06 04:49:00 · · #1
1. Introduction In large enterprises, marking products with inkjet printing is essential. Some companies primarily use manual inkjet printing, but with the application of inkjet printers, the printing effect has greatly improved. However, most still rely on manual adjustments to the printer settings for each print job. This is practical for small batches, but unsuitable for large batches. This paper proposes an automatic scanning method for product barcodes to obtain the parameters to be printed, and then uses a PC monitoring system to control the automatic printing process. 2. System Requirements Analysis A certain enterprise currently has an operating ERP system. The hardware equipment in the roll paper conveyor line has been installed. The monitoring system aims to monitor the automatic printing of the produced roll paper and requires tight integration with the existing ERP system. Due to potential on-site malfunctions, both manual adjustment and automatic operation functions are needed to effectively control the printing and scanning equipment. 3. Overall System Planning Based on the requirements analysis of the roll paper conveyor line, the architecture shown in Figure 1 can be used to control the entire conveyor line and printing process. [align=center] Figure 1 Architecture diagram of the inkjet printing automation monitoring system[/align] To ensure the normal automatic operation of the system, the following conditions must be met: (1) The roll paper entering the warehouse for inkjet printing must have been registered on the production line (the enterprise's ERP system has records); (2) The roll paper has a barcode related to the roll paper; (3) The relevant records of the enterprise's ERP system have been transmitted to the database of the monitoring computer. As the entire conveyor line operates continuously, the roll paper is conveyed to the inkjet printing site. First, the barcode scanner located in front of the inkjet printing equipment scans the barcode of the roll paper. Based on the information in the obtained barcode, the monitoring computer analyzes the weight, manufacturing number, category number, and other information of the roll paper. Then, the monitoring computer queries the database based on the manufacturing number to see if there is a record. If there is, it extracts the information related to the roll paper that needs to be printed from the database and sends the information to the inkjet printer controller. Then, the PLC sends a printing signal, and the printhead performs the printing. Regarding network cable selection, fiber optic connections are used because the workshop-level server is far from the monitoring site. A twisted-pair cable connects the monitoring PC and the fiber optic transceiver in the monitoring room. For communication between the microcomputer, PLC, inkjet controller, and barcode scanner, considering the RS232 communication interfaces of these components, a 4-port RS232 expansion card is primarily used. In the automated conveyor line, infrared position detection devices are used to detect the position of the paper rolls for coordinated inkjet printing. When the end of a paper roll enters the printing equipment, the detection device sends this information to the PLC to control the movement of the conveyor belts and the position of the inkjet guns for printing. Each conveyor belt connection has this detection device to facilitate coordination between them. The printing system uses the Marsh MLCP/ML8 large character inkjet printing system, suitable for online carton printing on packaging lines, providing excellent large character inkjet printing technology to meet all customer marking requirements. Especially suitable for multi-line printing requirements in harsh environments, the ML8 large character inkjet coding system can print up to 8 lines of characters, logos, and other information, clearly and easily distinguishable. It is suitable for providing smooth product coding in harsh production environments. The printing system includes a printhead, ink system, photoelectric sensor, input device, data line printing, stand, and accessories. The printhead provides printing up to 8 lines and can print double characters and special characters with empty frames. The printing height ranges from 7.9mm (0.312 inches) 7x5 dot matrix to 203.2mm (8 inches) 7x5 dot matrix, and the printing speed can reach 6.1-100m/minute. Its ink system uses non-contact inkjet printing technology, resulting in clean and easily distinguishable markings suitable for uneven surfaces. In the system's construction, the PLC plays a crucial control role. The communication between the PLC and the monitoring PC mainly involves uploading monitoring information and receiving control information from the PC; the coordinated control of the conveyor line is mainly achieved through the position information input by the infrared position detection device; the connection between the PLC and the electronic scale mainly involves receiving the weight information from the electronic scale; the connection between the PLC and the inkjet controller mainly involves sending the control signal to start inkjet printing. This system uses a Mitsubishi PLC from Japan. 4 System Software Design and Implementation 4.1 Overall Flowchart Based on the overall analysis of the site and the customer's requirements for the system flow, the overall flow of the system design is shown in Figure 2. [align=center] Figure 2 Overall System Flowchart[/align] 4.2 Selection of Software Development Tools In the software development part of the system, since the system involves functions such as data storage in the database, this system uses Microsoft SQL Server 2000 as the local database system and Visual Basic 6.0 as the application development platform. Since the Wonderware I/O server software product can achieve communication with the PLC through simple configuration, it shields various details in the communication with the PLC, and facilitates the upward integration of the system and saves costs. Therefore, this system uses Wonderware I/O server to achieve communication with the PLC. 4.3 Design of the monitoring interface According to the design principles of the production line monitoring interface: (1) intuitively reflect the operating status of the field system and equipment; (2) it can meet the linkage control of the overall system operation and the individual control of individual equipment, and also allow the field single-action control; the monitoring interface shown in Figure 3 was designed. The "L" shape represents the logical positional relationship of the conveyor lines in the system; the control button in the middle of the graphic controls a specific conveyor line; the control button in the lower right corner controls the ejection of the printed paper rolls from the production line; the upper right corner is the system automatic and manual switching switch. The automatic state reflects the overall production linkage status controlled by the PLC and cannot be adjusted independently. Only after switching to manual state can individual control of a specific device be achieved. In the manual state, the software implementation of the individual control button for a specific device uses three states, "1", "2", and "4", to represent "Stop", "Forward", and "Backward", respectively. The following is the detailed implementation code for m5 as an example: private sub ccm5_click() tagman.d370.text="4" tagman.d370.linkpoke end sub private sub sm5_click() tagman.d370.text="1" tagman.d370.linkpoke end sub private sub cm5_click() tagman.d370.text="2" tagman.d370.linkpoke end sub Where cm5, sm5, and ccm5 are the button names for implementing "Forward", "Stop", and "Back", respectively. 4.4 Communication Design (1) Design for communication with PLC Since Wonderware's I/O server is used to implement communication with the PLC, the program only needs to implement the basic connection function, and there is no need to understand the PLC's communication information format. The detailed code for communication with the PLC is as follows: sub linktodde() tagman.m112.linkmode = 1 tagman.m113.linkmode = 1 。 。 。 ... tagman.d348.linkmode = 1 tagman.d349.linkmode = 1 tagman.d350.linkmode = 1 plcstatus.linkmode = 1 end sub Communication with the PLC can be achieved simply by calling form_load() in the main interface. (2) Design of communication with the inkjet printer Communication with the inkjet printer is mainly achieved through the mscomm control. Since there are 2 inkjet controllers in the system, 2 mscomm controls are needed. In the system design, they are labelprint_1 and labelprint_2, respectively. The communication protocol with the inkjet controller is 2400,n,8,2, and the communication ports are ports 4 and 5, respectively. Each inkjet controller controls 8 inkjet guns, and each inkjet gun corresponds to a buffer to store the information to be printed. The following is the detailed code for communication: sub testreadbc() file:// First open the communication port of print_a and send data, then close the communication port lcp.outsidetest.labelprint_1.portopen=true `Open the communication port lcp.outsidetest.labelprint_1.output=chr$(4) `Clear the previous data lcp.outsidetest.labelprint_1.output=tpinstr(0).text lcp.outsidetest.labelprint_1.output=chr$(10) `Jump to the second buffer lcp.outsidetest.labelprint_1.output=tpinstr(1).text lcp.outsidetest.labelprint_1.output=chr$(10) `Jump to line 3 lcp.outsidetest.labelprint_1.output=tpinstr(2).text 。 。 。 。 。 。 。 lcp.outsidetest.labelprint_1.output=chr$(10) ` Jump to line 8 lcp.outsidetest.labelprint_1.output=tpinstr(7).text lcp.outsidetest.labelprint_1.output=chr$(1) ` Data transmission completed lcp.outsidetest.labelprint_1.portopen=false ` Close communication port file:// Communication with the inkjet controller b is the same as above end sub (3) Design of communication with barcode scanner Communication with barcode scanner is also implemented through the mscomm control, which is barcodecomm in the system design, the communication protocol is 9600,n,8,1, and the communication port is port 6. The detailed implementation code for the barcode scanner is as follows: `sub readbarcode()` `dim readbuf as string` ... sindex + 1 wend rmode = rmode + 1 while mid(readbuf, sindex, sindex) <> "," productcode = productcode & mid(readbuf, sindex, sindex) sindex = sindex + 1 wend wend match = false 'sql' search command, search the database for the existence of this information sqlstr = "select * from indata where manufacturing number='" & productcode & "'" outsidetest.scandb.recordsource = sqlstr outsidetest.scandb.refresh if outsidetest.scandb.recordset.recordcount = 0 then match = false else match = true end if if match then file:// extract the information to be printed from the database bufcusid = outsidetest.scandb.recordset("customer code") bufcusname = outsidetest.scandb.recordset("customer name") 。 。 。 。 。 。 。 `bufhold = outsidetest.scandb.recordset("Retain")` Writes data to the plc. `tagman.d340.text = asc(mid(bufcusid, 1, 1)) * 100 + asc(mid(bufcusid, 2, 1))` ... `tagman.d349.text = int(buflengh)` `tagman.d340.linkpoke` ... `tagman.d349.linkpoke` else `msgbox "No matching data found, or data is incorrect, please rescan!", vbokonly, "Error"` `end if` `end if` `end sub` Only a timer needs to be added to achieve the automatic data reading function of the barcode scanner. 4.5 Interface Design with ERP The establishment of this monitoring system needs to be closely integrated with the existing ERP system of the enterprise in order to maximize overall management benefits. Based on the above planning, it was decided to use a text-based data format as the bridge between the two. Therefore, the system construction needs to meet the following functional requirements: (1) The existing ERP system automatically generates text files for information related to the produced rolls of paper; (2) The monitoring system automatically downloads the text files, separates the parameter data, and stores them in the local database; (3) For information already printed and stored, the monitoring system automatically generates text files for the ERP system to use; (4) The existing ERP system automatically reads the information of the stored rolls of paper. Regarding the design of the monitoring system, the main focus is on meeting the functions of (2) and (3), namely, the design for downloading and uploading data. First, the problem of file storage location needs to be solved. Since the ERP system is on a remote workshop-level server, and the path selection for this system is limited to the local hard drive, a mapping of a specific file directory on the remote machine to the local system is adopted. (1) Program Design for Automatic Data Download The program design mainly uses a timer to achieve the automatic data download function. The following is the specific download implementation code: dim fileobj as new filesystemobject dim sfile as textstream dim onestring as string dim strbuf01, strbuf02, strbuf03, strbuf04, strbuf05, strbuf06, strbuf07 as string dim strbuf08, strbuf09, strbuf10, strbuf11, strbuf12, strbuf13 as string set sfile = fileobj.opentextfile(lcp.sysparset.setreadfile.text, forreading, false) while not sfile.atendofstream onestring = sfile.readline file:// Extract information according to the barcode format strbuf01 = mid(onestring, 1, 6) strbuf02 = mid(onestring, 7, 4) strbuf03 = mid(onestring, 11, 8) ... strbuf13 = mid(onestring, 45, 14) file://Add information to the database based on the scanned data downloaddb.recordset.addnew downloaddb.recordset("customer ID") = strbuf01 ... downloaddb.recordset("Reserved") = strbuf13 downloaddb.recordset.update wend sfile.close(2) Data upload design The following is the specific code for data upload: dim fileobj as new filesystemobject dim sfile as textstream dim onestring as string set sfile = fileobj.opentextfile("File storage location", forappending, true) lcp.dbmanager.rsuploaddb.movefirst while lcp.dbmanager.rsuploaddb.eof = false onestring=lcp.dbmanager.rsuploaddb("Manufacturing number") & lcp.dbmanager.rsuploaddb("Paper type") & _ lcp.dbmanager.rsuploaddb("Basic weight") & lcp.dbmanager.rsuploaddb("Dimension") & _ lcp.dbmanager.rsuploaddb("Dimension unit") & lcp.dbmanager.rsuploaddb("Inbound weight") & _ lcp.dbmanager.rsuploaddb("Weighing Date") & lcp.dbmanager.rsuploaddb("Weighing Time") & _ lcp.dbmanager.rsuploaddb("Production Shift") & lcp.dbmanager.rsuploaddb("Reserved") sfile.writeline(onestring) lcp.dbmanager.rsuploaddb("updated") = "1" lcp.dbmanager.rsuploaddb.movenext wend sfile.close 5 Conclusion The implementation of this automated inkjet printing monitoring system has greatly improved the efficiency and quality of roll paper printing, achieving good economic benefits.
Read next

CATDOLL Luisa Soft Silicone Head

You can choose the skin tone, eye color, and wig, or upgrade to implanted hair. Soft silicone heads come with a functio...

Articles 2026-02-22