Multi-servo driver and terminal communication system based on network switch
Through a multi-servo drive and terminal communication system based on network switches, the complex problem of servo drive data monitoring is solved, and efficient monitoring of multiple servo drives is realized by one terminal.
Patent Information
- Application Number
- CN202411850693.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-11
AI Technical Summary
In the prior art, each servo drive can only be connected to a computer equipped with a debug interface, resulting in very complex data monitoring of the servo drive when there are multiple servo drives.
A multi-servo drive and terminal communication system based on network switch is adopted, and the network switch is connected to the network switch through the terminal, and the network switch is connected to multiple servo drives to realize the forwarding and feedback of data frames, allowing one terminal to monitor multiple servo drives through the network switch.
It improves the monitoring efficiency of servo drives, solves the problem of complex data monitoring when multiple servo drives, and realizes centralized monitoring of multiple servo drives by one terminal.
Smart Images

Figure CN119814695A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and in particular to a system for communicating between multiple servo drives and terminals based on a network switch. Background Art
[0002] The servo drive has a network communication function and can be connected to the debugging computer through a network cable. The staff can send operation instructions or monitor data to the drive through the dedicated debugging interface of the drive, such as checking various drive parameters, drive operating status, motor speed, motor operating status, current error code, etc. At the same time, the driver can also be upgraded online according to whether the drive and the dedicated debugging interface have online upgrade functions. Figure 1 As shown, each drive can only be connected to a computer equipped with a debugging interface. For large quantities of drives in factories, factory debugging or factory drive upgrades are a large number of simple tasks, which requires a lot of manpower and material resources, making the data monitoring of servo drives very complicated.
[0003] There is currently no effective solution to the above-mentioned problems in the related art. Summary of the invention
[0004] The present application provides a system for communicating with multiple servo drives and terminals based on a network switch to solve the problem in the related art that each drive can only be connected to a computer equipped with a debugging interface, resulting in very complicated data monitoring of the servo drives when there are multiple servo drives.
[0005] In a first aspect, the present application provides a system for communicating between multiple servo drives and terminals based on a network switch, the system comprising a terminal, a network switch, and a servo drive; wherein the terminal is connected to the network switch, and the network switch is connected to multiple servo drives;
[0006] The terminal is used to send a first data frame indicating a debugging instruction to the network switch; wherein the data frame includes a first destination MAC address, and the first destination MAC address corresponds to a servo driver;
[0007] The network switch is used to obtain the first destination MAC address from the first data frame, and send the first data frame to the corresponding servo driver according to the port corresponding to the first destination MAC address;
[0008] The servo driver is used to receive the first data frame from the port, and feed back a second data frame indicating a debugging result to the network switch in response to the first data frame;
[0009] The network switch is used to forward the second data frame to the terminal based on the second destination MAC address in the second data frame;
[0010] The terminal is used to receive and display the debugging result in the second data frame.
[0011] Optionally, the network switch is further used to obtain a source MAC address from the first data frame, associate the source MAC address with a port in the network switch that receives the first data frame, and record the source MAC address and the associated port in a MAC address table.
[0012] Optionally, the network switch sends the first data frame to the corresponding servo drive according to the port corresponding to the first destination MAC address: the network switch is used to determine whether the first destination MAC address exists in the MAC address table; if the first destination MAC address exists in the MAC address table, the first data frame is sent to the servo drive based on the port corresponding to the first destination MAC address in the MAC address table; if the first destination MAC address does not exist in the MAC address table, the first data frame is flooded to all ports of the network switch to send the first data frame to the servo drive.
[0013] Optionally, the servo driver is further used to parse the received first data frame, obtain corresponding parameters according to the parsing result, encapsulate the obtained parameters into the second data frame, and send the second data frame to the terminal through the network switch.
[0014] Optionally, when there are multiple first data frames, the terminal is also used to send the multiple first data frames to the network switch; the network switch is also used to obtain the first destination MAC addresses in the multiple first data frames respectively, and send the multiple first data frames to multiple servo drives respectively according to the multiple first destination MAC addresses.
[0015] Optionally, there are multiple network switches, and each of the network switches is connected to multiple servo drives.
[0016] In a second aspect, the present application provides a data interaction method based on the system of the first aspect, comprising: the terminal sends a first data frame for indicating a debugging instruction to the network switch; wherein the data frame includes a first destination MAC address, and the first destination MAC address corresponds to a servo drive; wherein the network switch obtains the first destination MAC address from the first data frame, and sends the first data frame to the corresponding servo drive according to the port corresponding to the first destination MAC address; the terminal receives and displays the debugging result in the second data frame, wherein the second data frame is a data frame for indicating the debugging result fed back to the network switch by the servo drive in response to the first data frame.
[0017] In a third aspect, the present application provides a data interaction method based on the system of the first aspect, comprising: the network switch receives a first data frame sent by the terminal for indicating a debugging instruction; wherein the data frame includes a first destination MAC address, and the first destination MAC address corresponds to a servo drive; the network switch obtains the first destination MAC address from the first data frame, and sends the first data frame to the corresponding servo drive according to the port corresponding to the first destination MAC address; the network switch forwards the second data frame to the terminal based on the second destination MAC address in the second data frame, wherein the second data frame is sent by the servo drive in response to the first data frame and a data frame for indicating the debugging result is fed back to the network switch.
[0018] Optionally, the network switch sends the first data frame to the corresponding servo drive according to the port corresponding to the first destination MAC address, including: the network switch determines whether the first destination MAC address exists in the MAC address table; when the first destination MAC address exists in the MAC address table, the network switch sends the first data frame to the servo drive based on the port corresponding to the first destination MAC address in the MAC address table; when the first destination MAC address does not exist in the MAC address table, the network switch floods the first data frame to all ports of the network switch to send the first data frame to the servo drive.
[0019] In a fourth aspect, the present application provides a data interaction method based on the system of the first aspect, comprising: the servo drive receives a first data frame for indicating a debugging instruction sent by the terminal through a network switch; the servo drive responds to the first data frame and feeds back a second data frame for indicating a debugging result to the network switch.
[0020] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art: In the embodiment of the present application, the terminal can send a first data frame for debugging instructions to the servo driver through a network switch to obtain the parameter information of the servo driver currently required. After receiving the first data frame, the servo driver obtains the corresponding debugging parameters according to the debugging instructions, and sends the debugging parameters to the terminal through a second data frame, and the terminal collects and displays the parameter information of the servo driver, and the terminal can display the parameter information of multiple servo drivers, that is, one terminal can monitor multiple servo drivers through a network switch, which improves the monitoring efficiency of the servo driver and solves the problem that each driver in the related technology can only be connected to a computer equipped with a debugging interface, resulting in very complicated data monitoring of the servo driver when there are multiple servo drivers. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0023] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0024] Figure 1 It is a schematic diagram of the communication between a single servo drive and a PC in the related art;
[0025] Figure 2 A schematic diagram of a system structure for communication between multiple servo drives and terminals based on a network switch provided in an embodiment of the present application;
[0026] Figure 3 One of the flow charts of a data interaction method of a system for communicating between multiple servo drives and terminals based on a network switch provided in an embodiment of the present application;
[0027] Figure 4 A second flow chart of a data interaction method for a system of multiple servo drives and terminals communicating based on a network switch provided in an embodiment of the present application;
[0028] Figure 5A third flow chart of a data interaction method for a system of multiple servo drives and terminals communicating based on a network switch provided in an embodiment of the present application;
[0029] Figure 6 A schematic diagram of a network switch provided in an embodiment of the present application;
[0030] Figure 7 A network topology diagram of three servo drives and a PC provided in an embodiment of the present application;
[0031] Figure 8 A schematic diagram of local area network data communication provided in an embodiment of the present application;
[0032] Fig. 9 A flow chart of a terminal-side network communication connection method provided in an embodiment of the present application;
[0033] Fig.10 A flow chart of a network communication connection method on a network switch side provided in an embodiment of the present application;
[0034] Fig.11 A flow chart of the servo drive side network communication connection method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0036] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0037] In order to solve the problem in the related art that each driver can only be connected to a computer equipped with a debugging interface, which makes the data monitoring of the servo drivers very complicated when there are multiple servo drivers, the present application provides a system for communicating with multiple servo drivers and terminals based on a network switch, such as Figure 2As shown, the system in the embodiment of the present application includes a terminal, a network switch, and a servo drive; wherein the terminal is connected to the network switch, and the network switch is connected to multiple servo drives; in this regard, in a specific example, the terminal and the network switch can be connected via an RJ45 network cable, and the network switch and the drive can be connected via an RJ45 network cable.
[0038] The terminal is used to send a first data frame indicating a debugging instruction to a network switch; wherein the data frame includes a first destination MAC (Media Access Control Address) address, and the first destination MAC address corresponds to a servo drive. In this regard, in an embodiment of the present application, the debugging instruction is used to obtain various debugging parameters of the servo drive, such as the current real-time voltage of the servo drive, the current operating status of the servo drive, the current operating time of the servo drive, the current fault condition of the servo drive, etc.
[0039] The network switch is used to obtain the first destination MAC address from the first data frame, and send the first data frame to the corresponding servo driver according to the port corresponding to the first destination MAC address; in this regard, the network switch in the embodiment of the present application has multiple ports so that the network switch can connect more servo drivers.
[0040] The servo driver is used to receive a first data frame from a port, and to feed back a second data frame indicating a debugging result to the network switch in response to the first data frame;
[0041] The network switch is used to forward the second data frame to the terminal based on the second destination MAC address in the second data frame;
[0042] The terminal is used to receive and display the debugging result in the second data frame.
[0043] It can be seen that in the embodiment of the present application, the terminal can send a first data frame for debugging instructions to the servo driver through the network switch to obtain the parameter information of the servo driver currently required. After receiving the first data frame, the servo driver obtains the corresponding debugging parameters according to the debugging instructions, and sends the debugging parameters to the terminal through the second data frame. The terminal collects and displays the parameter information of the servo driver, and the terminal can display the parameter information of multiple servo drivers, that is, one terminal can monitor multiple servo drivers through the network switch, which improves the monitoring efficiency of the servo driver and solves the problem that each driver in the related technology can only be connected to a computer equipped with a debugging interface, resulting in very complicated data monitoring of the servo driver when there are multiple servo drivers.
[0044] It should be noted that the network switches in the embodiments of the present application may be of the following types:
[0045] 1) Layer 2 switch: forwards data frames based on MAC addresses.
[0046] 2) Layer 3 switch: It has routing function and can forward data packets at the network layer (the third layer of the OSI model), which is similar to the function of a router.
[0047] 3) Managed switches: provide more management and configuration options, support remote management and monitoring, and are suitable for enterprise-level networks.
[0048] According to the working conditions, you can choose a single or multiple network switches for local area network communication, and use the data forwarding function of the network switch to achieve one computer to control multiple drives. The servo drive and debugging interface are simply communicated based on the network switch, mainly using the forwarding function of the ordinary two-layer switch. The two-layer switch works at the second layer of the OSI seven-layer model, the link layer. When receiving data, it will learn the MAC address and store it in the MAC table. After receiving the data, it will forward the data through the port according to the destination host MAC address on that port.
[0049] Furthermore, the network switch in the embodiment of the present application is also used to obtain the source MAC address from the first data frame, and associate the source MAC address with the port in the network switch that receives the first data frame, and record the source MAC address and the associated port in the MAC address table. In this regard, the source MAC address and the port of the associated network switch are recorded in the MAC address table, and the destination MAC address and the port that sends the data frame to the servo driver are also recorded. Through the MAC address table, the ports commonly used by the source MAC address and the ports commonly used by the destination MAC address can be found, so that the required port can be found quickly and easily during the data interaction process, thereby improving the rate of data interaction.
[0050] In an embodiment of the present application, it is possible that the MAC address of the newly connected servo drive has not been recorded in the MAC address table. In this case, when performing data interaction, the destination MAC address in the first data frame sent by the terminal is not in the MAC address table. Therefore, it is necessary to flood the first data frame to all other ports to find the corresponding servo drive. Therefore, the network switch sends the first data frame to the corresponding servo drive according to the port corresponding to the first destination MAC address as follows: the network switch is used to determine whether the first destination MAC address exists in the MAC address table; if the first destination MAC address exists in the MAC address table, the first data frame is sent to the servo drive based on the port corresponding to the first destination MAC address in the MAC address table; if the first destination MAC address does not exist in the MAC address table, the first data frame is flooded to all ports of the network switch to send the first data frame to the servo drive.
[0051] Based on this, the servo driver in the embodiment of the present application is also used to parse the received first data frame, obtain the corresponding parameters according to the parsing results, encapsulate the obtained parameters into the second data frame, and send the second data frame to the terminal through the network switch. In this regard, in a specific example, after the servo driver parses the UDP (User Datagram Protocol) data (first data frame), the driver receives the debugging instruction forwarded by the switch as 12345, which represents the monitoring instruction, such as monitoring the real-time voltage. Then the servo driver will obtain a value such as 500V based on the voltage sampling, and will encapsulate 500V into the UDP data through the internally specified format, and send it to the terminal through the UDP protocol.
[0052] In an embodiment of the present application, if the current terminal needs to obtain the same data of multiple servo drives at the same time, the first data frame can be sent to the multiple servo drives through the network switch. Therefore, when the number of first data frames is multiple, the terminal is also used to send multiple first data frames to the network switch. And the network switch is also used to obtain the first destination MAC addresses in the multiple first data frames respectively, and send the multiple first data frames to the multiple servo drives respectively according to the multiple first destination MAC addresses.
[0053] Furthermore, in the embodiment of the present application, the total number of network switches can be multiple, and each network switch is connected to multiple servo drives. In this way, one terminal can monitor more servo drives.
[0054] The following is an explanation of the embodiments of the present application from the perspectives of the terminal side, the network switch side, and the servo drive side. First, the terminal, such as Figure 3 As shown, a data interaction method for a system of multiple servo drives and terminal communication based on a network switch includes the following steps:
[0055] Step 301, the terminal sends a first data frame for indicating a debugging instruction to a network switch; wherein the data frame includes a first destination MAC address, and the first destination MAC address corresponds to a servo driver; wherein the network switch obtains the first destination MAC address from the first data frame, and sends the first data frame to the corresponding servo driver according to the port corresponding to the first destination MAC address;
[0056] Step 302: The terminal receives and displays the debugging result in the second data frame, wherein the second data frame is a data frame for indicating the debugging result that is fed back by the servo driver to the network switch in response to the first data frame.
[0057] Through the above steps 301 to 302, after the terminal in the embodiment of the present application is connected to communicate with multiple servo drives through the network switch, the terminal can send debugging instructions (data frames) to the multiple servo drives through the network switch, and then the multiple servo drives feedback the debugging results through the network switch, so that the terminal can monitor data of multiple servo drives at the same time.
[0058] For the network switch side, such as Figure 4 As shown, the steps of the method include:
[0059] Step 401: The network switch receives a first data frame sent by a terminal for indicating a debugging instruction; wherein the data frame includes a first destination MAC address, and the first destination MAC address corresponds to a servo driver;
[0060] Step 402: The network switch obtains a first destination MAC address from the first data frame, and sends the first data frame to the corresponding servo driver according to the port corresponding to the first destination MAC address;
[0061] Step 403: The network switch forwards the second data frame to the terminal based on the second destination MAC address in the second data frame, wherein the second data frame is generated by the servo driver in response to the first data frame and feeds back a data frame indicating the debugging result to the network switch.
[0062] It can be seen that in the embodiment of the present application, after receiving the first data frame sent by the terminal, the network switch can forward it to the corresponding servo drive, and then forward the data frame fed back by the servo drive to the terminal. A network switch can connect multiple servo drives, so a terminal can monitor the data of multiple servo drives through the network switch, thereby improving the monitoring efficiency of the servo drive.
[0063] Furthermore, the method in which the network switch involved in the above step 402 sends the first data frame to the corresponding servo driver according to the port corresponding to the first destination MAC address may further include:
[0064] Step 11, the network switch determines whether the first destination MAC address exists in the MAC address table;
[0065] Step 12, when the first destination MAC address exists in the MAC address table, the network switch sends a first data frame to the servo driver based on the port corresponding to the first destination MAC address in the MAC address table;
[0066] Step 13: When the first destination MAC address does not exist in the MAC address table, the network switch floods the first data frame to all ports of the network switch to send the first data frame to the servo driver.
[0067] In this regard, in a specific example, the network switch will check the destination MAC address of the data frame (i.e., the MAC address of the servo drive). If the destination MAC address exists in the MAC address table and corresponds to another port, the switch will forward the data frame to that port. If the destination MAC address does not exist in the MAC address table, or is a broadcast address (such as FF:FF:FF:FF:FF:FF), the switch will flood the data frame to all other ports (except the port that receives the frame) in order to find the corresponding servo drive.
[0068] Corresponding to the servo drive, such as Figure 5 As shown, the steps of the method include:
[0069] Step 501, the servo driver receives a first data frame indicating a debugging instruction sent by a terminal through a network switch;
[0070] Step 502: The servo driver feeds back a second data frame indicating a debugging result to the network switch in response to the first data frame.
[0071] It can be seen that in the embodiment of the present application, multiple servo drivers can send parameter information of the servo drivers to the same terminal through the network switch, that is, multiple servo drivers can be monitored through the same terminal, thereby improving the monitoring efficiency of the servo drivers.
[0072] The present application is explained below in conjunction with a specific implementation of an embodiment of the present application, which provides a multi-servo drive network real-time communication method based on a network switch.
[0073] In the related art, the servo drive has a network communication function. After being directly connected to the debugging computer through a network cable, through the dedicated debugging interface application of the drive, after the communication connection between the interface and the drive is successfully established, the operation instructions can be issued through the interface, and the instructions are sent to the drive through a network communication protocol such as TCP / UDP. After the driver receives the instructions, it performs related operations. In the embodiment of the present application, the network switch (Switch) is a network device based on the international standard Ethernet protocol, which is used to transmit data between multiple network nodes. It works at the data link layer (the second layer of the OSI model). Its main function is to forward data frames according to the MAC address to ensure that data can be accurately transmitted from one device to another. The schematic diagram of the switch is shown in Figure 6 shown.
[0074] Specifically, the type of the network switch in the embodiment of the present application may be:
[0075] 1) Layer 2 switch: forwards data frames based on MAC addresses.
[0076] 2) Layer 3 switch: It has routing function and can forward data packets at the network layer (the third layer of the OSI model), which is similar to the function of a router.
[0077] 3) Managed switches: provide more management and configuration options, support remote management and monitoring, and are suitable for enterprise-level networks.
[0078] According to the working conditions, you can select a single or multiple network switches for local area networking communication. By using the data forwarding function of the network switch, one computer can control multiple drives. Figure 7 shown.
[0079] The simple communication between the servo drive and the debugging interface based on the network switch mainly uses the forwarding function of the ordinary two-layer switch. The two-layer switch works at the second layer of the OSI seven-layer model: the link layer, that is, when receiving data, it will learn the MAC address and store it in the MAC table. After receiving the data, it will forward the data through the port according to the destination host MAC address on that port. For example Figure 8 As shown, when the PC and the servo drive are connected through a layer 2 switch (also called a network switch), the data frame forwarding process mainly relies on the MAC address table to decide how to forward data from one port to another.
[0080] The detailed steps are as follows:
[0081] 1) Sending stage:
[0082] When the PC sends a data frame to the servo drive, the data frame first arrives at a port of the Layer 2 switch. The switch reads the source MAC address of the data frame (i.e. the MAC address of the PC), associates the MAC address with the port that received the frame, and records it in the MAC address table. If the MAC address already exists in the table, the corresponding port number is updated.
[0083] Specifically, the PC debugging interface uses one-key parameter reading to send data reading instructions to multiple drivers at the same time, here the example is 01020304; then the debugging interface is sent through the UDP protocol, then the interface program will encapsulate the data into the format specified by the UDP protocol, for example, the interface needs to send a read instruction to two drivers, No. 1 and No. 2, respectively, and the instructions here are the same as 01020304. The UDP protocol will encapsulate the instruction and then send it to the destination driver. However, the destination MAC and destination IP sent by UDP are different. The destination MAC of the two UDP data frames are the destination MAC addresses of drivers No. 1 and No. 2 respectively. The destination IP is the same. The switch will forward it to the port connected to the corresponding driver according to the destination MAC or destination IP, so as to achieve correct data forwarding. When the driver receives the UDP data frame sent by the PC, the program will parse the message according to the Ethernet protocol to parse whether the destination IP and destination MAC in the message are the MAC and IP addresses of this driver. If they are the same, the instruction will be judged. If it is 01020304, it is a read parameter instruction, then the driver will return the parameter information and encapsulate it in the UDP protocol and send it to the computer.
[0084] 2) Forwarding stage:
[0085] The switch checks the destination MAC address of the data frame (i.e. the MAC address of the servo drive). If the destination MAC address exists in the MAC address table and corresponds to another port, the switch forwards the data frame to that port. If the destination MAC address does not exist in the MAC address table, or is a broadcast address (e.g. FF:FF:FF:FF:FF:FF), the switch floods the data frame to all other ports (except the port that receives the frame) in order to find the target device.
[0086] 3) Receiving stage:
[0087] After receiving the data frame, the servo drive will determine whether it is sent to itself based on the destination MAC address. If so, it will make corresponding response strategies based on the content of the data frame. Specifically, after receiving the data frame, the drive will parse the data according to the Ethernet protocol. For example, if the data parsed is 01020304, the drive will recognize that the instruction is a parameter read instruction, and then the drive will put the parameter information into the data message and send it to the specified drive through the UDP protocol. The other functions are the same, all of which are to parse the data sent from the debugging interface, and then determine the type of instruction based on the data value.
[0088] The specific process is as follows Fig. 9 As shown, for the PC side, the method steps include:
[0089] Step 901, the PC opens the debugging interface and clicks the communication connection button to establish a communication connection with the driver.
[0090] Step 902: The PC waits for the communication data message returned by the driver to determine whether the communication is successful.
[0091] Step 903: If the communication is successful, debug operation and monitor driver data, otherwise repeat the communication connection.
[0092] like Fig.10 As shown, the method steps at the network switch end include:
[0093] Step 1001: The switch receives a communication data packet and learns a MAC address.
[0094] Step 1002, determine the port number of the destination MAC address.
[0095] Step 1003, select the port corresponding to the destination MAC to send data.
[0096] Step 1004, completing data forwarding.
[0097] like Fig.11 As shown, the method steps at the servo drive end include:
[0098] Step 1101, perform network initialization and determine whether the initialization is successful.
[0099] Step 1102: If the initialization is successful, wait for the data message forwarded by the switch, that is, communicate with the debugging computer. If not, repeat the initialization.
[0100] Step 1103, determine whether the connection is successful.
[0101] Step 1104, if the connection is successful, the debugging instruction data message forwarded by the switch can be accepted, and the current working data of the driver is fed back to the switch. If not, the communication connection is repeated.
[0102] For example, after parsing the UDP data protocol, the driver receives the debugging instruction forwarded by the switch as 12345, which represents the monitoring instruction, such as monitoring the real-time voltage. The driver will then obtain a value such as 500V based on the voltage sampling, and will encapsulate 500V into UDP data in the format specified in our program, and send it to the interface through the UDP protocol.
[0103] It can be seen that in the embodiment of the present application, the driver realizes the network communication of the PC debugging interface through the network switch, realizes one computer to control multiple drivers, saves work costs, and facilitates the basic operations of batch debugging for the staff. At the same time, the network switch is used for local area networking at the driver work site, and all driver data is forwarded to a fixed computer through the switch for real-time data monitoring, so that the working status, fault type, working content, etc. of each driver can be checked.
[0104] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0105] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0106] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0107] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A system for communicating between multiple servo drives and terminals based on a network switch, characterized in that: The system includes a terminal, a network switch, and a servo drive; wherein the terminal is connected to the network switch, and the network switch is connected to a plurality of servo drives; The terminal is used to send a first data frame indicating a debugging instruction to the network switch; wherein the data frame includes a first destination MAC address, and the first destination MAC address corresponds to a servo driver; The network switch is used to obtain the first destination MAC address from the first data frame, and send the first data frame to the corresponding servo driver according to the port corresponding to the first destination MAC address; The servo driver is used to receive the first data frame from the port, and feed back a second data frame indicating a debugging result to the network switch in response to the first data frame; The network switch is used to forward the second data frame to the terminal based on the second destination MAC address in the second data frame; The terminal is used to receive and display the debugging result in the second data frame.
2. The system according to claim 1, characterized in that The network switch is further configured to obtain a source MAC address from the first data frame, associate the source MAC address with a port in the network switch that receives the first data frame, and record the source MAC address and the associated port in a MAC address table.
3. The system according to claim 1, characterized in that The network switch sends the first data frame to the corresponding servo driver according to the port corresponding to the first destination MAC address in the following manner: The network switch is configured to determine whether the first destination MAC address exists in the MAC address table; if the first destination MAC address exists in the MAC address table, send the first data frame to the servo driver based on the port corresponding to the first destination MAC address in the MAC address table; If the first destination MAC address does not exist in the MAC address table, the first data frame is flooded to all ports of the network switch to send the first data frame to the servo driver.
4. The system according to claim 1, characterized in that The servo driver is further used to parse the received first data frame, obtain corresponding parameters according to the parsing result, encapsulate the obtained parameters into the second data frame, and send the second data frame to the terminal through the network switch.
5. The system according to claim 1, characterized in that In the case that the number of the first data frames is multiple, the terminal is further used to send the multiple first data frames to the network switch; The network switch is further used to respectively obtain the first destination MAC addresses in the multiple first data frames, and send the multiple first data frames to multiple servo drivers respectively according to the multiple first destination MAC addresses.
6. The system according to claim 1, characterized in that There are multiple network switches, and each of the network switches is connected to multiple servo drives.
7. A data interaction method based on the system of any one of claims 1 to 6, characterized in that: include: The terminal sends a first data frame for indicating a debugging instruction to the network switch; wherein the data frame includes a first destination MAC address, and the first destination MAC address corresponds to a servo driver; wherein the network switch obtains the first destination MAC address from the first data frame, and sends the first data frame to the corresponding servo driver according to the port corresponding to the first destination MAC address; The terminal receives and displays the debugging result in a second data frame, wherein the second data frame is a data frame for indicating the debugging result fed back by the servo driver to the network switch in response to the first data frame.
8. A data interaction method based on the system of any one of claims 1 to 6, characterized in that: include: The network switch receives a first data frame sent by the terminal for indicating a debugging instruction; wherein the data frame includes a first destination MAC address, and the first destination MAC address corresponds to a servo driver; The network switch obtains the first destination MAC address from the first data frame, and sends the first data frame to the corresponding servo driver according to the port corresponding to the first destination MAC address; The network switch forwards the second data frame to the terminal based on the second destination MAC address in the second data frame, wherein the second data frame is generated by the servo driver in response to the first data frame and is a data frame used to indicate a debugging result and fed back to the network switch.
9. The method according to claim 8, characterized in that The network switch sends the first data frame to the corresponding servo driver according to the port corresponding to the first destination MAC address, including: The network switch determines whether the first destination MAC address exists in the MAC address table; In a case where the first destination MAC address exists in the MAC address table, the network switch sends the first data frame to the servo driver based on the port corresponding to the first destination MAC address in the MAC address table; In a case where the first destination MAC address does not exist in the MAC address table, the network switch floods the first data frame to all ports of the network switch to send the first data frame to the servo driver.
10. A data interaction method based on the system of any one of claims 1 to 6, characterized in that: include: The servo driver receives a first data frame for indicating a debugging instruction sent by the terminal through a network switch; The servo driver feeds back a second data frame indicating a debugging result to the network switch in response to the first data frame.