A control method compatible with both Beckhoff PLC and Siemens PLC
By designing the PLC base class interface and using the inheritance characteristics of the class, creating derived classes of Beckhoff PLC and Siemens PLC, using the class factory mode and the singleton mode, it solves the problem that the 3D printer system needs to develop two sets of software architectures separately, achieving compatibility and reducing code redundancy and development workload.
Patent Information
- Application Number
- CN202210661572.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-13
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2042-06-13
AI Technical Summary
In the prior art, 3D printer systems need to develop two sets of software architectures to be compatible with Beckhoff ADS system PLC and Siemens system PLC, resulting in code redundancy and increased development workload.
By designing the PLC base class interface and using the inheritance characteristics of the class to create derived classes of Beckhoff PLC and Siemens PLC, the class factory mode and singleton mode are used to achieve compatibility.
A set of control logic is implemented to be compatible with the respective logic functions of Beckhoff PLC and Siemens PLC, reducing code redundancy and development workload, and improving development efficiency and maintenance convenience.
Smart Images

Figure CN114935912B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of electronic technology, and in particular relates to a control method that is compatible with both Beckhoff PLC and Siemens PLC. Background Art
[0002] In the 3D printer system, the PLC control system connects the communication and interaction between the host computer control software and the mechanical equipment. The full name of PLC is Programmable Logic Controller. The PLC control system is a new generation of industrial control device formed by introducing microelectronics technology, computer technology, automatic control technology and communication technology on the basis of traditional sequential controllers.
[0003] There are many different classifications of PLC systems, such as Beckhoff ADS system PLC and Siemens system PLC. Each system has its own characteristics and is suitable for different mechanical equipment, so they use different communication protocols and different transmission methods to support the protocol and different technical solutions to implement the functions. For example, Beckhoff ADS system PLC uses TCP / IP communication protocol, while Siemens system PLC uses snap7 communication protocol. Even for the same Siemens system, in addition to snap7 protocol, there are other communication protocols, such as s7-200, etc. Although some devices in the 3D printer system use different PLC systems, the overall logic design of 3D printer control is similar, and the functions provided by PLC are basically the same, but they are implemented using different PLC systems.
[0004] The current traditional technology adopts a set of logical architecture for the Beckhoff ADS system PLC. The software design provides a set of code design solutions. The TCP / IP protocol is used to realize the operation and control of the lower mechanical parts by the host computer control software through the Beckhoff ADS system PLC, so as to realize the layer-by-layer powder laying, printing, and laser burning and welding of the 3D printer system. Another set of software design solutions is adopted for the Siemens system PLC. The host computer control software uses the SNAP7 protocol to realize the operation and control of the lower mechanical parts by the host computer control software through the Siemens system PLC, so as to realize the operation of the 3D printer system. In this way, two sets of software architectures will appear. In these two sets of software architectures, the overall design scheme of the software is the same, and the software architecture is consistent. The only difference is that the PLC system is different, one is the Beckhoff ADS system, and the other is the Siemens system PLC. Then the interface functions provided by these two PLC systems are the same. For the same manufacturer, if they have two different PLC systems, they will have two sets of software systems and design solutions. However, there are many similarities or duplicate codes between the two design solutions, which will inevitably lead to redundancy of software code and accumulation of development workload for the manufacturer in software development, integration and subsequent maintenance. Summary of the invention
[0005] The purpose of the present invention is to provide a control method that is compatible with both Beckhoff PLC and Siemens PLC, which solves the technical problem of creating a PLC base class interface and then creating two derived classes of Beckhoff PLC and Siemens PLC by utilizing the inheritance characteristics of the class, thereby realizing a set of control logic compatible with the respective logical functions of Beckhoff PLC and Siemens PLC.
[0006] To achieve the above object, the present invention adopts the following technical solution:
[0007] A control method compatible with both Beckhoff PLC and Siemens PLC, comprising the following steps:
[0008] Step 1: Establish a client server and a program control server. The client server communicates with the program control server through the Internet. Create an application and a configuration file config.ini in the client server. Set the type of PLC system currently supported in the configuration file config.ini.
[0009] Step 2: Establish an interface in the program control server as the PLC base class interface, and define all properties and member functions of the PLC base class in the form of public functions in the PLC base class interface;
[0010] Define the Beckhoff PLC derived class, which is used to define the control characteristics and properties of the Beckhoff PLC. The Beckhoff PLC derived class inherits the PLC base class;
[0011] Set the AdsAmsNetID and AdsPort of the Beckhoff PLC in the Beckhoff PLC derived class. AdsAmsNetID and AdsPort are used to access the connection when creating a connection to the Beckhoff PLC.
[0012] Define Siemens PLC derived class, which is used to define the control characteristics and properties of Siemens PLC. Siemens PLC derived class inherits PLC base class;
[0013] Define the TS7Client() and TS7Server() classes in the Siemens PLC derived class. The TS7Client() class represents the PC client and is used to create a communication client instance. The TS7Server() class represents the PLC server and is used to provide the client with a specific linked PLC server.
[0014] Step 3: Define the Beckhoff PLC derived classes of multiple Beckhoff PLCs and the Siemens PLC derived classes of multiple Siemens PLCs in the program control server according to the method in step 2;
[0015] Step 4: The program controls the server to read and parse the configuration file config.ini of the client server, and obtains the types and models of PLCs that need to be supported contained in the configuration file config.ini;
[0016] According to the type and model of PLC, use the class factory mode to select an applicable PLC derived class A, and use the singleton mode to create a unique identifier for PLC derived class A;
[0017] Create a singleton mode object of PLC derived class A and operate PLC through the singleton mode object;
[0018] Step 5: After the operation is completed, destroy the singleton mode object of PLC derived class A.
[0019] Preferably, when executing step 4, the following steps are specifically included:
[0020] Step S4-1: adopting the class factory mode to select a PLC derived class applicable to the PLC supported in the configuration file config.ini, that is, a PLC derived class A;
[0021] Step S4-2: Using the singleton mode to create a unique identifier for the PLC derived class A, the program control server's access, modification, or read and write operations on the member functions and attributes of the PLC derived class A are all verified through the unique identifier of the PLC derived class A;
[0022] Step S4-4: Create a singleton mode object for the PLC derived class A;
[0023] Step S4-5: The program controls the server to create an intermediate transition class Device, calls a public function of the PLC base class in the intermediate transition class Device, and accesses the PLC to perform related operations according to the singleton mode object.
[0024] Preferably, the member functions in the PLC base class are all pure virtual functions.
[0025] Preferably, the AdsAmsNetID is the ADS router in the Beckhoff PLC, and AdsPort is the virtual device for the specified communication.
[0026] Preferably, when executing step 2, inheriting the PLC base class means inheriting all member functions and properties in the PLC base class.
[0027] Preferably, when executing step 2, the Beckhoff PLC derived class defines that PLC variables are transmitted between the client control software and the mechanical components through the TCP / IP protocol to achieve data communication; the Siemens derived class defines that PLC variables are transmitted between the client software and the mechanical components through the SNAP7 protocol to achieve data communication.
[0028] The control method described in the present invention is compatible with both Beckhoff PLC and Siemens PLC, which solves the technical problem of creating a PLC base class interface and then creating two derived classes of Beckhoff PLC and Siemens PLC by using the inheritance characteristics of the class, thereby realizing a set of control logic compatible with the respective logical functions of Beckhoff PLC and Siemens PLC. The present invention adopts the class factory mode in the design mode, creates two subclasses of Beckhoff PLC class and Siemens PLC class through the PLC base class interface, and realizes respective functional characteristics and operation logic in the subclasses. The present invention uses a configuration file to set which PLC type the current system uses, namely Beckhoff PLC or Siemens PLC. The present invention adopts the singleton mode in the design mode during actual operation, which has uniqueness and reduces the trouble of creating class instances multiple times. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 is a system architecture diagram of the present invention;
[0030] Figure 2 It is a schematic diagram of the inheritance relationship between the base class and the derived class of the present invention;
[0031] Figure 3 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0032] Depend on Figure 1-Figure 3 A control method shown in the figure is compatible with both Beckhoff PLC and Siemens PLC, comprising the following steps:
[0033] Step 1: Establish a client server and a program control server. The client server communicates with the program control server through the Internet. Create an application and a configuration file config.ini in the client server. Set the type of PLC system currently supported in the configuration file config.ini.
[0034] In this embodiment, the configuration file config.ini is used to set which PLC system the current host computer control software system supports. For example, Beckhoff ADS system PLC and Siemens system PLC,
[0035] [PLCTYPE]
[0036] Plc=Siemens
[0037] or
[0038] [PLCTYPE]
[0039] Plc=Ads
[0040] Read the value of the PLCTYPE item in the configuration file config.ini. If it is a Siemens system PLC, create a Siemens system PLC class. If it is a Beckhoff ADS system PLC, create an ADS system PLC class. Then perform related operations to complete the task execution.
[0041] In this embodiment, the user provides data and configuration files related to the overall logic design of the 3D printer control through the client server, and the program controls the server to complete the compatible logic flow of the two PLCs.
[0042] Step 2: Establish an interface in the program control server as the PLC base class interface, and define all properties and member functions of the PLC base class in the form of public functions in the PLC base class interface;
[0043] When executing step 2, inheriting the PLC base class means inheriting all member functions and properties in the PLC base class.
[0044] The member functions in the PLC base class are all pure virtual functions.
[0045] The AdsAmsNetID is the ADS router in Beckhoff PLC, and AdsPort is the virtual device for the specified communication.
[0046] When executing step 2, the Beckhoff PLC derived class defines the transmission of PLC variables between the client control software and the mechanical components through the TCP / IP protocol to achieve data communication; the Siemens derived class defines the transmission of PLC variables between the client software and the mechanical components through the SNAP7 protocol to achieve data communication.
[0047] In the PLC base class interface, all properties and member functions of the PLC base class are defined in public form, so that any derived class can inherit all properties and member functions of the base class; at the same time, all member functions are defined as pure virtual functions, making full use of the characteristics of pure virtual functions, that is, the base class does not need to define the function implementation content, and the derived subclass must define the implementation method specifically. After all, member functions of different subclasses have different behaviors and implementation methods.
[0048] In actual application, the specific PLC implementation method is called to solve the PLC communication and service functions according to the PLC configured in the current configuration file of the host control software system. All derived classes will inherit the member functions and properties defined in the base class. At the same time, any derived class can define methods and properties that reflect its own characteristics to implement the business logic processing of the PLC with its own characteristics. For example, Beckhoff PLC transmits PLC variables between the host control software and mechanical components through the TCP / IP protocol to achieve data communication; Siemens PLC uses the SNAP7 protocol to communicate data between the host software and mechanical components.
[0049] In this embodiment, a PLC base class PlcComm is defined, which includes member functions and properties of the base class. All its member functions are pure virtual functions, for example: defining a PLC connection function virtual int PlcConnect() = 0 indicates a PLC connection. The member functions and properties defined in the base class are defined as public types, so that all derived classes will inherit and have them.
[0050] The definition of PLC base class PlcComm is as follows:
[0051]
[0052]
[0053] Define the Beckhoff PLC derived class, which is used to define the control characteristics and properties of the Beckhoff PLC. The Beckhoff PLC derived class inherits the PLC base class;
[0054] Set the AdsAmsNetID and AdsPort of the Beckhoff PLC in the Beckhoff PLC derived class. AdsAmsNetID and AdsPort are used to access the connection when creating a connection to the Beckhoff PLC.
[0055] In this embodiment, the PLC derived class of Beckhoff ADS inherits from the PLC base class PlcComm in public form, and inherits all member functions and properties of the base class. At the same time, methods and properties that reflect their own characteristics can be defined in private form. Private type methods and properties cannot be inherited by any derived class and can only be called by themselves. For example, the private part is the part of its own characteristics. For example, OpenAds (const QStringList & strList) establishes communication between the host computer control software and the underlying mechanical components through the TCP / IP protocol, which is used to open the ADS Beckhoff system to facilitate the transmission of PLC variable data and data reading and writing operations; CloseAds (), used to close the ADS Beckhoff system, disconnect the communication connection between the host computer software and the underlying mechanical components; ReadBool (QString address, bool & bValue), with the help of TCP / IP protocol, used to read the bool type PLC variable in the Beckhoff ADS system; AmsAddr Addr, used to define the ADS system address; PAmsAddr pAddr = & Addr, used to access the ADS address value; and so on.
[0056] The declaration that defines the Beckhoff ADS system PLC class is as follows:
[0057]
[0058]
[0059] Define Siemens PLC derived class, which is used to define the control characteristics and properties of Siemens PLC. Siemens PLC derived class inherits PLC base class;
[0060] Define the TS7Client() and TS7Server() classes in the Siemens PLC derived class. The TS7Client() class represents the PC client and is used to create a communication client instance. The TS7Server() class represents the PLC server and is used to provide the client with a specific linked PLC server.
[0061] The Siemens system PLC class inherits from the PLC base class PlcComm in a public form, inheriting all member functions and properties of the base class. At the same time, methods and properties that reflect their own characteristics can be defined in a private form. Private methods and properties cannot be inherited by any derived class and can only be called by themselves. For example, the Private part is the part of its own characteristics, for example MReadBool(QString address,bool&bValue), where QString address represents the address name of the PLC variable; bool&bValue represents the value obtained after reading the PLC variable, and uses the SNAP7 protocol for data communication to read the bool type PLC data variable in the Siemens PLC class in the upper computer control software; MWriteBool(QStringaddress,bool bValue), uses the SNAP7 protocol to write the bool type PLC data variable in the Siemens PLC class in the upper computer control software; defines a pointer type variable of a snap7 client object so that the snap7 protocol can be used for data transmission in the subsequent code, that is, TS7Client*m_client=nullptr, the Siemens PLC class uses the snap7 protocol to transmit the PLC variable value, and the data protocol transmission pointer variable is initialized here.
[0062] The class declaration of Siemens system PLC is defined as follows:
[0063]
[0064]
[0065] Step 3: Define the Beckhoff PLC derived classes of multiple Beckhoff PLCs and the Siemens PLC derived classes of multiple Siemens PLCs in the program control server according to the method in step 2;
[0066] Step 4: The program controls the server to read and parse the configuration file config.ini of the client server, and obtains the types and models of PLCs that need to be supported contained in the configuration file config.ini;
[0067] According to the type and model of PLC, use the class factory mode to select an applicable PLC derived class A, and use the singleton mode to create a unique identifier for PLC derived class A;
[0068] Create a singleton mode object of PLC derived class A and operate PLC through the singleton mode object;
[0069] Step 5: After the operation is completed, destroy the singleton mode object of PLC derived class A.
[0070] In this embodiment, the information exchange between the various software modules in the Beckhoff system is completed through the TwinCAT ADS system, and communication is carried out through the TCP / IP protocol. Each ADS device has its own different AdsAmsNetID and AdsPort port number, which are also its two most important attributes. AdsAmsNetId specifies the ADS router and is an extension of the TCP IP address. When the IP of a PC is "192.168.10.10", AdsAmsNetId is "192.168.10.10.1.1". AdsPort specifies the virtual device for communication, which is different and fixed, while the port of the ADS client application is variable. The default port is 851 when creating a plc program.
[0071] Therefore, when creating a connection to the ADS system PLC, the access connection is performed through the AdsAmsNetId and AdsPort, which are completed through the TwinCAT system API interface. In the PlcConnect() member function, define the AMS address variable AmsAddr Addr, and define the port address variable PAmsAddr pAddr = &Addr. Set the port to 851, that is, pAddr->port = 851; use the ADS system API function AdsSyncReadStateReq to implement PLC connection communication, that is, nErr = AdsSyncReadStateReq (pAddr, &nAdsState, &nDeviceState); nAdsState indicates the state of the ADS system; nDeviceState indicates the state of the current device to be connected to the ADS system.
[0072] When reading the PLC variables of the Beckhoff system, first determine whether the current Beckhoff system is successfully connected, that is, use the ADS system API function AdsSyncReadStateReq() to determine whether the connection is successful. If the connection is successful, then use the ADS system API function AdsSyncReadWriteReq to set the handle to access the specific PLC variable address, then use the ADS system API function AdsSyncReadReq to read the value of the current PLC variable address, and finally use the ADS system API function AdsSyncWriteReq to release the handle. This includes reading multiple data types such as integer, Boolean, and floating point.
[0073] When writing to the Beckhoff system PLC variables, first determine whether the current Beckhoff system is successfully connected, that is, use the ADS system API function AdsSyncReadStateReq() to determine whether the connection is successful. If the connection is successful, then use the ADS system API function AdsSyncReadWriteReq to set the handle to access the specific PLC variable address, then use the ADS system API function AdsSyncWriteReq to write the value of the current PLC variable address, and finally use the ADS system API function AdsSyncWriteReq to release the handle. Call the interface to read the PLC variable value again to obtain the current PLC variable value, and then compare it with the value before writing to determine whether the write operation is successful. This includes writing multiple data types such as integer, Boolean, and floating point.
[0074] The Siemens PLC system uses snap7 as the communication protocol. snap7 is an open source library for communicating with Siemens S7 series PLCs based on Ethernet. When snap7 implements communication, it uses PLC as the server and PC actively connects as the client, so at the beginning, we should create the client needed for communication. First, define a class TS7Client() and a class TS7Server() to implement the communication connection between the PC client and the PLC server. Create a communication client instance, for example, plcObj = snap7.client.client; then connect to the specific PLC server, plcObj.connect("192.168.0.203",0,1); plcObj represents the created PC client instance.
[0075] When reading a PLC variable value, first call the client TS7Client class function interface CheckAsCompletion to determine whether the communication is established successfully. If the communication is established successfully, call the TS7Client class function interface ReadArea to read the value of a specific PLC variable address. This includes reading multiple data types such as integer, Boolean, and floating point.
[0076] When writing a certain PLC variable value, first call the client TS7Client class function interface CheckAsCompletion to determine whether the communication is established successfully. If the communication is established successfully, call the TS7Client class function interface WriteArea() to write the value of the specific PLC variable address. Then call the client TS7Client class function interface CheckAsCompletion to determine whether the communication is established successfully. If the communication is established successfully, call the TS7Cl ient class function interface ReadArea to read the value of the specific PLC variable address and whether it is equal to the written value. If they are equal, the writing of the PLC variable value is successful; otherwise, it fails. This includes writing multiple data types such as integer, Boolean, floating point, etc.
[0077] When executing step 4, the specific steps include:
[0078] Step S4-1: adopting the class factory mode to select a PLC derived class applicable to the PLC supported in the configuration file config.ini, that is, a PLC derived class A;
[0079] Class Factory Pattern Description: In the class factory pattern, the creation logic is not exposed to the client when creating an object, and a common interface is used to point to the newly created object. Intention: Define an interface for creating objects, and let its subclasses decide which class to instantiate. The class factory pattern delays the creation process to the subclasses. When explicitly planning to create different instances under different conditions, let its subclasses implement the class interface, and return an abstract product. The creation process is executed in its subclasses.
[0080] Step S4-2: Using the singleton mode to create a unique identifier for the PLC derived class A, the program control server's access, modification, or read and write operations on the member functions and attributes of the PLC derived class A are all verified through the unique identifier of the PLC derived class A;
[0081] The singleton pattern used in the present invention relates to a single class, which is responsible for creating its own object while ensuring that only a single object is created. This class provides a way to access its only object, which can be accessed directly without instantiating the object of this class.
[0082] The singleton pattern has the following advantages: a singleton class can have only one instance; a singleton class must create its own unique instance; and a singleton class must provide this instance to all other objects.
[0083] Step S4-4: Create a singleton mode object for the PLC derived class A;
[0084] Step S4-5: The program controls the server to create an intermediate transition class Device, calls a public function of the PLC base class in the intermediate transition class Device, and accesses the PLC to perform related operations according to the singleton mode object.
[0085] In this embodiment, an intermediate transition class Device that interacts with the main program is designed on the Beckhoff ADS system PLC class and the Siemens system PLC class. In the main program, when the application needs to access the PLC, the main program first calls the intermediate transition class Device, and calls the public function of the base class PlcCom in the intermediate transition class Device. The execution of the public function depends on whether the subclass derived from the current base class PlcComm is the Beckhoff ADS system PLC class or the Siemens system PLC class. The current derived class may be the Beckhoff ADS system PLC class or the Siemens system PLC class. Once the system is running, it is unique. The member functions and attributes in the class are also uniquely determined as the current class is uniquely determined. Therefore, the singleton mode in the design mode is used to uniquely identify the class once the current class is determined. During the running process of the entire program, the indicated object of the current class, whether it is the Beckhoff ADS system PLC class or the Siemens system PLC class, is the only one that exists and runs until the entire system stops running. In the main program, access, modification, reading and writing of the member functions and properties of the PLC class are uniquely identified by this class.
[0086] Once the PLC system is determined, the execution of the upper computer control software program will call the member function of that PLC class to complete the specific PLC function. Whether it is the Beckhoff ADS system PLC or the Siemens system PLC, when they inherit from the base class PLC, they realize their own functional characteristics. For example, to read the value of a bool type variable in the Beckhoff PLC class, use the member function ReadBool of the Beckhoff PLC class; to read the value of a bool type variable in the Siemens PLC class, use the member function MReadBool of the Siemens PLC class. Calling different PLC classes to achieve the same function will have different calling methods in each class.
[0087] The control method described in the present invention is compatible with both Beckhoff PLC and Siemens PLC, which solves the technical problem of creating a PLC base class interface and then creating two derived classes of Beckhoff PLC and Siemens PLC by using the inheritance characteristics of the class, thereby realizing a set of control logic compatible with the respective logical functions of Beckhoff PLC and Siemens PLC. The present invention adopts the class factory mode in the design mode, creates two subclasses of Beckhoff PLC class and Siemens PLC class through the PLC base class interface, and realizes respective functional characteristics and operation logic in the subclasses. The present invention uses a configuration file to set which PLC type the current system uses, namely Beckhoff PLC or Siemens PLC. The present invention adopts the singleton mode in the design mode during actual operation, which has uniqueness and reduces the trouble of creating class instances multiple times.
Claims
1. A control method compatible with both Beckhoff PLC and Siemens PLC, characterized in that: The steps include: Step 1: Establish a client server and a program control server. The client server communicates with the program control server through the Internet. Create an application and a configuration file config.ini in the client server. Set the type of PLC system currently supported in the configuration file config.ini. Step 2: Establish an interface in the program control server as a PLC base class interface, and define all properties and member functions of the PLC base class in the form of public functions in the PLC base class interface; Define the Beckhoff PLC derived class, which is used to define the control characteristics and properties of the Beckhoff PLC. The Beckhoff PLC derived class inherits the PLC base class; Set the AdsAmsNetID and AdsPort of the Beckhoff PLC in the Beckhoff PLC derived class. AdsAmsNetID and AdsPort are used to access the connection when creating a connection to the Beckhoff PLC. Define the Siemens PLC derived class. The Siemens PLC derived class is used to define the control characteristics and properties of the Siemens PLC. The Siemens PLC derived class inherits the PLC base class. Define the TS7Client() and TS7Server() classes in the Siemens PLC derived class. The TS7Client() class represents the PC client and is used to create a communication client instance. The TS7Server() class represents the PLC server and is used to provide the client with a specific linked PLC server. Step 3: Define the Beckhoff PLC derived classes of multiple Beckhoff PLCs and the Siemens PLC derived classes of multiple Siemens PLCs in the program control server according to the method in step 2; Step 4: The program controls the server to read and parse the configuration file config.ini of the client server, and obtains the types and models of PLCs that need to be supported contained in the configuration file config.ini; According to the type and model of PLC, use the class factory mode to select an applicable PLC derived class A, and use the singleton mode to create a unique identifier for PLC derived class A; Create a singleton mode object of PLC derived class A and operate PLC through the singleton mode object; When executing step 4, the specific steps include: Step S4-1: adopting the class factory mode to select a PLC derived class applicable to the PLC supported in the configuration file config.ini, that is, a PLC derived class A; Step S4-2: Using the singleton mode to create a unique identifier for the PLC derived class A, the program control server's access, modification, or read and write operations on the member functions and attributes of the PLC derived class A are all verified through the unique identifier of the PLC derived class A; Step S4-4: Create a singleton mode object for the PLC derived class A; Step S4-5: the program controls the server to create an intermediate transition class Device, calls a public function of the PLC base class in the intermediate transition class Device, and accesses the PLC to perform related operations according to the singleton mode object; Step 5: After the operation is completed, destroy the singleton mode object of PLC derived class A.
2. A control method compatible with both Beckhoff PLC and Siemens PLC as claimed in claim 1, characterized in that: The member functions in the PLC base class are all pure virtual functions.
3. A control method compatible with both Beckhoff PLC and Siemens PLC as claimed in claim 1, characterized in that: The AdsAmsNetID is the ADS router in Beckhoff PLC, and AdsPort is the virtual device for the specified communication.
4. A control method compatible with both Beckhoff PLC and Siemens PLC as claimed in claim 1, characterized in that: When executing step 2, inheriting the PLC base class means inheriting all member functions and properties in the PLC base class.
5. A control method compatible with both Beckhoff PLC and Siemens PLC as claimed in claim 1, characterized in that: When executing step 2, the Beckhoff PLC derived class defines the transmission of PLC variables between the client control software and the mechanical components through the TCP / IP protocol to achieve data communication; the Siemens derived class defines the transmission of PLC variables between the client software and the mechanical components through the SNAP7 protocol to achieve data communication.
Citation Information
Patent Citations
Cross-platform power electronic device software interface application method
CN114510355A