Method for preventing repeated code printing through action linkage triggering of crimping equipment
By writing PLC control programs and virtual shortcut key software in automotive wiring harness production, barcode printing is triggered by the action of the crimping equipment. This solves the problem of duplicate or missing codes that are easy to occur when manually printing wiring harness products, and improves production efficiency and product quality traceability.
Patent Information
- Application Number
- CN202511049031.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-12-05
AI Technical Summary
In automotive wiring harness production, existing technologies require manual printing of barcode labels after crimping of wiring harness products. This can easily lead to duplicate or missing barcodes, resulting in confusion in product traceability information and failing to meet the high-speed requirements of automated production lines.
By writing PLC control programs and virtual shortcut key software, the automatic printing of barcode printers is triggered by the action signals of the crimping equipment. M200 interlocking relays and ladder timers are used for control to ensure that only a unique barcode label is generated after each crimping.
It achieves automated linkage between crimping and barcode printing, avoiding human error, ensuring that each wire harness product corresponds to a unique label, improving production efficiency and product quality traceability, and reducing duplicate codes and omissions.
Smart Images

Figure CN121069873A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of automobile wire harness production, and particularly relates to a method for triggering anti-duplicate printing through linkage of action of a crimping device. BACKGROUND
[0002] In the production process of automobile wire harness, a bar code label containing a unique serial number is usually printed immediately after the crimping of the wire harness product, for quality tracing and product management. In the prior art, manual printing is usually adopted, which has the following disadvantages: the operator needs to manually click the "print" button of the printer software interface after crimping, and under high-intensity repetitive operation, it is easy to miss printing or repeatedly click, resulting in duplicate labels (the same serial number is printed multiple times) or missing labels (the serial number is not printed), which causes confusion of product tracing information; the worker needs to switch attention to observe the crimping completion state and perform mouse operation, which drags the production rhythm and cannot meet the high-speed demand of the automatic production line. SUMMARY
[0003] The application aims to provide a method for triggering anti-duplicate printing through linkage of action of a crimping device, which can automatically execute the printing instruction and ensure that only one printing is triggered each time.
[0004] To achieve the above-mentioned purpose, the application adopts the following technical scheme: a method for triggering anti-duplicate printing through linkage of action of a crimping device, comprising the following steps: Step 1: programming of a printer bar code label program: using the label design software matched with the bar code printer, creating or editing the label template to be printed and configuring the printer settings; Step 2: programming of a mouse action script through virtual shortcut key software: selecting and installing a virtual key / mouse macro recording software, and programming the running track of the mouse and the printing key action in the software; Step 3: programming of a PLC control program: programming a ladder diagram or structured text program in the PLC programming software: Input: defining the normally open button X000 as a start button, the crimping in-place sensor X001, and the normally closed button X000 as an emergency stop button; Output: defining the mouse moving relay M0, the mouse clicking relay M1, the indicator light M3, the timers T0, T1, T2 and T6, the manual mouse moving relay M10, the manual mouse clicking relay M11, the mouse moving relay Y000 and the mouse clicking relay Y001; Internal elements: using the normally open auxiliary relays M100, M101, M102 and M103, and the normally closed auxiliary relay M200; Control logic: after pressing the start button X000, the whole device starts, the indicator light M3 lights up; when the crimping action is completed, the crimping in-place sensor X001 detects the signal, sets M100, its contact is closed, indicating that the printing condition is met, sets M200, and opens its normally closed state to prohibit the release action. At this time, the coil of the mouse movement relay M0 is energized, its contacts are closed, and the timer T0 is started; when the timer T0 is set, M101 is set and M100 and M0 are reset, the coil of the mouse click relay M1 is energized, its contacts are closed, and the timer T1 is started; when the timer T1 is set, M102 is set and M101 and M1 are reset, and the timer T2 is started; when the timer T2 is set, M103 is set and M102 is reset, and the timer T6 is started; when the timer T6 is set, the single label printing is completed, M200 and M103 are reset, and the control system returns to the initial state, waiting for the next X001 signal. Step 4, confirm the wiring: physically check whether the wiring of the PLC controller, the start button X000, and the crimping in-place sensor X001 is correct; check whether the output point wiring of the PLC driving mouse movement relay and mouse click relay is correct; ensure that the relay coil input point is connected to the PLC output point, and the relay output contact is connected to the circuit of the target keyboard key or analog mouse key; check the physical installation position of the printer, and ensure that the crimping in-place sensor can be reliably triggered when the crimping device is pressed into place (position, sensing distance is correct); Step 5, power on the device: power on the PLC controller, the crimping device main power supply, the crimping in-place sensor, the barcode printer, and the PC running the virtual key software; press the start button X000, and the device enters standby or running mode; Step 6, crimping sensor triggering and printing action.
[0005] The method of the application uses the reliable logic control ability of the PLC and the automatic simulation operation of the virtual key software to indirectly control the desktop level barcode printer originally designed for human-computer interaction, and realizes automatic printing by simulating user operation.
[0006] Compared with the prior art, the beneficial effects of the present application are that the link originally requiring manual intervention is completely automated, the printing is triggered immediately after the crimping action is completed, the position deviation or click timing error that may be caused by manual operation is eliminated, the fatigue of manual operation is reduced, and the production efficiency is significantly improved; the control logic of the M200 interlocking relay and the step-type timer is adopted to ensure that only a unique print instruction is generated by a single signal, a single label corresponds to a single wire harness product, that is, a barcode label containing a unique serial number is output at the same time as the crimping action is completed, so as to avoid code duplication and omission, improve product quality and traceability; accurate timing control (T0, T1, T2, T6) is adopted to ensure that the mouse movement, clicking, and printing are independently delayed, and operation conflicts are avoided; the same linkage of different models of products can be realized by adjusting the virtual key script and the PLC parameters.
[0007] As a further improvement of the present application, the content of the label template in step 1 includes determining product batch information, product serial number, product barcode, text size, and layout, and the content of the printer setting includes printing density and printing speed. Binding the physical crimping action and the digital identity realizes "one product one code", eliminates the risk of code duplication / miscode caused by manual input from the design layer, and quickly locates the problem batch during quality traceability, shortening the troubleshooting time.
[0008] As a further improvement of the present application, the specific steps of step 2 are as follows: Step 2.1) Obtain the printer button screen coordinates: open the barcode printer software interface, hover the mouse over the print button, and view the current coordinates (X, Y) in the virtual key software; Step 2.2) Insert mouse movement instructions: fill in the target coordinates (X, Y) in the virtual key software and select absolute displacement to generate absolute mouse movement instructions; Step 2.3) Insert mouse click instructions: add a left single click and lift combination action, and set the keyboard shortcut key to trigger the action to generate "absolute mouse left key press target coordinates (X, Y), absolute mouse left key lift target coordinates (X, Y)" instructions; Step 2.4) Add a delay to ensure that the operation is completed: set the delay time according to the printer response speed and generate a delay instruction; Step 2.5) Configure the loop mode: set the loop mode to not loop and the number of times to 1; Step 2.6) Save and burn: save the template and burn it to the hardware, observe the status prompt, and confirm that the download is complete.
[0009] The switch signal of the PLC is converted into an operation instruction recognizable by software by simulating the keyboard shortcut through the relay contact, and the mouse action is triggered by the keyboard shortcut. Only two relays (moving and clicking) are needed to complete all operations, which saves 3-4 output points compared with the full mouse simulation scheme, and the anti-interference ability is improved.
[0010] As a further improvement of the present application, the specific steps of step 6 are as follows: Step 6.1) Pressing device working stage: when the pressing action is completed and the workpiece is in the correct position, the pressing in-place sensor X001 is triggered, and the PLC detects that the X001 signal is valid; Step 6.2) PLC controller logic execution stage: the normally open auxiliary relay M100 is powered on to close, and the indicator light M3 is turned on to indicate that the print trigger is being executed. The normally closed auxiliary relay M200 is powered on to open its normally closed contact, preventing retriggering; Step 6.3) Mouse movement instruction execution stage: the PLC outputs drive the mouse movement relay coil to be powered on, and the relay contact is closed, and the mouse executes the action of moving to the specified coordinates; Step 6.4) Mouse click instruction execution stage: after a specified time, the PLC outputs drive the mouse click relay coil to be powered on, and the relay contact is closed, simulating the pressing of the keyboard shortcut for triggering the mouse click part of the virtual key software, and executing the action of left-clicking at the current position; Step 6.5) Printer working stage: the printer receives the operation signal simulating the mouse click "print button", and the printer starts executing the preset label printing program, outputting a bar code label; Step 6.6) Reset and wait: after a specified time, the printer task is completed, the PLC resets the mouse movement relay and the mouse click relay, the relay loses power, the simulated key contact is opened, the PLC resets M100 and M200, and all states are reset. The control system waits for the next pressing to complete and starts a new printing cycle.
[0011] Hardware-level anti-recode design, physically cutting off the secondary trigger path, even if the pressing sensor X001 is repeatedly turned on by vibration or the operator accidentally touches the start button, it cannot trigger the printing action, completely eliminating the possibility of repeated printing; phased time sequence control, each action strictly depends on the previous completion; T6 delay covers the maximum response time of the printer, even if the printing is delayed, it does not affect the system state reset, and has a certain fault tolerance. BRIEF DESCRIPTION OF DRAWINGS
[0012] Figure 1 The flowchart of the method of the present application.
[0013] Figure 2User interface of software MyKey for setting virtual shortcut key used in the present application Figure 1 .
[0014] Figure 3 User interface of software MyKey for setting virtual shortcut key used in the present application Figure 2 .
[0015] Figure 4 PLC ladder diagram first part in the present application
[0016] Figure 5 PLC ladder diagram second part in the present application
[0017] Figure 6 PLC ladder diagram third part in the present application
[0018] Figure 7 Wiring diagram of power module in the present application
[0019] Figure 8 Wiring diagram of PLC control module in the present application
[0020] Figure 9 Wiring diagram of virtual shortcut key module in the present application
[0021] Figure 10 Efficiency comparison data table before and after using the method of the present application DETAILED DESCRIPTION
[0022] As shown in Figure 1 , it is a method for triggering anti-duplicate code printing through action linkage of a crimping device, comprising the following steps: Step 1: Writing printer barcode label program: using the label design software (such as ZebraDesigner, Bartender, Nicelabel, etc.) matched with the barcode printer, creating or editing the label template to be printed and configuring the printer settings; wherein the content of the label template includes: determining the product batch information, product serial number, product barcode, text size and layout, and the content of the printer settings includes: printing density and printing speed.
[0023] Step 2: Writing mouse action script through virtual shortcut key software: selecting and installing a virtual key / mouse macro recording software (such as MyKey, AutoHotkey, TinyTask, etc.), and writing the running track of the mouse and the printing key action in the software; Step 2.1) Obtain the screen coordinates of the printer button: open the barcode printer software interface (MyKey is selected in this embodiment, as shown in Figure 2 and 3), hover the mouse over the print button and view the current coordinates (X, Y) in the virtual key software; Step 2.2) Insert mouse movement instructions: Fill in the target coordinates (X, Y) in the virtual key software and select absolute displacement to generate absolute mouse movement instructions; Step 2.3) Insert mouse click instructions: Add left single click and lift combination action, and set the keyboard shortcut key to trigger the action to generate "absolute mouse left button down target coordinates (X, Y), absolute mouse left button up target coordinates (X, Y)" instructions; Step 2.4) Add delay to ensure operation is completed: Set the delay time according to the printer response speed and generate the delay instruction; Step 2.5) Configure loop mode: Set the loop mode to not loop and the number of times to 1; Step 2.6) Save and burn: Save the template and burn it to the hardware, observe the status prompt and confirm that the download is complete.
[0024] Step 3, write PLC control program (such as Mitsubishi GX Works2 / 3, Siemens TIA Portal, etc.): Write ladder diagram in PLC programming software (this example uses Mitsubishi GX Works2), such as Figures 4-6 : Input: Define normally open button X000 as start button, press to bit sensor X001, normally closed button X000 as emergency stop button, mouse move button X003, mouse click button X004; Output: Define mouse move relay M0, mouse click relay M1, move relay Y000, mouse click relay Y001, manual mouse move relay M10, manual mouse click relay M11, indicator light M3, indicator light Y003, timers T0, T1, T2, T6,; Internal components: Use normally open auxiliary relays M100, M101, M102, M103, normally closed auxiliary relays M200; Control logic: after pressing the start button X000, the whole device starts, the indicator light M3 is closed, and the indicator light Y003 is on; when the crimping action is completed and the crimping in-place sensor X001 detects a signal, M100 is set, its contacts are closed, indicating that the printing conditions are met, M200 is set, and its normally closed state is disabled to release the action; at this time, the mouse movement relay M0 and the coil of Y000 are energized, their contacts are closed, and timer T0 is started; after 0.2s, M101 is set and M100 and M0 are reset, the mouse click relay M1 and the coil of Y001 are energized, their contacts are closed, and timer T1 is started; after 0.2s, M102 is set and M101 and M1 are reset, and timer T2 is started; after 0.1s, M103 is set and M102 is reset, and timer T6 is started; after 3s, the single label printing is completed, M200 and M103 are reset, and the control system returns to the initial state, waiting for the next X001 signal; if an emergency fault occurs, press the emergency stop button X000, M100, M103, M0, M1, and M200 are batch reset, press the mouse movement button X003, M10 and Y000 contacts are closed, and the mouse movement trajectory can be manually controlled, press the mouse click button X004, M11 and Y001 contacts are closed, and the mouse click operation can be manually controlled.
[0025] Step 4, confirm the wiring is correct: the control system in the application includes an in-place detection module, a power module, a PLC control module, and a virtual shortcut key module, the in-place detection module includes a crimping in-place sensor, the PLC control module includes an FX3U-16MR / ES(-A) controller, its X00 port is connected with the emergency stop button SB01, its X01 port is connected with the crimping in-place sensor SB02, its X03 port is connected with the mouse movement button SB04, its X04 port is connected with the mouse click button SB05, its Y00 port is connected with the mouse movement relay KA01, its Y01 port is connected with the mouse click relay KA02, and its Y03 port is connected with the indicator light ULY; the power module supplies power (DC 24V) for the PLC control module and the virtual shortcut key module, the input end of the virtual shortcut key module is connected with the mouse movement relay and the mouse movement relay, and the output end is connected with the PC through USB. Physically check whether the wiring of the PLC controller and the start button, the crimping in-place sensor is correct; check whether the output point wiring of the PLC driving mouse movement relay and mouse click relay is correct; ensure that the relay coil input point is connected with the PLC output point, and the relay output contact is connected with the circuit of the target keyboard key or the analog mouse key; check the physical installation position of the printer, and ensure that the crimping in-place sensor can be reliably triggered when the crimping device is pressed in place (the installation position and the sensing distance are correct); Step 5, equipment power on: power supply for PLC controller, crimping equipment main power, crimping in place sensor, barcode printer, PC running virtual button software; press the start button X000, at this time the equipment enters standby or running mode; Step 6, crimping sensor trigger and printing action, including the following stages: Step 6.1) crimping equipment working stage: when the crimping action is completed and the workpiece is in the correct position, the crimping in place sensor X001 is triggered, and the PLC detects that the X001 signal is valid; Step 6.2) PLC controller logic execution stage: the normally open auxiliary relay M100 is powered on to close, and the indicator light M3 is on to indicate that the printing trigger is being executed, and the normally closed auxiliary relay M200 is powered on to open its normally closed contact to prevent retriggering; Step 6.3) mouse movement instruction execution stage: the PLC outputs drive the mouse movement relay coil to be powered on, and the relay contact is closed, and the mouse executes the action of moving to the specified coordinates; Step 6.4) mouse click instruction execution stage: after a specified time, the PLC outputs drive the mouse click relay coil to be powered on, and the relay contact is closed, and the simulated press of the keyboard shortcut for triggering the mouse click part of the virtual button software is executed to perform the action of left-clicking at the current position; Step 6.5) printer working stage: the printer receives the simulated mouse click "print button" operation signal, and the printer starts executing the preset label printing program to output a barcode label; Step 6.6) reset and wait: after a specified time, the printer task is completed, the PLC resets the mouse movement relay and the mouse click relay, the relay loses power, the simulated key contact is opened, the PLC resets M100 and M200, and all states are reset, and the control system waits for the next crimping completion to start a new printing cycle.
[0026] Figure 10 For efficiency comparison data before and after using the method of the application, it can be seen from the table that after using the method of the application, the production capacity is close to doubled, the production efficiency is significantly improved, the higher order demand can be met, the material waste caused by label errors is completely eliminated, the production cost is directly reduced, the production stability is greatly enhanced, and the downtime maintenance cost and production capacity loss are reduced.
[0027] The application is not limited to the above embodiments, and based on the technical solutions disclosed in the application, those skilled in the art can make some substitutions and modifications to some technical features without creative labor, and these substitutions and modifications are within the protection scope of the application.
Claims
1. A method for preventing double printing by linkage of actions of a crimping apparatus, characterized by, The method comprises the following steps: Step 1, writing a printer barcode label program: using the label design software matched with the barcode printer, creating or editing the label template to be printed and configuring the printer settings; Step 2, writing a mouse action script through virtual shortcut key software: selecting and installing a virtual key / mouse macro recording software, and writing the running track of the mouse and the printing key action in the software; Step 3, writing a PLC control program: writing a ladder diagram or structured text program in the PLC programming software: Input: defining the normally open button X000 as a start button, and pressing the contact sensor X001, and defining the normally closed button X000 as an emergency stop button; Output: defining the mouse moving relay M0, the mouse clicking relay M1, the indicator light M3, and the timers T0, T1, T2 and T6; Internal elements: using the normally open auxiliary relays M100, M101, M102 and M103, and the normally closed auxiliary relay M200; Control logic: after pressing the start button X000, the whole device starts, and the indicator light M3 is on; When the pressing action is completed, the contact sensor X001 detects the signal, sets M100, its contact is closed, indicating that the printing condition is met, sets M200, and opens its normally closed state to prohibit the release action, at this time, the coil of the mouse moving relay M0 is energized, its contact is closed, and the timer T0 is started at the same time; when the timer T0 is set to time, M101 is set and M100 and M0 are reset, the coil of the mouse clicking relay M1 is energized, its contact is closed, and the timer T1 is started at the same time; when the timer T1 is set to time, M102 is set and M101 and M1 are reset, and the timer T2 is started at the same time; when the timer T2 is set to time, M103 is set and M102 is reset, and the timer T6 is started at the same time; when the timer T6 is set to time, the single label printing is completed, M200 and M103 are reset, and the control system returns to the initial state, waiting for the next X001 signal; Step 4, confirming that the wiring is correct: physically checking whether the wiring of the PLC controller, the start button X000 and the pressing contact sensor X001 is correct; checking whether the output point wiring of the PLC driving mouse moving relay and the mouse clicking relay is correct; ensuring that the relay coil input point is connected to the PLC output point, and the relay output contact is connected to the circuit of the target keyboard key or the simulated mouse key; checking the physical installation position of the printer, and ensuring that the pressing contact sensor can be reliably triggered when the pressing device is pressed into position; Step 5, powering on the device: powering the PLC controller, the pressing device main power supply, the pressing contact sensor, the barcode printer and the PC running the virtual key software; pressing the start button X000, at this time, the device enters the standby or running mode; Step 6, triggering the pressing sensor and printing action.
2. The method of claim 1, wherein the method is performed by a crimping apparatus. The content of the label template in step 1 includes determining product batch information, product serial number, product barcode, text size and layout, and the content of the printer settings includes printing density and printing speed.
3. The method of claim 1, wherein the method further comprises: The specific steps of step 2 are as follows: Step 2.1) Obtain the printer button screen coordinates: open the barcode printer software interface, hover the mouse over the print button, and view the current coordinates (X, Y) in the virtual key software; Step 2.2) Insert mouse movement instructions: fill in the target coordinates (X, Y) in the virtual key software and select absolute displacement to generate absolute mouse movement instructions; Step 2.3) Insert mouse click instructions: add a left single-click and lift combination action, and set the keyboard shortcut to trigger the action to generate "absolute mouse left button down target coordinates (X, Y), absolute mouse left button up target coordinates (X, Y)" instructions; Step 2.4) Add a delay to ensure the operation is completed: set the delay time according to the printer response speed and generate a delay instruction; Step 2.5) Configure the loop mode: set the loop mode to not loop and the number of times to 1; Step 2.6) Save and burn: save the template and burn it to the hardware, observe the status prompt, and confirm that the download is complete.
4. The method of claim 1, wherein the method further comprises: The specific steps of step 6 are as follows: Step 6.1) Crimping equipment working stage: when the crimping action is completed and the workpiece is in the correct position, the crimping in-place sensor X001 is triggered, and the PLC detects that the X001 signal is valid; Step 6.2) PLC controller logic execution stage: the normally open auxiliary relay M100 is powered on to close, and the indicator light M3 is on to indicate that the print trigger is being executed. The normally closed auxiliary relay M200 is powered on to open its normally closed contacts, preventing re-triggering; Step 6.3) Mouse movement instruction execution stage: the PLC outputs drive the mouse movement relay coil to be powered on, and the relay contacts are closed, and the mouse executes the action of moving to the specified coordinates; Step 6.4) Mouse click instruction execution stage: after a specified time, the PLC outputs drive the mouse click relay coil to be powered on, and the relay contacts are closed, simulating the pressing of the shortcut key on the keyboard used to trigger the mouse click part in the virtual key software, and executing the left-click action at the current position; Step 6.5) Printer working stage: the printer receives the simulated mouse click "print button" operation signal, and the printer starts executing the preset label printing program, outputting a barcode label; Step 6.6) Reset and wait: after a specified time, the printer task is completed, the PLC resets the mouse movement relay and the mouse click relay, the relay loses power, the simulated key contacts are opened, the PLC resets M100 and M200, and all states are reset. The control system waits for the next crimping completion and starts a new printing cycle.