WO2013033889A1 - Method for communicating with plc and upper computer - Google Patents

Method for communicating with plc and upper computer Download PDF

Info

Publication number
WO2013033889A1
WO2013033889A1 PCT/CN2011/079364 CN2011079364W WO2013033889A1 WO 2013033889 A1 WO2013033889 A1 WO 2013033889A1 CN 2011079364 W CN2011079364 W CN 2011079364W WO 2013033889 A1 WO2013033889 A1 WO 2013033889A1
Authority
WO
WIPO (PCT)
Prior art keywords
plc
communication
communication protocol
parameters
read
Prior art date
Application number
PCT/CN2011/079364
Other languages
French (fr)
Chinese (zh)
Inventor
刘华浩
殷岳元
邓立波
赵万峰
车通
Original Assignee
长沙中联重工科技发展股份有限公司
湖南中联重科专用车有限责任公司
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 长沙中联重工科技发展股份有限公司, 湖南中联重科专用车有限责任公司 filed Critical 长沙中联重工科技发展股份有限公司
Priority to PCT/CN2011/079364 priority Critical patent/WO2013033889A1/en
Publication of WO2013033889A1 publication Critical patent/WO2013033889A1/en

Links

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/15Plc structure of the system
    • G05B2219/15028Controller and device have several formats and protocols, select common one

Definitions

  • the present invention relates to the field of communications, and in particular, to a method for communicating with a PLC and a host computer. Background technique
  • the mixing station generally uses the upper computer to communicate with the PLC connected to the upper computer.
  • the upper computer interface program need to be developed for the upper computer, so that the upper computer can perform with the different types of PLC. Communication to achieve data read and write.
  • the above communication methods have the following defects: (1) The versatility of the host computer is not high, and it can only communicate with the PLC of the common type. For a PLC of a very type, it is necessary to add a PLC for the very type of PLC in the host computer. Interface program, long development cycle, difficult to manage version; (2) This type of communication causes the control part of the mixing station to be inflexible during production and post-maintenance, and the production and maintenance costs increase. Summary of the invention
  • the object of the present invention is to provide a method for communicating with a PLC and a host computer.
  • the method and the host computer have high versatility, which makes the selection of the PLC more flexible.
  • the present invention provides a host computer for communicating with a PLC, the host computer comprising: a receiving port for receiving a command for connecting the PLC; and a controller for receiving at the receiving port After the command, the pre-stored communication protocols and/or communication parameters for a plurality of PLC types are used one by one, and the PLC type identification information in the PLC is attempted to be read, and after the reading is successful, the PLC is determined.
  • the communication protocol and the communication parameter are communication protocols and communication parameters used when successfully reading the PLC type identifier; and adopting the determined The communication protocol and communication parameters communicate with the PLC.
  • the present invention also provides a method for communicating with a PLC, the method comprising: receiving a command to connect to the PLC; using a pre-stored communication protocol and/or communication parameters for a plurality of PLC types one by one, attempting Reading the PLC type identification information in the PLC, and after the reading is successful, determining the communication protocol and the communication parameter of the PLC as the communication protocol and the communication parameter used when successfully reading the PLC type identifier; The determined communication protocol and communication parameters are communicated with the PLC.
  • the communication protocol and/or communication parameters of various types of PLCs can be uniformly encapsulated, and then the PLC type identification information in the PLC is attempted to realize the automatic identification of the PLC type and the communication parameters.
  • the unified package of communication protocols and/or communication parameters of various types of PLCs enables the host computer to meet the communication with most types of PLCs, improving the versatility of the host computer and the flexibility of PLC selection.
  • the automatic identification of communication protocols and/or communication parameters of various types of PLCs also eliminates the need to manually select PLC types and communication parameters to improve communication efficiency.
  • FIG. 1 is a schematic structural view of a host computer provided by the present invention.
  • FIG. 1 is a schematic structural view of a host computer provided by the present invention.
  • the present invention provides a host computer for communicating with a PLC, the host computer comprising: a receiving port 10 for receiving a command for connecting the PLC; and a controller 20 for After receiving the command, the receiving port adopts a pre-stored communication protocol and/or communication parameters for a plurality of PLC types one by one, and attempts to read the PLC type identification information in the PLC, and after the reading is successful, determine
  • the communication protocol and communication parameters of the PLC are communication protocols and communication parameters used when successfully reading the PLC type identifier; and communicating with the PLC by using the determined communication protocol and communication parameters.
  • the communication protocol may include a TCP/IP communication protocol and a serial communication protocol, etc.
  • the communication parameters may include one or more of the following: an IP address, a port number, a serial port number, a baud rate, and an MPI address.
  • the present invention is not limited thereto, and communication protocols and communication parameters required for communication with any type of PLC are applicable thereto.
  • the receiving port 10 may further receive a PLC type of the PLC; the controller 20 may further be configured to adopt the stored communication parameters one by one in a case of adopting a communication protocol corresponding to the received PLC type.
  • the controller 20 may further be configured to adopt the stored communication parameters one by one in a case of adopting a communication protocol corresponding to the received PLC type.
  • Trying to read the PLC type identification information in the PLC, and after the reading is successful determining that the communication protocol of the PLC is the communication protocol corresponding to the received PLC type, and the communication parameter of the PLC is successfully read.
  • the pass adopted by the PLC type identification Letter parameters Thereby, in the case that the PLC type is known, the communication protocol corresponding to the PLC type is used, and the communication parameters corresponding to the communication protocol are tried one by one, compared to each communication protocol and each corresponding one of them is tried one by one.
  • the communication parameters can reduce the time required to determine the communication protocol and communication parameters, and improve the speed of establishing a connection between
  • the receiving port 10 can also receive communication parameters of the PLC; the controller
  • the 20 can also be used to adopt the stored communication protocol one by one, attempt to read the PLC type identification information in the PLC, and determine the communication protocol of the PLC after the reading is successful, using the received communication parameters.
  • the communication parameter of the PLC is the received communication parameter.
  • the present invention provides a method for communicating with a PLC, the method comprising: receiving a command to connect to the PLC; adopting a pre-stored communication protocol for a plurality of PLC types one by one and / or communication parameters, try to read the PLC type identification information in the PLC, and after the reading is successful, determine the communication protocol and communication parameters of the PLC are the communication protocols used when successfully reading the PLC type identification and Communication parameters; and communicating with the PLC using the determined communication protocol and communication parameters.
  • the communication parameter may include one or more of the following: an IP address, a port number, a serial port number, a baud rate, and an MPI address.
  • the method may further include: receiving a PLC type of the PLC; the step of determining a communication protocol and/or a communication parameter of the PLC includes: in a case of adopting a communication protocol corresponding to the received PLC type, Using the stored communication parameters one by one, attempting to read the PLC type identification information in the PLC, and after the reading is successful, determining that the communication protocol of the PLC is the communication protocol corresponding to the received PLC type, the PLC Communication parameters for successful reading The communication parameters used in the description of the PLC type.
  • the method may further include: receiving a communication parameter of the PLC; the step of determining a communication protocol and/or a communication parameter of the PLC includes: using the stored communication parameter one by one, using the stored one by one a communication protocol, attempting to read the PLC type identification information in the PLC, and after the reading is successful, determining that the communication protocol of the PLC is a communication protocol used when successfully reading the PLC type identifier, the PLC
  • the communication parameters are the received communication parameters.
  • the communication protocol and/or communication parameters of various types of PLCs can be uniformly encapsulated, and then the PLC type identification information in the PLC is attempted to realize the automatic identification of the PLC type and the communication parameters.
  • the unified package of communication protocols and/or communication parameters of various types of PLCs enables the host computer to meet the communication with most types of PLCs, improving the versatility of the host computer and the flexibility of PLC selection.
  • the automatic identification of communication protocols and/or communication parameters of various types of PLCs also eliminates the need to manually select PLC types and communication parameters to improve communication efficiency.
  • the mixing station control system needs to develop different versions of the upper computer interface program for the upper computer each time, and the workload is quite large, the efficiency is low, and the failure rate is high.
  • the solution of the invention any replacement of different types of PLCs can be realized without changing the upper computer, and the working efficiency is greatly improved.
  • the specific application of the present invention is not limited to a mixing station, and any field in which such communication with a PLC is required may be employed.

Landscapes

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

Abstract

Disclosed are a method for communicating with a PLC and an upper computer. The method includes: receiving a command of connecting a PLC; attempting to read PLC type identifier information inside the PLC using pre-stored communication protocols and/or communication parameters for various types of PLCs one by one, and after the reading is successful, determining the communication protocol and communication parameter of the PLC as the communication protocol and communication parameter employed when successfully reading the PLC type identifier; and communicating with the PLC using the determined communication protocol and communication parameter. The uniform encapsulation of the communication protocols and/or communication parameters of various types of PLCs can enable an upper computer to communication with most types of PLCs, improving the universality of the upper computer and the flexibility of PLC selection. In addition, the automatic identification of the communication protocols and/or communication parameters of various types of PLCs can remove the work of manually selecting a PLC type or communication parameter, improving communication efficiency.

Description

一种用于与 PLC进行通信的方法及上位机  Method for communicating with PLC and upper computer
技术领域  Technical field
本发明涉及通信领域, 具体地, 涉及一种用于与 PLC进行通信的方法 及上位机。 背景技术  The present invention relates to the field of communications, and in particular, to a method for communicating with a PLC and a host computer. Background technique
目前搅拌站普遍采用上位机对与该上位机相连的 PLC进行通信, 对于 不同类型的 PLC, 需针对上位机开发不同版本的上位机接口程序, 从而使 得该上位机可与该不同类型的 PLC进行通信, 以实现数据的读写。  At present, the mixing station generally uses the upper computer to communicate with the PLC connected to the upper computer. For different types of PLC, different versions of the upper computer interface program need to be developed for the upper computer, so that the upper computer can perform with the different types of PLC. Communication to achieve data read and write.
上述通信方式存在着以下缺陷: (1 ) 上位机通用性不高, 仅可与常用 类型的 PLC进行通信, 对于非常用类型的 PLC, 则需于上位机内添加针对 该非常用类型的 PLC的接口程序, 开发周期长, 版本管理困难; (2) 此种 通信方式导致搅拌站控制部分在生产及后期维护过程中, PLC 的选择很不 灵活, 生产及维护成本增大。 发明内容  The above communication methods have the following defects: (1) The versatility of the host computer is not high, and it can only communicate with the PLC of the common type. For a PLC of a very type, it is necessary to add a PLC for the very type of PLC in the host computer. Interface program, long development cycle, difficult to manage version; (2) This type of communication causes the control part of the mixing station to be inflexible during production and post-maintenance, and the production and maintenance costs increase. Summary of the invention
本发明的目的是提供一种用于与 PLC进行通信的方法及上位机, 该方 法及上位机具有很高的通用性, 使得 PLC的选择更为灵活。  The object of the present invention is to provide a method for communicating with a PLC and a host computer. The method and the host computer have high versatility, which makes the selection of the PLC more flexible.
为了实现上述目的, 本发明提供一种用于与 PLC进行通信的上位机, 该上位机包括: 接收端口, 用于接收连接所述 PLC的命令; 以及控制器, 用于在所述接收端口接收到所述命令之后, 逐一采用预先存储的针对多种 PLC类型的通信协议和 /或通信参数, 尝试读取所述 PLC内的 PLC类型标 识信息, 并在读取成功之后, 确定所述 PLC的通信协议及通信参数为成功 读取该 PLC类型标识时所采用的通信协议及通信参数; 以及采用所确定的 通信协议及通信参数, 与所述 PLC进行通信。 In order to achieve the above object, the present invention provides a host computer for communicating with a PLC, the host computer comprising: a receiving port for receiving a command for connecting the PLC; and a controller for receiving at the receiving port After the command, the pre-stored communication protocols and/or communication parameters for a plurality of PLC types are used one by one, and the PLC type identification information in the PLC is attempted to be read, and after the reading is successful, the PLC is determined. The communication protocol and the communication parameter are communication protocols and communication parameters used when successfully reading the PLC type identifier; and adopting the determined The communication protocol and communication parameters communicate with the PLC.
相应地,本发明还提供一种用于与 PLC进行通信的方法,该方法包括: 接收连接所述 PLC的命令;逐一采用预先存储的针对多种 PLC类型的通信 协议和 /或通信参数, 尝试读取所述 PLC内的 PLC类型标识信息, 并在读 取成功之后,确定所述 PLC的通信协议及通信参数为成功读取该 PLC类型 标识时所采用的通信协议及通信参数; 以及采用所确定的通信协议及通信 参数, 与所述 PLC进行通信。  Accordingly, the present invention also provides a method for communicating with a PLC, the method comprising: receiving a command to connect to the PLC; using a pre-stored communication protocol and/or communication parameters for a plurality of PLC types one by one, attempting Reading the PLC type identification information in the PLC, and after the reading is successful, determining the communication protocol and the communication parameter of the PLC as the communication protocol and the communication parameter used when successfully reading the PLC type identifier; The determined communication protocol and communication parameters are communicated with the PLC.
通过上述技术方案,可对多种类型 PLC的通信协议和 /或通信参数进行 统一封装, 之后通过尝试读取所述 PLC内的 PLC类型标识信息, 实现 PLC 类型及通信参数的自动识别。多种类型 PLC的通信协议和 /或通信参数的统 一封装可使得上位机可满足与大多数类型 PLC的通信, 提高了上位机的通 用性及 PLC选择的灵活性。 另外, 多种类型 PLC的通信协议和 /或通信参 数的自动识别亦可省去人为选择 PLC类型及通信参数的工作, 提高通信效 率。  Through the above technical solution, the communication protocol and/or communication parameters of various types of PLCs can be uniformly encapsulated, and then the PLC type identification information in the PLC is attempted to realize the automatic identification of the PLC type and the communication parameters. The unified package of communication protocols and/or communication parameters of various types of PLCs enables the host computer to meet the communication with most types of PLCs, improving the versatility of the host computer and the flexibility of PLC selection. In addition, the automatic identification of communication protocols and/or communication parameters of various types of PLCs also eliminates the need to manually select PLC types and communication parameters to improve communication efficiency.
本发明的其他特征和优点将在随后的具体实施方式部分予以详细说 明。 附图说明  Other features and advantages of the invention will be described in detail in the detailed description which follows. DRAWINGS
附图是用来提供对本发明的进一步理解, 并且构成说明书的一部分, 与下面的具体实施方式一起用于解释本发明, 但并不构成对本发明的限制。 在附图中:  The drawings are intended to provide a further understanding of the invention, and are in the In the drawing:
图 1为本发明提供的上位机的结构示意图; 以及  1 is a schematic structural view of a host computer provided by the present invention;
图 2为本发明提供的用于与 PLC进行通信的方法的流程图。 附图标记说明  2 is a flow chart of a method for communicating with a PLC provided by the present invention. Description of the reference numerals
10 接收端口 20 控制器 具体实施方式 10 Receive Port 20 Controller detailed description
以下结合附图对本发明的具体实施方式进行详细说明。应当理解的是, 此处所描述的具体实施方式仅用于说明和解释本发明, 并不用于限制本发 明。  The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It is to be understood that the specific embodiments described herein are intended to be illustrative and not restrictive.
图 1为本发明提供的上位机的结构示意图。 如图 1所示, 本发明提供 了一种用于与 PLC进行通信的上位机, 该上位机包括: 接收端口 10, 用于 接收连接所述 PLC的命令; 以及控制器 20, 用于在所述接收端口接收到所 述命令之后,逐一采用预先存储的针对多种 PLC类型的通信协议和 /或通信 参数, 尝试读取所述 PLC内的 PLC类型标识信息, 并在读取成功之后, 确 定所述 PLC的通信协议及通信参数为成功读取该 PLC类型标识时所采用的 通信协议及通信参数;以及采用所确定的通信协议及通信参数,与所述 PLC 进行通信。  FIG. 1 is a schematic structural view of a host computer provided by the present invention. As shown in FIG. 1, the present invention provides a host computer for communicating with a PLC, the host computer comprising: a receiving port 10 for receiving a command for connecting the PLC; and a controller 20 for After receiving the command, the receiving port adopts a pre-stored communication protocol and/or communication parameters for a plurality of PLC types one by one, and attempts to read the PLC type identification information in the PLC, and after the reading is successful, determine The communication protocol and communication parameters of the PLC are communication protocols and communication parameters used when successfully reading the PLC type identifier; and communicating with the PLC by using the determined communication protocol and communication parameters.
为了与不同类型的 PLC进行通信,需指定不同的通信协议及通信参数, 诸如对于欧姆龙网络通信 PLC 以及西门子网络通信 PLC而言, 则需采用 TCT/IP通信协议, 且需指明 IP地址及端口号; 对于欧姆龙串口通信 PLC 而言,则需采用串口通信协议,且需指明串口号及波特率;对于西门子 5611 卡通信而言, 则需指明 MPI地址。  In order to communicate with different types of PLCs, different communication protocols and communication parameters must be specified. For example, for OMRON network communication PLC and Siemens network communication PLC, TCT/IP communication protocol is required, and the IP address and port number must be specified. For the Omron serial communication PLC, the serial communication protocol is required, and the serial port number and baud rate are required. For the Siemens 5611 card communication, the MPI address needs to be specified.
所述通信协议可包括 TCP/IP通信协议及串口通信协议等, 所述通信参 数可包括以下各项中的一者或多者: IP 地址、 端口号、 串口号、 波特率、 MPI地址。 然而本发明并不限于此, 与任何类型的 PLC进行通信所需的通 信协议及通信参数皆可适用于此。  The communication protocol may include a TCP/IP communication protocol and a serial communication protocol, etc., and the communication parameters may include one or more of the following: an IP address, a port number, a serial port number, a baud rate, and an MPI address. However, the present invention is not limited thereto, and communication protocols and communication parameters required for communication with any type of PLC are applicable thereto.
优选地, 所述接收端口 10可还接收所述 PLC的 PLC类型; 所述控制 器 20可还用于在采用所接收的 PLC类型所对应的通信协议的情况下,逐一 采用所存储的通信参数, 尝试读取所述 PLC内的 PLC类型标识信息, 并在 读取成功之后,确定所述 PLC的通信协议为所接收的 PLC类型所对应的通 信协议,所述 PLC的通信参数为成功读取所述 PLC类型标识时所采用的通 信参数。 藉此, 可在知晓 PLC类型的情况下, 采用该 PLC类型所对应的通 信协议, 逐一尝试该通信协议所可能对应的通信参数, 相比于逐一尝试每 一通信协议及其所对应的每一通信参数, 可减少确定通信协议及通信参数 所需时间, 提高上位机与 PLC之间建立连接的速度。 Preferably, the receiving port 10 may further receive a PLC type of the PLC; the controller 20 may further be configured to adopt the stored communication parameters one by one in a case of adopting a communication protocol corresponding to the received PLC type. Trying to read the PLC type identification information in the PLC, and after the reading is successful, determining that the communication protocol of the PLC is the communication protocol corresponding to the received PLC type, and the communication parameter of the PLC is successfully read. The pass adopted by the PLC type identification Letter parameters. Thereby, in the case that the PLC type is known, the communication protocol corresponding to the PLC type is used, and the communication parameters corresponding to the communication protocol are tried one by one, compared to each communication protocol and each corresponding one of them is tried one by one. The communication parameters can reduce the time required to determine the communication protocol and communication parameters, and improve the speed of establishing a connection between the host computer and the PLC.
优选地,所述接收端口 10还可接收所述 PLC的通信参数;所述控制器 Preferably, the receiving port 10 can also receive communication parameters of the PLC; the controller
20还可用于在采用所接收的通信参数的情况下, 逐一采用所存储的通信协 议, 尝试读取所述 PLC内的 PLC类型标识信息, 并在读取成功之后, 确定 所述 PLC的通信协议为成功读取所述 PLC类型标识时所采用的通信协议, 所述 PLC的通信参数为所接收的通信参数。 藉此, 可在知晓通信参数的情 况下, 逐一尝试该通信参数所可能对应的通信协议, 相比于逐一尝试每一 通信协议及其所对应的每一通信参数, 可减少确定通信协议及通信参数所 需时间, 提高上位机与 PLC之间建立连接的速度。 20 can also be used to adopt the stored communication protocol one by one, attempt to read the PLC type identification information in the PLC, and determine the communication protocol of the PLC after the reading is successful, using the received communication parameters. In order to successfully read the communication protocol used in the PLC type identification, the communication parameter of the PLC is the received communication parameter. Thereby, in the case of knowing the communication parameters, the communication protocol corresponding to the communication parameter may be tried one by one, and the determination of the communication protocol and the communication may be reduced compared to each communication protocol and each communication parameter corresponding thereto are tried one by one. The time required for the parameter increases the speed at which the connection between the host computer and the PLC is established.
图 2为本发明提供的用于与 PLC进行通信的方法的流程图。 如图 2所 示, 相应地, 本发明提供了一种用于与 PLC进行通信的方法, 该方法包括: 接收连接所述 PLC的命令;逐一采用预先存储的针对多种 PLC类型的通信 协议和 /或通信参数, 尝试读取所述 PLC内的 PLC类型标识信息, 并在读 取成功之后,确定所述 PLC的通信协议及通信参数为成功读取该 PLC类型 标识时所采用的通信协议及通信参数; 以及采用所确定的通信协议及通信 参数, 与所述 PLC进行通信。  2 is a flow chart of a method for communicating with a PLC provided by the present invention. As shown in FIG. 2, correspondingly, the present invention provides a method for communicating with a PLC, the method comprising: receiving a command to connect to the PLC; adopting a pre-stored communication protocol for a plurality of PLC types one by one and / or communication parameters, try to read the PLC type identification information in the PLC, and after the reading is successful, determine the communication protocol and communication parameters of the PLC are the communication protocols used when successfully reading the PLC type identification and Communication parameters; and communicating with the PLC using the determined communication protocol and communication parameters.
其中, 所述通信参数可包括以下各项中的一者或多者: IP地址、 端口 号、 串口号、 波特率、 MPI地址。  The communication parameter may include one or more of the following: an IP address, a port number, a serial port number, a baud rate, and an MPI address.
其中, 该方法还可包括: 接收所述 PLC 的 PLC类型; 所述确定所述 PLC的通信协议和 /或通信参数的步骤包括:在采用所接收的 PLC类型所对 应的通信协议的情况下, 逐一采用所存储的通信参数, 尝试读取所述 PLC 内的 PLC类型标识信息, 并在读取成功之后, 确定所述 PLC的通信协议为 所接收的 PLC类型所对应的通信协议,所述 PLC的通信参数为成功读取所 述 PLC类型标识时所采用的通信参数。 The method may further include: receiving a PLC type of the PLC; the step of determining a communication protocol and/or a communication parameter of the PLC includes: in a case of adopting a communication protocol corresponding to the received PLC type, Using the stored communication parameters one by one, attempting to read the PLC type identification information in the PLC, and after the reading is successful, determining that the communication protocol of the PLC is the communication protocol corresponding to the received PLC type, the PLC Communication parameters for successful reading The communication parameters used in the description of the PLC type.
其中,该方法还可包括:接收所述 PLC的通信参数;所述确定所述 PLC 的通信协议和 /或通信参数的步骤包括:在采用所接收的通信参数的情况下, 逐一采用所存储的通信协议, 尝试读取所述 PLC内的 PLC类型标识信息, 并在读取成功之后,确定所述 PLC的通信协议为成功读取所述 PLC类型标 识时所采用的通信协议, 所述 PLC的通信参数为所接收的通信参数。  The method may further include: receiving a communication parameter of the PLC; the step of determining a communication protocol and/or a communication parameter of the PLC includes: using the stored communication parameter one by one, using the stored one by one a communication protocol, attempting to read the PLC type identification information in the PLC, and after the reading is successful, determining that the communication protocol of the PLC is a communication protocol used when successfully reading the PLC type identifier, the PLC The communication parameters are the received communication parameters.
有关该用于与 PLC 进行通信的方法的具体细节及有益效果与上述与 PLC进行通信的上位机的相同, 于此不再赘述。  The specific details and beneficial effects of the method for communicating with the PLC are the same as those of the upper computer that communicates with the PLC, and will not be described herein.
通过上述技术方案,可对多种类型 PLC的通信协议和 /或通信参数进行 统一封装, 之后通过尝试读取所述 PLC内的 PLC类型标识信息, 实现 PLC 类型及通信参数的自动识别。多种类型 PLC的通信协议和 /或通信参数的统 一封装可使得上位机可满足与大多数类型 PLC的通信, 提高了上位机的通 用性及 PLC选择的灵活性。 另外, 多种类型 PLC的通信协议和 /或通信参 数的自动识别亦可省去人为选择 PLC类型及通信参数的工作, 提高通信效 率。  Through the above technical solution, the communication protocol and/or communication parameters of various types of PLCs can be uniformly encapsulated, and then the PLC type identification information in the PLC is attempted to realize the automatic identification of the PLC type and the communication parameters. The unified package of communication protocols and/or communication parameters of various types of PLCs enables the host computer to meet the communication with most types of PLCs, improving the versatility of the host computer and the flexibility of PLC selection. In addition, the automatic identification of communication protocols and/or communication parameters of various types of PLCs also eliminates the need to manually select PLC types and communication parameters to improve communication efficiency.
相比于现有技术, 搅拌站控制系统每次更换一种 PLC, 则需于针对上 位机开发不同版本的上位机接口程序, 工作量相当大, 效率低下, 且故障 率很高。 通过采用本发明的方案, 可在不改变上位机的情况下, 实现不同 类型 PLC的任意更换, 大大提高了工作效率。  Compared with the prior art, the mixing station control system needs to develop different versions of the upper computer interface program for the upper computer each time, and the workload is quite large, the efficiency is low, and the failure rate is high. By adopting the solution of the invention, any replacement of different types of PLCs can be realized without changing the upper computer, and the working efficiency is greatly improved.
本发明的具体应用并不限于搅拌站, 任何需要此类与 PLC进行通信的 领域皆可采用本发明。  The specific application of the present invention is not limited to a mixing station, and any field in which such communication with a PLC is required may be employed.
以上结合附图详细描述了本发明的优选实施方式, 但是, 本发明并不 限于上述实施方式中的具体细节, 在本发明的技术构思范围内, 可以对本 发明的技术方案进行多种简单变型, 这些简单变型均属于本发明的保护范 围。  The preferred embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the specific details of the above embodiments, and various simple modifications of the technical solutions of the present invention may be made within the scope of the technical idea of the present invention. These simple variations are within the scope of the invention.
另外需要说明的是, 在上述具体实施方式中所描述的各个具体技术特 征, 在不矛盾的情况下, 可以通过任何合适的方式进行组合。 为了避免不 必要的重复, 本发明对各种可能的组合方式不再另行说明。 In addition, it should be noted that each specific technical method described in the above specific embodiments is specifically described. In the case of no contradiction, it can be combined in any suitable way. In order to avoid unnecessary repetition, the present invention will not be further described in various possible combinations.
此外, 本发明的各种不同的实施方式之间也可以进行任意组合, 只要 其不违背本发明的思想, 其同样应当视为本发明所公开的内容。  In addition, any combination of various embodiments of the invention may be made, as long as it does not deviate from the idea of the invention, and should also be regarded as the disclosure of the invention.

Claims

权利要求 Rights request
1、 一种用于与 PLC进行通信的上位机, 其特征在于, 该上位机包括: 接收端口 (10), 用于接收连接所述 PLC的命令; 以及 1. A host computer for communicating with a PLC, wherein the host computer comprises: a receiving port (10) for receiving a command for connecting the PLC;
控制器 (20), 用于在所述接收端口接收到所述命令之后, 逐一采用预 先存储的针对多种 PLC类型的通信协议和 /或通信参数,尝试读取所述 PLC 内的 PLC类型标识信息, 并在读取成功之后, 确定所述 PLC的通信协议及 通信参数为成功读取该 PLC类型标识时所采用的通信协议及通信参数; 以 及采用所确定的通信协议及通信参数, 与所述 PLC进行通信。  a controller (20), configured to: after the receiving port receives the command, try to read a PLC type identifier in the PLC by using a pre-stored communication protocol and/or communication parameter for multiple PLC types one by one Information, and after successful reading, determining the communication protocol and communication parameters of the PLC are communication protocols and communication parameters used when successfully reading the PLC type identifier; and adopting the determined communication protocol and communication parameters, and The PLC communicates.
2、 根据权利要求 1所述的上位机, 其特征在于, 所述通信参数包括以 下各项中的一者或多者: IP地址、 端口号、 串口号、 波特率、 MPI地址。 2. The host computer according to claim 1, wherein the communication parameter comprises one or more of the following: an IP address, a port number, a serial port number, a baud rate, and an MPI address.
3、 根据权利要求 1所述的上位机, 其特征在于, 3. The host computer according to claim 1, wherein:
所述接收端口 ( 10) 还接收所述 PLC的 PLC类型;  The receiving port (10) also receives a PLC type of the PLC;
所述控制器 (20) 还用于在采用所接收的 PLC类型所对应的通信协议 的情况下, 逐一采用所存储的通信参数, 尝试读取所述 PLC内的 PLC类型 标识信息, 并在读取成功之后, 确定所述 PLC的通信协议为所接收的 PLC 类型所对应的通信协议,所述 PLC的通信参数为成功读取所述 PLC类型标 识时所采用的通信参数。  The controller (20) is further configured to: when using the communication protocol corresponding to the received PLC type, use the stored communication parameters one by one, try to read the PLC type identification information in the PLC, and read After the success, the communication protocol of the PLC is determined to be a communication protocol corresponding to the received PLC type, and the communication parameter of the PLC is a communication parameter used when the PLC type identifier is successfully read.
4、 根据权利要求 1所述的上位机, 其特征在于, 4. The host computer according to claim 1, wherein:
所述接收端口 (10) 还接收所述 PLC的通信参数;  The receiving port (10) also receives communication parameters of the PLC;
所述控制器 (20) 还用于在采用所接收的通信参数的情况下, 逐一采 用所存储的通信协议, 尝试读取所述 PLC内的 PLC类型标识信息, 并在读 取成功之后,确定所述 PLC的通信协议为成功读取所述 PLC类型标识时所 采用的通信协议, 所述 PLC的通信参数为所接收的通信参数。 The controller (20) is further configured to use the stored communication protocol one by one to attempt to read the PLC type identification information in the PLC, and after the reading is successful, determine, by using the received communication parameters. The communication protocol of the PLC is when the PLC type identifier is successfully read. The communication protocol adopted, the communication parameter of the PLC is the received communication parameter.
5、 一种用于与 PLC进行通信的方法, 其特征在于, 该方法包括: 接收连接所述 PLC的命令; 5. A method for communicating with a PLC, the method comprising: receiving a command to connect to the PLC;
逐一采用预先存储的针对多种 PLC类型的通信协议和 /或通信参数,尝 试读取所述 PLC 内的 PLC类型标识信息, 并在读取成功之后, 确定所述 PLC的通信协议及通信参数为成功读取该 PLC类型标识时所采用的通信协 议及通信参数; 以及  Using pre-stored communication protocols and/or communication parameters for a plurality of PLC types one by one, attempting to read PLC type identification information in the PLC, and after reading successfully, determining that the communication protocol and communication parameters of the PLC are Communication protocol and communication parameters used when successfully reading the PLC type identifier;
采用所确定的通信协议及通信参数, 与所述 PLC进行通信。  Communicating with the PLC using the determined communication protocol and communication parameters.
6、 根据权利要求 5所述的方法, 其特征在于, 所述通信参数包括以下 各项中的一者或多者: IP地址、 端口号、 串口号、 波特率、 MPI地址。 6. The method according to claim 5, wherein the communication parameter comprises one or more of the following: an IP address, a port number, a serial port number, a baud rate, and an MPI address.
7、 根据权利要求 5所述的方法, 其特征在于, 该方法还包括: 接收所 述 PLC的 PLC类型; 7. The method of claim 5, further comprising: receiving a PLC type of the PLC;
所述确定所述 PLC的通信协议和 /或通信参数的步骤包括:在采用所接 收的 PLC类型所对应的通信协议的情况下, 逐一采用所存储的通信参数, 尝试读取所述 PLC内的 PLC类型标识信息, 并在读取成功之后, 确定所述 PLC的通信协议为所接收的 PLC类型所对应的通信协议,所述 PLC的通信 参数为成功读取所述 PLC类型标识时所采用的通信参数。  The step of determining a communication protocol and/or a communication parameter of the PLC includes: using the stored communication parameters one by one in a case of adopting a communication protocol corresponding to the received PLC type, attempting to read the PLC The PLC type identifies information, and after the reading is successful, determines that the communication protocol of the PLC is a communication protocol corresponding to the received PLC type, and the communication parameter of the PLC is used when the PLC type identifier is successfully read. Communication parameters.
8、 根据权利要求 5所述的方法, 其特征在于, 该方法还包括: 接收所 述 PLC的通信参数; 8. The method of claim 5, further comprising: receiving communication parameters of the PLC;
所述确定所述 PLC的通信协议和 /或通信参数的步骤包括:在采用所接 收的通信参数的情况下, 逐一采用所存储的通信协议, 尝试读取所述 PLC 内的 PLC类型标识信息, 并在读取成功之后, 确定所述 PLC的通信协议为 成功读取所述 PLC类型标识时所采用的通信协议,所述 PLC的通信参数为 所接收的通信参数。 The step of determining a communication protocol and/or a communication parameter of the PLC includes: using the stored communication protocol one by one, attempting to read the PLC type identification information in the PLC, using the received communication parameters, And after the reading is successful, determining that the communication protocol of the PLC is The communication protocol used when the PLC type identifier is successfully read, and the communication parameter of the PLC is the received communication parameter.
PCT/CN2011/079364 2011-09-06 2011-09-06 Method for communicating with plc and upper computer WO2013033889A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2011/079364 WO2013033889A1 (en) 2011-09-06 2011-09-06 Method for communicating with plc and upper computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2011/079364 WO2013033889A1 (en) 2011-09-06 2011-09-06 Method for communicating with plc and upper computer

Publications (1)

Publication Number Publication Date
WO2013033889A1 true WO2013033889A1 (en) 2013-03-14

Family

ID=47831433

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/079364 WO2013033889A1 (en) 2011-09-06 2011-09-06 Method for communicating with plc and upper computer

Country Status (1)

Country Link
WO (1) WO2013033889A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102018006724A1 (en) 2017-09-18 2019-03-21 Sew-Eurodrive Gmbh & Co Kg Drive system for carrying out a test method and method for testing a drive system
US11778072B2 (en) 2018-08-27 2023-10-03 Phoenix Contact Gmbh & Co. Kg Control and data transfer system for supporting different communication protocols and an adapter module

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101013313A (en) * 2007-01-15 2007-08-08 大连光洋科技工程有限公司 Bus protocol analysis chip for servocontrol
CN101178596A (en) * 2006-11-09 2008-05-14 南通明兴科技开发有限公司 Communication method between superior machine and PLC in monitoring system
CN101262486A (en) * 2008-04-18 2008-09-10 清华大学 Modbus bus analysis system based on built-in platform
CN201903776U (en) * 2010-09-10 2011-07-20 中国电器科学研究院 Field bus control system for surface treatment production line
CN102354191A (en) * 2011-09-06 2012-02-15 中联重科股份有限公司 Method for communicating with PLCs (Programmable Logic Controllers) and upper computer

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101178596A (en) * 2006-11-09 2008-05-14 南通明兴科技开发有限公司 Communication method between superior machine and PLC in monitoring system
CN101013313A (en) * 2007-01-15 2007-08-08 大连光洋科技工程有限公司 Bus protocol analysis chip for servocontrol
CN101262486A (en) * 2008-04-18 2008-09-10 清华大学 Modbus bus analysis system based on built-in platform
CN201903776U (en) * 2010-09-10 2011-07-20 中国电器科学研究院 Field bus control system for surface treatment production line
CN102354191A (en) * 2011-09-06 2012-02-15 中联重科股份有限公司 Method for communicating with PLCs (Programmable Logic Controllers) and upper computer

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102018006724A1 (en) 2017-09-18 2019-03-21 Sew-Eurodrive Gmbh & Co Kg Drive system for carrying out a test method and method for testing a drive system
US11778072B2 (en) 2018-08-27 2023-10-03 Phoenix Contact Gmbh & Co. Kg Control and data transfer system for supporting different communication protocols and an adapter module

Similar Documents

Publication Publication Date Title
CN102354191B (en) Method for communicating with PLCs (Programmable Logic Controllers) and upper computer
CN105260337B (en) A kind of automatic addressing method and system of single-chip microcomputer
EP2169978A1 (en) Equipment and method to implement adaptive functions of communication protocols
CN101542980B (en) Method for the operation of an ethernet-compatible field bus device
CN104780054B (en) A kind of gateway to the wake-up of control area net(CAN) network or suspend mode
CN107926075A (en) The system and method for supporting the data communication under isomerous environment
WO2013071709A1 (en) Wireless broadband data card supporting accessing network in 3g and wi-fi manners
CN104283749A (en) Communication system based on RS-485 half-duplex bus and service disc communication upgrading method
CN105704206A (en) Implementation method for performing Ethernet communication with LED display control card
CN106982222A (en) The multi-protocol data cut-in method and device that can configure under a kind of industrial 4.0 environment
CN103580942A (en) Simulation serial port testing method and device
CN109981360A (en) Internet of things equipment website activating method, device, system and storage medium
CN102710629B (en) Method for connecting network and system
CN112787893A (en) Remote diagnosis method, device, electronic equipment and storage medium
WO2013033889A1 (en) Method for communicating with plc and upper computer
US20080263191A1 (en) Method and system for handling packet filtering information
CN103905498B (en) Service information management method and service information management system
CN107566526A (en) A kind of device based on Web configuration RTU parameters
CN102737003B (en) A kind of method and device of simulating USB device
CN104102607A (en) CAN (controlled area network) bus driving method and system based on VxWorks operating system environment
CN111404739B (en) System for configuring serial port networking attribute
WO2015058413A1 (en) Data configuration method and network management server
CN104797004A (en) Method for implementation of automatic networking between master and slave devices
WO2012065452A1 (en) Home automation system, control method thereof, and information processing center device
CN104753746A (en) Device accessing method and control server

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11872084

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11872084

Country of ref document: EP

Kind code of ref document: A1