CN111800435A - Motion controller and communication method of motion controller and equipment - Google Patents

Motion controller and communication method of motion controller and equipment Download PDF

Info

Publication number
CN111800435A
CN111800435A CN202010733908.9A CN202010733908A CN111800435A CN 111800435 A CN111800435 A CN 111800435A CN 202010733908 A CN202010733908 A CN 202010733908A CN 111800435 A CN111800435 A CN 111800435A
Authority
CN
China
Prior art keywords
motion controller
lcom
communication
equipment
tcp
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.)
Pending
Application number
CN202010733908.9A
Other languages
Chinese (zh)
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.)
Siemens Ltd China
Original Assignee
Siemens Ltd China
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 Siemens Ltd China filed Critical Siemens Ltd China
Priority to CN202010733908.9A priority Critical patent/CN111800435A/en
Publication of CN111800435A publication Critical patent/CN111800435A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/163In-band adaptation of TCP data exchange; In-band control procedures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40228Modbus

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Communication Control (AREA)

Abstract

A method of communicating a motion controller with a device, comprising the steps of: leading in an LCom application library in the motion controller and calling an LCom function module in the LCom application library; setting a client program for establishing TCP communication on the equipment; and the motion controller establishes communication with the client program of the equipment through a TCP protocol through an LCom function module in the LCom application library. The communication method of the motion controller and the equipment ensures the communication quality between the motion controller and the equipment, has higher communication transmission data volume, and is convenient for inquiring historical transmission information for diagnosis. The invention also provides a motion controller used for the communication method of the motion controller and the equipment.

Description

Motion controller and communication method of motion controller and equipment
Technical Field
The invention relates to a motion controller, in particular to a motion controller capable of communicating with equipment by adopting a ModBus TCP protocol. The invention also relates to a motion controller for the communication method of the motion controller and the equipment.
Background
SIMOTION motion controllers in siemens typically need to communicate with third party devices using the ModBus TCP protocol. Basic TCP communication can only be established from the bottom layer. This method is not only not guaranteed in terms of communication quality, diagnosis, and amount of information to be transmitted, but also causes communication quality to be uneven due to different standards for programming functional blocks.
Disclosure of Invention
The invention aims to provide a communication method of a motion controller and equipment, which ensures the communication quality between the motion controller and the equipment, has higher communication transmission data volume and is convenient for inquiring historical transmission information for diagnosis.
Another object of the present invention is to provide a motion controller, which can ensure the communication quality with the device, and the communication transmission data volume is higher, and it is also convenient to inquire the historical transmission information for diagnosis.
The invention provides a communication method of a motion controller and equipment, which comprises the following steps:
leading in an LCom application library in the motion controller and calling an LCom function module in the LCom application library;
setting a client program for establishing TCP communication on the equipment; and
and the motion controller establishes communication with a client program of the equipment through a TCP (transmission control protocol) through an LCom function module in the LCom application library.
According to the communication method between the motion controller and the equipment, the motion controller calls the LCom function module in the LCom application library to communicate with the third-party equipment based on the LCom TCP protocol by importing the LCom application library into the motion controller. Compared with a method for establishing basic TCP communication from a bottom layer, the communication method of the motion controller and the equipment provided by the invention can further ensure the communication quality between the motion controller and the equipment, has higher communication transmission data volume and is convenient for inquiring historical transmission information for diagnosis.
In yet another exemplary embodiment of a method of communicating a motion controller with a device, the method further comprises the steps of:
and embedding an instruction analysis code corresponding to each function code of the ModBus in the LCom application library.
In still another exemplary embodiment of a communication method of a motion controller and a device, a client program provided on the device is used to define an IP address, a port number, a master-slave relationship, and a received data length.
In another exemplary embodiment of a method of communication of a motion controller with a device, the steps of: the method for establishing communication between the motion controller and the client program of the equipment through the LCom function module in the LCom application library through the TCP specifically comprises the following steps:
initializing an LCom function module, and particularly defining a communication dual IP address, a port number and a master-slave relationship; and
and starting the LCom function module to establish communication with the equipment through the TCP protocol.
In another exemplary embodiment of a method of communication of a motion controller with a device, the steps of: the client program for establishing TCP communication is specifically set on the equipment by writing the client program by the upper computer in C # language and configuring the equipment.
The invention also provides a motion controller, which comprises an LCom application library which is provided with a plurality of LCom functional modules. The motion controller can establish communication with a device provided with a client program for establishing TCP communication through a TCP protocol via a plurality of LCom function modules.
In yet another exemplary embodiment of the motion controller, an instruction resolution code corresponding to each function code of the ModBus protocol is embedded in the LCom application library.
Drawings
The following drawings are only schematic illustrations and explanations of the present invention, and do not limit the scope of the present invention.
FIG. 1 is a flow chart of one illustrative embodiment of a method of communicating between a motion controller and a device.
Fig. 2 is a schematic diagram of the connection of the motion controller to the device.
Fig. 3 is a schematic diagram of a communication process between a motion controller and a device.
FIG. 4 is a flow chart of the steps for the motion controller to establish communication with the device via the LCom function.
Description of the reference symbols
10 motion controller
12 LCom functional module
20 device
22 client program
30 upper computer
40 Ethernet switch
Detailed Description
In order to more clearly understand the technical features, objects and effects of the present invention, embodiments of the present invention will now be described with reference to the accompanying drawings, in which the same reference numerals indicate the same or structurally similar but functionally identical elements.
"exemplary" means "serving as an example, instance, or illustration" herein, and any illustration, embodiment, or steps described as "exemplary" herein should not be construed as a preferred or advantageous alternative.
For the sake of simplicity, the drawings only schematically show the parts relevant to the present invention, and they do not represent the actual structure as a product.
FIG. 1 is a flow chart of one illustrative embodiment of a method of communicating between a motion controller and a device. Fig. 2 is a schematic diagram of the connection of the motion controller to the device. Referring to fig. 1 and 2, in an exemplary embodiment, the motion controller 10, the device 20 and the host computer 30 are connected through an ethernet switch 40, and a communication method of the motion controller and the device includes the following steps:
s10: and embedding an instruction analysis code corresponding to each function code of the ModBus protocol in the LCom application library.
The LCom function block in the LCom application library is developed based on a TCP (transmission control protocol), and can be used for realizing industrial Ethernet point-to-point full duplex communication based on the TCP, so that data interaction between a SimOTION motion controller and a third-party device is realized. When communicating through the LCom function blocks, the user does not need to write function blocks based on system basic functions, such as tcpponserver (connect), _ tcpReceive (receive), and tcpSend (send). The LCom protocol defines data records that can be up to 16 megabytes in length, much larger than 1400 bytes in the underlying TCP communication. Meanwhile, a diagnosis structure is arranged in the LCom functional block, so that historical transmission information can be conveniently inquired for diagnosis.
In step S10, an instruction parsing code corresponding to each function code of the ModBus protocol is embedded in the existing function of the LCom application library, and the instruction parsing code is written based on the C # language. Fig. 3 is a schematic diagram of a communication process between a motion controller and a device. Referring to fig. 3, when the LCom functional block receives an instruction using the ModBus protocol, the instruction parsing code can process data in the instruction according to the function expressed by the function code by recognizing the function code in the instruction and send the data to the application layer of the SIMOTION motion controller. Otherwise, when the LCom functional block sends an instruction adopting the ModBus protocol, the data is processed into an instruction with functional codes and data according with the ModBus protocol format through the instruction parsing code. In the currently used communication mode, a user writes a corresponding function block according to a required ModBus protocol function to realize data exchange, and a large amount of time is required for writing a new function block each time. Through the step S10, the LCom function block in the LCom application library can automatically recognize the instruction transmitted by adopting the Modbus protocol, so that the programming process of a user is omitted, and a large amount of time is saved. In other exemplary embodiments that do not use the Modbus protocol, this step may also be eliminated.
S20: the LCom application library is imported into the motion controller 10 and the LCom function module 12 in the LCom application library is called. Specifically, the configuration is realized by configuration software of the upper computer 30.
S30: a client program 22 for establishing TCP communication is provided on the device 20. Specifically, the upper computer 30 writes the client program 22 in the C # language and configures the device 20. The client program 22 provided on the device 20 is used to define an IP address, a port number, a master-slave relationship, a received data length, and the like. Where the master-slave relationship is used to determine whether device 20 is set as a client or server in the TCP communication protocol, device 20 is typically set as a client.
S40, the motion controller 10 establishes communication with the client program 22 of the device 20 via the TCP protocol via the LCom function module 12 in the LCom application library. FIG. 4 is a flow chart of the steps for the motion controller to establish communication with the device via the LCom function. Referring to fig. 4, step S40 specifically includes the following steps:
and S41, initializing the LCom function module 12, specifically including defining communication dual IP addresses, port numbers, master-slave relationship and receiving data length. Specifically, the configuration is realized by configuration software of the upper computer 30.
At S42, LCom function 12 is enabled to establish communication with device 20 via the TCP protocol. Specifically, the configuration is realized by configuration software of the upper computer 30.
According to the communication method between the motion controller and the equipment, the motion controller 10 calls the LCom function module 12 in the LCom application library to communicate with the third-party equipment 20 on the basis of the LCom TCP protocol by importing the LCom application library into the motion controller 10. Compared with a method for establishing basic TCP communication from a bottom layer, the communication method of the motion controller and the equipment provided by the invention can further ensure the communication quality between the motion controller 10 and the equipment 20, has higher communication transmission data volume and is convenient for inquiring historical transmission information for diagnosis.
The present invention also provides a motion controller 10. referring to fig. 2, the motion controller 10 includes an LCom application library having a plurality of LCom functional modules 12. The motion controller 10 is capable of establishing communication via the TCP protocol with a device 20 provided with a client program 22 for establishing TCP communication via a number of LCom functional modules 12.
The motion controller 10 provided by the invention communicates with the third-party equipment 20 through the LCom functional module 12 in the LCom application library based on the LCom TCP protocol. Compared with a method for establishing basic TCP communication from a bottom layer, the communication method of the motion controller and the equipment provided by the invention can further ensure the communication quality between the motion controller 10 and the equipment 20, has higher communication transmission data volume and is convenient for inquiring historical transmission information for diagnosis.
In the illustrative embodiment, the LCom application library has embedded therein an instruction parsing code corresponding to each function code of the ModBus protocol. The instruction parsing code can process data in the instruction and send the data to the application layer of the SIMOTION motion controller 10 according to the function expressed by the function code by recognizing the function code in the instruction when the LCom functional block 12 receives the instruction adopting the ModBus protocol. On the contrary, when the LCom functional block 12 sends an instruction using the ModBus protocol, the data is processed into an instruction having a functional code and data in compliance with the ModBus protocol format by the instruction parsing code. In the currently used communication mode, a user writes a corresponding function block according to a required ModBus protocol function to realize data exchange, and a large amount of time is required for writing a new function block each time. The LCom functional block 12 in the LCom application library can automatically recognize the instruction transmitted by the Modbus protocol, so that the programming process of a user is omitted, and a large amount of time is saved.
It should be understood that although the present description has been described in terms of various embodiments, not every embodiment includes only a single embodiment, and such description is for clarity purposes only, and those skilled in the art will recognize that the embodiments described herein may be combined as suitable to form other embodiments, as will be appreciated by those skilled in the art.
The above-listed detailed description is only a specific description of a possible embodiment of the present invention, and they are not intended to limit the scope of the present invention, and equivalent embodiments or modifications such as combinations, divisions or repetitions of features, which do not depart from the technical spirit of the present invention, should be included in the scope of the present invention.

Claims (7)

1. A method of communicating a motion controller with a device, the method comprising the steps of:
leading in an LCom application library in the motion controller and calling an LCom function module in the LCom application library;
setting a client program for establishing TCP communication on the equipment; and
and the motion controller establishes communication with a client program of the equipment through a TCP (transmission control protocol) through an LCom function module in the LCom application library.
2. The method of communicating a motion controller with a device according to claim 1, wherein the method further comprises the steps of:
and embedding an instruction analysis code corresponding to each function code of the ModBus protocol in the LCom application library.
3. The communication method of a motion controller and a device according to claim 1, wherein a client program provided on the device is used to define an IP address, a port number, and a master-slave relationship.
4. The communication method of a motion controller and a device according to claim 1, wherein the steps of: the method for establishing communication between the motion controller and the client program of the equipment through the LCom function module in the LCom application library through the TCP specifically comprises the following steps: initializing an LCom function module, and particularly defining a communication dual IP address, a port number, a master-slave relationship and a received data length; and
and starting the LCom function module to establish communication with the equipment through the TCP protocol.
5. The communication method of a motion controller and a device according to claim 1, wherein the steps of: the client program for establishing TCP communication is specifically set on the equipment by writing the client program by the upper computer in C # language and configuring the equipment.
6. A motion controller, comprising:
and the motion controller can establish communication with the equipment provided with the client program for establishing TCP communication through the plurality of LCom functional modules through a TCP protocol.
7. The motion controller according to claim 6, wherein the LCom application library has embedded therein an instruction resolution code corresponding to each function code of the ModBus protocol.
CN202010733908.9A 2020-07-24 2020-07-24 Motion controller and communication method of motion controller and equipment Pending CN111800435A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010733908.9A CN111800435A (en) 2020-07-24 2020-07-24 Motion controller and communication method of motion controller and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010733908.9A CN111800435A (en) 2020-07-24 2020-07-24 Motion controller and communication method of motion controller and equipment

Publications (1)

Publication Number Publication Date
CN111800435A true CN111800435A (en) 2020-10-20

Family

ID=72828475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010733908.9A Pending CN111800435A (en) 2020-07-24 2020-07-24 Motion controller and communication method of motion controller and equipment

Country Status (1)

Country Link
CN (1) CN111800435A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070005158A1 (en) * 2005-06-30 2007-01-04 Kabushiki Kaisha Yaskawa Denki Web based controller
CN106959672A (en) * 2017-04-28 2017-07-18 深圳市汇川控制技术有限公司 A kind of industrial kinetic control system and method based on API
CN108021096A (en) * 2016-11-03 2018-05-11 沈阳高精数控智能技术股份有限公司 A kind of long-distance monitoring method of the digital control system based on Modbus
CN209215922U (en) * 2018-11-30 2019-08-06 鞍钢股份有限公司 A kind of coke-oven locomotive wireless communication system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070005158A1 (en) * 2005-06-30 2007-01-04 Kabushiki Kaisha Yaskawa Denki Web based controller
CN108021096A (en) * 2016-11-03 2018-05-11 沈阳高精数控智能技术股份有限公司 A kind of long-distance monitoring method of the digital control system based on Modbus
CN106959672A (en) * 2017-04-28 2017-07-18 深圳市汇川控制技术有限公司 A kind of industrial kinetic control system and method based on API
CN209215922U (en) * 2018-11-30 2019-08-06 鞍钢股份有限公司 A kind of coke-oven locomotive wireless communication system

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
SIEMENS: "SIMOTION LCom库的使用", 《HTTPS://WWW.AD.SIEMENS.COM.CN/1847/VIDEO/VIDEOPLAY?COURSEID=1146》 *
工控编程吧: "SIMOTION LCom库的使用", 《HTTPS://V.YOUKU.COM/V_SHOW/ID_XMTMWOTEXNTIWNA==.HTML》 *
西门子(中国)有限公司,游辉胜,杨同杰: "《运动控制系统应用指南》", 机械工业出版社 *
西门子(中国)有限公司,王薇,吕其栋,张雪亮: "SIMOTION以太网通信", 《深入浅出西门子运动控制器—SIMOTION实用手册》 *

Similar Documents

Publication Publication Date Title
CN106154985B (en) Data transfer over industrial process networks
CN108989358B (en) Method for acquiring running data of textile machine based on TCP/IP protocol
CN110351378A (en) A kind of control method and system of internet of things equipment
CN104518910B (en) Apparatus for configuring Ethernet device and method for configuring Ethernet device
CN110891005A (en) IOT equipment control method, cloud server and IOT equipment control system
CN102902241B (en) For determining and/or the equipment of chemistry in monitoring automation technology or physical process variable
CN112422485B (en) Communication method and device of transmission control protocol
JP5361564B2 (en) Flexible approach showing different bus protocols
CN103401738A (en) Terminal connecting method and terminal connecting device
CN104348645A (en) Server and data transmission method of server
CN111800435A (en) Motion controller and communication method of motion controller and equipment
CN105487621A (en) Electronic device
CN213342280U (en) Communication system
CN110045690A (en) Controller, action state obtain system and method
CN114760285A (en) Internet of things sensor configuration and control method and system
CN114253205A (en) PLC data reading method, device and system
KR101810196B1 (en) Communication module in inverter
CN109871277B (en) Inter-process multi-request management method and device, terminal equipment and readable storage medium
CN108196866B (en) Firmware updating method and device
CN112564999A (en) Network measurement method, measurement management server, system and storage medium
KR100956640B1 (en) Self-Control Common Apparatus of Resource and Method Thereof
CN111007737B (en) Device control method, device control apparatus, and computer-readable storage medium
CN111221768B (en) USB equipment composite communication method and system
JP7409131B2 (en) Systems, methods, and computer program products for controlling field devices
CN118034209A (en) Production line data transmission method and architecture

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20201020

RJ01 Rejection of invention patent application after publication