Active analog input regulation and control system and method based on EtherCAT protocol

Through the EtherCAT protocol, the analog input active control system is used to transmit adjustment information using the diagnostic word of the analog input module, which realizes active regulation of the voltage and current at the input end, solving the problem that the existing analog input module cannot be actively adjusted, and improving the Automated testing and calibration flexibility.

CN119200496APending Publication Date: 2024-12-27湖南智领通信科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411318215.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The existing analog input modules cannot actively adjust the voltage and current at the input, and the method of implementing this function using the EtherCAT protocol has not been considered, resulting in insufficient control flexibility in automated testing and calibration.

Method used

Design an active control system for analog input based on EtherCAT protocol, transmit adjustment information through the diagnostic word of the analog input module, use the CPU module to analyze and adjust the output value of the analog output module to realize the input terminal Active regulation of voltage and current.

Benefits of technology

The analog input module is realized to actively adjust the voltage and current at the input terminal, which reduces the transmission packet size of the EtherCAT communication network, simplifies the PLC system structure, and improves the flexibility of automated testing and calibration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119200496A_ABST
    Figure CN119200496A_ABST
Patent Text Reader

Abstract

The invention relates to an analog input active regulation and control system and method based on an EtherCAT protocol, and the system employs an idle diagnosis word of an analog input module to transmit adjustment information, does not need to additionally increase a transmission variable, for example, does not increase an output variable, reduces the size of a transmission message in an EtherCAT communication network, enables the analog input module to actively send an adjustment command, and improves the adjustment efficiency. The voltage / current value of the input end is adjusted instead of passive waiting, and the purpose of actively adjusting the voltage and current of the input end through the analog input module is achieved. The adjustment command is transmitted by using the existing EtherCAT protocol, and complex external configuration does not need to be introduced, so that the structure of the PLC system is kept simple.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of automated industrial control, and relates to an analog quantity input active control system and method based on the EtherCAT protocol. Background Art

[0002] In the field of PLC (Programmable Logic Controller), each manufacturer usually develops its own voltage and current analog input module (AI module for short), which is mainly used for the acquisition of analog signals. The analog input module provides acquisition channels. The channels are based on the product size and functional requirements. The current mainstream products contain 2-128 channels. Each channel is used to receive analog signals from the source end (such as 4mA-20mA current signals or -10V~10V voltages). The module converts the input analog quantity into digital quantity through the ADC (analog-to-digital converter) chip inside, obtains the corresponding value, and then transmits it to the host computer through some method. Because the main function of the analog input module is to receive voltage and current signals from the source end, the module itself cannot actively request to change the voltage and current of the input end. Almost all products of various manufacturers follow this model. Summary of the invention

[0003] In view of the problems existing in the above-mentioned traditional methods, the present invention proposes an analog input active control system based on the EtherCAT protocol and an analog input active control method based on the EtherCAT protocol, which can actively adjust the voltage and current of the input end through the analog input module.

[0004] In order to achieve the above objectives, the embodiments of the present invention adopt the following technical solutions:

[0005] On the one hand, an analog input active control system based on the EtherCAT protocol is provided, comprising a CPU module, an analog output module and an analog input module, wherein the CPU module, the analog output module and the analog input module all provide an EtherCAT interface, and the modules communicate on-site through the EtherCAT interface respectively, the CPU module is used to connect to a host computer, and the idle bits of the diagnostic word of the analog input module are configured with adjustment command bits, voltage / current value bits and channel number bits;

[0006] The analog input module sends the diagnostic word to the CPU module through the EtherCAT interface. When the CPU module parses the diagnostic word and finds that the adjustment command bit is valid, it obtains the modification value from the voltage / current value bit of the diagnostic word. After obtaining the channel number to be adjusted from the channel number bit of the diagnostic word, the CPU module adjusts the output value of the channel corresponding to the channel number of the analog output module to the modification value based on the modification value and channel number.

[0007] In one embodiment, when the CPU module finds from the diagnostic word that the adjustment command bit is invalid, the CPU module does not perform an output value adjustment operation on the analog output module.

[0008] In one embodiment, the adjustment command bit of the diagnostic word of the analog input module is bit 31 in the diagnostic word, the voltage / current value bit of the diagnostic word of the analog input module is bit 30 to bit 20 in the diagnostic word, and the channel number bit of the diagnostic word of the analog input module is bit 19 to bit 18 in the diagnostic word.

[0009] In one of the embodiments, when the analog output module adjusts the output value of the channel corresponding to the channel number, the modified value is rounded and converted to a decimal during actual processing.

[0010] In one of the embodiments, after the output value of the channel corresponding to the channel number of the analog output module is adjusted, the error between the input value collected by the analog input module and the modified value is maintained within the set error range for a set number of cycles, and then the adjustment command bit in the diagnostic word is restored to invalid.

[0011] On the other hand, an active control method for analog input based on the EtherCAT protocol is also provided, which is applied to the above-mentioned active control system for analog input based on the EtherCAT protocol. The active control method for analog input based on the EtherCAT protocol comprises the steps of:

[0012] The analog input module sends the diagnostic word to the CPU module through the EtherCAT interface;

[0013] When the CPU module parses the diagnostic word and finds that the adjustment command bit is valid, it obtains the modification value from the voltage / current value bit of the diagnostic word and obtains the channel number to be adjusted from the channel number bit of the diagnostic word;

[0014] The CPU module adjusts the output value of the channel corresponding to the channel number of the analog output module to the modified value according to the modified value and the channel number.

[0015] One of the above technical solutions has the following advantages and beneficial effects:

[0016] The above-mentioned analog input active control system and method based on the EtherCAT protocol transmits adjustment information by using the idle diagnostic word of the analog input module, and no additional transmission variables are added, such as no additional "output" variables, which reduces the size of the transmission message in the EtherCAT communication network, and enables the analog input module to actively send adjustment commands to adjust the voltage / current value of the input terminal, instead of passively waiting, so as to achieve the purpose of actively adjusting the voltage and current of the input terminal through the analog input module. The existing EtherCAT protocol is used to transmit adjustment commands, and there is no need to introduce complex external configurations, so that the structure of the PLC system remains simple. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions are 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 any creative work.

[0018] Figure 1 A schematic diagram of the wiring structure of an analog input active control system based on the EtherCAT protocol in one embodiment;

[0019] Figure 2 It is a schematic diagram of a process of actively adjusting an input terminal of an analog quantity input module in one embodiment;

[0020] Figure 3 A schematic diagram of a process flow of an active control method for analog quantity input based on the EtherCAT protocol in one embodiment;

[0021] Figure 4 It is a flowchart of an active control method of analog input based on EtherCAT protocol in another embodiment. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and Examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art of the present invention. The terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0023] It should be noted that the reference to "embodiment" in this article means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The presentation of this phrase at various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It will be appreciated by those skilled in the art that the embodiments described herein may be combined with other embodiments. The term "and / or" used in the specification of the present invention and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.

[0024] The following will describe the implementation of the present invention in detail with reference to the accompanying drawings in the embodiment diagram of the present invention.

[0025] For PLC series products, manufacturers will develop voltage and current analog output modules (AO modules for short) in addition to AI modules, which can be used as input sources to provide voltage and current signals. Because if the voltage and current source is provided by a third party, such as a process instrument or a voltage regulator, it can provide voltage and current. Unless the third party opens the interface and connects according to the rules set by the third party, the voltage and current of the other party can be adjusted. The operation is troublesome and cumbersome, and it is not suitable for rapid development and application.

[0026] At present, the voltage and current type analog input module does not provide active regulation of the voltage and current at the source end, or has not considered using the EtherCAT protocol to implement this function. At the current stage, the voltage and current type analog input module is mainly used for the acquisition of analog signals. It provides an acquisition channel to convert the input analog quantity into a digital quantity and then report the data. At the same time, the analog input module provides a diagnostic word to show whether there is a problem with the module. This design can meet the needs of most customers.

[0027] Through the above scheme, applications in certain specific fields can be realized. For example, the AI ​​module can use this function in automated testing and calibration to achieve more flexible control. In automated testing, the AI ​​module executes automated test cases and expects different voltage values ​​to be input at the input end, but it is unknown how long the input end inputs and when it ends. If the AI ​​module can collect another value that is expected to be adjusted based on the input (voltage / current) value, and then tell the input end to switch to the other value: if the AI ​​module issues an adjustment command and sends it to the host computer, the host computer adjusts the output parameters of the AO module according to the received adjustment command, thus realizing the adjustment of the voltage / current of the AO module.

[0028] During calibration, taking the voltage collection as an example, suppose the AI ​​module needs to collect voltages of 10V, 5V, 1V, -5V and -10V respectively. The more traditional method is manual calibration: that is, input the specified voltage at the input end of the AI ​​module each time, and then perform calibration judgment. When the automatic calibration mode appears, the voltage at the input end is automatically modified. This method is that the outside world (such as the host computer and serial port instructions, etc.) actively adjusts the voltage at the input end, and the AI ​​module only passively collects the input voltage value.

[0029] In the above scheme, the AI ​​module sends an adjustment command to adjust the voltage ( / current) at the input end. When the AI ​​module collects 10V voltage, assuming that the calibration time of each channel is unstable, such as 3 seconds for the first time, 5 seconds for the second time, and 6 seconds for the third time, the input end does not know when the AI ​​module completes the collection of values. If it is an automated test, for safety reasons, the voltage input specified by each channel lasts for 10 seconds to ensure that each input value is stable so that the AI ​​module can collect the value.

[0030] According to the practical findings during development, this application has made corresponding improvements to the analog input module, so that it can issue instructions as needed through the EhterCAT protocol to actively adjust the voltage and current of the input end. That is, the analog input module can issue commands to allow the input end to adjust the voltage or current.

[0031] Among them, the PLC (Programmable Logic Controller) system is a digital computer designed specifically for industrial automation control. PLC systems are widely used in industrial and manufacturing environments for the control and process management of automated production lines and mechanical equipment. It can process input signals, make corresponding output controls according to preset logic programs, and realize automatic control and monitoring of various mechanical equipment.

[0032] The CPU module (Central Processing Unit) of the PLC system is the core part of the PLC system. It is equivalent to the "brain" of the PLC system, responsible for executing the control program written by the user, processing input signals, performing logical and mathematical operations, and controlling output signals. The CPU module of the PLC system includes a processor, memory, and various interfaces, and is a key component for the operation of the entire PLC system.

[0033] The voltage / current analog input module (Analog Input) of the PLC system is a module specifically used to receive and process analog signals. The analog input module can convert the voltage or current signal output by an external sensor or transmitter into a digital signal that can be processed by the PLC for measurement, monitoring and control. The analog input module can receive analog signals output by various sensors or transmitters. Common signal types include voltage signals (such as 0-10V, ±10V, etc.) and current signals (such as 4-20mA, 0-20mA, etc.). The analog input converts the analog signal into a digital signal through the internal analog-to-digital converter (ADC), and these digital signals can be processed by the CPU module of the PLC system.

[0034] The voltage / current analog output module (Analog Output) of the PLC system is a module used to convert the digital signal of the PLC system into an analog signal. The analog output module can output continuously changing voltage or current signals to drive actuators (such as control valves, frequency converters and regulators, etc.) or other devices on site to achieve precise control and regulation of industrial processes. The analog output module converts the digital signal into a continuous voltage or current signal through the internal digital-to-analog converter (DAC) based on the digital signal inside the PLC system (such as the result of the control program calculation). The analog output module usually supports a variety of voltage and current output ranges, such as 0-10V, ±10V, 0-20mA and 4-20mA, which can be selected through software or hardware settings to meet the needs of different devices or applications.

[0035] EtherCAT (Ethernet for Control Automation Technology) is a high-performance real-time Ethernet communication protocol used in industrial automation. It was developed by BECKHOFF Automation and is designed to meet the needs of industrial automation for real-time, bandwidth, synchronization, and device interoperability. It achieves efficient data transmission and precise device coordination through ring communication, processing-transparent transmission mechanism, time synchronization and other technologies, and is widely used in various industrial control and automation systems.

[0036] The control logic program running in the PLC system is used to automate control equipment and systems. It defines the processing logic of input signals, output control instructions, and various calculation functions through programming languages ​​(such as ladder diagrams, function block diagrams, and instruction tables). It can perform tasks such as logical operations, timing, counting, controlling switch actions, and processing digital signals in an industrial environment to achieve automated control of machines or production lines.

[0037] In one embodiment, Figure 1 As shown, an analog input active control system based on EtherCAT protocol is provided, including a CPU module, an analog output module (AO) and an analog input module (AI). The CPU module, the analog output module and the analog input module all provide EtherCAT ( Figure 1 The analog input module uses the EtherCAT interface to communicate with each other on site. The CPU module is used to connect to the host computer. The free bits of the diagnostic word of the analog input module are configured with adjustment command bits, voltage / current value bits and channel number bits. The analog input module sends the diagnostic word to the CPU module through the EtherCAT interface. When the CPU module parses the diagnostic word and finds that the adjustment command bit is valid, it obtains the modification value from the voltage / current value bit of the diagnostic word, and obtains the channel number to be adjusted from the channel number bit of the diagnostic word. The CPU module adjusts the output value of the channel corresponding to the channel number of the analog output module to the modification value according to the modification value and the channel number.

[0038] It is understandable that Figure 1 The PLC system connection method shown uses the AO module of the same manufacturer. Since the same communication connection is used, the field communication cable of the EtherCAT protocol is uniformly used, which is convenient for development. The host computer can usually be a PC computer with a PLC monitoring program provided by the PLC manufacturer installed. The required control can be performed through the graphical interface of the program. The host computer is connected to the PLC system through a communication network and can interact with the PLC system in real time. Each module of the PLC system can define "input" and "output" variables according to its own functions. For example, the "input" variable in the AI ​​module is the collection value of each channel. The AI ​​module collects the value of the channel and reports it to the host computer. For example, a voltage of 5V is provided to the input end of the specified channel, and the AI ​​module collects the (voltage) value from the channel. The host computer can see that the current collection voltage of the AI ​​module is 5V.

[0039] In the AO module, the "output" variable is the output parameter modified by the host computer and passed to the AO module, so that the AO module outputs the corresponding (voltage / current) value. For example, if the "output" variable value of the specified channel is modified to 3V in the host computer, the corresponding channel of the AO module can output 3V voltage. Each type of module will define the module's diagnostic word and the channel's diagnostic word, which are used to monitor the module's own status online. For example, when a channel short circuit or module overcurrent occurs in a module, the diagnostic word is provided to the host computer in real time, so that the host computer can make corresponding processing according to the problem. These diagnostic words are the medium for the module application to detect its own module and report to the host computer immediately when a problem occurs. These diagnostic words are "input" variables.

[0040] In the AI ​​module, because only data is collected, there are usually only "input" variables, and no "output" variables are configured. The "input" variables include the collected values ​​of each channel, the module's diagnostic word, and the channel's diagnostic word. Because there is currently no need to configure "output" variables in the AI ​​module, these variables are transmitted through the EtherCAT protocol, and configuring more variables will increase the EtherCAT communication volume. Therefore, when designing, the minimum number of variables will be used as much as possible, so the AI ​​module does not configure "output" variables. The present invention utilizes the module diagnostic words in the existing "input" variables to achieve control of the input voltage and current.

[0041] The PLC monitoring program of the host computer is installed in the PC computer, and the customer performs monitoring work through the PLC monitoring program running on the host computer. The AO module serves as the input end of the AI ​​module, provides voltage / current signals, and is connected to the AI ​​module through a channel. The AI ​​module collects input values. The CPU module, AO module, and AI module of the PLC system communicate on-site through the EtherCAT (protocol) interface. When the modules of the PLC system are in operation, the CPU module will send more than 700 EtherCAT messages per second to the AO module and the AI ​​module. The AO module and the AI ​​module will reply to the EtherCAT message and reply to the CPU module. When the PLC system is running, the CPU module will execute the control logic program of the PLC to realize the control of other modules. For example, by writing a new value to the "output" variable in the AO module, the AO module can adjust its output to the new voltage / current value.

[0042] For another example, a channel of the analog input module collects 8mA of current at the input end. Now the analog input module actively hopes that the input end will adjust the input to 3mA, but the analog input module cannot change the current at the input end. Through the above scheme of the present invention, the analog input module uses commands to let the input end adjust the input current to 3mA.

[0043] In the system of this embodiment, the specific process of the scheme design is: the voltage and current type analog input module uses the idle bits (bits) of the diagnostic word in the module to set the adjustment command, and sends the adjustment command to the CPU module of the PLC system through the EtherCAT protocol. After receiving the adjustment command, the task of the CPU module parses the (voltage / current) value that needs to be adjusted, and then sends it to the voltage and current type analog output module (i.e., AO module). The AO module adjusts its own (voltage / current) output value, and the AI ​​module can collect the (voltage / current) value after adjustment.

[0044] The analog input active control system based on the EtherCAT protocol transmits adjustment information by using the idle diagnostic word of the analog input module, and no additional transmission variables are added, such as no additional "output" variables, which reduces the size of the transmission message in the EtherCAT communication network, and enables the analog input module to actively send adjustment commands to adjust the voltage / current value of the input terminal, instead of passively waiting, so as to achieve the purpose of actively adjusting the voltage and current of the input terminal through the analog input module. The existing EtherCAT protocol is used to transmit adjustment commands, and there is no need to introduce complex external configuration, so that the structure of the PLC system remains simple.

[0045] In one embodiment, when the CPU module finds from the diagnostic word that the adjustment command bit is invalid, the CPU module does not perform an output value adjustment operation on the analog output module.

[0046] In one embodiment, the command adjustment bit of the diagnostic word of the analog input module is bit 31 in the diagnostic word, the voltage / current value bit of the diagnostic word of the analog input module is bit 30 to bit 20 in the diagnostic word, and the channel number bit of the diagnostic word of the analog input module is bit 19 to bit 18 in the diagnostic word.

[0047] It can be understood that the diagnostic word format of the AI ​​module is defined. The meaning of each bit of the diagnostic word is shown in Table 1 below:

[0048] Table 1

[0049] [Module] Bit offset illustrate Remark 0 The entire module status 1 is normal, 0 is abnormal 1 Field voltage loss 1 is normal, 0 is abnormal 2 Module short circuit or overcurrent 1 is normal, 0 is abnormal 3 Channel disconnection 1 is normal, 0 is abnormal 4 Reserved bits Write all 1 5 A channel value overflowed 1 is normal, 0 is abnormal 6 A channel value underflow 1 is normal, 0 is abnormal 7 Reserved bits Write all 1 8 Module internal error 1 is normal, 0 is abnormal 9~31 Reserved bits Write all 1

[0050] It can be seen from Table 1 that bits 9 to 31 are idle bits. Using some of the idle bits, the message format is defined as shown in Table 2 below:

[0051] Table 2

[0052]

[0053] Specifically, when the output of the AO module does not need to be changed, bits 31 to 18 in the diagnosis word of the AI ​​module are always 0.

[0054] When the AI ​​module expects the voltage / current value of the input terminal to change, the 31st bit in the diagnostic word of the AI ​​module becomes 1 (indicating that the bit is valid), and then bits 30 to 20 are the required modification values. For example: 0xFD0 means adjustment to 0x7D07 (2000), indicating that the current value of the input terminal is expected to be modified to 20.00mA.

[0055] In one embodiment, when the analog output module adjusts the output value of the channel corresponding to the channel number, the modified value is rounded and converted to a decimal during actual processing.

[0056] It is understandable that because the voltage / current value usually contains decimals, in order to process data more conveniently, it is not necessary to use values ​​with decimals. Values ​​with decimals need to use float (floating point) type, and cannot be represented by integer values. Therefore, in order to facilitate the adoption of the convention, after the AO module receives the modified value, it needs to divide by 100 to get the actual expected modified value. In the diagnostic word of the AI ​​module, bits 19 to 18 represent the channel number, which means channel 1 at this time. Bits 17 to 16 are still the original diagnostic word of the module, and the default value is 1.

[0057] In one embodiment, after the output value of the channel corresponding to the channel number of the analog output module is adjusted, the error between the input value collected by the analog input module and the modified value is maintained within the set error range for a set number of cycles, and then the adjustment command bit in the diagnostic word is restored to invalid.

[0058] It can be understood that the CPU module checks the diagnostic word of the AI ​​module in real time through the EtherCAT message. When the corresponding bit (such as 31bit) in the diagnostic word of the AI ​​module issues an adjustment command, the CPU module executes the logic control program of the PLC to obtain the new modified value. The CPU module checks the legality of the modified value. If it is legal, it modifies the "output" variable of the AO module so that the AO module adjusts its output value to the new output value.

[0059] The AI ​​module collects input values. If the error between the collected input values ​​and the expected input values ​​is within the set error range (such as 0.3%) within the set number of cycles (for example, 20 cycles), the AI ​​module restores bits 31 to 20 in the module's diagnostic word to 0 (that is, the bits are restored to an invalid state). The process of adjusting the input end is completed. The entire adjustment process is as follows: Figure 2 shown.

[0060] In one embodiment, Figure 3As shown, an analog quantity input active control method based on the EtherCAT protocol is provided, which is applied to the above-mentioned analog quantity input active control system based on the EtherCAT protocol. The analog quantity input active control method based on the EtherCAT protocol may include the following processing steps S10 to S14:

[0061] S10, the analog input module sends the diagnostic word to the CPU module through the EtherCAT interface;

[0062] S12, when the CPU module parses the diagnostic word and finds that the adjustment command bit is valid, it obtains the modification value from the voltage / current value bit of the diagnostic word, and obtains the channel number to be adjusted from the channel number bit of the diagnostic word;

[0063] S14, the CPU module adjusts the output value of the channel of the analog output module corresponding to the channel number to the modified value according to the modified value and the channel number.

[0064] The above-mentioned analog input active control method based on the EtherCAT protocol transmits adjustment information by using the idle diagnostic word of the analog input module, and no additional transmission variables are added, such as no additional "output" variables, which reduces the size of the transmission message in the EtherCAT communication network, and enables the analog input module to actively send adjustment commands to adjust the voltage / current value of the input terminal, instead of passively waiting, so as to achieve the purpose of actively adjusting the voltage and current of the input terminal through the analog input module. The existing EtherCAT protocol is used to transmit adjustment commands, and there is no need to introduce complex external configuration, so that the structure of the PLC system remains simple.

[0065] In one embodiment, Figure 4 As shown, after the above step S14, the above analog input active control method based on the EtherCAT protocol may further include step S16:

[0066] S16, the analog input module collects the input current of the channel with the channel number, and after determining that the input current has changed to the modified value within a set number of cycles, restores bit 31-bit 18 in the diagnostic word to 0.

[0067] It can be understood that for the specific limitations of the analog input active control method based on the EtherCAT protocol, reference can be made to the corresponding limitations of the analog input active control system based on the EtherCAT protocol above, which will not be repeated here.

[0068] It should be understood that although Figure 3 and Figure 4The steps in the method are shown in sequence as indicated by the arrows, but the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of the steps, and the steps can be executed in other orders. Figure 3 and Figure 4 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequentially, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0069] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus dynamic random access memory (RambusDRAM, referred to as RDRAM) and interface dynamic random access memory (DRDRAM).

[0070] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0071] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of protection of the invention. It should be pointed out that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the attached claims.

Claims

1. An analog input active control system based on EtherCAT protocol, characterized in that: It includes a CPU module, an analog output module and an analog input module, wherein the CPU module, the analog output module and the analog input module all provide EtherCAT interfaces, and the modules communicate on site through the EtherCAT interfaces respectively, the CPU module is used to connect to a host computer, and the idle bits of the diagnostic word of the analog input module are configured with adjustment command bits, voltage / current value bits and channel number bits; The analog input module sends the diagnostic word to the CPU module through the EtherCAT interface. When the CPU module parses the diagnostic word and finds that the adjustment command bit is valid, it obtains the modification value from the voltage / current value bit of the diagnostic word, obtains the channel number to be adjusted from the channel number bit of the diagnostic word, and then the CPU module adjusts the output value of the channel corresponding to the channel number of the analog output module to the modification value based on the modification value and the channel number.

2. The analog input active control system based on EtherCAT protocol according to claim 1 is characterized in that: When the CPU module parses the diagnostic word and finds that the adjustment command bit is invalid, the CPU module does not perform an output value adjustment operation on the analog output module.

3. The analog input active control system based on EtherCAT protocol according to claim 1 or 2, characterized in that: The adjustment command bit of the diagnostic word of the analog input module is bit 31 in the diagnostic word, the voltage / current value bit of the diagnostic word of the analog input module is bit 30 to bit 20 in the diagnostic word, and the channel number bit of the diagnostic word of the analog input module is bit 19 to bit 18 in the diagnostic word.

4. The analog input active control system based on EtherCAT protocol according to claim 3 is characterized in that: When the analog output module adjusts the output value of the channel corresponding to the channel number, the modified value is rounded and converted into a decimal during actual processing.

5. The analog input active control system based on EtherCAT protocol according to claim 4 is characterized in that: After the output value of the channel corresponding to the channel number of the analog output module is adjusted, the error between the input value collected by the analog input module and the modified value is maintained within the set error range for a set number of cycles, and then the adjustment command bit in the diagnostic word is restored to invalid.

6. An active control method for analog input based on EtherCAT protocol, characterized in that: Applicable to the analog quantity input active control system based on the EtherCAT protocol according to any one of claims 1 to 5, the analog quantity input active control method based on the EtherCAT protocol comprises the steps of: The analog input module sends the diagnostic word to the CPU module through the EtherCAT interface; When the CPU module parses the diagnostic word and finds that the adjustment command bit is valid, it obtains the modification value from the voltage / current value bit of the diagnostic word and obtains the channel number to be adjusted from the channel number bit of the diagnostic word; The CPU module adjusts the output value of the channel of the analog output module corresponding to the channel number to the modified value according to the modified value and the channel number.

7. The analog input active control method based on EtherCAT protocol according to claim 6 is characterized in that: After the step of the CPU module adjusting the output value of the channel of the analog output module corresponding to the channel number to the modified value according to the modified value and the channel number, the step further includes: The analog input module collects the input current of the channel with the channel number, and after determining that the input current has changed to the modified value within a set number of cycles, restores the 31-bit to 18-bit bits in the diagnostic word to 0.