CN105629862B - Real-time log recording method of control equipment based on PLC - Google Patents
Real-time log recording method of control equipment based on PLC Download PDFInfo
- Publication number
- CN105629862B CN105629862B CN201410616769.6A CN201410616769A CN105629862B CN 105629862 B CN105629862 B CN 105629862B CN 201410616769 A CN201410616769 A CN 201410616769A CN 105629862 B CN105629862 B CN 105629862B
- Authority
- CN
- China
- Prior art keywords
- information
- plc
- log
- time
- real
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Testing And Monitoring For Control Systems (AREA)
Abstract
Disclosed is a real-time log recording method of a PLC-based control device. The method comprises the following steps: assigning a unique number to each type of metadata used to describe the state of the control device; in the running process of equipment, information numbers corresponding to the metadata in the current period of the PLC are pressed into a stack, and the current time of the PLC is read and stored as a time stamp; after the PLC establishes communication connection with an output device, information numbers in a stack and corresponding timestamps are popped and sent to the output device; the output device interprets the received information number and the corresponding time stamp to store a log of the control apparatus. By using the scheme, the state, the operation flow, the abnormal condition of the system and the command which is beneficial to monitoring and analyzing the system work can be recorded in real time and stored in the form of log.
Description
Technical Field
Embodiments of the present invention relate to PLC (programmable logic controller) data processing, and more particularly, to logging in a PLC-based control device.
Background
In the existing automatic control equipment taking the PLC as a control core, the monitoring of the system state and the troubleshooting of the system state can only record and observe the system information which keeps the state for a long time after the occurrence, or know the running state of the equipment by continuously monitoring the running of the PLC program on line, and the state which is updated quickly or disappears immediately after the occurrence is difficult to directly judge the occurrence sequence and the specific reason of the state or the command.
Disclosure of Invention
In view of at least one technical problem in the prior art, a real-time logging method in a PLC-based control device is proposed, so that the cause of a failure can be determined quickly and accurately.
In one aspect of the present invention, a real-time logging method for a control device based on a Programmable Logic Controller (PLC) is provided, which includes the steps of: assigning a unique number to each type of metadata used to describe the state of the control device; in the running process of equipment, information numbers corresponding to the metadata in the current period of the PLC are pressed into a stack, and the current time of the PLC is read and stored as a time stamp; after the PLC establishes communication connection with an output device, information numbers in a stack and corresponding timestamps are popped and sent to the output device; and the output device interprets the received information number and the corresponding time stamp to store a log of the control apparatus.
According to some embodiments, the PLC and the output device establish a communication connection through a TCP/IP protocol or a PROFIBUS protocol.
According to some embodiments, the control device is a control apparatus that controls a security check system, and the metadata includes: start of scan, end of scan.
According to some embodiments, the date and time of the PLC's system clock is utilized as a time stamp.
According to some embodiments, the output device sends the log to a remote server for storage.
According to some embodiments, the output device is embodied as a touch screen or a personal computer.
According to some embodiments, the metadata includes system commands that need to be collected, collected information, and the current state of the control device.
According to some embodiments, logging of the control device's log is initiated by way of a remote instruction or a user's manual instruction or timing.
In another aspect of the present invention, there is provided a method of real-time logging in a security inspection system including a PLC-based control apparatus and an output device, the method including the steps of: assigning a fixed information number to each of the system commands, collected information or generated states to be collected; when the security inspection system operates, state information generated in the current period of the PLC and information numbers corresponding to executed or triggered commands are pressed into a stack, and the time of the current period of a CPU of the PLC is read and stored as an information timestamp; after the PLC establishes communication with external equipment, the information numbers and the information timestamps in the stacks are popped and sent; and the external equipment receives the information time stamp, lists the information content corresponding to the information number and finishes the list and storage of the log.
By utilizing the scheme, the system state, the operation flow, the abnormal condition and the command which is beneficial to monitoring and analyzing the system work are recorded in real time and stored in the form of logs, so that a worker can find and verify whether the system operation flow reaches the design target or not by looking up and analyzing the logs after the equipment finishes the work or has a fault. In addition, the scheme can help to search system fault information and eliminate system faults.
Drawings
For a better understanding of the invention, embodiments thereof will be described with reference to the following drawings:
FIG. 1 illustrates a process for rapid inspection of a container truck in a security inspection system according to an embodiment of the present invention;
fig. 2 illustrates a structure of a PLC and a relationship between the PLC and an external device in an embodiment according to the present invention;
FIG. 3 is a schematic flow chart diagram depicting a method of logging in real-time in accordance with an embodiment of the present invention.
The figures do not show all of the circuitry or structures of the embodiments. The same reference numbers will be used throughout the drawings to refer to the same or like parts or features.
Detailed Description
Specific embodiments of the present invention will be described in detail below, and it should be noted that the embodiments described herein are only for illustration and are not intended to limit the present invention. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention. However, it will be apparent to one of ordinary skill in the art that: it is not necessary to employ these specific details to practice the present invention. In other instances, well-known circuits, materials, or methods have not been described in detail in order to avoid obscuring the present invention.
Throughout the specification, reference to "one embodiment," "an embodiment," "one example," or "an example" means: the particular features, structures, or characteristics described in connection with the embodiment or example are included in at least one embodiment of the invention. Thus, the appearances of the phrases "in one embodiment," "in an embodiment," "one example" or "an example" in various places throughout this specification are not necessarily all referring to the same embodiment or example. Furthermore, the particular features, structures, or characteristics may be combined in any suitable combination and/or sub-combination in one or more embodiments or examples. Further, those of ordinary skill in the art will appreciate that the drawings provided herein are for illustrative purposes and are not necessarily drawn to scale. It will be understood that when an element is referred to as being "coupled" or "connected" to another element, it can be directly coupled or coupled to the other element or intervening elements may be present. In contrast, when an element is referred to as being "directly coupled" or "directly connected" to another element, there are no intervening elements present. Like reference numerals refer to like elements. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The following describes the apparatus for imaging inspection of a moving object according to the present invention with reference to the accompanying drawings. As shown in the drawings, a vehicle rapid inspection apparatus is explained as an embodiment. The following description is intended only to illustrate the present invention with reference to examples and is not intended to limit the present invention to the following.
Fig. 1 is a schematic diagram describing an inspection method according to an embodiment of the present invention. As shown in fig. 1, the apparatus for fast imaging inspection includes an accelerator cabin 109, fast response light curtain switches 102, 105 and 106, ground induction coils 103 and 108, a photoelectric switch 110, guard walls 104 and 111, a speed radar 107, a detector arm 112, control software, and so on.
The quick response light curtain switch 102 is installed on an installation upright column on two sides of a channel, the ground sensing coil 103 is embedded below the ground surface of the channel inlet and is a first switch of a vehicle inlet, the protective walls 104 and 111 are vertically installed on two sides of the channel and are respectively connected with the accelerator cabin 109 and the detector arm 112 on two sides of the channel, the quick response light curtain switches 105 and 106 are installed on the wall of the accelerator cabin 109 and the detector arm 112 on two sides of the channel, the photoelectric switch 110 is installed on the protective wall 111 on two sides of the channel, the speed measuring radar 107 is installed on the outer wall, close to the channel, of the accelerator cabin 109, and the ground sensing coil 108 is embedded below the ground surface of the channel and is deviated to. The inspection process according to the present embodiment is as follows:
when the number of vehicles in the channel is 0, the system is in a standby state, when one vehicle 101A drives to the channel, the sensing coil 103 is firstly effective, the judgment of the vehicle driving direction is completed by combining the quick response light curtain switch 102, if the vehicle drives to the channel, the number of vehicles in the channel is added with 1, the speed measuring radar 107 measures the vehicle driving speed, and the system enters a ready state. The vehicle continues to run forwards, and the system records the state change of the vehicle in the running process of the passage in the whole course.
When the vehicle passes from 101A to 101B at normal speed, the photoelectric switch 110 is active, and at the moment, whether the detected vehicle is a container truck or a closed truck is judged according to the state of the light curtain switch 105, and different scanning triggering conditions are adopted according to different vehicle types. If the vehicle is a closed truck, the accelerator immediately emits the beam to scan.
The above-mentioned fast imaging inspection apparatus may further comprise a detector, after the fast response light curtain switch 102 detects that the vehicle enters the inspection area, if the state of the light curtain switch 105 is determined to be a container truck, it starts to detect whether the cab of the vehicle passes and generates a pass signal, and then a scanning inspection is performed when the container arrives at the inspection area. Wherein the control system generates a control signal for controlling the betatron system to generate the electron beam based on the pass signal from the detector.
The fast products have a large amount of equipment states which can change in a short time due to high flow speed, the information quantity of information collected by the system, triggered commands and the like is large, many of the information are instantaneously changed, the real-time state of the system cannot be recorded, and the whole operation process cannot be accurately and completely recorded by continuously monitoring the operation of a PLC program on line.
Fig. 2 illustrates a structure of a PLC and a relationship between the PLC and an external device in an embodiment according to the present invention. As shown in fig. 2, the PLC201, which is a core of the control apparatus, includes an I/O circuit, a CPU, a program memory, a user memory (data memory), a programmer, and the like. The PLC may establish communication with an external output device, such as a touch screen/display 203, through the switch 202.
FIG. 3 is a schematic flow chart diagram depicting a method of logging in real-time in accordance with an embodiment of the present invention. As shown in fig. 3, in step S301, a unique number is given to each metadata used to describe the state of the control device. For example, macros that may appear in certain security devices, for example, status, some important commands and data, etc., are each assigned a unique number.
Then, in step S302, the information number corresponding to the metadata in the current period of the PLC is pushed onto the stack during the operation of the device, and the current time of the PLC is read and saved as a timestamp.
In step S303, after the PLC establishes a communication connection with an output device such as the injection touch screen 203, the information number in the stack and the corresponding timestamp are popped and transmitted to the output device.
In step S304, the output device interprets the received information number and the corresponding time stamp to store a log of the control apparatus.
Therefore, the system state, the operation flow, the abnormal condition and the command which is beneficial to monitoring and analyzing the system work can be recorded in real time and stored in the form of logs, so that a worker can find and verify whether the system operation flow reaches the design target or not by looking up and analyzing the logs after the equipment finishes the work or has a fault; and the system fault information can be searched for, and the system fault can be eliminated.
In some embodiments, the information of the system command, the collected information, the generated state and the like which needs to be collected corresponds to a fixed information number. Therefore, when the system runs, the state information generated in the current period of the PLC and the information number corresponding to the executed or triggered command are pressed into the stack, and the current time of the PLC system is read and stored as the information timestamp.
The PLC communicates with intelligent equipment such as a touch screen or a PC through related communication protocols (such as communication protocols of a TCP/IP protocol, a PROFIBUS protocol and the like), after the communication is established, the PLC pops the information number and the information timestamp in the stack to be sent, and after the intelligent equipment such as the touch screen or the PC receives the information number, the information timestamp is read and the information content corresponding to the information number is listed, so that the list and the storage of the log are completed. In other embodiments, a wireless connection mode may be used to establish communication between the PLC and a device such as a touch screen or a PC, or a connection with a remote server through a network may be used to record log information in real time.
The embodiment of the invention discloses a real-time log recording method based on a PLC, which can record system information required by the whole process in real time in a shorter process according to the sequence of system state change and the time sequence of command triggering and execution. The designer confirms whether the design of the process and the judgment of the system state meet the design target or not by referring to the analysis log, and the worker can also quickly confirm the fault and the fault reason existing in the process by referring to the analysis log, so that the fault can be quickly and effectively eliminated.
Meanwhile, the real-time log recording method is also used for an equipment operation and maintenance system, and the system operation state and the real-time system information recorded by the scanning control subsystem are stored and reported, so that related personnel can know the equipment state locally or remotely, the equipment information of one hand is collected, and the field and remote technical support personnel can analyze the equipment fault together to search and solve the problem.
1) Compiling an information number list, and determining information content corresponding to the information number, such as: 100, indicating the start of the scan; 101, indicating the end of the scan; 102, representing a scan interruption;
2) the date and time of a PLC system clock are used as time stamps for information triggering;
3) storing the information number, the information number and the like to a specified address, loading the information number, the information number and the like to an address register, and recording and storing the information number and the information number;
4) analyzing the timestamp of the information to be transmitted into 7 variables, wherein the variables are respectively millisecond in time, month, day and time;
5) the time of state information change or the triggering and executing time of the command during the operation of the system is used as a mark for pressing the information number into the stack;
6) storing the information number and the information timestamp in a log cache region, wherein the log structure is a timestamp plus an information number; the number of the transmitted and stored logs and the information of the last log (timestamp + message number format) are recorded simultaneously
7) The PLC and the touch screen or the PC and other intelligent devices communicate with each other through a related communication protocol (for example: communication protocols such as a TCP/IP protocol and a PROFIBUS protocol) are established, and the PLC sends information of a system storage stack to intelligent equipment such as a touch screen or a PC;
8) and (3) the touch screen or the PC corresponds to the information number list established before, and the received information timestamp and the information content corresponding to the information number are recorded in the list, namely the real-time log is recorded.
Although the above description is directed to a quick check system, those skilled in the art may apply the above scheme to other fields to record the log of the control device in real time.
The foregoing detailed description has set forth numerous embodiments of a method of logging in real-time using schematics, flowcharts, and/or examples. Where such diagrams, flowcharts, and/or examples contain one or more functions and/or operations, it will be understood by those within the art that each function and/or operation within such diagrams, flowcharts, or examples can be implemented, individually and/or collectively, by a wide range of structures, hardware, software, firmware, or virtually any combination thereof. In one embodiment, portions of the subject matter described by embodiments of the invention may be implemented by Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs), Digital Signal Processors (DSPs), or other integrated formats. However, those skilled in the art will recognize that some aspects of the embodiments disclosed herein, in whole or in part, can be equivalently implemented in integrated circuits, as one or more computer programs running on one or more computers (e.g., as one or more programs running on one or more computer systems), as one or more programs running on one or more processors (e.g., as one or more programs running on one or more microprocessors), as firmware, or as virtually any combination thereof, and that designing the circuitry and/or writing the code for the software and or firmware would be well within the skill of one of skill in the art in light of this disclosure. In addition, those skilled in the art will appreciate that the mechanisms of the subject matter described herein are capable of being distributed as a program product in a variety of forms, and that an illustrative embodiment of the subject matter described herein applies regardless of the particular type of signal bearing media used to actually carry out the distribution. Examples of signal bearing media include, but are not limited to: recordable type media such as floppy disks, hard disk drives, Compact Disks (CDs), Digital Versatile Disks (DVDs), digital tape, computer memory, etc.; and a transmission type medium such as a digital and/or an analog communication medium (e.g., a fiber optic cable, a waveguide, a wired communications link, a wireless communication link, etc.).
While the present invention has been described with reference to several exemplary embodiments, it is understood that the terminology used is intended to be in the nature of words of description and illustration, rather than of limitation. As the present invention may be embodied in several forms without departing from the spirit or essential characteristics thereof, it should also be understood that the above-described embodiments are not limited by any of the details of the foregoing description, but rather should be construed broadly within its spirit and scope as defined in the appended claims, and therefore all changes and modifications that fall within the meets and bounds of the claims, or equivalences of such meets and bounds are therefore intended to be embraced by the appended claims.
Claims (5)
1. A method of recording logs in real time in a security inspection system including a PLC-based control device and an external device, the method comprising the steps of:
assigning a fixed information number to each of the scanning start, the scanning end and the scanning interruption of the security inspection system;
when the security inspection system runs, information numbers of scanning start, scanning end and scanning interruption of the PLC in the current period are pressed into a log cache region of a stack, time of the CPU of the PLC in the current period is read and stored as an information timestamp, and the number of sent and stored logs and information of the latest log are recorded in the log cache region;
after the PLC establishes communication with external equipment, the information numbers and the information timestamps in the stacks are popped and sent;
the external device receives the information time stamp and interprets the information time stamp into 7 variables: and the information content corresponding to the information number is listed, and the list and the storage of the log are completed.
2. The method of claim 1, wherein the PLC establishes a communication connection with the external device through a TCP/IP protocol or a PROFIBUS protocol.
3. The method of claim 1, wherein the external device sends the log to a remote server storage.
4. The method of claim 1, wherein the external device is in particular a touch screen or a personal computer.
5. The method of claim 1, wherein logging of the control device log is initiated by remote instruction or manual instruction of a user or timed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410616769.6A CN105629862B (en) | 2014-11-05 | 2014-11-05 | Real-time log recording method of control equipment based on PLC |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410616769.6A CN105629862B (en) | 2014-11-05 | 2014-11-05 | Real-time log recording method of control equipment based on PLC |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105629862A CN105629862A (en) | 2016-06-01 |
CN105629862B true CN105629862B (en) | 2020-03-17 |
Family
ID=56044927
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410616769.6A Active CN105629862B (en) | 2014-11-05 | 2014-11-05 | Real-time log recording method of control equipment based on PLC |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105629862B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018234246A1 (en) * | 2017-06-21 | 2018-12-27 | Tetra Laval Holdings & Finance S.A. | Method of logging process data in a plc controlled equipment |
CN108580892A (en) * | 2018-03-15 | 2018-09-28 | 大族激光科技产业集团股份有限公司 | A kind of powdering formula laser 3D printing system and its recording method |
CN110320825A (en) * | 2018-03-28 | 2019-10-11 | 北京京东尚科信息技术有限公司 | A kind of method and apparatus counting equipment state |
TWI666560B (en) * | 2018-04-16 | 2019-07-21 | 緯創資通股份有限公司 | Electronic device and method for event logging |
CN109460392B (en) * | 2018-10-10 | 2020-11-06 | 东软集团股份有限公司 | Log file acquisition method and device, readable storage medium and electronic equipment |
CN111669389A (en) * | 2020-06-03 | 2020-09-15 | 浙江中控技术股份有限公司 | Data transmission method and device of industrial control system and related equipment |
CN112486054A (en) * | 2020-10-29 | 2021-03-12 | 惠州市德赛西威汽车电子股份有限公司 | Device and method for controlling on-off of signal |
CN116027771B (en) * | 2023-03-30 | 2023-06-13 | 深圳市深蓝宇科技有限公司 | Abnormality detection method for industrial personal computer control system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102110167A (en) * | 2011-03-01 | 2011-06-29 | 上海奈凯电子科技有限公司 | Method for implementing log information management in numerical control system |
JP2012103936A (en) * | 2010-11-11 | 2012-05-31 | Sharp Corp | Log output device and rearrangement method for its output log |
CN103631699A (en) * | 2012-08-28 | 2014-03-12 | 纽海信息技术(上海)有限公司 | Log management system and method for log monitoring, acquiring and querying |
CN103718122A (en) * | 2011-09-02 | 2014-04-09 | 横河电机株式会社 | Field apparatus |
-
2014
- 2014-11-05 CN CN201410616769.6A patent/CN105629862B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012103936A (en) * | 2010-11-11 | 2012-05-31 | Sharp Corp | Log output device and rearrangement method for its output log |
CN102110167A (en) * | 2011-03-01 | 2011-06-29 | 上海奈凯电子科技有限公司 | Method for implementing log information management in numerical control system |
CN103718122A (en) * | 2011-09-02 | 2014-04-09 | 横河电机株式会社 | Field apparatus |
CN103631699A (en) * | 2012-08-28 | 2014-03-12 | 纽海信息技术(上海)有限公司 | Log management system and method for log monitoring, acquiring and querying |
Also Published As
Publication number | Publication date |
---|---|
CN105629862A (en) | 2016-06-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105629862B (en) | Real-time log recording method of control equipment based on PLC | |
JP6896375B2 (en) | Integrated transformer health monitoring architecture | |
CN101622649B (en) | Error logging method for a coating plant | |
CN103699111B (en) | The fault detection method of distributed monitoring system and device | |
CN105718570A (en) | Data migration method and device used for database | |
US20100070213A1 (en) | Method for Monitoring the Electrical Energy Quality in an Electrical Energy Supply System, Power Quality Field Device and Power Quality System | |
CN104360922A (en) | Method for automatically monitoring BMC working state based on ipmitool | |
EP3771951B1 (en) | Using data from plc systems and data from sensors external to the plc systems for ensuring data integrity of industrial controllers | |
RU2009108308A (en) | DEVICES, SYSTEMS AND METHODS CONCERNING PLC SYSTEM FAILURE | |
CN103678105A (en) | Page code testing method and device | |
CN103529711A (en) | Automatic testing method and system for ATC (Automatic Train Control) vehicle-mounted equipment | |
CN1982848A (en) | Information inspecting controller based on sensor and its inspection | |
CN104881729A (en) | Electric power marketing system power failure information processing method, and electric power marketing system power failure information processing system | |
CN111627199A (en) | Hydropower station dam safety monitoring system and monitoring method | |
CN110739025A (en) | storage equipment power failure test method, device and system | |
CN103684917A (en) | Multi-target-machine system monitoring system and method | |
CN116513279B (en) | Method and device for testing normal operation of train backup mode | |
CN103245915B (en) | Based on the excitation system in-service monitoring method of real-time PMU data | |
CA2944774A1 (en) | Data collection system and method | |
EP3506034B1 (en) | Control system | |
KR101834814B1 (en) | Method for saving fault wave data | |
KR20180074473A (en) | Pre-sensing apparatus for abnormal of coiling equipment | |
CN102508065A (en) | Method, system and engineering machinery for electrical fault diagnosis | |
CN103339055B (en) | Monitored control system and method | |
JP6139149B2 (en) | Analysis method and analysis apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |