Method for automatically distributing PLC module addresses and automatically uploading module parameters
Through analog quantity acquisition technology, the PLC module address is automatically allocated and the module parameters is automatically uploaded, which solves the problems of low hardware resource utilization, high cost and complex fault diagnosis of the existing PLC system, and improves the stability and convenience of the system.
Patent Information
- Application Number
- CN202411615960.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-02-25
AI Technical Summary
The existing PLC systems have problems such as low hardware resource utilization, high cost, high electromagnetic interference risk and complex fault diagnosis in module address allocation and parameter upload.
The analog quantity acquisition technology is used to automatically allocate the module address, and the module parameters are automatically uploaded through the analog quantity acquisition interface. This method is based on the principle of resistive voltage division, supports hot swapping, and regularly updates module information through broadcasting for upper computer communication.
It improves the utilization rate of hardware resources, reduces costs and electromagnetic interference risks, simplifies the fault diagnosis process, and improves the stability and convenience of the PLC system.
Smart Images

Figure CN119511927A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of industrial control and communication technology, and in particular to a method for automatically allocating PLC module addresses and automatically uploading module parameters. Background Art
[0002] The development trend of industrial automation today is intelligence, efficiency and integration. In factory automation systems, PLC, as the core control device, needs to manage a large number of input / output (I / O) modules, communication modules and other types of modules. With the expansion of factory scale and the complexity of production processes, the number of modules contained in PLC systems continues to increase. In medium and large PLC systems, module address information is mostly allocated manually on site through external dip switches, or through software, using serial ports / other interfaces to write address information to modules. However, these technologies increase the complexity of the code on the one hand, and increase hardware and labor costs on the other. Therefore, it is particularly important to invent a method for automatic allocation of PLC module addresses and automatic upload of module parameters.
[0003] The prior art, such as the invention application patent with announcement number: CN108897277A, discloses a method and structure for automatically allocating addresses of independent IO modules of a PLC. When the module backplane slot is connected to the PLC main controller, a fixed address code can be obtained in the corresponding module backplane slot according to the hardware bus shift principle. Regardless of whether the module backplane slot is inserted with an independent IO module, its address will not change. When the module backplane slot is inserted with an independent IO module, its address will be allocated to the independent IO module; when the module backplane slot is not inserted with an independent IO module, the address will be reserved until an independent IO module is inserted and allocated. This application significantly reduces the logic operation burden of the code and the cost of the peripheral hardware interface, optimizes the communication structure, realizes multi-point support for medium and large PLCs, and greatly improves the stability and operability of the PLC system.
[0004] The prior art also has the following shortcomings, which are specifically embodied in:
[0005] 1. The prior art uses digital quantities to encode and allocate slot addresses, so 16 addresses will occupy 4 GPIOs and 4 connector PINs, reducing the utilization rate of hardware resources, increasing the complexity of hardware design, and leading to an increase in product costs. More pins are used for address encoding, which means that more signal lines are exposed to the external environment, increasing the risk of interference from electromagnetic interference signals and reducing the accuracy of digital signals used for address encoding.
[0006] 2. In the prior art, there is little attention paid to the automatic upload and diagnosis mechanism of module information after the address is determined. When a system fails, since there is no automatic upload of module information, maintenance personnel need to manually obtain relevant information of each module, which increases the difficulty of fault diagnosis and reduces the efficiency of maintenance. When upgrading or expanding the PLC system, the complexity of system upgrade and expansion is increased. Summary of the invention
[0007] The purpose of the present invention is to provide a method for automatically allocating PLC module addresses and automatically uploading module parameters, which solves the problems existing in the background technology.
[0008] To solve the above technical problems, the present invention adopts the following technical solution: The present invention provides a method for automatically allocating PLC module addresses and automatically uploading module parameters, including: step one, analog quantity acquisition, used to acquire the analog quantity of the system, obtain module parameters, and realize automatic allocation of module addresses.
[0009] Step 2: Automatic address allocation: Based on analog quantity acquisition, automatic module address allocation is achieved.
[0010] Step 3: Automatically upload module parameters to the host computer.
[0011] Preferably, the module address is automatically allocated, and the specific analysis method is as follows: the module is installed on the backplane through a connector, and the N PIN pins of the connector are used for module address allocation, and the rest are used for power supply and backplane communication; the backplane slot is not higher than 20, and the module contains 2 analog quantity acquisition interfaces, and the sampling range of the analog quantity acquisition interface is 0-3.3V; the analog quantity acquisition range of 0~3.3V is divided into several equal parts; using the principle of resistance voltage division, when the module is installed on the backplane, the several different voltage values are generated, and after the module acquires different voltages, its slot address is automatically allocated.
[0012] Preferably, the resistors are divided into voltages, and a 3.3V voltage is generated on the module. The resistors are divided into upper resistors and lower resistors, the upper resistors are installed on the module, and the lower resistors are installed on the backplane; the upper resistors have the same resistance value; the lower resistors are designed and valued according to the voltage division value; the analog quantity acquisition interface 1 makes a judgment based on the collected voltage division value.
[0013] Preferably, the lower resistor is variable, supports hot plugging, and is installed on the backplane, that is, the module address is determined by the lower resistor on the backplane.
[0014] Preferably, for the hot plug, a TVS is added at the module analog interface as the first-level protection for discharging the impact energy during the hot plug process. At the same time, after the first-level protection, an RC circuit is added as the second-level protection for buffering the impact energy.
[0015] Preferably, the module parameters are automatically uploaded to the host computer. The specific analysis method is: after the module address is determined, the module address and module type are sent to the main control module by broadcasting. The main control module updates the module information at a regular period and transmits the information to the host computer through communication with the host computer. The host computer automatically generates module information and can also verify the module information of the previous cycle to perform module information fault diagnosis.
[0016] The beneficial effects of the present invention are: 1. The present invention encodes addresses based on analog quantities, and 16 addresses only occupy 2 GPIOs and 2 connector PINs, and even 64 addresses can occupy 2 related resources, thereby improving the utilization rate of hardware resources. At the same time, the method of automatically allocating addresses in advance, under the premise of adding protection circuits, enables the module to support hot plugging, reduces the risk of interference from electromagnetic interference signals, and increases the accuracy of digital signals used for address encoding.
[0017] 2. In the present invention, more attention is paid to the automatic uploading and diagnosis mechanism of module information after the address is determined. When a system failure occurs, the control system can quickly upload various relevant information of the module to the monitoring system or the host computer. Maintenance personnel can quickly locate the faulty module and the cause of the failure by analyzing the automatically uploaded information, thereby improving the convenience of on-site use of PLC. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] 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, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 The present invention is a schematic flow chart of the steps for implementing the method.
[0020] Figure 2 The present invention is a schematic diagram of a method for automatically allocating addresses of PLC modules and automatically uploading module information that supports hot plugging.
[0021] Figure 3 Schematic diagram of upper resistor and lower resistor.
[0022] Figure 4 This is a schematic diagram of the hot-swap protection circuit.
[0023] Figure 5 This is a schematic diagram of the specific effect of the method for automatically uploading module information.
[0024] Figure 6 The figure is a specific flow chart of the method for automatically uploading module information. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] Reference Figure 1 As shown, the present invention provides a method for automatically allocating PLC module addresses and automatically uploading module parameters, including: step one, analog quantity acquisition, used to acquire the analog quantity of the system, obtain module parameters, and realize automatic module address allocation.
[0027] Step 2: Automatic address allocation: Based on analog quantity acquisition, automatic module address allocation is achieved.
[0028] In a specific embodiment, the module address is automatically assigned, and the specific analysis method is as follows: the module is installed on the backplane through a connector, and N PIN pins of the connector are used for module address assignment, and the rest are used for power supply and backplane communication; the backplane slot is not higher than 20, and the module contains 2 analog quantity acquisition interfaces, and the sampling range of the analog quantity acquisition interface is 0-3.3V; the analog quantity acquisition range of 0~3.3V is divided into several equal parts; using the principle of resistance voltage division, when the module is installed on the backplane, the several different voltage values are generated, and after the module acquires different voltages, its slot address is automatically assigned.
[0029] It should be noted that the analog quantity acquisition range of 0~3.3V is divided into several equal parts, which can be evenly divided into 4 equal parts, namely 0V, 1.1V, 2.2V, and 3V, or evenly divided into 8 equal parts. If the analog quantity is divided into 8 equal parts, then using 2 analog quantity interfaces can realize the automatic allocation of a maximum of 8*8=64 slot addresses. The analog quantity needs to be evenly divided according to the actual situation.
[0030] The present invention encodes addresses based on analog quantities, and 16 addresses only occupy 2 GPIOs and 2 connector PINs, and even 64 addresses can occupy 2 related resources, thereby improving the utilization rate of hardware resources. At the same time, the method of automatically allocating addresses in advance, under the premise of adding protection circuits, enables the module to support hot plugging, reduces the risk of interference by electromagnetic interference signals, and increases the accuracy of digital signals used for address encoding.
[0031] In a specific embodiment, the resistor is divided into a voltage, and a 3.3V voltage is generated on the module. The resistor is divided into an upper resistor and a lower resistor. The upper resistor is installed on the module, and the lower resistor is installed on the backplane. The upper resistors have the same resistance value. The lower resistors are designed and valued according to the voltage division value. The analog quantity acquisition interface 1 makes a judgment based on the collected voltage division value.
[0032] It should be noted that the upper resistors have the same resistance value, which is 1kΩ. The lower resistors are designed and taken according to the voltage divider values, which are: 0Ω, 510Ω, 2000Ω, and 10000Ω. The analog quantity acquisition interface 1 makes a judgment based on the collected voltage divider value, and records the vicinity of 0V as "00", the vicinity of 1.1V as "01", the vicinity of 2.2V as "10", and the vicinity of 3V as "11". Using 2 analog quantity interfaces, a maximum of 4*4=16 slot addresses can be automatically allocated.
[0033] In a specific embodiment, the lower resistor is variable, supports hot plugging, and is installed on the backplane, that is, the module address is determined by the lower resistor on the backplane, that is, the slot address of the backplane is pre-allocated before design, and the module can be installed in any slot on the backplane, and module plugging and unplugging will not affect the system.
[0034] like Figure 2 As shown, a method for automatically allocating addresses of PLC modules supporting hot plugging and automatically uploading module information includes: a main controller, N IO modules, a power module, and a backplane system. All modules can be installed in any slot of the backplane system, and the backplane can be further expanded downward through an expansion interface. The automatic address allocation method is implemented based on an analog quantity acquisition unit. The analog quantity acquisition unit includes a resistor voltage divider and hot plug protection. The resistor voltage divider includes an upper resistor and a lower resistor.
[0035] like Figure 3As shown, the upper resistor has a fixed resistance and is installed on an independent module. The lower resistor has a resistance determined according to the voltage divider value and is installed on the backplane slot in order of resistance value. The voltage divider values are "0V-0V", "0V-1.1V", "0V-2.2V", "0V-3V", "1.1V-0V", "1.1V-1.1V" ... "3V-3V" respectively. After the analog interface collects the corresponding voltage, the corresponding slot address is stored in the address register. The slot addresses are arranged in binary as: "0000", "0001", "0010", "0011", "0100", "0101" ... "1111".
[0036] In a specific embodiment, for the hot plug, a TVS is added at the module analog interface as the first-level protection for releasing the impact energy during the hot plug process. At the same time, after the first-level protection, an RC circuit is added as the second-level protection for buffering the impact energy.
[0037] like Figure 4 As shown, S1 is the first level protection, using TVS tube for energy discharge, S2 is the second level protection, using RC low-pass filter for energy buffering.
[0038] Step 3: Automatically upload module parameters to the host computer.
[0039] In a specific embodiment, the module parameters are automatically uploaded to the host computer. The specific analysis method is: after the module address is determined, the module address and module type are sent to the main control module by broadcasting. The main control module updates the module information periodically and transmits the information to the host computer through communication with the host computer. The host computer automatically generates module information and can also verify the module information of the previous cycle to perform module information fault diagnosis.
[0040] It should be noted that the address and module type of the module are determined by the module's own software.
[0041] In the present invention, more attention is paid to the automatic uploading and diagnosis mechanism of module information after the address is determined. When a system failure occurs, the control system can quickly upload various relevant information of the module to the monitoring system or the host computer. Maintenance personnel can quickly locate the faulty module and the cause of the failure by analyzing the automatically uploaded information, thereby improving the convenience of on-site use of PLC.
[0042] like Figure 5 , 6As shown, the upper side is the upper side, and the lower side is the field side. After the module is installed on the backplane, its address information will be recognized by the module and stored in the corresponding address register, and the module type information is determined by its own module code, and its information is stored in the parameter register. After the CPU module sends a command to other modules to request module information by broadcasting, the other modules send the address and parameter register information to the CPU module. After the CPU module processes the relevant information, it uploads the information to the host computer through Ethernet and other communication methods. After the host computer obtains the information, it automatically generates a Figure 4 The human-machine interface in the system can also be verified to see if it is consistent with the module type on the field side. If it is inconsistent, an error message will be given, which greatly saves labor costs.
[0043] The above contents are merely examples and explanations of the concept of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the concept of the invention or exceed the scope defined by the present invention, they shall all fall within the protection scope of the present invention.
Claims
1. A method for automatically allocating PLC module addresses and automatically uploading module parameters, characterized in that: include: Step 1: Analog quantity acquisition, used to collect the analog quantity of the system, obtain module parameters, and realize automatic module address allocation; Step 2: Automatic address allocation: Based on analog quantity acquisition, automatic module address allocation is realized; Step 3: Automatically upload module parameters to the host computer.
2. The method for automatically allocating PLC module addresses and automatically uploading module parameters according to claim 1, characterized in that: The module address is automatically allocated, and the specific analysis method is as follows: The module is installed on the backplane through a connector, and N PIN pins of the connector are used for module address allocation, and the rest are used for power supply and backplane communication; the backplane slot is not higher than 20, and the module contains 2 analog quantity acquisition interfaces, and the sampling range of the analog quantity acquisition interface is 0-3.3V; the analog quantity acquisition range of 0-3.3V is divided into several equal parts; using the principle of resistor voltage division, when the module is installed on the backplane, the several different voltage values are generated, and after the module collects different voltages, its slot address is automatically allocated.
3. The method for automatically allocating PLC module addresses and automatically uploading module parameters according to claim 2, characterized in that: The resistors divide the voltage, and a 3.3V voltage is generated on the module. The resistors are divided into upper resistors and lower resistors. The upper resistors are installed on the module, and the lower resistors are installed on the backplane. The upper resistors have the same resistance value. The lower resistors are designed and valued according to the voltage division value. The analog quantity acquisition interface 1 makes a judgment based on the collected voltage division value.
4. The method for automatically allocating PLC module addresses and automatically uploading module parameters according to claim 3 is characterized in that: The lower resistor is variable, supports hot plugging, and is installed on the backplane, that is, the module address is determined by the lower resistor on the backplane.
5. The method for automatically allocating PLC module addresses and automatically uploading module parameters according to claim 4, characterized in that: For the hot plug, a TVS is added at the module analog interface as the first-level protection for releasing the impact energy during the hot plug process. At the same time, after the first-level protection, an RC circuit is added as the second-level protection for buffering the impact energy.
6. The method for automatically allocating PLC module addresses and automatically uploading module parameters according to claim 1, characterized in that: The module parameters are automatically uploaded to the host computer. The specific analysis method is as follows: After the module address is determined, the module address and module type are sent to the main control module by broadcasting. The main control module updates the module information periodically and transmits the information to the host computer through communication with the host computer. The host computer automatically generates module information and can also verify the module information of the previous cycle to perform module information fault diagnosis.
Citation Information
Patent Citations
Independent IO (Input / Output) module address automatic distribution method and structure of PLC (Programmable Logic Controller)
CN108897277A