CN111897283B - Programmable logic controller software element monitoring method, system and storage medium - Google Patents
Programmable logic controller software element monitoring method, system and storage medium Download PDFInfo
- Publication number
- CN111897283B CN111897283B CN202010776892.XA CN202010776892A CN111897283B CN 111897283 B CN111897283 B CN 111897283B CN 202010776892 A CN202010776892 A CN 202010776892A CN 111897283 B CN111897283 B CN 111897283B
- Authority
- CN
- China
- Prior art keywords
- soft element
- target soft
- monitoring
- target
- list
- 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
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/05—Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
- G05B19/054—Input/output
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/10—Plc systems
- G05B2219/13—Plc programming
- G05B2219/13108—Flow diagram, sequential function chart with transitions and states SFC Grafcet
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Programmable Controllers (AREA)
Abstract
The invention discloses a programmable logic controller software element monitoring method, a programmable logic controller software element monitoring system and a storage medium.A target soft element identifier to be monitored is collected into a soft element monitoring list, the target soft element identifier in the soft element monitoring list is sequenced according to an address sequence, and because the same type of soft element is connected on the address, the relationship between the number of the target soft element identifiers which are continuously of the same type in the sequenced soft element monitoring list and a preset threshold value is judged, and when the number of the target soft element identifiers which are continuously of the same type is judged to be smaller than the preset threshold value, monitoring data of the target soft element is read in a first communication mode; otherwise, the second communication mode is adopted to read the monitoring data of the target soft element, and different communication modes are adopted to read the monitoring data of the target soft element aiming at the conditions of the target soft element which needs to be monitored in different conditions, so that the communication efficiency can be improved, and the real-time performance of reading the monitoring data of the PLC soft element is improved.
Description
Technical Field
The invention relates to the technical field of programmable logic controllers, in particular to a method and a system for monitoring a software element of a programmable logic controller and a storage medium.
Background
The soft element is a programming element with certain functions in a Programmable Logic Controller (PLC), the programming elements comprise a relay, a register, a timer, a counter and the like, the programming element can complete the same functions as an actual element in a software mode, but the programming element has some differences from the actual element, such as the problems of no working voltage level, no power consumption, no electromagnetic inertia and the like of a working coil of the soft relay, no limitation on the number of contacts, no mechanical wear, no electric erosion and the like, and under different instruction operations, the working state of the soft relay can be memorized or memorized, and can also be used as a pulse number element.
When a user carries out PLC programming debugging work, the state or input/output value of a soft element is monitored, namely the monitoring data of the soft element is read, which is the basic function of PLC programming software, and the monitoring schemes of the traditional PLC soft element are mainly divided into the following two types:
the first scheme is as follows: and a direct communication reading mode is adopted. And collecting a soft element list which needs to be monitored currently, and after the soft element list is subjected to sequencing and combination processing, sending communication frames one by one to read monitoring data of each soft element. In the method, each soft element needs one communication frame to be read, and when the number of soft elements to be monitored is large, the read monitoring data of the soft elements is slowly updated due to the influence of the communication frame speed, so that the real-time monitoring effect is influenced.
Scheme II: and a batch address reading mode is adopted. Collecting a soft element list which needs to be monitored currently, determining a soft element address list corresponding to the soft element list, sending a communication frame from an address with the smallest first address after sequencing and combining the address lists, selecting a proper address interval, and reading the monitoring data of the soft element corresponding to the address in the address interval through the same communication frame. Although the number of communications is reduced by a batch address reading mode, the addresses of the soft elements which do not need to be monitored by the user often exist in the batch addresses, and inconvenience is brought to the user for analyzing the monitoring data.
Disclosure of Invention
The invention mainly solves the technical problem of how to read the monitoring data of the PLC soft element in real time.
According to a first aspect, an embodiment provides a method for monitoring a programmable logic controller software element, including:
acquiring a soft element monitoring list, wherein the soft element monitoring list comprises at least one identifier of a target soft element to be monitored;
determining the address of a target soft element corresponding to the identifier in the soft element monitoring list;
sorting the identifiers of the target soft elements in the soft element monitoring list according to an address sequence;
judging the relation between the number of the identifiers of the target soft elements which are continuously of the same type in the sorted soft element monitoring list and a preset threshold value;
when the number of the identifiers of the target soft elements continuously in the same type is judged to be smaller than a preset threshold value, reading monitoring data of the target soft elements in a first communication mode;
and when the number of the identifications of the target soft element continuously in the same type is judged to be larger than or equal to a preset threshold value, reading the monitoring data of the target soft element by adopting a second communication mode.
Further, the reading the monitoring data of the target soft element in the first communication mode comprises:
adding addresses of the target soft elements corresponding to the identifiers of the same type into a preset address list;
judging whether the preset address list is updated or not;
if the preset address list is updated, acquiring monitoring data of a target soft element corresponding to each address in the preset address list, adding the preset address list into a pre-constructed address cache region, and adding the monitoring data into the pre-constructed monitoring data cache region;
and sending a communication frame to read the monitoring data corresponding to all the target soft elements in the monitoring data cache region according to the address of the target soft element corresponding to at least one identifier to be monitored.
Further, the reading the monitoring data of the target soft element in the second communication mode comprises:
and sending a communication frame to read monitoring data corresponding to a plurality of target soft elements which are continuously of the same type.
Further, the preset threshold is determined according to storage types of the target soft element, wherein the storage types comprise a bit element storage type, a word element storage type and a double word element storage type.
Further, the obtaining the soft element monitoring list comprises:
receiving user input information, and determining the type of at least one target soft element to be monitored of the programmable logic controller and the number of the target soft element under each type according to the input information;
and collecting the type of at least one target soft element to be detected and the number of the target soft element under each type into a soft element monitoring list.
Further, the receiving user input information includes:
receiving a ladder diagram input by a user in a ladder diagram input interface, wherein the ladder diagram is used for analyzing the type of at least one target soft element to be monitored of the programmable logic controller and the number of the target soft element under each type;
or receiving selection instruction information input by a user in a batch monitoring interface, wherein the batch monitoring interface comprises all types of soft elements of the programmable logic controller and the numbers of all soft elements in each type, and the selection instruction information is used for selecting the type of at least one target soft element to be monitored in the batch monitoring interface and the starting number of the target soft element in each type;
or receiving instruction information input by a user in a free monitoring interface, wherein the free monitoring interface is used for the user to freely add the target soft element to be monitored of the programmable logic controller, and the instruction information is used for adding the type of at least one target soft element to be monitored and the number of the target soft element under each type.
Further, still include:
and displaying the read monitoring data of the target soft element on a ladder diagram input interface, a batch monitoring interface or a free monitoring interface.
Further, before the identifier of at least one of the target soft elements in the soft element monitoring list is sorted according to the address order, the method further includes:
determining an identification of a target soft element having an offset in the soft element watch list;
shifting the identification of the target soft element with the offset according to the offset;
and replacing the identification of the target soft element before the offset with the identification of the target soft element after the offset.
According to a second aspect, an embodiment provides a programmable logic controller software element monitoring system, comprising:
a soft element monitoring list obtaining module, configured to obtain a soft element monitoring list, where the soft element monitoring list includes an identifier of at least one target soft element to be monitored;
a soft element address determining module, configured to determine an address of a target soft element corresponding to an identifier in the soft element monitoring list;
the soft element address sequencing module is used for sequencing the identifier of at least one target soft element in the soft element monitoring list according to the address sequence;
the judging module is used for judging the relation between the number of the continuous identifiers of the target soft elements of the same type in the sorted soft element monitoring list and a preset threshold value;
the first communication monitoring module is used for reading monitoring data of the target soft element in a first communication mode when the number of the identifiers of the target soft elements continuously in the same type is judged to be smaller than a preset threshold value;
and the second communication monitoring module is used for reading the monitoring data of the target soft element in a second communication mode when the number of the identifications of the target soft element continuously in the same type is judged to be larger than or equal to a preset threshold value.
According to a third aspect, an embodiment provides a computer-readable storage medium comprising a program executable by a processor to implement the method according to the above embodiment.
According to the programmable logic controller software element monitoring method, the programmable logic controller software element monitoring system and the storage medium of the embodiment, the identifiers of target soft elements to be monitored are all collected into a soft element monitoring list, the identifiers of the target soft elements in the soft element monitoring list are sorted according to the address sequence, as the soft elements of the same type are connected on the addresses, the relation between the number of the identifiers of the target soft elements which are continuously of the same type in the sorted soft element monitoring list and a preset threshold value is judged, and when the number of the identifiers of the target soft elements which are continuously of the same type is judged to be smaller than the preset threshold value, monitoring data of the target soft elements are read in a first communication mode; otherwise, reading the monitoring data of the target soft element by adopting a second communication mode, and reading the monitoring data of the target soft element by adopting different communication modes aiming at the condition of the target soft element needing to be monitored under different conditions, so that the communication efficiency can be improved, and the real-time property of reading the monitoring data of the PLC soft element is improved.
Drawings
FIG. 1 is a flow diagram of a programmable logic controller software component monitoring method of an embodiment;
FIG. 2 is a flow chart of programmable logic controller software component monitoring for one monitoring cycle;
fig. 3 is a block diagram of a software component monitoring system of a programmable logic controller according to an embodiment.
Detailed Description
The present invention will be described in further detail with reference to the following detailed description and accompanying drawings. Wherein like elements in different embodiments are numbered with like associated elements. In the following description, numerous details are set forth in order to provide a better understanding of the present application. However, those skilled in the art will readily recognize that some of the features may be omitted or replaced with other elements, materials, methods in different instances. In some instances, certain operations related to the present application have not been shown or described in detail in order to avoid obscuring the core of the present application from excessive description, and it is not necessary for those skilled in the art to describe these operations in detail, so that they may be fully understood from the description in the specification and the general knowledge in the art.
Furthermore, the features, operations, or characteristics described in the specification may be combined in any suitable manner to form various embodiments. Also, the various steps or actions in the method descriptions may be transposed or transposed in order, as will be apparent to one of ordinary skill in the art. Thus, the various sequences in the specification and drawings are for the purpose of describing certain embodiments only and are not intended to imply a required sequence unless otherwise indicated where such sequence must be followed.
The numbering of the components as such, e.g., "first", "second", etc., is used herein only to distinguish the objects as described, and does not have any sequential or technical meaning. The term "connected" and "coupled" when used in this application, unless otherwise indicated, includes both direct and indirect connections (couplings).
Example (b):
referring to fig. 1, fig. 1 is a flowchart of a monitoring method of a software element of a programmable logic controller according to an embodiment, which can be executed in an upper computer of the programmable logic controller, and the method includes steps S10 to S60, which are described in detail below.
Step S10, a soft element monitoring list is obtained, where the soft element monitoring list includes at least one identifier of a target soft element to be monitored.
Wherein step S10 includes: determining at least one target soft element of the programmable logic controller to be monitored; collecting an identification of at least one of the target soft elements into a soft element monitoring list.
The identifier of the target soft component in this embodiment is also the type of the target soft component and the corresponding number under the type. The types of the target soft elements comprise an input relay (X), an output relay (Y), an auxiliary relay (M), a state relay (S), a timer (T), a counter (C), a data register (D), a special auxiliary relay (SM) and a special data register (SD)9, wherein each type corresponds to a plurality of soft elements numbered sequentially, for example, the types of the data registers comprise D1-D100, and the number of the soft elements is 100, wherein D1 is the number of the soft elements. And if the type of the target soft element on the side to be monitored is D and the corresponding identifiers are D1, D3 and D6, adding the identifiers D1, D3 and D6 into a soft element monitoring list.
In one embodiment, the determining at least one target soft element of the programmable logic controller to be monitored in step S10 includes:
receiving user input information, and determining the type of at least one target soft element to be monitored of the programmable logic controller and the number of the target soft element under each type according to the input information.
In one embodiment, receiving user input information includes:
and receiving a ladder diagram input by a user in a ladder diagram input interface, wherein the ladder diagram is used for analyzing the type of at least one target soft element to be monitored of the programmable logic controller and the number of the target soft element under each type. In this embodiment, the ladder diagram input by the user on the ladder diagram input interface is an instruction of the programmable logic controller, each effective ladder diagram node represents an instruction, each instruction includes an instruction operand, the instruction operand includes a target soft element to be read, the type and the number of the target soft element can be obtained by analyzing the instruction operand, and the type and the number of the target soft element obtained by analysis are added to the soft element monitoring list. In some embodiments, the ladder diagram input by the user is long, the ladder diagram cannot be completely displayed in the ladder diagram user input interface, and the user only needs to scroll the scroll bar at the edge of the ladder diagram to display the rest ladder diagrams.
Receiving selection instruction information input by a user in a batch monitoring interface, wherein the batch monitoring interface comprises all types of soft elements of the programmable logic controller and the numbers of all soft elements in each type, and the selection instruction information is used for selecting the type of at least one target soft element to be monitored in the batch monitoring interface and the starting number of the target soft element in each type. The state and input/output value of all the soft elements can be monitored in a batch monitoring interface, a user selects the type and the starting number of the soft elements to be monitored in batch, dozens of soft elements which are continuous from the starting number are displayed in the batch monitoring interface, the target soft elements selected by the user are added into a soft element monitoring list, the type and the starting number of the soft elements selected by the user are different, and the soft element monitoring list is changed accordingly.
Receiving instruction information input by a user in a free monitoring interface, wherein the free monitoring interface is used for the user to freely add the target soft element to be monitored of the programmable logic controller, and the instruction information is used for adding the type of at least one target soft element to be monitored and the number of the target soft element under each type. And when the user adds more soft elements, only the currently visible target soft elements are collected into the soft element monitoring list, and the target soft elements collected into the soft element monitoring list are changed when the free monitoring interface is rolled.
In step S20, an address in the soft element monitoring list is determined that identifies the corresponding target soft element. In this embodiment, each target soft element has a specific communication address, and the address of the target soft element in this embodiment is its communication address.
And step S30, the identification of at least one target soft element in the soft element monitoring list is sorted according to the address sequence. Since the addresses of the target soft elements of the same type are consecutive, that is, the address order of the target soft elements of the same type corresponds to the numbering order thereof. The present embodiment sorts the target soft elements in ascending order of addresses, so that the identifiers of the target soft elements of the same type in the sorted soft element monitoring list are connected.
And step S40, judging the relation between the number of the continuous target soft element identifiers of the same type in the sorted soft element monitoring list and a preset threshold value.
In one embodiment, the preset threshold is determined based on the storage type of the target soft element, which includes a bit element storage type, a word element storage type, and a double word element storage type.
In this embodiment, if the bit element is a bit element, the predetermined threshold is 32; if the word element is the word element, the preset threshold value is 20; in the case of a doubleword element, the predetermined threshold is 10.
And step S50, when the number of the identifications of the target soft element continuously of the same type is judged to be less than the preset threshold value, reading the monitoring data of the target soft element by adopting a first communication mode.
In one embodiment, reading the monitoring data of the target soft element in the first communication mode comprises:
and adding addresses of the target soft elements corresponding to the identifiers of the same type into a preset address list. If yes, adding the address to the bit address list; if the word element is the word element, adding the address into a word address list; if it is a doubleword element, the address is added to the word address list.
After the address is added to the address list, whether the preset address list is updated or not is mainly judged, because the soft element to be monitored does not change in the monitoring period, whether the address list is updated or not needs to be monitored, if the soft element to be monitored does not change, the soft element to be monitored does not send changes, and at the moment, the monitoring data of each target soft element in the data cache area is directly read.
If the preset address list is updated, which indicates that the soft element to be monitored changes, the monitoring data of the target soft element corresponding to each address in the preset address list are acquired, the preset address list is added into a pre-constructed address cache region, and the monitoring data are added into a pre-constructed monitoring data cache region. In this embodiment, both the address buffer and the monitor data buffer are provided in the lower computer.
And according to the address of at least one target soft element to be monitored, the upper computer sends a communication frame to read the monitoring data corresponding to all the target soft elements in the monitoring data cache region.
In some embodiments, if the number of consecutive target soft elements of the same type is too large, and thus a communication frame cannot read all consecutive target soft elements of the same type, the consecutive target soft elements of the same type need to be divided, for example, into two parts, which are read by two communication frames respectively.
In addition, the read monitoring data are arranged according to the address arrangement sequence in the word address list and the bit address list, the input/output value or the state of each target soft element is respectively analyzed according to the address range, and the input/output value or the state is displayed on a ladder diagram input interface, a batch monitoring interface or a free monitoring interface.
And step S60, when the number of the identification of the target soft element continuously of the same type is judged to be larger than or equal to the preset threshold value, reading the monitoring data of the target soft element by adopting a second communication mode.
In one embodiment, reading the monitoring data of the target soft element in the second communication mode comprises:
the upper computer sends a communication frame to read monitoring data corresponding to a plurality of target soft elements of the same type continuously. And similarly, the upper computer analyzes the input/output value or state of each target soft element according to the read monitoring data corresponding to the target soft element, and displays the input/output value or state on a ladder diagram input interface, a batch monitoring interface or a free monitoring interface.
Since many soft elements have offset, before sorting the identification of at least one target soft element in the soft element monitoring list according to the address order, the method further comprises:
an identification of a target soft element in the soft element watch list having an offset is determined.
The identification of the target soft element having the offset is offset according to the offset it has.
And replacing the identification of the target soft element before the offset with the identification of the target soft element after the offset.
For example, for the target soft element identified as D10, assuming it has an offset of V100, the offset target soft element is identified as D110.
The whole process from step S10 to step S60 is a monitoring period, and the identities of the soft elements in the soft element monitoring list need to be cleared at the beginning of the monitoring period.
Referring to fig. 2, fig. 2 is a flow chart of monitoring the programmable logic controller software component in one monitoring cycle, which includes:
step S101, emptying the soft element monitoring list.
Step S102, analyzing the ladder diagram input by the user, and collecting the identification of the target soft element required to be read in the ladder diagram to a soft element monitoring list.
Step S103, collecting the identification of the target soft element which is selected by the user in the batch monitoring interface and needs to be read to a soft element monitoring list.
And step S104, collecting the identification of the target soft element which is added in the free monitoring interface by the user and needs to be read into a soft element monitoring list.
Step S105, the identification of the target soft element collected in the soft element monitoring list is sorted; wherein the sorting comprises offset processing, sorting and dividing a long continuous plurality of target soft elements of the same type.
And step S106, traversing the identification of the target soft element in the soft element monitoring list.
Step S107, judging whether the current target soft element is a bit element, if so, executing step S108; otherwise, judging whether the current target soft element is a character element, if so, executing the step S109; otherwise, judging whether the current target soft element is a dual sub-element, if so, executing the step S110; otherwise, step S111 is performed.
Step S108, judging whether the number of the labels of the current target soft elements continuously in the same type is greater than or equal to 32, if so, reading the monitoring data of the current target soft elements by adopting a direct communication mode (a second communication mode); otherwise, the address of the current target soft element is added to the bit address list.
Step S109, judging whether the number of the identifiers of the current target soft elements continuously in the same type is greater than or equal to 20, if so, reading the monitoring data of the current target soft elements by adopting a direct communication mode (a second communication mode); otherwise, the address of the current target soft element is added to the word address list.
Step S110, judging whether the number of the identifications of the current target soft element continuously in the same type is more than or equal to 10, if so, reading the monitoring data of the current target soft element by adopting a direct communication mode (a second communication mode); otherwise, the address of the current target soft element is added to the word address list.
Step S111, judging whether the identification of the current target soft element is the last soft element identification in the soft element monitoring list, if not, returning to the step S106; if it is the last one, go to step S112.
Step S112, judging whether the bit address list or the word address list changes, if so, executing step S113; otherwise, step S114 is executed.
In step S113, the bit address list and the word address list are written into the address buffer.
Step S114, reading the monitoring data of the data buffer.
Step S115, analyzing the read monitoring data to obtain the state or output/input value of each target soft element, and ending a monitoring period.
In the embodiment of the invention, the identifiers of target soft elements to be monitored are all collected into a soft element monitoring list, the identifiers of the target soft elements in the soft element monitoring list are sequenced according to the address sequence, because the soft elements of the same type are connected on the address, the relation between the number of the identifiers of the target soft elements which are continuously of the same type in the sequenced soft element monitoring list and a preset threshold value is judged, when the number of the identifiers of the target soft elements which are continuously of the same type is judged to be more than or equal to the preset threshold value, the monitoring data of the target soft elements are read in a direct communication mode, namely, a communication frame is sent to read the monitoring data corresponding to a plurality of target soft elements which are continuously of the same type; when the number of the identifiers of the target soft elements of the same type is judged to be smaller than a preset threshold value continuously, the addresses of the target soft elements of the same type are added into an address list, the address list is written into an address buffer area of a lower computer, monitoring data are added into a monitoring data buffer area which is constructed in advance, according to the address of at least one target soft element to be monitored, the upper computer sends a communication frame to read the monitoring data of all the target soft elements in the monitoring data buffer area, therefore, the monitoring data of all the target soft elements in the monitoring data buffer area can be read through one communication frame, the communication rate is improved, and the PLC soft elements can be monitored in real time.
Referring to fig. 3, fig. 3 is a block diagram of a monitoring system of a software component of a programmable logic controller according to an embodiment, including: the system comprises a soft element monitoring list acquisition module 10, a soft element address determination module 20, a soft element address sorting module 30, a judgment module 40, a first communication monitoring module 50 and a second communication monitoring module 60.
Wherein: the soft element monitoring list obtaining module 10 is configured to obtain a soft element monitoring list, where the soft element monitoring list includes an identifier of at least one target soft element to be monitored.
The soft element address determining module 20 is configured to determine an address of a target soft element corresponding to an identifier in the soft element monitoring list;
the soft element address sorting module 30 is configured to sort the identifier of at least one target soft element in the soft element monitoring list according to an address order;
the judging module 40 is configured to judge a relationship between the number of identifiers of the target soft elements that are continuously of the same type in the sorted soft element monitoring list and a preset threshold;
the first communication monitoring module 50 is configured to, when it is determined that the number of the identifiers of the target soft elements that are continuously of the same type is smaller than a preset threshold, read monitoring data of the target soft elements in a first communication manner;
the second communication monitoring module 60 is configured to, when it is determined that the number of the identifiers of the target soft element that are continuously of the same type is greater than or equal to a preset threshold, read the monitoring data of the target soft element in a second communication manner.
It should be noted that the functional modules in this embodiment correspond to the method steps in the above embodiments, and the specific implementation thereof has been described in detail in the above embodiments, which is not described herein again.
Those skilled in the art will appreciate that all or part of the functions of the various methods in the above embodiments may be implemented by hardware, or may be implemented by computer programs. When all or part of the functions of the above embodiments are implemented by a computer program, the program may be stored in a computer-readable storage medium, and the storage medium may include: a read only memory, a random access memory, a magnetic disk, an optical disk, a hard disk, etc., and the program is executed by a computer to realize the above functions. For example, the program may be stored in a memory of the device, and when the program in the memory is executed by the processor, all or part of the functions described above may be implemented. In addition, when all or part of the functions in the above embodiments are implemented by a computer program, the program may be stored in a storage medium such as a server, another computer, a magnetic disk, an optical disk, a flash disk, or a removable hard disk, and may be downloaded or copied to a memory of a local device, or may be version-updated in a system of the local device, and when the program in the memory is executed by a processor, all or part of the functions in the above embodiments may be implemented.
The present invention has been described in terms of specific examples, which are provided to aid understanding of the invention and are not intended to be limiting. For a person skilled in the art to which the invention pertains, several simple deductions, modifications or substitutions may be made according to the idea of the invention.
Claims (8)
1. A method for monitoring a software component of a programmable logic controller is characterized by comprising the following steps:
acquiring a soft element monitoring list, wherein the soft element monitoring list comprises at least one identifier of a target soft element to be monitored;
determining the address of a target soft element corresponding to the identifier in the soft element monitoring list;
sorting the identifiers of the target soft elements in the soft element monitoring list according to an address sequence;
judging the relation between the number of the identifiers of the target soft elements which are continuously of the same type in the sorted soft element monitoring list and a preset threshold value;
when the number of the identifiers of the target soft elements continuously in the same type is judged to be smaller than a preset threshold value, reading monitoring data of the target soft elements in a first communication mode;
when the number of the identifiers of the target soft elements continuously in the same type is judged to be larger than or equal to a preset threshold value, reading monitoring data of the target soft elements in a second communication mode;
the reading of the monitoring data of the target soft element in the first communication mode comprises:
adding addresses of the target soft elements corresponding to the identifiers of the same type into a preset address list;
judging whether the preset address list is updated or not;
if the preset address list is updated, acquiring monitoring data of a target soft element corresponding to each address in the preset address list, adding the preset address list into a pre-constructed address cache region, and adding the monitoring data into the pre-constructed monitoring data cache region;
sending a communication frame to read monitoring data corresponding to all target soft elements in the monitoring data cache region according to the address of the target soft element corresponding to at least one identifier to be monitored;
the reading of the monitoring data of the target soft element in the second communication mode comprises:
and sending a communication frame to read monitoring data corresponding to a plurality of target soft elements which are continuously of the same type.
2. The method of claim 1, wherein the preset threshold is determined based on a storage type of the target soft element, the storage type including a bit element storage type, a word element storage type, and a double word element storage type.
3. The method of claim 1, wherein the obtaining a soft element monitoring list comprises:
receiving user input information, and determining the type of at least one target soft element to be monitored of the programmable logic controller and the number of the target soft element under each type according to the input information;
and collecting the type of at least one target soft element to be detected and the number of the target soft element under each type into a soft element monitoring list.
4. The method of claim 3, wherein the receiving user input information comprises:
receiving a ladder diagram input by a user in a ladder diagram input interface, wherein the ladder diagram is used for analyzing the type of at least one target soft element to be monitored of the programmable logic controller and the number of the target soft element under each type;
or receiving selection instruction information input by a user in a batch monitoring interface, wherein the batch monitoring interface comprises all types of soft elements of the programmable logic controller and the numbers of all soft elements in each type, and the selection instruction information is used for selecting the type of at least one target soft element to be monitored in the batch monitoring interface and the starting number of the target soft element in each type;
or receiving instruction information input by a user in a free monitoring interface, wherein the free monitoring interface is used for the user to freely add the target soft element to be monitored of the programmable logic controller, and the instruction information is used for adding the type of at least one target soft element to be monitored and the number of the target soft element under each type.
5. The method of claim 4, further comprising:
and displaying the read monitoring data of the target soft element on a ladder diagram input interface, a batch monitoring interface or a free monitoring interface.
6. The method of claim 1, wherein prior to sorting the identification of at least one of the target soft elements in the soft element watch list in address order, further comprising:
determining an identification of a target soft element having an offset in the soft element watch list;
shifting the identification of the target soft element with the offset according to the offset;
and replacing the identification of the target soft element before the offset with the identification of the target soft element after the offset.
7. A programmable logic controller software component monitoring system, comprising:
a soft element monitoring list obtaining module, configured to obtain a soft element monitoring list, where the soft element monitoring list includes an identifier of at least one target soft element to be monitored;
a soft element address determining module, configured to determine an address of a target soft element corresponding to an identifier in the soft element monitoring list;
the soft element address sequencing module is used for sequencing the identifier of at least one target soft element in the soft element monitoring list according to the address sequence;
the judging module is used for judging the relation between the number of the continuous identifiers of the target soft elements of the same type in the sorted soft element monitoring list and a preset threshold value;
the first communication monitoring module is used for reading monitoring data of the target soft element in a first communication mode when the number of the identifiers of the target soft elements continuously in the same type is judged to be smaller than a preset threshold value;
the second communication monitoring module is used for reading the monitoring data of the target soft element in a second communication mode when the number of the identifiers of the target soft elements continuously in the same type is judged to be larger than or equal to a preset threshold value;
the reading of the monitoring data of the target soft element in the first communication mode comprises:
adding addresses of the target soft elements corresponding to the identifiers of the same type into a preset address list;
judging whether the preset address list is updated or not;
if the preset address list is updated, acquiring monitoring data of a target soft element corresponding to each address in the preset address list, adding the preset address list into a pre-constructed address cache region, and adding the monitoring data into the pre-constructed monitoring data cache region;
sending a communication frame to read monitoring data corresponding to all target soft elements in the monitoring data cache region according to the address of the target soft element corresponding to at least one identifier to be monitored;
the reading of the monitoring data of the target soft element in the second communication mode comprises:
and sending a communication frame to read monitoring data corresponding to a plurality of target soft elements which are continuously of the same type.
8. A computer-readable storage medium, characterized by comprising a program executable by a processor to implement the method of any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010776892.XA CN111897283B (en) | 2020-08-05 | 2020-08-05 | Programmable logic controller software element monitoring method, system and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010776892.XA CN111897283B (en) | 2020-08-05 | 2020-08-05 | Programmable logic controller software element monitoring method, system and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111897283A CN111897283A (en) | 2020-11-06 |
CN111897283B true CN111897283B (en) | 2021-10-22 |
Family
ID=73245683
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010776892.XA Active CN111897283B (en) | 2020-08-05 | 2020-08-05 | Programmable logic controller software element monitoring method, system and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111897283B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112711218B (en) * | 2020-12-08 | 2022-03-15 | 杭州电子科技大学上虞科学与工程研究院有限公司 | Industrial equipment data acquisition method |
CN117452873B (en) * | 2023-12-26 | 2024-03-15 | 宁波和利时信息安全研究院有限公司 | Communication method, device, equipment and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003280732A (en) * | 2002-03-20 | 2003-10-02 | Digital Electronics Corp | Data transmitter and control system using the same |
CN103365237A (en) * | 2013-06-28 | 2013-10-23 | 深圳市汇川控制技术有限公司 | Method and device for monitoring and recording component and variable in PLC (Programmable Logic Controller) system |
CN105452970A (en) * | 2014-04-21 | 2016-03-30 | 株式会社东芝 | Monitoring control system, monitoring control device, and controller |
CN108427361A (en) * | 2017-02-13 | 2018-08-21 | 欧姆龙株式会社 | Method, module and the mobile terminal that programmable logic controller (PLC) is monitored |
CN108932171A (en) * | 2018-06-15 | 2018-12-04 | 中国航发控制***研究所 | Embedded software exchange method |
CN109270885A (en) * | 2018-10-26 | 2019-01-25 | 苏州华兴源创科技股份有限公司 | Monitor data communications method, device, equipment and the storage medium of PLC system |
CN110262370A (en) * | 2019-05-30 | 2019-09-20 | 苏州华兴源创科技股份有限公司 | Batch reading/writing method, the apparatus and system of PLC |
CN110941236A (en) * | 2019-12-31 | 2020-03-31 | 郑州信大捷安信息技术股份有限公司 | PLC safety monitoring and dynamic measuring method and system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103326958B (en) * | 2012-03-22 | 2017-07-04 | 罗普特(厦门)科技集团有限公司 | Monitoring data caching method and system |
-
2020
- 2020-08-05 CN CN202010776892.XA patent/CN111897283B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003280732A (en) * | 2002-03-20 | 2003-10-02 | Digital Electronics Corp | Data transmitter and control system using the same |
CN103365237A (en) * | 2013-06-28 | 2013-10-23 | 深圳市汇川控制技术有限公司 | Method and device for monitoring and recording component and variable in PLC (Programmable Logic Controller) system |
CN105452970A (en) * | 2014-04-21 | 2016-03-30 | 株式会社东芝 | Monitoring control system, monitoring control device, and controller |
CN108427361A (en) * | 2017-02-13 | 2018-08-21 | 欧姆龙株式会社 | Method, module and the mobile terminal that programmable logic controller (PLC) is monitored |
CN108932171A (en) * | 2018-06-15 | 2018-12-04 | 中国航发控制***研究所 | Embedded software exchange method |
CN109270885A (en) * | 2018-10-26 | 2019-01-25 | 苏州华兴源创科技股份有限公司 | Monitor data communications method, device, equipment and the storage medium of PLC system |
CN110262370A (en) * | 2019-05-30 | 2019-09-20 | 苏州华兴源创科技股份有限公司 | Batch reading/writing method, the apparatus and system of PLC |
CN110941236A (en) * | 2019-12-31 | 2020-03-31 | 郑州信大捷安信息技术股份有限公司 | PLC safety monitoring and dynamic measuring method and system |
Non-Patent Citations (1)
Title |
---|
可编程控制器通信技术的研究与实现;黄维;《中国优秀硕士学位论文全文数据库 信息科技辑》;20170915(第09期);第I140-371页 * |
Also Published As
Publication number | Publication date |
---|---|
CN111897283A (en) | 2020-11-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111897283B (en) | Programmable logic controller software element monitoring method, system and storage medium | |
CN109117391A (en) | Controller for storage system | |
EP3629197A1 (en) | System and method for binned inter-quartile range analysis in anomaly detection of a data series | |
CN104331520A (en) | Performance optimization method and device of Hadoop cluster and node state recognition method and device | |
CN109844660B (en) | Debugging assistance device and debugging assistance method | |
CN107483283B (en) | Communication reliability test method and device | |
CN106403188A (en) | Air conditioner maintenance method and maintenance device thereof | |
JP2008226006A (en) | Facility equipment diagnostic device and program | |
CN102341789A (en) | Apparatus and method for monitoring a computer system | |
CN110989509B (en) | Automatic control method and device for production line, terminal equipment and storage medium | |
CN112785281A (en) | Filter screen replacement prompting method and system | |
CN111680236A (en) | Menu display method and device, terminal equipment and storage medium | |
CN109605374B (en) | Method and device for displaying movement path of robot and robot | |
CN113722134A (en) | Cluster fault processing method, device and equipment and readable storage medium | |
CN111108453B (en) | Control system, control method, and control program | |
CN111885218B (en) | Method and device for managing intelligent equipment and binding equipment | |
CN114037010A (en) | Method and device for identifying abnormal electric quantity data | |
CN112988540A (en) | Primitive replacement method, system, computer readable storage medium and terminal equipment | |
CN109445877B (en) | Method for detecting same virtual machine used by multiple threads of game server | |
JP2011247451A (en) | Air conditioning system | |
CN111861012A (en) | Test task execution time prediction method and optimal execution node selection method | |
CN116066951A (en) | Method and device for controlling air conditioner, electronic equipment and storage medium | |
CN113756042B (en) | Equipment control method and device | |
CN113692177B (en) | Control method, device and terminal for power consumption of refrigeration system of data center | |
CN113946380B (en) | Picture loading method and device and video processing 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 |