CN113219898B - Communication system of upper computer and PLC - Google Patents

Communication system of upper computer and PLC Download PDF

Info

Publication number
CN113219898B
CN113219898B CN202110770549.9A CN202110770549A CN113219898B CN 113219898 B CN113219898 B CN 113219898B CN 202110770549 A CN202110770549 A CN 202110770549A CN 113219898 B CN113219898 B CN 113219898B
Authority
CN
China
Prior art keywords
data
data interaction
interaction channel
plc
upper computer
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
CN202110770549.9A
Other languages
Chinese (zh)
Other versions
CN113219898A (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.)
Tianjin Yike Automation Co ltd
Original Assignee
Elco Tianjin Electronics 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 Elco Tianjin Electronics Co Ltd filed Critical Elco Tianjin Electronics Co Ltd
Priority to CN202110770549.9A priority Critical patent/CN113219898B/en
Publication of CN113219898A publication Critical patent/CN113219898A/en
Application granted granted Critical
Publication of CN113219898B publication Critical patent/CN113219898B/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/1194Send dummy, check data to I-O to check correct I-O connection

Landscapes

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

Abstract

The invention relates to a communication system of an upper computer and a PLC (programmable logic controller), which comprises the upper computer, the PLC, a processor and a memory for storing a computer program, wherein the upper computer is connected with the PLC through a communication interface; the PLC is provided with data interaction channels, each data interaction channel corresponds to a preset data interaction operation, a first signal interaction point M1, a second signal interaction point M2 and at least one data interaction point for storing target data are arranged in each data interaction channel, the state value of M1 is 0 or 1, and the state value of M2 is 0 or 1; the PLC allows read-write operation to the M1 of the data interaction channel and performs read-only operation to the M2 of the data interaction channel; the upper computer allows read-write operation on the M2 and read-only operation on the M1; the PLC and the upper computer monitor the state value of M1M2 of the data interaction channel in real time, and the changed M1 value or M2 value completes the data interaction operation of the PLC and the upper computer. The invention can ensure the validity and accuracy of data in the communication process between the upper computer and the PLC and improve the communication reliability between the upper computer and the PLC.

Description

Communication system of upper computer and PLC
Technical Field
The invention relates to the technical field of communication between an upper computer and a PLC (programmable logic controller), in particular to a communication system between the upper computer and the PLC.
Background
When the upper computer communicates with the PLC, that is, the upper computer and a Programmable Logic Controller (PLC) are two independent devices, and data interaction is performed between the upper computer and the PLC in an asynchronous communication manner. In the existing communication technology between an upper computer and a PLC, the current interactive data in the PLC is cleared by default after a data interaction process is completed, and then the next data interaction process is executed. However, because a plurality of data processing processes may exist in the PLC at the same time, a data interaction error may be caused by crossing of different data processing processes, or a data interaction error may also be caused by being influenced by network communication, equipment itself, and the like in the data transmission process, but the next data interaction operation is executed by directly resetting by default, so that the data error cannot be found in time. If the zero clearing fails, the result of the last interactive data is directly used in the next data interactive scene, so that data errors are caused, and therefore, the effectiveness and accuracy of the data in the communication process cannot be guaranteed by the existing upper computer and PLC communication technology, and the reliability is poor.
Disclosure of Invention
The invention aims to provide a communication system of an upper computer and a PLC (programmable logic controller), which can ensure the validity and the accuracy of data in the communication process of the upper computer and the PLC and improve the communication reliability of the upper computer and the PLC.
According to a first aspect of the present invention, there is provided a communication system between an upper computer and a PLC, comprising an upper computer, at least one PLC, a processor and a memory storing a computer program;
the upper computer is connected with at least one PLC, at least one data interaction channel is arranged in the PLC, each data interaction channel corresponds to a preset data interaction operation, each PLC can execute the data interaction operations of a plurality of data interaction channels in parallel, and only one data interaction operation can be processed in each data interaction channel at the same time;
a first signal interaction point M1, a second signal interaction point M2 and at least one data interaction point are arranged in the data interaction channel, the first signal interaction point M1, the second signal interaction point M2 and each data interaction point correspond to an address in the PLC, the state value of M1 is 0 or 1, the state value of M2 is 0 or 1, and the data interaction points are used for storing target data of data interaction operation;
the PLC is configured to allow read-write operation to the M1 of the data interaction channel and read-only operation to the M2 of the data interaction channel; the upper computer is configured to allow read-write operation on M2 and read-only operation on M1;
the processor, when executing the computer program, implements the steps of:
and S100, monitoring the state value of M1M2 corresponding to the data interaction channel in real time by the PLC and the upper computer, changing the corresponding M1 value or M2 value based on the data interaction operation process, and finishing the data interaction operation of the PLC and the upper computer.
Compared with the prior art, the invention has obvious advantages and beneficial effects. By means of the technical scheme, the communication system of the upper computer and the PLC can achieve considerable technical progress and practicability, has industrial wide utilization value and at least has the following advantages:
the invention sets the corresponding data interaction channel for each type of data interaction operation, each data interaction channel only executes one data interaction operation each time, the interaction among different data interaction operations is avoided, the whole data interaction process is monitored based on the state values of M1M2 of two information interaction points of each data interaction channel, the validity and the accuracy of data in the communication process are ensured, and the reliability of the communication between an upper computer and a PLC is improved.
The foregoing description is only an overview of the technical solutions of the present invention, and in order to make the technical means of the present invention more clearly understood, the present invention may be implemented in accordance with the content of the description, and in order to make the above and other objects, features, and advantages of the present invention more clearly understood, the following preferred embodiments are described in detail with reference to the accompanying drawings.
Drawings
Fig. 1 is a schematic view of a communication system between an upper computer and a PLC according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a general assembly line target information acquisition system according to an embodiment of the present invention;
fig. 3 is a schematic view of a vehicle frame according to an embodiment of the present invention.
Detailed Description
To further illustrate the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description will be made on the specific implementation and effects of a communication system between a host computer and a PLC according to the present invention with reference to the accompanying drawings and preferred embodiments.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. A process may be terminated when its operations are completed, but may have additional steps not included in the figure. A process may correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
The embodiment of the invention provides a communication system of an upper computer and a PLC (programmable logic controller), which comprises the upper computer, at least one PLC, a processor and a memory stored with a computer program, wherein the upper computer can be an industrial personal computer, and the processor and the memory can be directly arranged in the upper computer or independently arranged in other servers. The upper computer is at least connected with one PLC, at least one data interaction channel is arranged in the PLC, each data interaction channel corresponds to a preset data interaction operation, each PLC can execute the data interaction operations of a plurality of data interaction channels in parallel, and each data interaction channel can only process one data interaction operation at the same time. The data interaction channel is provided with a corresponding first signal interaction point M1, a corresponding second signal interaction point M2 and at least one data interaction point, wherein M1, M2 and each data interaction point correspond to an address in the PLC, the state value of M1 is 0 or 1, the state value of M2 is 0 or 1, the data interaction points are used for storing target data of data interaction operation, and it can be understood that the number of the data interaction points corresponding to each data interaction channel is not less than the maximum data amount required by the data interaction operation type corresponding to the data channel. The PLC is configured to allow read-write operation to the M1 of the data interaction channel and read-only operation to the M2 of the data interaction channel; the upper computer is configured to allow read-write operation on M2 and read-only operation on M1. The processor, when executing the computer program, implements the steps of:
and S100, monitoring the state value of M1M2 corresponding to the data interaction channel in real time by the PLC and the upper computer, changing the corresponding M1 value or M2 value based on the data interaction operation process, and finishing the data interaction operation of the PLC and the upper computer.
The communication system of the embodiment of the invention sets the corresponding data interaction channel for each type of data interaction operation, each data interaction channel only executes one data interaction operation each time, so that the mutual influence between different data interaction operations is avoided, the whole data interaction process is monitored based on the state values of M1M2 of two information interaction points of each data interaction channel, the validity and the accuracy of data in the communication process are ensured, and the reliability of the communication between an upper computer and a PLC (programmable logic controller) is improved.
The following detailed description is made of the communication process between the upper computer and the PLC according to two embodiments:
the first embodiment,
In a scene that the PLC acquires target data from the upper computer, the step S100 includes:
step S1, a data interaction channel of the PLC receives a first data interaction request sent by an external device connected with the PLC, whether the state value of M1M2 corresponding to the data interaction channel is 00 or not is judged, if yes, M1 of the data interaction channel is changed into 1, and a first target data acquisition request is sent to an upper computer;
it is understood that the external device may be an electrical device on a specific production line, for example, an electrical device on a vehicle production line, and the specific first target data is also determined according to the electrical device, for example, the first target data may be vehicle assembly parameter information corresponding to a vehicle model id.
S2, the upper computer monitors that the state value of M1M2 of the data interaction channel changes from 00 to 10, acquires first target data from an upper computer database based on a received first target data acquisition request, writes the first target data into the data interaction channel data point, and after the writing is finished, the upper computer changes M2 of the data interaction channel into 1;
step S3, the PLC monitors that the state value of the M1M2 of the data interaction channel is changed from 10 to 11, acquires the first target data from the data points of the data interaction channel and sends the first target data to external equipment, or controls the external equipment to execute corresponding actions according to the first target data and changes the M1 state of the data interaction channel to 0;
and S4, when the upper computer monitors that the state value of the M1M2 of the data interaction channel is changed from 11 to 01, changing the M2 of the data interaction channel to 0, and clearing data in data points of the data interaction channel for data interaction operation of the data interaction channel.
It can be understood that, for a scenario where the uploading of the next first data interaction request is not strictly limited in the same first data interaction operation time period, in the current first data interaction operation process, if the next first data interaction request is acquired, the processing may be resumed when the state value of M1M2 corresponding to the data interaction channel becomes 00, as an embodiment, in the step S1, when the state value of M1M2 corresponding to the data interaction channel is not 00, an alarm operation is directly performed or the following operations are performed: and placing the received first data interaction request in a PLC request queue corresponding to the data interaction channel, and sequentially executing the first data interaction request in the PLC request queue corresponding to the data interaction channel when the state value of M1M2 corresponding to the data interaction channel is changed to 00. It can be understood that, for a scenario that a next first data interaction request is not allowed to be uploaded within the same first data interaction operation time period, in the current first data interaction operation process, when a next first data interaction request is acquired, a corresponding alarm is performed, so that the effectiveness and reliability of acquiring the first target data can be improved.
In order to improve the accuracy of obtaining the target data, as an embodiment, the PLC is further provided with a first data detection mechanism corresponding to each data interaction channel, and when the PLC monitors that the state value of M1M2 of the data interaction channel changes from 10 to 11, the step S3 further includes:
and step S31, the PLC detects the first target data in the data points of the data interaction channel according to a first data detection mechanism corresponding to the data interaction channel, and if the detection is passed, the PLC acquires the first target data from the data points of the data interaction channel and sends the first target data to external equipment, or controls the external equipment to execute corresponding actions according to the first target data, so that the M1 state of the data interaction channel is changed into 0, otherwise, the PLC maintains the state value 11 of the M1M2 of the data interaction channel unchanged.
As an embodiment, the step S100 further includes:
and step S5, when the state value of the M1M2 of the data interaction channel maintains 01, 11 or 10 and exceeds a preset first time threshold value, performing alarm operation.
It is understood that the state value of M1M2 of the data interaction channel may be maintained at 01, 11 or 10 when various abnormal conditions such as device failure, signal failure, data acquisition error and the like occur. And the PLC still can save the current data after power failure, and when the fault is eliminated, the data interaction process can still be continuously executed based on historical operation. The first time threshold may be set according to a time required for normal processing of the corresponding data interaction channel.
Example II,
The PLC is further configured to acquire the connected device state data, store the device state data in a preset data buffer area in the PLC, or store the device state data in a data point of a data interaction channel corresponding to the device state data in real time, and it can be understood that, for a scene where the device state data needs to be accurately acquired in real time, the device state data needs to be directly stored in the data point of the data interaction channel. For application scenarios only used for data backup and the like, the real-time requirement on the device state data is not high, and the device state data can be stored in a data cache region and acquired by an upper computer at intervals. In a scene that the upper computer acquires target data from the PLC, the step S100 includes:
s10, the upper computer sends a second data interaction request to a data interaction channel of the PLC, judges whether the state value of M1M2 corresponding to the data interaction channel is 00, if yes, the upper computer changes M2 of the data interaction channel into 1, sends a second target data acquisition request to the PLC, and then executes the step S20 or the step S30;
step S20, the PLC monitors that the state value of M1M2 of the data interaction channel changes from 00 to 01, based on the received second target data acquisition request, the PLC acquires second target data from the data buffer area and writes the second target data into the data point of the data interaction channel, after the writing is finished, the PLC changes M1 of the data interaction channel into 1, and step S40 is executed;
step S30, the PLC monitors that the state value of the M1M2 of the data interaction channel changes from 00 to 01, judges whether the second target data in the data points of the data interaction channel are completely acquired based on the received second target data acquisition request, if the second target data are completely acquired, the PLC changes the M1 of the data interaction channel to 1, and executes step S40;
s40, the upper computer monitors that the state value of M1M2 of the data interaction channel changes from 01 to 11, obtains second target data from data points of the data interaction channel and stores the second target data in an upper computer database, and then changes the M2 state to 0;
and S50, when the PLC monitors that the state value of the M1M2 of the data interaction channel is changed from 11 to 10, changing the M1 of the data interaction channel to 0, and clearing data in data points of the data interaction channel.
It can be understood that, for a scenario where the uploading of the next second data interaction request is not strictly limited in the same second data interaction operation time period, in the current second data interaction operation process, if the next second data interaction request is acquired, the processing may be resumed after the state value of M1M2 corresponding to the data interaction channel becomes 00, as an embodiment, in the step S10, when the state value of M1M2 corresponding to the data interaction channel is not 00, an alarm operation is directly performed or the following operations are performed: and placing the received second data interaction request in an upper computer request queue corresponding to the data interaction channel, and sequentially executing the second data interaction request in the upper computer request queue corresponding to the data interaction channel when the state value of M1M2 corresponding to the data interaction channel is changed into 00. It can be understood that, for a scenario that a next second data interaction request is not allowed to be uploaded within the same second data interaction operation time period, in the current second data interaction operation process, when a next second data interaction request is acquired, a corresponding alarm is performed, so that the effectiveness and reliability of acquiring the second target data can be improved.
In order to improve the accuracy of obtaining the target data, as an embodiment, a second data detection mechanism corresponding to each data interaction channel is further disposed in the upper computer, and when the upper computer monitors that the state value of M1M2 of the data interaction channel changes from 01 to 11, the step S40 further includes:
and S401, the upper computer detects the second target data in the data interaction channel data points according to a second data detection mechanism corresponding to the data interaction channel, if the second target data pass the detection, the second target data are acquired from the data points of the data interaction channel and stored in an upper computer database, the M2 state of the data interaction channel is changed into 0, and if the second target data pass the detection, the state value 11 of the M1M2 of the data interaction channel is maintained unchanged.
As an embodiment, the step S100 further includes:
and step S60, when the state value of the M1M2 of the data interaction channel maintains 01, 11 or 10 and exceeds a preset second time threshold, performing alarm operation.
It is understood that the state value of M1M2 of the data interaction channel may be maintained at 01, 11 or 10 when various abnormal conditions such as device failure, signal failure, data acquisition error and the like occur. And the PLC still can save the current data after power failure, and when the fault is eliminated, the data interaction process can still be continuously executed based on historical operation. The second time threshold may be set according to a time required for normal processing of the corresponding data interaction channel.
The communication system of the upper computer and the PLC provided by the embodiment of the invention can be applied to communication scenes of a plurality of PLCs and the upper computer, and the application scene of the general assembly line target information acquisition system is taken as an example for further explanation. The embodiment of the invention also provides a general assembly line target information acquisition system, which comprises an upper computer, a PLC, a target information acquisition device, a first information detector and a second information detector, wherein the upper computer is in communication connection with the PLC, the first information detector and the second information detector, and the PLC is connected with the target information acquisition device. The height from the ground to the installation position of the target information collector is a first height h1, the first height h1 is stored in the upper computer and is used for scanning a target information code, as an example, the target information collector can be a code scanner, and the target information code is a bar code, a two-dimensional code and the like. The target information code is installed on a preset installation position of the object to be assembled, and it can be understood that the target information code needs to be installed on a plane of the object to be assembled parallel to the ground and does not block the position of the target information collector. And when the object to be assembled runs to a preset target position, the target information code is positioned in the scanning range of the target information collector. The upper computer further comprises a processor and a memory storing a computer program, and when the processor executes the computer program, the following steps are realized:
step C1, when the first information detector detects that the object to be assembled moves to the target position along a preset track, sending in-place information to the upper computer;
the first information detector can be an in-place switch, the in-place switch is triggered when the object to be assembled moves to the target position along a preset track, and the in-place switch sends in-place information to the upper computer.
Step C2, the upper computer controls the second information detector to acquire a second height h2 from the ground of a target information code of the object to be assembled and sends the second height h2 to the upper computer;
after the upper computer receives the in-place information sent by the in-place switch, the upper computer controls the second information detector to measure a second height h2 of the target information code from the ground, and as an example, the second information detector can specifically adopt a photoelectric sensor. It can be understood that the second height of the target information code from the ground can be measured by directly measuring the second height of the plane where the target information code installation area is located from the ground.
Step C3, the upper computer determines the target focal length h3 of the target information collector from the target information code of the object to be assembled based on h1 and h 2: h3= h 1-h 2;
it can be understood that h3 is the best focal length for the target information collector to scan the target information code corresponding to the current object to be assembled.
Step C4, the PLC communicates with the upper computer to obtain h3, controls the target information collector to adjust the focal length to h3, scans the target information code to obtain target information, and stores the target information in the PLC;
the target information can be quickly and accurately acquired by directly acquiring the optimal focal length of the target information code corresponding to the current object to be assembled scanned by the target information acquisition device and adjusting the focal length to h3 by the target information acquisition device, so that the efficiency and accuracy of acquiring the target information are improved.
And step C5, the upper computer communicates with the PLC to acquire the target information of the object to be assembled.
According to the embodiment of the invention, the general assembly line target information acquisition system is set up, so that when each object to be assembled enters the general assembly line, the target information code can be automatically placed in the scanning range of the target information acquisition device, and the general assembly line target information can be quickly and accurately acquired by the target information acquisition device.
As an embodiment, when the processor executes the computer program, the following steps are also implemented:
step C10, acquiring a cone angle of a formed viewing cone of the target information collector, a maximum value h2max of the height of the target information code from the ground, and a maximum radial distance Lmax of a preset installation position on a plane parallel to the ground, wherein the formed viewing cone of the target information collector is conical;
step C20, cone angle of formed view cone based on the target information collector
Figure 176693DEST_PATH_IMAGE002
Determining the value range of h1 according to the maximum value h2max of the distance between the target information code and the ground height and the maximum radial distance Lmax of the preset installation position on a plane parallel to the ground:
Figure 890571DEST_PATH_IMAGE004
it can be understood that the range of h1 obtained in the steps C10-C20 can ensure that the target information collector can quickly and accurately collect the target information of objects to be assembled of different models.
As an embodiment, the assembly line target information collecting system may be specifically disposed on a vehicle assembly line, and correspondingly, the object to be assembled is a vehicle frame, as shown in fig. 3, and the target information is a vehicle type id. It should be noted that the target information needs to be installed on a plane, which is convenient for the target information collector to collect the target information, and the target information codes generally need to be manually pasted, so as to be a preferred embodiment, the preset installation position is a vehicle front windshield base area, as shown in fig. 3.
As an embodiment, the upper computer includes a MES System (Manufacturing Execution System), and the step C5 is followed by further including:
and step C6, the upper computer acquires assembly information corresponding to the vehicle type from the MES system based on the target information and adds the assembly information into a production queue. And assembling the subsequent assembly based on the assembling information corresponding to the target information.
By adopting the communication system of the upper computer and the PLC, the step C4 specifically comprises the following steps:
step C41, a data interaction channel of the PLC receives a target focal length interaction request sent by a target information collector, whether the state value of M1M2 corresponding to the data interaction channel is 00 or not is judged, if yes, M1 of the data interaction channel is changed into 1, and a target focal length acquisition request is sent to an upper computer;
step C42, the upper computer monitors that the state value of M1M2 of the data interaction channel changes from 00 to 10, based on the received target focal length obtaining request, h3 is obtained from a database, h3 is written into the data point of the data interaction channel, and after the writing is finished, the upper computer changes M2 of the data interaction channel into 1;
step C43, the PLC monitors that the state value of the M1M2 of the data interaction channel is changed from 10 to 11, acquires h3 from the data point of the data interaction channel, controls the target information collector to scan a target information code according to the h3 to acquire target information, and changes the M1 state of the data interaction channel to 0;
and step C44, when the upper computer monitors that the state value of the M1M2 of the data interaction channel is changed from 11 to 01, changing the M2 of the data interaction channel to 0, and clearing data in data points of the data interaction channel.
The step C4 further includes a step C45, when the state value of M1M2 of the data interaction channel maintains 01, 11 or 10 and exceeds a preset first time threshold, or when the state value of M1M2 corresponding to the data interaction channel in the step C41 is not 00, performing an alarm operation.
Based on the communication system between the upper computer and the PLC according to the embodiment of the present invention, the PLC stores the acquired target information in a data cache area preset in the PLC, or stores the acquired target information in a data point of a data interaction channel corresponding to the target information in real time, where the step C5 includes:
step C51, the upper computer sends a target information interaction request to a data interaction channel of the PLC, judges whether the state value of M1M2 corresponding to the data interaction channel is 00, if yes, the upper computer changes M2 of the data interaction channel into 1, and executes step C52 or step C53;
step C52, the PLC monitors that the state value of M1M2 of the data interaction channel changes from 00 to 01, based on the received target information acquisition request, the PLC acquires target information from the data cache region and writes the target information into the data point of the data interaction channel, after the writing is finished, the PLC changes M1 of the data interaction channel into 1, and step C54 is executed;
step C53, the PLC monitors that the state value of the M1M2 of the data interaction channel is changed from 00 to 01, judges whether the target information in the data point of the data interaction channel is completely acquired or not based on the received target information acquisition request, if the target information is completely acquired, the PLC changes the M1 of the data interaction channel to 1, and executes step C54;
step C54, the upper computer monitors that the state value of M1M2 of the data interaction channel changes from 01 to 11, the target information is obtained from the data points of the data interaction channel and stored in an upper computer database, and then the M2 state is changed to 0;
and step C55, when the PLC monitors that the state value of the M1M2 of the data interaction channel is changed from 11 to 10, changing the M1 of the data interaction channel to 0, and clearing data in data points of the data interaction channel.
Wherein the step C5 further comprises:
and step C56, when the state value of the M1M2 of the data interaction channel maintains 01, 11 or 10 and exceeds a preset second time threshold, or when the state value of the M1M2 corresponding to the data interaction channel is not 00 in the step C51, performing alarm operation.
It should be noted that other exception handling in steps C4 and C5 can be handled by using the processing details of the communication system between the upper computer and the PLC according to the embodiment of the present invention, and will not be described again here.
Although the present invention has been described with reference to a preferred embodiment, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (8)

1. A communication system of an upper computer and a PLC is characterized in that,
the PLC-based intelligent monitoring system comprises an upper computer, at least one PLC, a processor and a memory for storing a computer program;
the upper computer is connected with at least one PLC, at least one data interaction channel is arranged in the PLC, each data interaction channel corresponds to a preset data interaction operation, each PLC can execute the data interaction operations of a plurality of data interaction channels in parallel, and only one data interaction operation can be processed in each data interaction channel at the same time;
a first signal interaction point M1, a second signal interaction point M2 and at least one data interaction point are arranged in the data interaction channel, the first signal interaction point M1, the second signal interaction point M2 and each data interaction point correspond to an address in the PLC, the state value of M1 is 0 or 1, the state value of M2 is 0 or 1, and the data interaction points are used for storing target data of data interaction operation;
the PLC is configured to allow read-write operation to the M1 of the data interaction channel and read-only operation to the M2 of the data interaction channel; the upper computer is configured to allow read-write operation on M2 and read-only operation on M1;
the processor, when executing the computer program, implements the steps of:
s100, the PLC and the upper computer monitor the state value of M1M2 corresponding to the data interaction channel in real time, and change the corresponding M1 value or M2 value based on the data interaction operation process to complete the data interaction operation of the PLC and the upper computer;
the step S100 includes:
step S1, a data interaction channel of the PLC receives a first data interaction request sent by an external device connected with the PLC, whether the state value of M1M2 corresponding to the data interaction channel is 00 or not is judged, if yes, M1 of the data interaction channel is changed into 1, and a first target data acquisition request is sent to an upper computer;
s2, the upper computer monitors that the state value of M1M2 of the data interaction channel changes from 00 to 10, acquires first target data from an upper computer database based on a received first target data acquisition request, writes the first target data into the data interaction channel data point, and after the writing is finished, the upper computer changes M2 of the data interaction channel into 1;
step S3, the PLC monitors that the state value of the M1M2 of the data interaction channel is changed from 10 to 11, acquires the first target data from the data points of the data interaction channel and sends the first target data to external equipment, or controls the external equipment to execute corresponding actions according to the first target data and changes the M1 state of the data interaction channel to 0;
and S4, when the upper computer monitors that the state value of the M1M2 of the data interaction channel is changed from 11 to 01, changing the M2 of the data interaction channel to 0, and clearing data in data points of the data interaction channel.
2. The communication system of claim 1,
in the step S1, when the state value of M1M2 corresponding to the data interaction channel is not 00, directly performing an alarm operation or performing the following operations: and placing the received first data interaction request in a PLC request queue corresponding to the data interaction channel, and sequentially executing the first data interaction request in the PLC request queue corresponding to the data interaction channel when the state value of M1M2 corresponding to the data interaction channel is changed to 00.
3. The communication system of claim 1,
the PLC is further provided with a first data detection mechanism corresponding to each data interaction channel, and when the PLC monitors that the state value of M1M2 of the data interaction channel changes from 10 to 11, the step S3 further includes:
and step S31, the PLC detects the first target data in the data points of the data interaction channel according to a first data detection mechanism corresponding to the data interaction channel, and if the detection is passed, the PLC acquires the first target data from the data points of the data interaction channel and sends the first target data to external equipment, or controls the external equipment to execute corresponding actions according to the first target data, so that the M1 state of the data interaction channel is changed into 0, otherwise, the PLC maintains the state value 11 of the M1M2 of the data interaction channel unchanged.
4. The communication system according to any of claims 1 to 3,
the step S100 further includes:
and step S5, when the state value of the M1M2 of the data interaction channel maintains 01, 11 or 10 and exceeds a preset first time threshold value, performing alarm operation.
5. The communication system of claim 1,
the PLC is further configured to obtain connected device status data, store the device status data in a preset data buffer in the PLC, or store the device status data in a data point of a data interaction channel corresponding to the device status data in real time, where step S100 includes:
s10, the upper computer sends a second data interaction request to a data interaction channel of the PLC, judges whether the state value of M1M2 corresponding to the data interaction channel is 00, if yes, the upper computer changes M2 of the data interaction channel into 1, sends a second target data acquisition request to the PLC, and then executes the step S20 or the step S30;
step S20, the PLC monitors that the state value of M1M2 of the data interaction channel changes from 00 to 01, based on the received second target data acquisition request, the PLC acquires second target data from the data buffer area and writes the second target data into the data point of the data interaction channel, after the writing is finished, the PLC changes M1 of the data interaction channel into 1, and step S40 is executed;
step S30, the PLC monitors that the state value of the M1M2 of the data interaction channel changes from 00 to 01, judges whether the second target data in the data points of the data interaction channel are completely acquired based on the received second target data acquisition request, if the second target data are completely acquired, the PLC changes the M1 of the data interaction channel to 1, and executes step S40;
s40, the upper computer monitors that the state value of M1M2 of the data interaction channel changes from 01 to 11, obtains second target data from data points of the data interaction channel and stores the second target data in an upper computer database, and then changes the M2 state to 0;
and S50, when the PLC monitors that the state value of the M1M2 of the data interaction channel is changed from 11 to 10, changing the M1 of the data interaction channel to 0, and clearing data in data points of the data interaction channel.
6. The communication system of claim 5,
in the step S10, when the state value of M1M2 corresponding to the data interaction channel is not 00, directly performing an alarm operation or performing the following operations: and placing the received second data interaction request in an upper computer request queue corresponding to the data interaction channel, and sequentially executing the second data interaction request in the upper computer request queue corresponding to the data interaction channel when the state value of M1M2 corresponding to the data interaction channel is changed into 00.
7. The communication system of claim 5,
the upper computer is further provided with a second data detection mechanism corresponding to each data interaction channel, and when the upper computer monitors that the state value of the M1M2 of the data interaction channel changes from 01 to 11, the step S40 further includes:
and S401, the upper computer detects the second target data in the data interaction channel data points according to a second data detection mechanism corresponding to the data interaction channel, if the second target data pass the detection, the second target data are acquired from the data points of the data interaction channel and stored in an upper computer database, the M2 state of the data interaction channel is changed into 0, and if the second target data pass the detection, the state value 11 of the M1M2 of the data interaction channel is maintained unchanged.
8. The communication system according to any of claims 5 to 7,
the step S100 further includes:
and step S60, when the state value of the M1M2 of the data interaction channel maintains 01, 11 or 10 and exceeds a preset second time threshold, performing alarm operation.
CN202110770549.9A 2021-07-08 2021-07-08 Communication system of upper computer and PLC Active CN113219898B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110770549.9A CN113219898B (en) 2021-07-08 2021-07-08 Communication system of upper computer and PLC

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110770549.9A CN113219898B (en) 2021-07-08 2021-07-08 Communication system of upper computer and PLC

Publications (2)

Publication Number Publication Date
CN113219898A CN113219898A (en) 2021-08-06
CN113219898B true CN113219898B (en) 2021-09-21

Family

ID=77081211

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110770549.9A Active CN113219898B (en) 2021-07-08 2021-07-08 Communication system of upper computer and PLC

Country Status (1)

Country Link
CN (1) CN113219898B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN205919404U (en) * 2016-08-24 2017-02-01 深圳市高德威技术有限公司 Fume purification device and system
KR20180010748A (en) * 2016-07-22 2018-01-31 두산중공업 주식회사 Apparatus and System for Simulating Core Protection system software
CN108196529A (en) * 2018-01-19 2018-06-22 京东方科技集团股份有限公司 Data processing method and its device, data processing system
CN108449250A (en) * 2018-05-22 2018-08-24 三明学院 A kind of IO-LINK master station devices and method for supporting multibus
CN109752990A (en) * 2018-11-29 2019-05-14 西北工业大学 A kind of control of multi-channel circuit on-off and voltage collecting device
CN110361042A (en) * 2019-07-25 2019-10-22 深圳中物兴华科技发展有限公司 A kind of humiture monitoring device automatic gauge calibration method and system
CN110658793A (en) * 2019-09-10 2020-01-07 上海大学 Intelligent production heterogeneous equipment multi-channel information perception analysis system and operation method thereof
CN110737255A (en) * 2019-10-31 2020-01-31 共享智能铸造产业创新中心有限公司 Automatic processing method for multi-station disordered process paths
CN111179462A (en) * 2019-12-04 2020-05-19 山西诚鹏科技开发有限公司 PLC operation data recording method based on multi-master station communication mode
CN111240273A (en) * 2020-03-19 2020-06-05 科德数控股份有限公司 Multi-channel multiplying power control method based on physical keys of machine tool keyboard
CN113028603A (en) * 2021-03-24 2021-06-25 贵州汇通华城股份有限公司 Equipment monitoring system applied to central air-conditioning system

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61145607A (en) * 1984-12-19 1986-07-03 Toshiba Corp Pre-program controller
CN1613045B (en) * 2002-02-09 2010-04-28 联想(北京)有限公司 Personal computer system based on wireless man machine interacting device and its data transmitting method
JP2010252107A (en) * 2009-04-16 2010-11-04 Toshiba Corp Semiconductor integrated circuit device
CN103744365B (en) * 2013-12-16 2017-05-24 南京贝孚莱电子科技有限公司 Bridging module for communication between room control terminal and upper computer and method thereof
CN105491015B (en) * 2015-11-21 2018-07-20 国网山东潍坊市寒亭区供电公司 A kind of communication of data and storage method
CN110297457A (en) * 2019-06-19 2019-10-01 安徽合矿环境工程有限公司 A kind of human-computer interaction interface automatic control system for sewage disposal device
DE102019213982A1 (en) * 2019-09-13 2021-03-18 Dr. Johannes Heidenhain Gmbh Device and method for synchronous serial data transmission
CN110989486B (en) * 2019-12-20 2021-09-07 广东利元亨智能装备股份有限公司 Interaction method of upper computer and PLC

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180010748A (en) * 2016-07-22 2018-01-31 두산중공업 주식회사 Apparatus and System for Simulating Core Protection system software
CN205919404U (en) * 2016-08-24 2017-02-01 深圳市高德威技术有限公司 Fume purification device and system
CN108196529A (en) * 2018-01-19 2018-06-22 京东方科技集团股份有限公司 Data processing method and its device, data processing system
CN108449250A (en) * 2018-05-22 2018-08-24 三明学院 A kind of IO-LINK master station devices and method for supporting multibus
CN109752990A (en) * 2018-11-29 2019-05-14 西北工业大学 A kind of control of multi-channel circuit on-off and voltage collecting device
CN110361042A (en) * 2019-07-25 2019-10-22 深圳中物兴华科技发展有限公司 A kind of humiture monitoring device automatic gauge calibration method and system
CN110658793A (en) * 2019-09-10 2020-01-07 上海大学 Intelligent production heterogeneous equipment multi-channel information perception analysis system and operation method thereof
CN110737255A (en) * 2019-10-31 2020-01-31 共享智能铸造产业创新中心有限公司 Automatic processing method for multi-station disordered process paths
CN111179462A (en) * 2019-12-04 2020-05-19 山西诚鹏科技开发有限公司 PLC operation data recording method based on multi-master station communication mode
CN111240273A (en) * 2020-03-19 2020-06-05 科德数控股份有限公司 Multi-channel multiplying power control method based on physical keys of machine tool keyboard
CN113028603A (en) * 2021-03-24 2021-06-25 贵州汇通华城股份有限公司 Equipment monitoring system applied to central air-conditioning system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一种新的关联规则挖掘方法;彭珍等;《计算机工程与应用》;20090921(第27期);全文 *
利用实时数据对装置设备运行状态进行监测的改进方法;曹静等;《中国管理信息化》;20160501(第09期);全文 *

Also Published As

Publication number Publication date
CN113219898A (en) 2021-08-06

Similar Documents

Publication Publication Date Title
CN101470426B (en) Fault detection method and system
US20190301979A1 (en) Abnormality detection system, support device, and abnormality detection method
US20180343385A1 (en) Image capturing apparatus, system, and method
US20200310898A1 (en) Information processing method and information processing apparatus
KR20190017121A (en) Algorithm and method for detecting error data of machine based on machine-learning technique
EP3324256B1 (en) Control system and control device
US20190158363A1 (en) Parameter setting method, data analysis device, data analysis system and program
CN112506207A (en) Inspection robot and path planning method thereof
CN112734971A (en) Automatic inspection method, storage medium and inspection robot
TWM575368U (en) Cloud computing system for intelligent machine tools
US11682112B2 (en) Inspection device and machine learning method
CN116902536A (en) Intelligent deviation rectifying system of belt conveyor
CN106959688A (en) A kind of vehicle trouble messages acquisition method and device
US11521120B2 (en) Inspection apparatus and machine learning method
CN112327930A (en) Routing inspection path determining method and device
CN113219898B (en) Communication system of upper computer and PLC
CN109547271B (en) Network state real-time monitoring alarm system based on big data
CN113219899B (en) General assembly line target information acquisition system
CN111200780B (en) Method and device for detecting abnormality of positioning data and computer-readable storage medium
KR102418892B1 (en) Method of saving energy based on confidence interval and apparatus using the same
CN114192583A (en) Scada platform-based strip steel rolling process quality monitoring method and system
JP2013011987A (en) Abnormal state detection device and abnormal state detection method
CN115802013B (en) Video monitoring method, device and equipment based on intelligent illumination and storage medium
JP2017204107A (en) Data analytic method, and system and device therefor
CN116560219B (en) Self-adaptive monitoring control method and system based on transmission tower wind speed joint analysis

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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: No.12, Saida 4th branch road, economic development zone, Xiqing District, Tianjin

Patentee after: Tianjin Yike Automation Co.,Ltd.

Address before: No.12, Saida 4th branch road, economic development zone, Xiqing District, Tianjin

Patentee before: ELCO (TIANJIN) ELECTRONICS Co.,Ltd.

CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: No. 12 Saida Fourth Branch Road, Xiqing Economic and Technological Development Zone, Xiqing District, Tianjin, 300385

Patentee after: Tianjin Yike Automation Co.,Ltd.

Address before: No.12, Saida 4th branch road, economic development zone, Xiqing District, Tianjin

Patentee before: Tianjin Yike Automation Co.,Ltd.