PLC-based line body process duration analysis method and application thereofTechnical Field
The invention relates to a process duration analysis method applied to industrial control, in particular to a PLC-based line process duration analysis method.
Background
The welding process is an important process link in the automobile manufacturing industry at present, and the automation rate is higher and higher. How to accurately measure and calculate the production beat and the line body starting rate of a welding production line directly influences the capacity improvement of a later-stage production line; analyzing the action time of each device is helpful for finding out a beat bottleneck station, so as to optimize the corresponding bottleneck process.
Currently, there are two commonly used methods for recording process beats: the first method is to record the production quantity in unit time and calculate the process beat by using the production quantity in unit time; the second is to collect time data through a time relay in the PLC, and only record the process beat of each single station; these prior arts have the following problems: the first method is to calculate the process beat by recording the production quantity in unit time, which is greatly influenced by factors such as line fault and the like in practical application and cannot be used for accurate analysis of later data; in the second mode, because the number of time relays in the PLC is limited, accurate recording of the action time of each device cannot be realized, and the recorded time of a single cycle is taken as a reference sample, so that the number of samples is too small to obtain accurate process beats in sequence;
disclosure of Invention
The invention provides a PLC-based line body procedure duration analysis method and application thereof to avoid the defects in the prior art, so that the action duration of line body equipment can be completely recorded, more accurate process beats can be obtained through later-stage data analysis, and a bottleneck station and a bottleneck procedure can be found.
The invention adopts the following technical scheme for solving the technical problems:
the invention relates to a PLC-based line process duration analysis method, which is characterized by comprising the following steps of:
step 1, obtaining local system time, and obtaining action information of each device in a line process;
step 2, recording the starting time and the ending time of each equipment action, generating a timestamp of each equipment action when the equipment with the latest starting time in the process finishes the action, and sending the timestamp data to a cache region;
step 3, checking the timestamp data in the cache region, if the timestamp data has the start time and the end time, judging the data to be complete and qualified, marking the corresponding timestamp data as '1', and sending the timestamp data marked as '1' to the storage region; otherwise, judging that the data is incomplete, marking the corresponding timestamp data as '0', and leaving the timestamp data marked as '0' in the cache region until the data is complete, judging as qualified, marking as '1', and sending to the storage region;
and 4, analyzing the action duration of each device and the device action time interval information according to the timestamp data marked as '1', and calculating to obtain the process duration.
The PLC-based line process duration analysis method is also characterized in that: recording the number of the device actions in the process as N, wherein N is not less than 2; sequencing all the equipment actions into a first action, a second action, … …, an N-1 action and an N action according to the sequence of the starting time, respectively recording the starting time and the ending time of each equipment action, and generating the time stamps of all the equipment actions in a one-to-one correspondence manner as follows: a first timestamp, a second timestamp, … …, an N-1 timestamp, an Nth timestamp; the qualified timestamp contains at least a start time and an end time of the device action.
The PLC-based line process duration analysis method is also characterized in that: the data format Of the local system Time is Time Of Date, and the data storage form is TOD # H: M: S: MS.
The PLC-based line process duration analysis method is also characterized in that: the equipment action duration is the time interval from the starting time to the ending time of the equipment action; the process duration is the interval between the earliest start time of the device action in the process and the latest end time of the device action in the process.
The invention relates to a PLC-based line process duration analysis system, which is characterized by comprising the following steps:
the information acquisition module is used for acquiring equipment action information in a line body procedure;
the time module is used for acquiring local system time and acquiring the starting time and the ending time of equipment actions in the process;
the cache module is used for recording, storing and marking the timestamp data of the equipment actions in the working procedure and judging the integrity of the timestamp data;
the storage module is used for storing qualified timestamp data of equipment actions in the process, and simultaneously storing the time length and timestamp information of each equipment action;
and the analysis module is used for analyzing the action duration and the time interval of each device according to the timestamp data, and calculating the in-line procedure and the action duration of each device.
The PLC-based line process duration analysis system is also characterized in that: the data format Of the local system Time acquired by the Time module is Time Of Date, and the data storage form is TOD # H: M: S: MS.
The PLC-based line process duration analysis system is also characterized in that: the cache module judges the integrity of the timestamp data according to the following form: if the timestamp data has the starting time and the ending time, judging the data to be complete and qualified, marking the corresponding timestamp data as '1', and sending the timestamp data marked as '1' to the storage area; otherwise, the data is judged to be incomplete and is unqualified, the corresponding timestamp data is marked as '0', the timestamp data marked as '0' is left in the buffer area until the data is judged to be complete and is marked as '1' and is sent to the storage area.
The invention relates to a PLC-based line process duration analysis device, which is characterized in that: comprising a memory for storing at least one program and a processor for loading the at least one program to perform the method of any one of claims 1 to 4.
The storage medium of the present invention, in which instructions executable by a processor are stored, is characterized by: the processor-executable instructions, when executed by a processor, are for performing the method of any one of claims 1-4.
Compared with the prior art, the invention has the beneficial effects that:
1. according to the invention, the action duration of each device can be accurately calculated by recording the time stamp data of the starting time and the ending time of the device, and the method is not limited by the number of the time relays in the PLC.
2. According to the invention, the time can be accurate to millisecond level by collecting the timestamp data of the equipment action through the local PLC, and the control precision is improved.
3. According to the invention, a large number of data samples are obtained through cache records, and reliable guarantee is provided for analyzing bottleneck stations and bottleneck processes.
4. The invention is particularly applied to a welding production line, collects the beats of each process/station in the welding production line, accurately records the action duration of each device, is used for improving and promoting production and effectively improves the production efficiency.
Drawings
FIG. 1 is a schematic flow diagram of the process of the present invention;
Detailed Description
Referring to fig. 1, the method for analyzing the line process duration based on the PLC in the present embodiment includes the following steps:
step 1, local system Time is obtained, the data format Of the local system Time is Time Of Date, and action information Of each device in a line body process is obtained.
And 2, recording the starting time and the ending time of each equipment action, generating a time stamp of each equipment action when the equipment with the latest starting time in the process finishes the action, and sending the time stamp data to the cache region.
Step 3, checking the timestamp data in the cache region, if the timestamp data has the start time and the end time, judging the data to be complete and qualified, marking the corresponding timestamp data as '1', and sending the timestamp data marked as '1' to the storage region; otherwise, judging that the data is incomplete, marking the corresponding timestamp data as '0', and leaving the timestamp data marked as '0' in the cache region until the data is complete, judging as qualified, marking as '1', and sending to the storage region; the data storage form is TOD # H: M: S: MS.
Step 4, analyzing the action duration of each device and the device action time interval information according to the timestamp data marked as '1', and calculating to obtain the process duration; the equipment action duration is the time interval from the starting time to the ending time of the equipment action; the process time length is an interval between the earliest start time of the in-process device operation and the latest end time of the device operation.
Recording the number of the equipment actions in the process as N, wherein N is not less than 2; then: sequencing all the equipment actions into a first action, a second action, … …, an N-1 action and an N action according to the sequence of the starting time, respectively recording the starting time and the ending time of each equipment action, and generating the time stamps of all the equipment actions in a one-to-one correspondence manner as follows: a first timestamp, a second timestamp, … …, an N-1 timestamp, an Nth timestamp; the qualified timestamp contains at least a start time and an end time of the device action.
The present embodiment further provides a line body process duration analysis system based on a PLC, which includes an information acquisition module, a time module, a cache module, a storage module, and an analysis module, wherein:
the information acquisition module is used for acquiring equipment action information in a line body procedure;
the time module is used for acquiring local system time and acquiring the starting time and the ending time of equipment actions in the process; the data format Of the local system Time acquired by the Time module is Time Of Date.
The cache module is used for recording, storing and marking the timestamp data of the equipment actions in the process, and judging the integrity of the timestamp data according to the following form: if the timestamp data has the starting time and the ending time, judging the data to be complete and qualified, marking the corresponding timestamp data as '1', and sending the timestamp data marked as '1' to the storage area; otherwise, the data is judged to be incomplete and is unqualified, the corresponding timestamp data is marked as '0', the timestamp data marked as '0' is left in the buffer area until the data is judged to be complete and is marked as '1' and is sent to the storage area.
And the storage module is used for storing qualified timestamp data of equipment actions in the process, and simultaneously storing the action duration and timestamp information of each equipment, and the data storage form is TOD # H: M: S: MS.
And the analysis module is used for analyzing the action duration and the time interval of each device according to the timestamp data, and calculating the in-line procedure and the action duration of each device.
The present embodiment also provides a PLC-based line body procedure duration analysis apparatus, which includes a memory and a processor, where the memory is used to store at least one program, and the processor is used to load the at least one program to execute the program, so as to implement the PLC-based line body procedure duration analysis in this embodiment.
A storage medium is also provided in this embodiment, in which processor-executable instructions are stored, and when executed by the processor, the processor-executable instructions are used to execute relevant instructions of the PLC-based line process duration analysis in this embodiment.
In the concrete implementation, in order to realize the line body process duration analysis based on the PLC, the corresponding measures also include:
1. regarding the device actions: numbering each production workpiece, defining all steps required for producing the workpiece, and decomposing each step into each equipment action; the equipment action is the smallest action unit which cannot be disassembled in the workpiece production step.
2. Regarding the action duration of the device: giving a starting action trigger signal when the equipment starts to act, and simultaneously recording the current local system time of the PLC as the starting time of the equipment action; recording the end time of the equipment action in the same way; the interval between the starting time and the ending time of the device action is the action duration of the device.
3. Regarding data caching: and when the last step of equipment action finishes the action, all the obtained action time stamp data and part numbers are transmitted to a cache region. For example, for a workpiece with the number 001, 10 steps are required to be performed to produce a 001 workpiece, each step is divided into 5 device actions, the number of device actions for completing the 001 workpiece production is 50, the timestamp data of the start time and the end time of the device actions of the 50 device actions are recorded in a one-to-one correspondence manner, and after the 50 th device action is completed, all the timestamp data are transmitted to the buffer area.
4. Judgment on data integrity: for the integrity of the data in the cache region is integrally detected, the data integrity refers to that: each device action has a start time and an end time; if the data is incomplete, continuing to wait until the equipment action is finished and carrying out corresponding recording; for example, the total number of the workpiece process steps with the number 001 is 10, after the 10 th operation is completed, data integrity check is performed on the stored data in the buffer area, if the device operation in the 9 th operation is incomplete, the incomplete device operation is marked, and then the corresponding device operation time is written into the buffer area.
5. With respect to data analysis: the production time of each work and the action time of each device can be inquired according to the workpiece number, and the bottleneck process is analyzed and judged by transversely comparing the action time of each device for guiding production.