CN109270885B - Data communication method, device and equipment for monitoring PLC system and storage medium - Google Patents

Data communication method, device and equipment for monitoring PLC system and storage medium Download PDF

Info

Publication number
CN109270885B
CN109270885B CN201811258692.4A CN201811258692A CN109270885B CN 109270885 B CN109270885 B CN 109270885B CN 201811258692 A CN201811258692 A CN 201811258692A CN 109270885 B CN109270885 B CN 109270885B
Authority
CN
China
Prior art keywords
data
plc system
communication
decoding
data packet
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
Application number
CN201811258692.4A
Other languages
Chinese (zh)
Other versions
CN109270885A (en
Inventor
韩万贵
韩传云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou HYC Technology Co Ltd
Original Assignee
Suzhou HYC Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Suzhou HYC Technology Co Ltd filed Critical Suzhou HYC Technology Co Ltd
Priority to CN201811258692.4A priority Critical patent/CN109270885B/en
Publication of CN109270885A publication Critical patent/CN109270885A/en
Application granted granted Critical
Publication of CN109270885B publication Critical patent/CN109270885B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • G05B19/054Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/11Plc I-O input output
    • G05B2219/1103Special, intelligent I-O processor, also plc can only access via processor

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Programmable Controllers (AREA)

Abstract

The embodiment of the invention provides a data communication method, a device, equipment and a storage medium for monitoring a PLC system. The method comprises the following steps: circularly executing the processes of sending a data acquisition instruction to a PLC system and receiving a response data packet sent by the PLC system; if a response data packet is received, decoding the response data packet; and if the communication data is obtained by decoding, updating the communication data to a local database. Through the technical scheme, the processes of receiving the response data packet, decoding the response data packet and updating the communication data are executed in parallel, and the efficiency of monitoring the data communication of the PLC system is improved.

Description

Data communication method, device and equipment for monitoring PLC system and storage medium
Technical Field
The embodiment of the invention relates to a PLC technology, in particular to a data communication method, a device, equipment and a storage medium for monitoring a PLC system.
Background
In an automatic production system, control and monitoring of a plurality of devices are realized by adopting a PLC (programmable logic controller), the PLC has strict logic time sequence structure, flexible flow control and strong device compatibility, and data communication with the PLC system is generally required to be carried out by adopting upper computer industrial control software and specially developed software so as to acquire process data of soft elements in the PLC system.
The process data of the PLC soft element is collected and stored by adopting upper computer industrial control software and specially developed software, the data can be stored for a long time, the traceability of the data is better, but the monitoring of the process data has certain limitation, the main problems are that the period of data collection is longer, some intermediate instantaneous process data cannot be collected, and the collection and the recording of some process data of instantaneous action less than 100ms are more difficult. Because the instantaneous process data of the PLC cannot be monitored at a high speed, the process data cannot be monitored or cannot be stored in time and are lost frequently, and some instantaneous process states cannot be recorded and traced, so that the equipment maintenance and the equipment state analysis are not facilitated. Therefore, a high-speed monitoring method is needed to collect and store data of the PLC soft elements which change constantly in real time, so that the data communication efficiency between the upper computer and the PLC system is improved.
Disclosure of Invention
The invention provides a data communication method, a device, equipment and a storage medium for monitoring a PLC system, which aim to improve the efficiency of monitoring the data communication of the PLC system.
In a first aspect, an embodiment of the present invention provides a data communication method for monitoring a PLC system, including:
circularly executing the processes of sending a data acquisition instruction to a PLC system and receiving a response data packet sent by the PLC system;
if a response data packet is received, decoding the response data packet;
and if the communication data is obtained by decoding, updating the communication data to a local database.
Further, before the process of cyclically executing the process of sending the data acquisition instruction to the PLC system and receiving the response data packet sent by the PLC system, the method further includes:
according to the input template of the PLC system, the soft element in the PLC system is input into the PLC monitoring system, and the input template comprises: soft element name, data type, and function annotation.
Further, the format of the input template is an Excel table.
Further, the number of the PLC systems is at least one.
Further, the decoding the response packet includes:
and dividing the response data packet into two or more sub-packets, and decoding the sub-packets in parallel.
Further, the updating the communication data to the local database includes:
if the communication data is in the local database, keeping the local database unchanged; and if the communication data is not in the local database, writing the communication data into the local database.
Further, the storage format of the local database is an Excel file.
In a second aspect, an embodiment of the present invention provides a data communication apparatus for monitoring a PLC system, including:
the system comprises a cyclic acquisition module, a data transmission module and a data transmission module, wherein the cyclic acquisition module is used for circularly executing the processes of transmitting a data acquisition instruction to a PLC system and receiving a response data packet transmitted by the PLC system;
the decoding module is used for decoding the response data packet when receiving the response data packet;
and the updating module is used for updating the communication data to the local database when the communication data is obtained by decoding.
In a third aspect, an embodiment of the present invention provides an apparatus, including:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the data communication method of monitoring a PLC system according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the data communication method for monitoring a PLC system according to the first aspect.
The embodiment of the invention provides a data communication method, a device, equipment and a storage medium for monitoring a PLC system, wherein the method comprises the following steps: circularly executing the processes of sending a data acquisition instruction to a PLC system and receiving a response data packet sent by the PLC system; if a response data packet is received, decoding the response data packet; and if the communication data is obtained by decoding, updating the communication data to a local database. Through the technical scheme, the processes of receiving the response data packet, decoding the response data packet and updating the communication data are executed in parallel, and the efficiency of monitoring the data communication of the PLC system is improved.
Drawings
Fig. 1 is a schematic flowchart of a data communication method for monitoring a PLC system according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of connection between an upper computer and a PLC system according to a first embodiment of the present invention;
fig. 3 is a schematic flowchart of a data communication method for monitoring a PLC system according to a second embodiment of the present invention;
fig. 4 is a flowchart illustrating an implementation of a data communication method for monitoring a PLC system according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a data communication device for monitoring a PLC system according to a third embodiment of the present invention;
fig. 6 is a schematic diagram of a hardware structure of an apparatus according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a schematic flowchart of a data communication method for monitoring a PLC system according to an embodiment of the present invention. The embodiment is suitable for the condition of carrying out data communication between the upper computer and each PLC system. Specifically, the data communication method of the monitoring PLC system may be performed by a data communication device of the monitoring PLC system, which may be implemented in software and/or hardware and integrated in the device. Further, devices include, but are not limited to: desktop computer, host computer and industrial computer.
It should be noted that, when performing data communication with the PLC system, an industrial personal computer or a PC is preferably used as an upper computer to quickly process a large amount of real-time data and store the data, which is convenient for query and trace of historical data. In the embodiment, when the data communication method for monitoring the PLC system is executed, an industrial ethernet is first established between the upper computer and each PLC system, a TCP/IP-based communication network technical standard is provided, and a fast hardware link is established.
Fig. 2 is a schematic structural diagram of connection between an upper computer and a PLC system according to an embodiment of the present invention. Referring to fig. 2, the upper computer 10 is connected to the PLC system 11 and the PLC system 12, respectively, and the network transmission medium adopts two pairs of 5-type unshielded twisted pair lines with impedance of 100 ohms in accordance with 100BASE-TX standard, and the maximum transmission distance is 100 meters. The number of the PLC systems may be one or more, two PLC systems are illustrated in fig. 2 as an example, and the PLC systems 11 and 12 are all mitsubishi Q series PLC systems. Each PLC system is provided with a communication network module QJ71E71-100 and is connected to a network segment of an upper computer through a 100BASE-TX standard network wire. A communication network module of the PLC system selects a 100Mbps network port of the Ethernet, and the data communication speed is 100/1000Mbps in the Ethernet transmission process; the network port of the upper computer selects a 1000Mbps network port, so that a rapid Ethernet communication network is established, and hardware support is provided for communication of a PLC system. The data communication between the upper computer and the PLC system is based on a TCP/IP protocol, and the IP address of the PLC system and the IP address of the upper computer are arranged in the same network segment.
Referring to fig. 1, the data communication method for monitoring a PLC system specifically includes:
and S110, sending a data acquisition instruction to the PLC system.
Specifically, when data communication is performed, the upper computer sends a data acquisition instruction to the PLC system to access communication data stored in the PLC system.
And S120, receiving a response data packet sent by the PLC system.
Specifically, the PLC system responds to the data acquisition instruction and encodes the communication data to form a response data packet which is returned to the upper computer, wherein the response data packet comprises the communication data obtained by the PLC system through real-time monitoring. The upper computer receives the response data packet sent by the PLC system, and shares the response data packet to the decoding process while receiving the response data packet, that is, step S130 is executed, and further processing is performed on the response data packet.
It should be noted that step S110 and step S120 are executed in a loop, and constitute a loop data collecting process. Specifically, when the upper computer receives the response data packet sent by the PLC system, on one hand, the response data packet is shared to the decoding process, and step S130 is executed, on the other hand, the upper computer continues to execute step S110, sends the data acquisition instruction to the PLC system, and re-accesses the communication data in the PLC system. The PLC system can be circularly acquired by rapidly and circularly executing data acquisition instructions sent to the PLC system and receiving response data packets sent by the PLC system.
And S130, decoding the response data packet when the response data packet is received.
Specifically, the response data packet is formed by encoding communication data by the PLC system and is returned to the upper computer, and after the upper computer receives the response data packet, the corresponding response data packet is decoded, and the response data packet is restored to the corresponding communication data. And sharing the communication data to the data updating process while decoding the communication data, namely executing step S140 to perform further processing on the communication data.
It should be noted that, since the loop data collecting process (step S110 and step S120) is always executed in a loop, the upper computer may continuously obtain the response data packet sent by the PLC system, share the response data packet to the decoding process, and decode the response data packet by the decoding process, that is, the loop data collecting process and the decoding process are executed independently and concurrently.
And S140, decoding to obtain communication data, and updating the communication data to a local database.
Specifically, in the data updating process, the communication data obtained after decoding is updated to the local database, so that the communication data sent by the PLC system is recorded in real time.
Further, when the communication data is updated to the local database, update detection may be performed first, for example, it is determined whether there is a change in the obtained communication data compared with existing data in the local database, and if there is a change, the communication data is updated to the local database, so as to record a change process of the communication data and ensure traceability of the communication data.
It should be noted that, in this embodiment, the data communication of the monitoring PLC system is divided into three independent processes, that is, a data loop collection process, a decoding process, and a data update process, and these three processes are executed in parallel, that is, while the response data packet sent this time is decoded and the communication data is updated, the upper computer has started the next data collection. In the process of circularly acquiring data, the operation of decoding response data packets and updating communication data is not included, so that the intermediate links of encoding, decoding, data processing, storage and the like in the process of sending the communication data to the upper computer by the PLC system are reduced, the flow of acquiring the data from the upper computer to the PLC system is simplified, the scanning period of executing a data acquisition program is shortened, the data acquisition speed is increased, and the real-time monitoring of the communication data of the PLC system is facilitated.
The data communication method for monitoring the PLC system of the embodiment comprises the following steps: circularly executing the processes of sending a data acquisition instruction to a PLC system and receiving a response data packet sent by the PLC system; if a response data packet is received, decoding the response data packet; and if the communication data is obtained by decoding, updating the communication data to a local database. By the technical scheme, the operation of circularly acquiring data, decoding response data packets and updating communication data is executed in parallel, and the efficiency of monitoring the data communication of the PLC system is improved.
Example two
Fig. 3 is a schematic flowchart of a data communication method for monitoring a PLC system according to a second embodiment of the present invention. In this embodiment, on the basis of the above embodiments, a data communication method for monitoring a PLC system is optimized, and details that are not described in detail in this embodiment may be referred to any of the above embodiments.
Referring to fig. 3, the data communication method for monitoring the PLC system in this embodiment is specifically optimized as follows:
s210, according to the input template of the PLC system, inputting the soft element in the PLC system into the PLC monitoring system, wherein the input template comprises: soft element name, data type, and function annotation.
Specifically, the soft elements are devices with certain functions in the PLC system, the devices are composed of electronic circuits, registers, memory units and the like, and mainly include relays, timers and the like, and the soft elements cooperate with a monitoring program of the PLC system and an application program of a user to generate or simulate different functions. The essence of circularly acquiring data from the PLC system by the upper computer is to read real-time data monitored by a soft element in the PLC system. Before data are collected circularly, a login mode of the soft element is established, namely the soft element in the PLC system is logged into the PLC monitoring system according to a set logging template. Illustratively, the soft element is entered in the form of a table, and the name of the soft element, the data type and the functional annotation are included in the entry template. Table 1 is a mapping table of soft element names, data types, and function annotations in this embodiment.
Serial number Name of Soft element Data type Functional annotations
1 X00000 BIT Warning sound signal
2 Y00000 BIT Reset signal
3 M00000 BIT ……
4 L00000 BIT ……
5 B00000 BIT ……
6 D00001 WORD_I ……
7 D00002 WORD_U ……
8 D00003 DWORD_F ……
9 W00000 DWORD_I ……
10 W00002 DWORD_U ……
Table 1 mapping relationship table for soft element names, data types, and function annotations.
As shown in table 1, when the soft elements are entered according to the entry template, a valid data type is specified for each soft element, and the data types include: BIT data, 16-BIT signed integer, 16-BIT unsigned integer, 32-BIT signed integer, 32-BIT unsigned integer and 32-BIT floating point, corresponding to BIT, WORD _ I, WORD _ U, DWORD _ I, DWORD _ U, DWORD _ F in table 1, respectively; meanwhile, function annotation can be carried out on each PLC soft element, for example, the data type of the soft element X00000 is bit data, so as to monitor a warning sound signal; the data type of the soft element Y00000 is micro data for monitoring a reset signal and the like. The soft element is recorded into the PLC monitoring system, recorded soft element data are managed conveniently, and when the upper computer acquires data, the PLC system can quickly respond and return a response data packet according to a data acquisition command and the recorded soft element data, so that data can be acquired in a rapid circulating mode.
It should be noted that the PLC monitoring system is an integral body formed by connecting an upper computer and each PLC system through a network, and is a process of inputting a soft element into the PLC monitoring system, which is a process of substantially providing information or an interface related to the soft element to the upper computer for each PLC system.
Further, the format of the input template is an Excel table.
The Excel form is used as an entry template, and the soft element name, the data type and the function annotation of the soft element are entered into the PLC monitoring system, so that the data information of each soft element in the PLC system has a clear structure, and the entered soft element data can be managed conveniently and an access instruction to an upper computer can be responded quickly.
Further, when the soft elements are recorded, the soft elements are screened, deduplicated, reordered, and segmented. Specifically, when the entered data is not valid soft element data or is repeatedly entered soft element data, the data thereof is ignored, and, for example, the soft element data that does not conform to the set soft element name and the repeatedly entered soft element data are removed. Then, the effective soft elements are rearranged and sequenced, and the soft elements are divided into different address blocks according to the requirements of the MC protocol, so that the upper computer can conveniently access the soft elements of the PLC system in blocks when the data is circularly acquired, namely, the data is acquired in blocks.
And S220, sending a data acquisition instruction to the PLC system.
Furthermore, the upper computer accesses the soft elements of the PLC system in a blocking mode when the data are collected circularly.
Specifically, when sending a data acquisition instruction to the PLC system, the upper computer may encode the address blocks of the soft elements to be accessed, respectively, to form a plurality of instruction encoding packets, and send the instruction encoding packets to the PLC system, that is, send the data acquisition instruction to the PLC system. Wherein the number of instruction encoding packets is the number of soft element address blocks to be accessed. If the number of the instruction coding packets is large, the instruction coding packets can be sequenced in sequence, and the coding packet array is established, so that a plurality of addresses to be accessed can be converted into corresponding instruction coding packets at one time, redundancy of repeated coding can be avoided, and the efficiency of circularly acquiring data is improved. By dividing the soft element address blocks and sending data acquisition instructions to the PLC system in a mode of respectively coding each address block, the data acquisition in blocks is realized, the code amount of an access program is compressed, and the data acquisition efficiency is further improved.
And S230, receiving a response data packet sent by the PLC system.
Specifically, the upper computer receives the response data packets corresponding to the PLC system in sequence. After the upper computer sends the command coding packets to the PLC system in sequence, the PLC system responds and returns the response data packets to the upper computer, the upper computer receives the response data packets in sequence, stores the response data packets in sequence according to the sequence of the command coding packets and shares the response data packets to a decoding process. The cycle is repeated rapidly, so that the response data packet of the PLC system is refreshed rapidly, and the data communication efficiency is improved.
It should be noted that step S220 and step S230 are executed circularly to form a circular data collecting process.
Further, the number of the PLC systems is at least one.
Specifically, there may be one or more PLC systems. During data communication, the upper computer only circularly collects data for one PLC system each time; if only one PLC system is monitored, the PLC system can be directly connected with an upper computer through a 100BASE-TX standard network cable to form a simple network hardware structure.
And S230, decoding the response data packet when the response data packet is received.
Further, decoding the response packet includes: and dividing the response data packet into two or more sub-packets, and decoding the sub-packets in parallel.
Specifically, after receiving the response packet of the PLC system, the PLC system decodes the response packet to convert the response packet into communication data. The decoding is reverse decoding according to the coding sequence of the coding packet, and comprises dividing the response data packet and decoding the sub data packets in parallel, and the soft element address can be analyzed according to the response data packet or the sub data packets thereof in the decoding process, so that the response data packet is reduced into the corresponding PLC soft element address and the corresponding soft element actual data, and the PLC soft element address and the corresponding soft element actual data are used as communication data. And sharing the communication data to the communication data updating process while decoding the communication data. The cycle is repeated rapidly, so that the communication data can be stored in time after decoding, and the traceability of data communication is ensured.
S240, decoding to obtain communication data, and updating the communication data to a local database.
Further, if the communication data is in the local database, keeping the local database unchanged; and if the communication data is not in the local database, writing the communication data into the local database.
Specifically, after the communication data is obtained, the communication data is updated and detected, and the communication data is written into the local database according to the result of the update and detection. Illustratively, the latest decoded communication data is compared with original data already stored in a local database, if the data is not changed, the data does not need to be updated, and the local database is kept unchanged; if the data change exists, the time, the soft element name, the current element value and the function annotation which are changed are recorded, the contents are written into the local database and displayed in a display panel of the upper computer, so that the change process of the communication data is rapidly recorded, and the traceability of the communication data is ensured.
Further, the storage format of the local database is an Excel file.
When the communication data is updated to the local database, the real-time change process of the communication data of the PLC system needs to be recorded, so that the management and the query are facilitated. The communication data is updated to the local database in a timed automatic storage mode. Illustratively, communication data generated every day is stored in an Excel file, and the storage position of the Excel file can be customized. The communication data is stored in a local database in an Excel file mode, the time of the communication data changing, the soft element name, the current element value and the function annotation are clearly recorded, the communication data is stored for a long time, and the traceability of the communication data is ensured.
Fig. 4 is a flowchart of an implementation of the data communication method for monitoring a PLC system according to the second embodiment of the present invention. Referring to fig. 4, the data communication of the monitoring PLC system is divided into three independent processes, namely, a loop data collection process, a decoding process and a data updating process, which are executed in parallel. The process of circularly acquiring data comprises the steps of recording soft elements, screening, removing duplicate, reordering and dividing the soft elements, and then respectively encoding according to the address blocks of the soft elements to be accessed to form a plurality of instruction encoding packets. And then the upper computer sends an instruction coding packet to the PLC system in a circulating manner, the PLC system returns a response data packet to the upper computer after responding, and the upper computer receives the response data packet, stores the response data packet in sequence and shares the response data packet to a decoding process. In the decoding process, the response data packet is divided into two or more sub-packets, the sub-packets are decoded in parallel to obtain communication data, and the communication data is shared to the data updating process. And in the data updating process, updating and detecting the communication data, and writing the communication data into a local database according to the result of the updating and detecting.
According to the embodiment, the soft elements in the PLC system are recorded into the PLC system according to the recording template of the PLC system, so that the communication data can be conveniently recorded and managed; the data acquisition instruction is sent to the PLC system by dividing the address block of the soft element and respectively coding the address block, so that the data is acquired in blocks, and the data acquisition efficiency is improved; the efficiency of monitoring the data communication of the PLC system is improved by executing the processes of circularly acquiring data, decoding response data packets and updating communication data in parallel; by updating the communication data to the local database, the traceability of the communication data is ensured.
EXAMPLE III
Fig. 5 is a schematic structural diagram of a data communication device for monitoring a PLC system according to a third embodiment of the present invention. Referring to fig. 5, the apparatus includes:
the system comprises a cyclic acquisition module 100, a data transmission module and a data transmission module, wherein the cyclic acquisition module is used for circularly executing the processes of transmitting a data acquisition instruction to a PLC system and receiving a response data packet transmitted by the PLC system;
a decoding module 101, configured to decode a response packet when receiving the response packet;
and the updating module 102 is configured to update the communication data to the local database when the communication data is decoded.
The data communication device for monitoring the PLC system of the embodiment circularly executes the processes of sending a data acquisition instruction to the PLC system and receiving a response data packet sent by the PLC system through the circular acquisition module; when receiving the response data packet through the decoding module, decoding the response data packet; and when the communication data are obtained through decoding by the updating module, the communication data are updated to the local database. By the technical scheme, the operation of circularly acquiring data, decoding response data packets and updating communication data can be executed in parallel, and the efficiency of monitoring the data communication of the PLC system is improved.
On the basis of the above embodiment, the apparatus further includes: the input module is used for inputting the soft elements in the PLC system into the PLC monitoring system according to the input template of the PLC system, and the input template comprises: soft element name, data type, and function annotation.
Further, the logging module is also used for screening, de-weighting, reordering and segmenting the soft elements.
Further, the cyclic acquisition module 100 is further configured to access the soft elements of the PLC system in blocks, and sequentially receive response data packets corresponding to the PLC system; and meanwhile, the response data packet is shared to the decoding module.
Further, the decoding module 101 is further configured to divide the response data packet into two or more sub-packets, and decode the sub-packets in parallel to obtain communication data; and sharing the communication data to the update module.
Further, the update module 102 is further configured to: if the communication data is in the local database, keeping the local database unchanged; and if the communication data is not in the local database, writing the communication data into the local database.
Further, the update module 102 is further configured to perform update detection, and compare the latest decoded communication data with the original data already stored in the local database.
It should be noted that the data communication device for monitoring a PLC system according to the third embodiment of the present invention may be used to execute the data communication method for monitoring a PLC system according to any of the above embodiments, and has corresponding functions and advantages. Technical details that are not elaborated in this embodiment may be referred to any of the embodiments described above.
Example four
Fig. 6 is a schematic diagram of a hardware structure of an apparatus according to a fourth embodiment of the present invention. As shown in fig. 6, the present embodiment provides an apparatus, including: a processor 610 and a storage device 620. The number of the processors in the device may be one or more, one processor 610 is taken as an example in fig. 6, the processor 610 and the storage 620 in the device may be connected by a bus or in other manners, and the connection by the bus is taken as an example in fig. 6. The one or more programs are executed by the one or more processors 610, so that the one or more processors implement the data communication method of monitoring the PLC system described in any of the above embodiments.
The storage device 620 in the apparatus is used as a computer readable storage medium for storing one or more programs, which may be software programs, computer executable programs, and modules, such as program instructions/modules corresponding to the data communication method of the monitoring PLC system in the embodiment of the present invention (for example, the modules in the data communication device of the monitoring PLC system shown in fig. 5, including the loop collection module 100, the decoding module 101, and the updating module 102). The processor 610 executes various functional applications and data processing of the device by executing software programs, instructions and modules stored in the storage device 620, that is, implements the data communication method for monitoring the PLC system in the above method embodiment.
The storage device 620 mainly includes a storage program area and a storage data area, wherein the storage program area can store an operating system and an application program required by at least one function; the storage data area may store data created according to the use of the device, etc. (reply data packets, entry templates, etc. as in the above-described embodiments). Further, the storage 620 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the storage 620 may further include memory located remotely from the processor 610, which may be connected to the device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
And, when one or more programs included in the above-described apparatus are executed by the one or more processors 610, the programs perform the following operations:
circularly executing the processes of sending a data acquisition instruction to a PLC system and receiving a response data packet sent by the PLC system;
if a response data packet is received, decoding the response data packet;
and if the communication data is obtained by decoding, updating the communication data to a local database.
The device proposed by the present embodiment is the same as the data communication method for monitoring the PLC system proposed by the above embodiment, and the technical details not described in detail in the present embodiment can be referred to any of the above embodiments, and the present embodiment has the same beneficial effects as the data communication method for monitoring the PLC system.
On the basis of the above-mentioned embodiments, the present embodiment also provides a computer-readable storage medium having stored thereon a computer program that, when executed by a data communication apparatus of a monitored PLC system, implements a data communication method of the monitored PLC system in any of the above-mentioned embodiments of the present invention, the method including:
circularly executing the processes of sending a data acquisition instruction to a PLC system and receiving a response data packet sent by the PLC system;
if a response data packet is received, decoding the response data packet;
and if the communication data is obtained by decoding, updating the communication data to a local database.
Of course, the storage medium containing the computer-executable instructions provided in the embodiments of the present invention is not limited to the operations of the data communication method for monitoring the PLC system described above, and may also perform related operations in the data communication method for monitoring the PLC system provided in any embodiment of the present invention, and has corresponding functions and advantages.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the … … method according to the embodiments of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (9)

1. A data communication method for monitoring a PLC system is characterized by comprising the following steps:
the method comprises the steps of circularly executing the processes of sending a data acquisition instruction to a PLC system and receiving a response data packet sent by the PLC system through a circular data acquisition process;
sharing the response data packet to a decoding process to decode the response data packet when the response data packet is received;
decoding to obtain communication data, and updating the communication data to a local database through a data updating process;
wherein the loop collection data process, the decoding process and the data updating process are executed in parallel;
the process of circularly acquiring data is used for partitioning the input soft elements and respectively encoding according to the address blocks of the soft elements to form instruction encoding packets;
and the decoding process is used for dividing the response data packet into two or more sub-packets and decoding the sub-packets in parallel.
2. The method of claim 1, wherein before the cyclically executing the process of sending the data acquisition command to the PLC system and receiving the response data packet sent by the PLC system, further comprising:
according to the input template of the PLC system, the soft element in the PLC system is input into the PLC monitoring system, and the input template comprises: soft element name, data type, and function annotation.
3. The method according to claim 2, wherein the format of the entry template is an Excel form.
4. The method of claim 1, wherein the number of PLC systems is at least one.
5. The method of claim 1, wherein updating the communication data to the local database comprises:
if the communication data is in the local database, keeping the local database unchanged; and if the communication data is not in the local database, writing the communication data into the local database.
6. The method according to claim 1, wherein the local database is stored in an Excel file format.
7. A data communication apparatus for monitoring a PLC system, comprising:
the system comprises a cyclic acquisition module, a data transmission module and a data transmission module, wherein the cyclic acquisition module is used for circularly executing the processes of transmitting a data acquisition instruction to a PLC system and receiving a response data packet transmitted by the PLC system through a cyclic acquisition data process;
the decoding module is used for sharing the response data packet to a decoding process to decode the response data packet when receiving the response data packet;
the updating module is used for updating the communication data to the local database through a data updating process when the communication data are obtained through decoding;
wherein the loop collection data process, the decoding process and the data updating process are executed in parallel;
the process of circularly acquiring data is used for partitioning the input soft elements and respectively encoding according to the address blocks of the soft elements to form instruction encoding packets;
and the decoding process is used for dividing the response data packet into two or more sub-packets and decoding the sub-packets in parallel.
8. An apparatus, comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of monitoring a PLC system of any of claims 1-6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method of monitoring data communication of a PLC system according to any one of claims 1 to 6.
CN201811258692.4A 2018-10-26 2018-10-26 Data communication method, device and equipment for monitoring PLC system and storage medium Active CN109270885B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811258692.4A CN109270885B (en) 2018-10-26 2018-10-26 Data communication method, device and equipment for monitoring PLC system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811258692.4A CN109270885B (en) 2018-10-26 2018-10-26 Data communication method, device and equipment for monitoring PLC system and storage medium

Publications (2)

Publication Number Publication Date
CN109270885A CN109270885A (en) 2019-01-25
CN109270885B true CN109270885B (en) 2021-01-01

Family

ID=65193774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811258692.4A Active CN109270885B (en) 2018-10-26 2018-10-26 Data communication method, device and equipment for monitoring PLC system and storage medium

Country Status (1)

Country Link
CN (1) CN109270885B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110262370B (en) * 2019-05-30 2021-07-06 苏州华兴源创科技股份有限公司 Batch reading and writing method, device and system of PLC
CN111897283B (en) * 2020-08-05 2021-10-22 深圳市海浦蒙特科技有限公司 Programmable logic controller software element monitoring method, system and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101193284A (en) * 2007-12-27 2008-06-04 北京中星微电子有限公司 Validation method, system and device for transmission integrity of compressed file
WO2016049716A1 (en) * 2014-10-02 2016-04-07 Petróleo Brasileiro S.A. - Petrobras System for communication of data via an electrical network to a three-phase induction motor used in the artificial lifting method of submerged centrifugal pumping type

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1542579A (en) * 2003-11-04 2004-11-03 上海理工大学 PLC data monitoring and setting apparatus
CN102684943B (en) * 2012-04-18 2015-01-21 经纬软信科技无锡有限公司 Textile industrial ethernet monitoring system and method thereof
CN203241957U (en) * 2013-03-20 2013-10-16 泉州市桑川电气设备有限公司 Industrial touch screen structure with programmable control function
CN103365237A (en) * 2013-06-28 2013-10-23 深圳市汇川控制技术有限公司 Method and device for monitoring and recording component and variable in PLC (Programmable Logic Controller) system
CN103631179B (en) * 2013-11-06 2016-07-20 天津瑞能电气有限公司 A kind of CPU carries out method and the harvester of communication with extending out logic gates
CN105353715A (en) * 2015-09-23 2016-02-24 上海大学 Realization method of logic control of VB/VC (Microsoft Visual Basic 6.0/Microsoft Visual C++) and PLC (Programmable Logic Controller) on the basis of serial communication
CN105172081A (en) * 2015-09-23 2015-12-23 上海大学 Method for achieving combined control over vacuum casting device based on VB and Mitsubishi FX type PLC programming port communication
CN106375284A (en) * 2016-08-26 2017-02-01 西北工业大学 STM32F103 based Mitsubishi FX type PLC communication converter and conversion method thereof
CN106444602A (en) * 2016-08-31 2017-02-22 北京龙鼎源科技股份有限公司 Security programmable logic controller communication system and communication method
CN108234614B (en) * 2017-12-25 2020-02-18 华南理工大学 Interaction method based on custom protocol and Netty framework

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101193284A (en) * 2007-12-27 2008-06-04 北京中星微电子有限公司 Validation method, system and device for transmission integrity of compressed file
WO2016049716A1 (en) * 2014-10-02 2016-04-07 Petróleo Brasileiro S.A. - Petrobras System for communication of data via an electrical network to a three-phase induction motor used in the artificial lifting method of submerged centrifugal pumping type

Also Published As

Publication number Publication date
CN109270885A (en) 2019-01-25

Similar Documents

Publication Publication Date Title
CN112468372B (en) Method and device for detecting equipment state in power line communication network
CN109587018A (en) Method, apparatus, network system and the mobile terminal of device configuration
CN107957940B (en) Test log processing method, system and terminal
CN204425399U (en) A kind of hydrometeorological operation system based on cloud computing
CN112685248B (en) Intelligent network card monitoring log acquisition method and device, electronic equipment and storage medium
US7080137B2 (en) Communication system between a programmable logic controller server and a client machine
CN110262370B (en) Batch reading and writing method, device and system of PLC
CN109270885B (en) Data communication method, device and equipment for monitoring PLC system and storage medium
CN111242807A (en) Method for accessing data of transformer substation into ubiquitous power Internet of things
CN111966289A (en) Partition optimization method and system based on Kafka cluster
CN113377701B (en) Serial port control system based on complex programmable logic device CPLD and communication method thereof
CN111224970A (en) SDN network system, network attack defense method, device and storage medium
CN108696375B (en) Industrial network information acquisition device, method, monitoring system and storage medium
CN113381907A (en) Log collection method and device, electronic equipment and storage medium
CN111737084A (en) Information monitoring method and device, intelligent equipment, computer equipment and medium
CN114268650B (en) Configuration method and system for establishing communication connection
CN113381880B (en) Internet of things equipment management method, device and system
CN115348320A (en) Communication data conversion method and device and electronic equipment
CN114598602A (en) Data acquisition method and device, computer equipment and computer readable storage medium
CN113434604A (en) Time sequence database synchronization method, system, equipment and storage medium
CN113676353A (en) Control method and device for equipment, storage medium and electronic device
CN112055058A (en) Data storage method and device and computer readable storage medium
CN114826867B (en) Method, device, system and storage medium for processing data
CN116112357B (en) Visual configuration soft gateway system and implementation method thereof
CN111131477B (en) Data processing method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant