CN114815720B - Programmable controller, analog quantity multiplexing interface control method thereof and storage medium - Google Patents

Programmable controller, analog quantity multiplexing interface control method thereof and storage medium Download PDF

Info

Publication number
CN114815720B
CN114815720B CN202210744669.6A CN202210744669A CN114815720B CN 114815720 B CN114815720 B CN 114815720B CN 202210744669 A CN202210744669 A CN 202210744669A CN 114815720 B CN114815720 B CN 114815720B
Authority
CN
China
Prior art keywords
load
module
input
output
voltage data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210744669.6A
Other languages
Chinese (zh)
Other versions
CN114815720A (en
Inventor
韩景超
董丽佳
付建伟
郭宏伟
沙宏磊
俞天野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin Feixuan Technology Co ltd
Original Assignee
Tianjin Feixuan Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin Feixuan Technology Co ltd filed Critical Tianjin Feixuan Technology Co ltd
Priority to CN202210744669.6A priority Critical patent/CN114815720B/en
Publication of CN114815720A publication Critical patent/CN114815720A/en
Application granted granted Critical
Publication of CN114815720B publication Critical patent/CN114815720B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/24Pc safety
    • G05B2219/24215Scada supervisory control and data acquisition
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Programmable Controllers (AREA)

Abstract

The invention provides a programmable controller and an analog quantity multiplexing interface control method and a storage medium thereof, relating to the technical field of electronic power and comprising the following steps: controlling an input mode selection module to connect the microcontroller with the analog input module to obtain first voltage data and second voltage data; determining a load type of the input load based on the first voltage data and the second voltage data; controlling an output mode selection module to connect the microcontroller with an analog quantity current output module in the analog quantity output module to obtain third voltage data; determining a load type of the output load based on the third voltage data; the microcontroller is connected with the analog input module corresponding to the load type of the input load, and is connected with the analog output module corresponding to the load type of the output load, so that the technical problem that the programmable controller needs to carry out interface mode configuration aiming at different types of loads is solved.

Description

Programmable controller, analog quantity multiplexing interface control method thereof and storage medium
Technical Field
The invention relates to the technical field of electronic power, in particular to a programmable controller, an analog quantity multiplexing interface control method thereof and a storage medium.
Background
A Programmable Logic Controller (PC) or PLC is an electronic system with digital operation, and is designed for application in industrial environments. It uses programmable memories for storing instructions for logical operations and sequence control, timing, counting, and arithmetic operations, and controls various types of machinery or manufacturing processes through digital or analog input (I) and output (O) interfaces.
The analog quantity interface of the programmable controller is divided into an analog quantity output interface and an analog quantity input interface, and is also divided into a current type interface and a voltage type interface, although the current multiplexing interface can simultaneously output a voltage signal of 0-10V or a current signal of 4-20mA, the interface mode needs to be configured in advance by a program, so that the field cannot be processed in time after encountering a sudden situation, the efficiency is reduced, and the like.
No effective solution has been proposed to the above problems.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a programmable controller, an analog multiplexing interface control method thereof, and a storage medium, so as to alleviate the technical problem that the programmable controller needs to perform interface mode configuration for different types of loads.
In a first aspect, an embodiment of the present invention provides an analog quantity multiplexing interface control method for a programmable controller, which is applied to a microcontroller, and includes: the input mode selection module is controlled to enable the microcontroller to be connected with the analog input module to obtain first voltage data and second voltage data, wherein the analog input module comprises: the first voltage data is voltage data output by the analog quantity voltage input module when the first voltage data is connected with the analog quantity voltage input module, and the second voltage data is voltage data output by the analog quantity current input module when the second voltage data is connected with the analog quantity current input module; determining a load type of an input load based on the first voltage data and the second voltage data, wherein the load type of the input load comprises: a voltage load and a current load; the output mode selection module is controlled to enable the microcontroller to be connected with an analog quantity current output module in the analog quantity output module to obtain third voltage data output by the current feedback module, and the analog quantity output module comprises: the analog quantity voltage output module and the analog quantity current output module; determining a load type of an output load based on the third voltage data, wherein the load type of the output load comprises: a voltage load and a current load; the input mode selection module is controlled to enable the microcontroller to be connected with the analog quantity input module corresponding to the load type of the input load, and the output mode selection module is controlled to enable the microcontroller to be connected with the analog quantity output module corresponding to the load type of the output load.
Further, determining a load type of the input load based on the first voltage data and the second voltage data includes: if the first voltage data is within a first preset range, the load type of the input load is a current load; if the first voltage data is not within the first preset range and the second voltage data is within the first preset range, the load type of the input load is a voltage load.
Further, if neither the first voltage data nor the second voltage data is within the first preset range, the method further includes: if the first voltage data is larger than the second voltage data, the load type of the input load is a current load; if the first voltage data is smaller than the second voltage data, the load type of the input load is a voltage load.
Further, the method further comprises: if the first voltage data and the second voltage data are both the upper limit values within the first preset range, the load type of the input load is a current load; and if the first voltage data and the second voltage data are both 0, the load type of the input load is a voltage load.
Further, determining a load type of the output load based on the third voltage data includes: converting the third voltage data into corresponding current data; if the current data is within a second preset range, the load type of the output load is the current load; and if the current data is not in the second preset range, the load type of the output load is the voltage load.
Further, controlling an input mode selection module to connect the microcontroller with an analog input module corresponding to the load type of the input load, and controlling an output mode selection module to connect the microcontroller with an analog output module corresponding to the load type of the output load, includes: if the load type of the input load is a voltage load, controlling the input mode selection module to connect the microcontroller with the analog quantity voltage input module; if the load type of the input load is a current load, controlling the input mode selection module to connect the microcontroller with the analog quantity current input module; if the load type of the output load is a voltage load, controlling the output mode selection module to connect the microcontroller with the analog quantity voltage output module; and if the load type of the output load is a current load, controlling the output mode selection module to connect the microcontroller with the analog quantity current output module.
Further, before controlling the input mode selection module to connect the microcontroller with the analog input module to obtain the first voltage data and the second voltage data, the method further includes: and detecting the state of the analog input module and the analog output module, and if the analog input module or the analog output module is abnormal, generating an alarm signal.
In a second aspect, an embodiment of the present invention further provides a programmable controller, including: microcontroller, analog input module, analog output module, input mode selection module, output mode selection module and current feedback module, wherein, analog input module includes: analog quantity voltage input module and analog quantity current input module, analog quantity output module includes: the microcontroller is connected with the analog quantity input module through the input mode selection module, the microcontroller is connected with the analog quantity output module through the output mode selection module, and the current feedback module is respectively connected with the microcontroller and the analog quantity current output module; the microcontroller is configured to control the input mode selection module, so that the microcontroller is connected to the analog input module to obtain first voltage data and second voltage data, where the analog input module includes: the first voltage data is voltage data output by the analog quantity voltage input module when the first voltage data is connected with the analog quantity voltage input module, and the second voltage data is voltage data output by the analog quantity current input module when the second voltage data is connected with the analog quantity current input module; the microcontroller is configured to determine a load type of an input load based on the first voltage data and the second voltage data, where the load type of the input load includes: a voltage load and a current load; the microcontroller is used for controlling the output mode selection module so as to enable the microcontroller to be connected with an analog quantity current output module in the analog quantity output module to obtain third voltage data output by the current feedback module; the microcontroller is configured to determine a load type of an output load based on the third voltage data, where the load type of the output load includes: a voltage load and a current load; the microcontroller is used for controlling the input mode selection module so that the microcontroller is connected with the analog quantity input module corresponding to the load type of the input load, and controlling the output mode selection module so that the microcontroller is connected with the analog quantity output module corresponding to the load type of the output load.
Further, the programmable controller further comprises: the analog quantity output module comprises a first pin connector, a first relay, a second pin connector and a second relay, wherein the first pin connector is connected with the analog quantity input module through the first relay, the second pin connector is connected with the analog quantity output module through the second relay, the input load is connected with the first pin connector, and the output load is connected with the second pin connector.
In a third aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium.
In the embodiment of the present invention, a microcontroller connects the microcontroller to an analog input module by controlling an input mode selection module to obtain first voltage data and second voltage data, wherein the analog input module includes: the first voltage data is voltage data output by the analog quantity voltage input module when the first voltage data is connected with the analog quantity voltage input module, and the second voltage data is voltage data output by the analog quantity current input module when the second voltage data is connected with the analog quantity current input module; determining a load type of an input load based on the first voltage data and the second voltage data, wherein the load type of the input load comprises: a voltage load and a current load; the output mode selection module is controlled to enable the microcontroller to be connected with an analog quantity current output module in the analog quantity output module to obtain third voltage data output by the current feedback module, and the analog quantity output module comprises: the analog quantity voltage output module and the analog quantity current output module; determining a load type of an output load based on the third voltage data, wherein the load type of the output load comprises: a voltage load and a current load; the input mode selection module is controlled to enable the microcontroller to be connected with the analog input module corresponding to the load type of the input load, the output mode selection module is controlled to enable the microcontroller to be connected with the analog output module corresponding to the load type of the output load, the purpose that the programmable controller automatically selects the corresponding interface mode according to the type of the load is achieved, the technical problem that the programmable controller needs to carry out interface mode configuration according to loads of different types is solved, and therefore the technical effects of improving working efficiency and using experience are achieved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of an analog multiplexing interface control method for a programmable controller according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a programmable controller according to an embodiment of the present invention.
In the figure, 10 is a microcontroller, 21 is an analog voltage input module, 22 is an analog current input module, 31 is an analog voltage output module, 32 is an analog current output module, 40 is an input mode selection module, 50 is an output mode selection module, 60 is a current feedback module, 70 is a first pin connector, 80 is a first relay, 90 is a second pin connector, and 100 is a second relay.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
The first embodiment is as follows:
in accordance with an embodiment of the present invention, there is provided an embodiment of an analog multiplexing interface control method for a programmable controller, it should be noted that the steps illustrated in the flowchart of the accompanying drawings may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
Fig. 1 is a flowchart of an analog multiplexing interface control method of a programmable controller according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S102, controlling an input mode selection module to connect the microcontroller with an analog input module to obtain first voltage data and second voltage data, wherein the analog input module comprises: the first voltage data is voltage data output by the analog quantity voltage input module when the first voltage data is connected with the analog quantity voltage input module, and the second voltage data is voltage data output by the analog quantity current input module when the second voltage data is connected with the analog quantity current input module;
step S104, determining a load type of an input load based on the first voltage data and the second voltage data, wherein the load type of the input load includes: a voltage load and a current load;
step S106, controlling an output mode selection module to connect the microcontroller with an analog quantity current output module in the analog quantity output module, so as to obtain third voltage data output by the current feedback module, where the analog quantity output module includes: the analog quantity voltage output module and the analog quantity current output module;
step S108, determining a load type of an output load based on the third voltage data, wherein the load type of the output load includes: a voltage load and a current load;
step S110, controlling an input mode selection module to connect the microcontroller with an analog input module corresponding to the load type of the input load, and controlling an output mode selection module to connect the microcontroller with an analog output module corresponding to the load type of the output load.
In the embodiment of the present invention, a microcontroller connects to an analog input module by controlling an input mode selection module to obtain first voltage data and second voltage data, wherein the analog input module includes: the first voltage data is voltage data output by the analog quantity voltage input module when the first voltage data is connected with the analog quantity voltage input module, and the second voltage data is voltage data output by the analog quantity current input module when the second voltage data is connected with the analog quantity current input module; determining a load type of an input load based on the first voltage data and the second voltage data, wherein the load type of the input load comprises: a voltage load and a current load; the output mode selection module is controlled to enable the microcontroller to be connected with an analog quantity current output module in the analog quantity output module to obtain third voltage data output by the current feedback module, and the analog quantity input module comprises: the analog quantity voltage output module and the analog quantity current output module; determining a load type of an output load based on the third voltage data, wherein the load type of the output load comprises: a voltage load and a current load; the input mode selection module is controlled to enable the microcontroller to be connected with the analog input module corresponding to the load type of the input load, the output mode selection module is controlled to enable the microcontroller to be connected with the analog output module corresponding to the load type of the output load, the purpose that the programmable controller automatically selects the corresponding interface mode according to the type of the load is achieved, the technical problem that the programmable controller needs to carry out interface mode configuration according to loads of different types is solved, and therefore the technical effects of improving working efficiency and using experience are achieved.
In the embodiment of the present invention, step S104 includes the following steps:
step S11, if the first voltage data is within a first preset range, the load type of the input load is a current load;
in step S12, if the first voltage data is not within the first preset range and the second voltage data is within the first preset range, the load type of the input load is a voltage load.
If neither the first voltage data nor the second voltage data is within the first preset range, the method further includes:
step S13, if the first voltage data is greater than the second voltage data, the load type of the input load is a current load;
in step S14, if the first voltage data is smaller than the second voltage data, the load type of the input load is a voltage load.
Step S15, if the first voltage data and the second voltage data are both the upper limit values within the first preset range, the load type of the input load is a current load.
In step S16, if the first voltage data and the second voltage data are both 0, the load type of the input load is a voltage load.
In the embodiment of the present invention, taking the programmable controller shown in fig. 2 as an example, in order to determine the load type of the input load, first, the Microcontroller (MCU) controls the output mode selection module to connect the nodes 6 and 7 of J1C and controls the first relay to connect the nodes 2 and 3, at this time, the load connected to the pin connector P1 is connected to the microcontroller through the analog voltage input module, and then, the microcontroller reads the output voltage value (i.e., the first voltage data) of the analog voltage input module.
Specifically, the analog quantity voltage input module is set in the circuit in a proportion of Vout1=0.3 Vin, when the input is 0-10V (i.e., the load type of the input load is a voltage load, and the input voltage of the load is 0-10V), the output voltage value of the analog quantity voltage input module is 0-3V, because the voltage dividing resistor in the analog voltage input module is about 1K overall, if the input is 4-20mA current (i.e., the load type of the input load is a current load, and the input current of the load is 4-20 mA), vout1=0.3 × 1000 × Iin, the value of the output voltage of the analog voltage input module is 1.2-6V, the circuit sets the clamping voltage to 3.3V, it can be confirmed that if Vout1 is 3-3.3V (i.e., within the first predetermined range), the load type of the input load is a current load.
Vout1 is first voltage data, Vin is an input voltage of the load, and Iin is an input current of the load.
Then, the microcontroller Vout1 is 0-3V, the Microcontroller (MCU) controls the output mode selection module to connect the nodes 7 and 5 of the J1C and controls the first relay to connect the nodes 2 and 4, at which time the load connected to the pin connector P1 is connected to the microcontroller through the analog current input module, and then the microcontroller reads the output voltage value (i.e., the second voltage data) of the analog current input module.
The ratio of the analog input current module is set to Vout2=150 i in, when the input is 4-20mA (i.e., the load type of the input load is a current load and the input current of the load is 4-20 mA), the output voltage value of the analog input current module (i.e., the second voltage data) is 0.6-3V, and if the input is 0-10V voltage (i.e., the load type of the input load is a voltage load and the input voltage of the load is 0-10V) according to the circuit model, Vout2=1.5 Vin =0-15V, and the clamp voltage set by the circuit is 3.3V, so it can be confirmed that the load type of the input load is a voltage load if Vout2 is 3-3.3V (i.e., within the first preset range).
Note that Vout2 is the second voltage data.
In addition, it should be noted that, if neither the first voltage data nor the second voltage data is within the first preset range (in the programmable controller shown in fig. 2, both the first voltage data and the second voltage data are within 0 to 3V), when the first voltage data is greater than the second voltage data, the load type of the input load is a current load; when the first voltage data is smaller than the second voltage data, the load type of the input load is a voltage load.
For example, when the load is a current load and the input current of the load is 5mA, Vout1=1.5V, Vout2=0.75V, Vout2< Vout1, and Vout2 are the output voltage values (second voltage data) of the analog quantity current input module, and therefore, it is confirmed that the load type of the input load is a current load.
When the load is a voltage load, Vout1=0.15V, Vout2=0.75V, Vout1< Vout2, and Vout1 are voltage values (first voltage data) output by the analog voltage input module when the input voltage of the load is 0.5V.
In the embodiment of the present invention, step S108 includes the following steps:
step S21, converting the third voltage data into corresponding current data;
step S22, if the current data is within a second preset range, the load type of the output load is the current load;
in step S23, if the current data is not within the second preset range, the load type of the output load is the voltage load.
In the embodiment of the present invention, taking the programmable controller shown in fig. 2 as an example, first, the microcontroller controls the output selection module to connect the microcontroller with the analog current output module, and controls the second relay to connect the nodes 2 and 3, so that the load connected to the pin connector P1 is connected with the microcontroller through the analog current output module.
Then, the third voltage data output by the current feedback module is read, because the internal resistance of the current load is smaller relative to the internal resistance of the voltage load, the internal resistance of the current load is about 250R-500R (corresponding to outputting 5V-10V), and the voltage load is generally more than a few K ranges. Therefore, at this time, the analog quantity current output module outputs a current of 20mA (that is, the load type of the output load is a current load, and the output current of the load is 20 mA), if the current data obtained by converting the third voltage data is within a range of error of 20mA ± 0.5%, that is, the load type of the output load is a current load, it should be noted that the preferred error of the range is ± 0.5%, which can be set by a worker according to the actual situation.
The effect of the circuit parameter configuration shown in fig. 2 is that when the load is greater than 900 Ω, the output will be overloaded and the current value will be reduced, resulting in a smaller feedback current value, and therefore, if the current data obtained by converting the third voltage data is more than 20mA, the load type of the output load is a voltage load.
In an embodiment of the present invention, before controlling the input mode selection module to connect the microcontroller with the analog input module to obtain the first voltage data and the second voltage data, the method further includes:
step S101, carrying out state detection on the analog input module and the analog output module, and generating an alarm signal if the analog input module or the analog output module is abnormal.
Example two:
the embodiment of the present invention further provides a programmable controller, where the programmable controller is configured to execute the method for controlling an analog multiplexing interface of a programmable controller provided in the foregoing description of the embodiment of the present invention, and the following is a detailed description of the programmable controller provided in the embodiment of the present invention.
As shown in fig. 2, fig. 2 is a schematic diagram of the programmable controller, where the programmable controller includes: the controller comprises a microcontroller 10, an analog input module, an analog output module, an input mode selection module 40, an output mode selection module 50 and a current feedback module 60, wherein the analog input module comprises: the analog quantity voltage input module 21 and the analog quantity current input module 22, the analog quantity output module includes: the analog quantity voltage output module 31 and the analog quantity current output module 32, the microcontroller is connected with the analog quantity input module through the input mode selection module, the microcontroller is connected with the analog quantity output module through the output mode selection module, and the current feedback module is respectively connected with the microcontroller and the analog quantity current output module;
the microcontroller is configured to control the input mode selection module, so that the microcontroller is connected to the analog input module to obtain first voltage data and second voltage data, where the analog input module includes: the first voltage data is voltage data output by the analog quantity voltage input module when the first voltage data is connected with the analog quantity voltage input module, and the second voltage data is voltage data output by the analog quantity current input module when the second voltage data is connected with the analog quantity current input module;
the microcontroller is configured to determine a load type of an input load based on the first voltage data and the second voltage data, where the load type of the input load includes: a voltage load and a current load;
the microcontroller is used for controlling the output mode selection module so as to enable the microcontroller to be connected with an analog quantity current output module in the analog quantity output module to obtain third voltage data output by the current feedback module;
the microcontroller is configured to determine a load type of an output load based on the third voltage data, where the load type of the output load includes: a voltage load and a current load;
the microcontroller is used for controlling the input mode selection module so that the microcontroller is connected with the analog quantity input module corresponding to the load type of the input load, and controlling the output mode selection module so that the microcontroller is connected with the analog quantity output module corresponding to the load type of the output load.
In the embodiment of the present invention, a microcontroller connects the microcontroller to an analog input module by controlling an input mode selection module to obtain first voltage data and second voltage data, wherein the analog input module includes: the first voltage data is voltage data output by the analog quantity voltage input module when the first voltage data is connected with the analog quantity voltage input module, and the second voltage data is voltage data output by the analog quantity current input module when the second voltage data is connected with the analog quantity current input module; determining a load type of an input load based on the first voltage data and the second voltage data, wherein the load type of the input load comprises: a voltage load and a current load; the output mode selection module is controlled to enable the microcontroller to be connected with an analog quantity current output module in the analog quantity output module to obtain third voltage data output by the current feedback module, and the analog quantity output module comprises: the analog quantity voltage output module and the analog quantity current output module; determining a load type of an output load based on the third voltage data, wherein the load type of the output load comprises: a voltage load and a current load; the input mode selection module is controlled to enable the microcontroller to be connected with the analog input module corresponding to the load type of the input load, the output mode selection module is controlled to enable the microcontroller to be connected with the analog output module corresponding to the load type of the output load, the purpose that the programmable controller automatically selects the corresponding interface mode according to the type of the load is achieved, the technical problem that the programmable controller needs to carry out interface mode configuration according to loads of different types is solved, and therefore the technical effects of improving working efficiency and using experience are achieved.
As shown in fig. 2, the programmable controller further includes: a first pin connector 70 connected with the analog input module through the first relay, a first relay 80 connected with the analog output module through the second relay, a second pin connector 90 connected with the analog output module through the second relay, and a second relay 100 connected with the input load connected with the first pin connector and the output load connected with the second pin connector.
Example three:
the embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the method in the first embodiment.
In addition, in the description of the embodiments of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that the following descriptions are only illustrative and not restrictive, and that the scope of the present invention is not limited to the above embodiments: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. An analog quantity multiplexing interface control method of a programmable controller is characterized in that the method is applied to a microcontroller and comprises the following steps:
the input mode selection module is controlled to enable the microcontroller to be connected with the analog quantity input module to obtain first voltage data and second voltage data, wherein the analog quantity input module comprises: the first voltage data is voltage data output by the analog quantity voltage input module when the first voltage data is connected with the analog quantity voltage input module, and the second voltage data is voltage data output by the analog quantity current input module when the second voltage data is connected with the analog quantity current input module;
determining a load type of an input load based on the first voltage data and the second voltage data, wherein the load type of the input load comprises: a voltage load and a current load;
the output mode selection module is controlled to enable the microcontroller to be connected with an analog quantity current output module in the analog quantity output module to obtain third voltage data output by the current feedback module, and the analog quantity output module comprises: the analog quantity voltage output module and the analog quantity current output module;
determining a load type of an output load based on the third voltage data, wherein the load type of the output load comprises: a voltage load and a current load;
the input mode selection module is controlled to enable the microcontroller to be connected with the analog quantity input module corresponding to the load type of the input load, and the output mode selection module is controlled to enable the microcontroller to be connected with the analog quantity output module corresponding to the load type of the output load.
2. The method of claim 1, wherein determining the load type of the input load based on the first voltage data and the second voltage data comprises:
if the first voltage data is within a first preset range, the load type of the input load is a current load;
if the first voltage data is not within the first preset range and the second voltage data is within the first preset range, the load type of the input load is a voltage load.
3. The method of claim 2, wherein if neither the first voltage data nor the second voltage data is within the first predetermined range, the method further comprises:
if the first voltage data is larger than the second voltage data, the load type of the input load is a current load;
if the first voltage data is smaller than the second voltage data, the load type of the input load is a voltage load.
4. The method of claim 2, further comprising:
if the first voltage data and the second voltage data are both the upper limit values within the first preset range, the load type of the input load is a current load;
and if the first voltage data and the second voltage data are both 0, the load type of the input load is a voltage load.
5. The method of claim 1, wherein determining the load type of the output load based on the third voltage data comprises:
converting the third voltage data into corresponding current data;
if the current data is within a second preset range, the load type of the output load is the current load;
and if the current data is not in the second preset range, the load type of the output load is the voltage load.
6. The method as claimed in claim 1, wherein the controlling an input mode selection module to connect the microcontroller with the analog input module corresponding to the load type of the input load and controlling an output mode selection module to connect the microcontroller with the analog output module corresponding to the load type of the output load comprises:
if the load type of the input load is a voltage load, controlling the input mode selection module to connect the microcontroller with the analog quantity voltage input module;
if the load type of the input load is a current load, controlling the input mode selection module to connect the microcontroller with the analog quantity current input module;
if the load type of the output load is a voltage load, controlling the output mode selection module to connect the microcontroller with the analog quantity voltage output module;
and if the load type of the output load is a current load, controlling the output mode selection module to connect the microcontroller with the analog quantity current output module.
7. The method of claim 1, wherein before controlling the input mode selection module to connect the microcontroller to the analog input module to obtain the first voltage data and the second voltage data, the method further comprises:
and detecting the state of the analog input module and the analog output module, and if the analog input module or the analog output module is abnormal, generating an alarm signal.
8. A programmable controller, comprising: microcontroller, analog input module, analog output module, input mode selection module, output mode selection module and current feedback module, wherein, analog input module includes: analog quantity voltage input module and analog quantity current input module, analog quantity output module includes: the microcontroller is connected with the analog quantity input module through the input mode selection module, the microcontroller is connected with the analog quantity output module through the output mode selection module, and the current feedback module is respectively connected with the microcontroller and the analog quantity current output module;
the microcontroller is configured to control the input mode selection module, so that the microcontroller is connected to the analog input module to obtain first voltage data and second voltage data, where the analog input module includes: the first voltage data is voltage data output by the analog quantity voltage input module when the first voltage data is connected with the analog quantity voltage input module, and the second voltage data is voltage data output by the analog quantity current input module when the second voltage data is connected with the analog quantity current input module;
the microcontroller is configured to determine a load type of an input load based on the first voltage data and the second voltage data, where the load type of the input load includes: a voltage load and a current load;
the microcontroller is used for controlling the output mode selection module so as to enable the microcontroller to be connected with an analog quantity current output module in the analog quantity output module to obtain third voltage data output by the current feedback module;
the microcontroller is configured to determine a load type of an output load based on the third voltage data, where the load type of the output load includes: a voltage load and a current load;
the microcontroller is used for controlling the input mode selection module so that the microcontroller is connected with the analog quantity input module corresponding to the load type of the input load, and controlling the output mode selection module so that the microcontroller is connected with the analog quantity output module corresponding to the load type of the output load.
9. The programmable controller of claim 8, further comprising: the analog quantity output module comprises a first pin connector, a first relay, a second pin connector and a second relay, wherein the first pin connector is connected with the analog quantity input module through the first relay, the second pin connector is connected with the analog quantity output module through the second relay, the input load is connected with the first pin connector, and the output load is connected with the second pin connector.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for controlling an analog-multiplexing interface of a programmable controller according to any one of claims 1 to 7.
CN202210744669.6A 2022-06-29 2022-06-29 Programmable controller, analog quantity multiplexing interface control method thereof and storage medium Active CN114815720B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210744669.6A CN114815720B (en) 2022-06-29 2022-06-29 Programmable controller, analog quantity multiplexing interface control method thereof and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210744669.6A CN114815720B (en) 2022-06-29 2022-06-29 Programmable controller, analog quantity multiplexing interface control method thereof and storage medium

Publications (2)

Publication Number Publication Date
CN114815720A CN114815720A (en) 2022-07-29
CN114815720B true CN114815720B (en) 2022-09-09

Family

ID=82522536

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210744669.6A Active CN114815720B (en) 2022-06-29 2022-06-29 Programmable controller, analog quantity multiplexing interface control method thereof and storage medium

Country Status (1)

Country Link
CN (1) CN114815720B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5043911A (en) * 1989-12-22 1991-08-27 Sundstrand Corporation Multiplexing A/D converter for a generator control unit
CN204856101U (en) * 2015-05-21 2015-12-09 杭州东益福电气股份有限公司 Direct current analog output's electronic circuit
CN111736520A (en) * 2020-07-17 2020-10-02 上海电气自动化设计研究所有限公司 Core controller circuit for PLC practical training device

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3051788B2 (en) * 1993-01-12 2000-06-12 株式会社日立製作所 Programmable controller
US6308231B1 (en) * 1998-09-29 2001-10-23 Rockwell Automation Technologies, Inc. Industrial control systems having input/output circuits with programmable input/output characteristics
US7912562B2 (en) * 2000-07-25 2011-03-22 Electronic Solutions, Inc. System, device and method for comprehensive input/output interface between process or machine transducers and controlling device or system
US7216191B2 (en) * 2001-02-14 2007-05-08 Berkeley Process Control, Inc. System for programmed control of signal input and output to and from cable conductors
US7366577B2 (en) * 2002-12-19 2008-04-29 Sigmatel, Inc. Programmable analog input/output integrated circuit system
CN101042582A (en) * 2007-04-25 2007-09-26 上海电器科学研究所(集团)有限公司 Programmable and configurable remote I/O module with field bus interface
US8656065B1 (en) * 2013-01-29 2014-02-18 Honeywell International Inc. Method and apparatus for automatically selecting a plurality of modes for programmable interface circuit by coupling field devices to process controllers
US9116531B2 (en) * 2013-02-27 2015-08-25 General Electric Company Methods and systems for current output mode configuration of universal input-output modules
CN204331374U (en) * 2014-12-29 2015-05-13 上海新华控制技术(集团)有限公司 A kind of multichannel analog amount output module
CN207503002U (en) * 2017-10-13 2018-06-15 上海智大电子有限公司 The 8 tunnels analogy amount of voltage/current type of PLC a kind of inputs 2 tunnels analogy output modules
CN107942787B (en) * 2017-11-17 2020-06-16 上海华兴数字科技有限公司 Analog signal multiplexing circuit and analog signal acquisition circuit
US10684611B2 (en) * 2018-04-23 2020-06-16 Rockwell Automation Technologies, Inc. Industrial control module providing universal I/O
CN108829006A (en) * 2018-06-29 2018-11-16 北京广利核***工程有限公司 The analogue quantity output device and method of alternative output voltage or electric current
CN109782660B (en) * 2018-12-28 2020-04-24 深圳市优必选科技有限公司 Control circuit and device compatible with voltage-type and current-type analog input
DE202019106469U1 (en) * 2019-11-21 2021-02-24 WAGO Verwaltungsgesellschaft mit beschränkter Haftung Circuit with a current output driver for outputting an output current to a load
CN111007819B (en) * 2019-12-19 2020-11-27 杭州和利时自动化有限公司 IO module multiplexing AI channel and DI channel
CN210776300U (en) * 2019-12-26 2020-06-16 成都云尚物联环境科技有限公司 Analog quantity data acquisition device
CN114217542A (en) * 2021-12-16 2022-03-22 杭州和利时自动化有限公司 Output channel control method and related assembly

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5043911A (en) * 1989-12-22 1991-08-27 Sundstrand Corporation Multiplexing A/D converter for a generator control unit
CN204856101U (en) * 2015-05-21 2015-12-09 杭州东益福电气股份有限公司 Direct current analog output's electronic circuit
CN111736520A (en) * 2020-07-17 2020-10-02 上海电气自动化设计研究所有限公司 Core controller circuit for PLC practical training device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于IEC61131-3标准的可编程控制器的研究与实现;仲崇权等;《工业控制计算机》;20101025(第10期);全文 *

Also Published As

Publication number Publication date
CN114815720A (en) 2022-07-29

Similar Documents

Publication Publication Date Title
US9225534B2 (en) Power conditioning management
CN101840216B (en) Programmable logical controller parameter setting system and method thereof
CN104598364A (en) Method for monitoring power consumption of load equipment in server system
CN114815720B (en) Programmable controller, analog quantity multiplexing interface control method thereof and storage medium
CN109709373B (en) Signal self-adaptive acquisition circuit and acquisition method
CN104348931A (en) Self-adaptive compatible system and method of quartz crystal oscillator for mobile terminal
CN111761571A (en) Robot control method and device
DE102005051623A1 (en) Battery detection system
CN216057079U (en) Internet of things terminal and internet of things system
CN105656327A (en) State monitoring method, power adapter and electronic equipment
US10108216B2 (en) Power tap with adjustable configuration
US10991169B2 (en) Method for determining a mean time to failure of an electrical device
CN211504208U (en) Urea case testing arrangement and system for experiments
EP2386991A1 (en) Plant operation management - support system
CN112486621A (en) Horizontal and vertical screen adaptation method, device and storage medium based on IO level
WO2021004753A1 (en) Method for operating an automation field device
CN214335936U (en) Excitation system control device
CN113241568B (en) Method for connecting electromechanical devices
CN211263689U (en) Comprehensive test system for fire-fighting electrical control device
CN118330455A (en) Relay adhesion detection system and method, electronic equipment and medium
CN219715994U (en) Control circuit of temperature controller
CN117407033B (en) Method, system and storage medium for switching product types based on resistor
CN116626530B (en) High-power voltage stabilizing source fault detection method and system based on double channels
US20110115459A1 (en) Phase adjusting system and method
US20040190232A1 (en) Case for programmable logic controller (PLC)

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant