A control method and control system for a double-control solenoid valve

By integrating the target output address of the solenoid valve group into the index address and using division operations to simplify the calculation of the output control variables, the problems of large code volume and high complexity in the existing technology are solved, and the efficiency and maintenance of the solenoid valve control are improved. Convenience.

CN114089686BActive Publication Date: 2024-08-23CHANGYUAN MEDICAL PRECISION (ZHUHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111310530.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-05
Publication Date
2024-08-23
Estimated Expiration
2041-11-05

AI Technical Summary

Technical Problem

When the existing Mitsubishi programming software controls the IO dual-control solenoid valve, the amount of code is large and the complexity is high, which makes it difficult for programmers to maintain, slows down the PLC scan cycle, and increases the workload.

Method used

By integrating the target output address of each current solenoid valve group into the index address, using division operations to obtain the quotient and remainder, determining whether the register address is an even number, and calculating the output control variable, code writing and program module calling are simplified.

Benefits of technology

It reduces the amount and complexity of the code, simplifies program module calls, reduces the programmer's workload, and improves the PLC scan cycle, making it easier to maintain and modify the code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114089686B
    Figure CN114089686B
Patent Text Reader

Abstract

The embodiment of the present invention relates to the field of data control technology, and discloses a control method and control system for a dual-control solenoid valve, the method comprising: when obtaining the displacement address for the current solenoid valve group, defining the displacement address as the first data register address and dividing it by a specified value, then defining the quotient and remainder obtained by the division as the second data register address and the third data register address respectively, then when both the trigger variable and the trigger condition variable meet the requirements, judging whether the first data register address is an even number according to the value of the third data register address, if so, calculating the sum of the displacement address and the initial value of the control address to obtain the first output control variable, adding one to the sum to obtain the second output control variable, and finally setting the first output control variable and resetting the second output control variable. The implementation of the embodiment of the present invention can modularize the program programming of the dual-control solenoid valve, making the program module call simple.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data control technology, and in particular to a control method and a control system for a double-control solenoid valve. Background Art

[0002] The current Mitsubishi programming software for IO dual-control solenoid valve control is that one output point Y corresponds to the coil switching control of a solenoid valve, and the coil of the solenoid valve controls the action of the cylinder. Simply put, one output point Y controls one action of a cylinder, and a cylinder has two actions to execute, so a cylinder needs two output points Y to control the switching of its actions, that is, as many solenoid valves or cylinders as there are, there will be double the number of output points of cylinders or solenoid valves, which need to be written one by one in the programming for the corresponding control to be carried out.

[0003] For example: Now we need to control the telescopic action of IO dual-control cylinder A and cylinder B. Each cylinder has an extension action and a retraction action. The two cylinders AB will have 2 extension actions and 2 retraction actions. Therefore, there are 4 groups of output points Y in Mitsubishi programming to control cylinder AB. When you need to control the extension action of cylinder A, you need to write the output control of code Y1, and when you need to retract the action, you need to write the output control of code Y2. When you need to control the extension action of cylinder B, you need to write the output control of code Y3, and when you need to retract the action, you need to write the output control of code Y4. Therefore, in the entire code, you need to write 4 output control instructions of codes Y1 to Y4 respectively. By analogy, 2 cylinders need to write 4 output control instruction codes, 3 cylinders need to write 6 output control instruction codes... n cylinders need to write n*2 output control instruction codes.

[0004] However, in practice, it is found that when the code is written according to the existing control method, when there are a large number of controls, the following disadvantages will occur:

[0005] 1. The amount of code will increase, and the complexity of the code will also increase

[0006] 2. The increase in complexity will make it more difficult for programmers to consult the subsequent maintenance

[0007] 3. The increase in the amount of code will also cause the scanning cycle of PLC (Programmable Logic Controller) control to slow down.

[0008] 4. The increase in the amount of code also means that the workload of programmers increases during the programming process. Summary of the invention

[0009] The embodiment of the present invention discloses a control method and control system for a dual-control solenoid valve, which can integrate the target output address of each current solenoid valve group into the displacement address to ensure that the program module call is simple while being able to individually control the target output address of each current solenoid valve group, thereby solving the problems of large code volume, high complexity, and difficult maintenance.

[0010] A first aspect of an embodiment of the present invention discloses a control method for a dual-control solenoid valve, the method comprising:

[0011] When the indexed address for the current solenoid valve group is obtained, the indexed address is defined as a first data register address;

[0012] After dividing the first data register address by a specified value, defining a quotient obtained by dividing the first data register address as a second data register address and a remainder obtained by dividing the first data register address as a third data register address;

[0013] According to the displacement address, convert the trigger variable and the trigger condition variable corresponding to the current solenoid valve;

[0014] When both the trigger variable and the trigger condition variable meet the requirements, judging whether the first data register address is an even number according to the value of the third data register address;

[0015] If yes, calculate the sum of the index address and the initial value of the control address to serve as the first output control variable for controlling the current solenoid valve group to perform the first action;

[0016] Adding one to the sum to obtain a second output control variable for controlling the current solenoid valve group to perform a second action;

[0017] The first output control variable is set and the second output control variable is reset.

[0018] As another optional implementation, in the first aspect of the embodiment of the present invention, the method further includes:

[0019] If it is determined that the first register address is not an even number, the operation of calculating the sum of the index address and the initial value of the control address as the first output control variable for controlling the current solenoid valve group to perform the first action is performed;

[0020] The sum is subtracted by one to obtain the second output control variable for controlling the current solenoid valve group to perform the second action.

[0021] As another optional implementation, in the first aspect of the embodiment of the present invention, after setting the first output control variable and resetting the second output control variable, the method further includes:

[0022] The trigger variable is reset.

[0023] As another optional implementation, in the first aspect of the embodiment of the present invention, after resetting the trigger variable, the method further includes:

[0024] Adding one to the displacement address to obtain the next displacement address;

[0025] Detecting whether the value of the next indexed address is greater than the loop preset value; if not, defining the next indexed address as the first data register address;

[0026] Re-execute the operation of defining the quotient obtained by dividing the first data register address by a specified value as a second data register address and defining the remainder obtained by dividing the first data register address as a third data register address.

[0027] As another optional implementation, in the first aspect of the embodiment of the present invention, the method further includes:

[0028] If both the trigger variable and the trigger condition variable fail to meet the requirements, the operation of adding one to the displacement address is performed to obtain the next displacement address.

[0029] A second aspect of an embodiment of the present invention discloses a control system, the control system comprising:

[0030] A first definition unit, configured to define the indexed address as a first data register address when obtaining the indexed address for the current solenoid valve group;

[0031] a second definition unit, configured to define, after dividing the first data register address by a specified value, a quotient obtained by dividing the first data register address as a second data register address and a remainder obtained by dividing the first data register address as a third data register address;

[0032] A conversion unit, used for converting the trigger variable and the trigger condition variable corresponding to the current solenoid valve according to the displacement address;

[0033] a judging unit, configured to judge whether the first data register address is an even number according to the value of the third data register address when both the trigger variable and the trigger condition variable meet the requirements;

[0034] A first calculation unit, configured to calculate the sum of the index address and the initial value of the control address when the judgment unit determines that the first data register address is an even number, so as to serve as a first output control variable for controlling the current solenoid valve group to perform a first action;

[0035] A second calculation unit, used for performing a calculation process of adding one to the sum to obtain a second output control variable for controlling the current solenoid valve group to perform a second action;

[0036] A setting and resetting unit is used to set the first output control variable and reset the second output control variable.

[0037] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the control system further includes:

[0038] a first execution unit, configured to, when the judgment unit determines that the first data register address is not an even number, execute the operation of calculating the sum of the index address and the initial value of the control address as a first output control variable for controlling the current solenoid valve group to perform a first action;

[0039] a third calculation unit, configured to perform a calculation process of subtracting one from the sum to obtain the second output control variable for controlling the current solenoid valve group to perform the second action;

[0040] The setting and resetting unit is further used to set the first output control variable and reset the second output control variable.

[0041] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the control system further includes:

[0042] A reset unit is used to reset the trigger variable after the setting and resetting unit sets the first output control variable and resets the second output control variable.

[0043] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the control system further includes:

[0044] A fourth calculation unit, configured to perform a calculation process of adding one to the displacement address after the reset unit performs a reset process on the trigger variable, so as to obtain a next displacement address;

[0045] A detection unit, used for detecting whether the value of the next address change is greater than a cycle preset value;

[0046] A third definition unit, configured to define the next indexed address as the first data register address when the detection unit detects that the value of the next indexed address is not greater than the loop preset value;

[0047] The re-execution unit is used to re-execute the operation of defining the quotient obtained by dividing the first data register address by a specified value as the second data register address and the remainder obtained by dividing the first data register address as the third data register address.

[0048] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the control system further includes:

[0049] The second execution unit is used for executing the operation of adding one to the displacement address to obtain the next displacement address if the trigger variable and the trigger condition variable do not meet the requirements.

[0050] A third aspect of an embodiment of the present invention discloses a control system, the control system comprising:

[0051] A memory storing executable program code;

[0052] a processor coupled to the memory;

[0053] The processor calls the executable program code stored in the memory to execute a control method for a dual-control solenoid valve disclosed in the first aspect of an embodiment of the present invention.

[0054] A fourth aspect of an embodiment of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute a control method for a dual-control solenoid valve disclosed in the first aspect of an embodiment of the present invention.

[0055] A fifth aspect of an embodiment of the present invention discloses a computer program product. When the computer program product is run on a computer, the computer is enabled to execute part or all of the steps of any one of the control methods for a dual-control solenoid valve of the first aspect.

[0056] A sixth aspect of an embodiment of the present invention discloses an application publishing platform, which is used to publish a computer program product. When the computer program product runs on a computer, the computer executes part or all of the steps of any one of the control methods for a dual-control solenoid valve of the first aspect.

[0057] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0058] In an embodiment of the present invention, when the displacement address for the current solenoid valve group is obtained, the displacement address is defined as a first data register address; after dividing the first data register address by a specified value, the quotient obtained by dividing the first data register address is defined as a second data register address and the remainder obtained by dividing the first data register address is defined as a third data register address; according to the displacement address, the trigger variable and the trigger condition variable corresponding to the current solenoid valve are converted; when both the trigger variable and the trigger condition variable meet the requirements, whether the first data register address is an even number is determined according to the value of the third data register address; if so, the sum of the displacement address and the initial value of the control address is calculated as the first output control variable for controlling the current solenoid valve group to perform the first action; the sum is added by one to obtain the second output control variable for controlling the current solenoid valve group to perform the second action; the first output control variable is set and the second output control variable is reset. It can be seen that the embodiment of the present invention can integrate the target output address of each current solenoid valve group into the displacement address to ensure that the program module call is simple while being able to individually control the target output address of each current solenoid valve group, thereby solving the problems of large code volume, high complexity, and difficult maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0060] Figure 1 It is a flow chart of a control method of a dual-control solenoid valve disclosed in an embodiment of the present invention;

[0061] Figure 2 It is a flow chart of another control method of a dual-control solenoid valve disclosed in an embodiment of the present invention;

[0062] Figure 3 It is a structural schematic diagram of a control system disclosed in an embodiment of the present invention;

[0063] Figure 4 It is a structural schematic diagram of another control system disclosed in an embodiment of the present invention;

[0064] Figure 5 It is a structural schematic diagram of another control system disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0065] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0066] It should be noted that the terms "first", "second", "third", "fourth", etc. in the specification and claims of the present invention are used to distinguish different objects rather than to describe a specific order. The terms "including" and "having" in the embodiments of the present invention and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0067] The embodiment of the present invention discloses a control method and control system for a dual-control solenoid valve, which can integrate the target output address of each current solenoid valve group into the displacement address to ensure that the program module call is simple while being able to individually control the target output address of each current solenoid valve group, thereby solving the problems of large code volume, high complexity, and difficult maintenance.

[0068] The following is a detailed description with reference to the accompanying drawings.

[0069] Embodiment 1

[0070] See also Figure 1 , Figure 1 1 is a flow chart of a control method of a dual-control solenoid valve disclosed in an embodiment of the present invention. Figure 1 As shown, the control method of the dual-control solenoid valve may include the following steps.

[0071] 101. When the control system obtains the displacement address for the current solenoid valve group, the displacement address is defined as the first data register address.

[0072] As an optional implementation, in an embodiment of the present invention, the first data register address in the present application can be used to indirectly save the value change of the indexed address.

[0073] 102. After dividing the first data register address by the specified value, the control system defines the quotient obtained by dividing the first data register address as the second data register address and the remainder obtained by dividing the first data register address as the third data register address.

[0074] As an optional implementation, in an embodiment of the present invention, the control system can use division to calculate the first data register address, that is, divide the first data register address by 2, and save the quotient of the calculation result in the second data register address, and save the remainder of the calculation result in the third data register address. The purpose here is to judge whether the value of the first register address is an even number or an odd number based on the third data register address.

[0075] 103. The control system converts the trigger variable and the trigger condition variable corresponding to the current solenoid valve according to the displacement address.

[0076] As an optional implementation, in an embodiment of the present invention, the present application may pre-define trigger variables and trigger condition variables outside the module, the trigger variable is used to trigger the output of the first output control variable and the second output control variable, the trigger condition variable is used to determine whether the trigger variable can be triggered, and the suffix of the trigger variable and the trigger condition variable can be added with a displacement address so that it can change according to the change of the displacement address.

[0077] As an optional implementation, in an embodiment of the present invention, when the trigger variable and the trigger condition variable meet the requirements, the corresponding first output control variable and the second output control variable can be set. After setting the corresponding first output control variable and the second output control variable, the solenoid valve on the corresponding hardware will also receive a signal to execute an action, thereby controlling the switching of the solenoid valve.

[0078] 104. When both the trigger variable and the trigger condition variable meet the requirements, the control system determines whether the first data register address is an even number according to the value of the third data register address; if so, execute steps 105 to 107; if not, end this process.

[0079] 105. The control system calculates the sum of the displacement address and the initial value of the control address as the first output control variable for controlling the current solenoid valve group to perform the first action.

[0080] 106. The control system adds one to the sum to obtain a second output control variable for controlling the current solenoid valve group to perform a second action.

[0081] 107. The control system sets the first output control variable and resets the second output control variable.

[0082] As an optional implementation, in the embodiment of the present invention, since each solenoid valve has two actions and the two actions cannot be executed at the same time, when the first output control variable is triggered to execute the first action, the execution of the second output control variable must be stopped. For example, if the action Y100 of the cylinder extension is required, then the action Y101 of the cylinder retracting needs to be stopped. The two output points Y cannot be executed at the same time. Therefore, after setting the first output control variable, the second output control variable needs to be reset.

[0083] As an optional implementation, in the embodiment of the present invention, it is assumed that the two output points of the first group of solenoid valves are the first output control variable Y100 and the second output control variable Y101. When the first output control variable Y100 is controlled to be output, the second output control variable Y101 must not be output. When the displacement address Z=0, the output of the first output control variable Y100 is controlled, and the second output control variable Y101 is not output. When the displacement address Z=1, the control is reversed, Y100 is not output, and Y101 is output. The solenoid valves of the second group are controlled to be Y102 and Y103. When the displacement address Z=2, Y102 is controlled to be output, and Y103 is not output. When the displacement address Z=3, the output of Y103 is controlled in reverse, and Y102 is not output. And so on and so forth, so that each output Y and the corresponding output Y+1 can be controlled in pairs.

[0084] As an optional implementation, in an embodiment of the present invention, the usage of the displacement address Z in this application, for example, Y100Z, can be regarded as Y(100+Z), so Z=0, that is, Y(100+0)=Y100, Z=1, that is, Y(100+1)=Y101, and this application does not impose any limitation on the Yn value, that is, the instruction address code.

[0085] As an optional implementation, in the embodiment of the present invention, when the operator needs to control Y101 to output, the operator can input the displacement address Z=1 into the system, and then according to Y100=Y(100+1)=Y101, the output of Y101 can be controlled at this time, but Y101=Y(101+1)=Y102, and Y102 belongs to the solenoid valve of the second group, which is obviously not the same group being controlled, and Y0FF=Y(0FF+1)=Y100, Y100 is the solenoid valve of the first group, so the parity characteristic is used to distinguish whether to control the non-output of Y101 or the non-output of Y0FF.

[0086] As an optional implementation, in the embodiment of the present invention, the first output control variable Y100 and the second output control variable Y101 belong to the same solenoid valve control, and the other target output addresses Y102 and Y103 belong to another solenoid valve control. According to the rule of address change, when the address change address Z=1, then Y100 Z=Y101, Y101 Z=Y102, and Y102 does not belong to the control variable of the same solenoid valve. Such control is not corresponding, so in this case, the third data register address remainder calculated above is required. The present application can judge according to whether the remainder is 0 or 1. When the third data register address=0, it is an even number. At this time, Y100Z is set, and the first action of the solenoid valve is controlled. Y101Z is reset, and the second action of the solenoid valve is controlled. When the third data register address=1, it is an odd number. At this time, Y100 Z is set, and the second action of the solenoid valve is controlled. The previous variable of Y100 Z is Y0FF Z, so Y0FF Z reset controls the first action of the solenoid valve. By reference, when the displacement address Z=0, Y100 controls the execution of the first action of the solenoid valve, and Y101 controls the stop of the second action of the solenoid valve. When the displacement address Z=1, Y101 controls the execution of the second action of the solenoid valve, and the previous displacement variable corresponding to Y100Z is Y0FFZ, so resetting Y0FFZ at this time will control the stop of the first action of the solenoid valve.

[0087] exist Figure 1 In the control method of the dual-control solenoid valve shown in the figure, the control system is used as an example for description. It should be noted that: Figure 1 The execution subject of the control method of the dual-control solenoid valve shown can also be an independent device associated with the control system, which is not limited in the embodiment of the present invention.

[0088] It can be seen that the implementation Figure 1 The described control method of a dual-control solenoid valve can integrate the target output address of each current solenoid valve group into the displacement address to ensure that the program module call is simple while being able to individually control the target output address of each current solenoid valve group, thereby solving problems such as large code volume, high complexity, and difficult maintenance.

[0089] In addition, implementation Figure 1 The described control method of a double-control solenoid valve can modularize the program programming of the double-control solenoid valve, making the program module call simple, which not only reduces the workload of programmers but also makes the control modification more convenient.

[0090] Embodiment 2

[0091] See also Figure 2 , Figure 2FIG. 1 is a flow chart of another control method of a dual-control solenoid valve disclosed in an embodiment of the present invention. Figure 2 As shown, the control method of the dual-control solenoid valve may include the following steps:

[0092] 201. When the control system obtains the displacement address for the current solenoid valve group, the displacement address is defined as the first data register address.

[0093] 202. After dividing the first data register address by the specified value, the control system defines a quotient obtained by dividing the first data register address as a second data register address and a remainder obtained by dividing the first data register address as a third data register address.

[0094] 203. The control system converts the trigger variable and the trigger condition variable corresponding to the current solenoid valve according to the displacement address.

[0095] 204. If both the trigger variable and the trigger condition variable do not meet the requirements, the control system performs a calculation process of adding one to the displacement address to obtain the next displacement address, and executes step 213.

[0096] 205. When both the trigger variable and the trigger condition variable meet the requirements, the control system determines whether the first data register address is an even number based on the value of the third data register address; if so, execute steps 206 to 207 and steps 2010 to 213; if not, execute steps 208 to 213.

[0097] 206. The control system calculates the sum of the displacement address and the initial value of the control address as the first output control variable for controlling the current solenoid valve group to perform the first action.

[0098] 207. The control system adds one to the sum to obtain a second output control variable for controlling the current solenoid valve group to perform a second action.

[0099] 208. The control system calculates the sum of the index address and the initial value of the control address as the first output control variable for controlling the current solenoid valve group to perform the first action.

[0100] 209. The control system performs a calculation process of subtracting one from the sum to obtain a second output control variable for controlling the current solenoid valve group to perform a second action.

[0101] 210. The control system sets the first output control variable and resets the second output control variable.

[0102] As an optional implementation, in the embodiment of the present invention, the first output control variable Y100 and the second output control variable Y101 belong to the same solenoid valve control, and the other target output addresses Y102 and Y103 belong to another solenoid valve control. According to the rule of address change, when the address change address Z=1, then Y100 Z=Y101, Y101 Z=Y102, and Y102 does not belong to the control variable of the same solenoid valve. Such control is not corresponding, so in this case, the third data register address remainder calculated above is required. The present application can judge according to whether the remainder is 0 or 1. When the third data register address=0, it is an even number. At this time, Y100Z is set, and the first action of the solenoid valve is controlled. Y101Z is reset, and the second action of the solenoid valve is controlled. When the third data register address=1, it is an odd number. At this time, Y100 Z is set, and the second action of the solenoid valve is controlled. The previous variable of Y100 Z is Y0FF Z, so Y0FF Z reset controls the first action of the solenoid valve. By reference, when the displacement address Z=0, Y100 controls the execution of the first action of the solenoid valve, and Y101 controls the stop of the second action of the solenoid valve. When the displacement address Z=1, Y101 controls the execution of the second action of the solenoid valve, and the previous displacement variable corresponding to Y100Z is Y0FFZ, so resetting Y0FFZ at this time will control the stop of the first action of the solenoid valve.

[0103] As an optional implementation, in the embodiment of the present invention, when the operator needs to control Y101 to output, the operator can input the displacement address Z=1 into the system, and then according to Y100=Y(100+1)=Y101, the output of Y101 can be controlled at this time, but Y101=Y(101+1)=Y102, and Y102 belongs to the solenoid valve of the second group, which is obviously not the same group being controlled, and Y0FF=Y(0FF+1)=Y100, Y100 is the solenoid valve of the first group, so the parity characteristic is used to distinguish whether to control the non-output of Y101 or the non-output of Y0FF.

[0104] 211. The control system resets the trigger variable.

[0105] As an optional implementation, in an embodiment of the present invention, after the trigger variable triggers the output of the first output control variable and the second output control variable, the trigger variable may be reset to ensure that the first output control variable and the second output control variable are not always set.

[0106] 212. The control system performs calculation processing on the displacement address plus one to obtain the next displacement address.

[0107] 213. The control system detects whether the value of the next address change is greater than the loop preset value; if not, execute step 214; if so, end this process.

[0108] 214. The control system defines the next displacement address as the first data register address and executes steps 202 to 205.

[0109] As an optional implementation, in an embodiment of the present invention, the execution process of the program is mainly divided into three steps, input detection, program scanning, and output refresh. This is the working order of a system working cycle. During the scanning, some program segments need to be executed multiple times. At this time, the FOR instruction can be used to allow a certain section in the program to be repeatedly executed multiple times, and then scan down.

[0110] As an optional implementation, in an embodiment of the present invention, the control system can pre-specify the number of function cycles before outputting the two operating output points of the solenoid valve. The number of cycles is determined by the number of groups of cylinder actions that need to be controlled. For example, if there are 32 groups of cylinder actions in the solenoid valve, the specified function can be cycled 32 times.

[0111] As an optional implementation, in an embodiment of the present invention, the control system may pre-specify an address displacement address and set its initial value to 0, so as to provide an initial variable for the subsequent displacement of the first output control variable and the second output control variable.

[0112] As an optional implementation, in an embodiment of the present invention, when entering the loop process for the first time, since the initial setting number of the displacement address is 0, the address Y100Z can be changed to Y100, and then the displacement address Z is incremented by 1 through the add instruction, and then the second loop is entered, and so on, until the number of loops specified by the system is reached. In this way, a long and lengthy section is simplified into a short section, saving program steps and reducing programming time.

[0113] As an optional implementation, in an embodiment of the present invention, the cyclic scanning processing process can avoid the system from entering an infinite loop during the execution of a program, or causing a system failure due to the system executing an unpredicted program, thereby causing the system to crash. If the program runs normally, the displacement address can be reset and cleared during the internal processing stage of each scanning cycle. If the program runs abnormally and enters an infinite loop, the displacement address cannot be reset and cleared in time, and the system can immediately issue an alarm or stop working, thereby effectively ensuring the smooth logic of the system.

[0114] It can be seen that the implementation Figure 2Another control method for a dual-control solenoid valve described herein can integrate the target output address of each current solenoid valve group into the displacement address to ensure that the program module call is simple while being able to individually control the target output address of each current solenoid valve group, thereby solving problems such as large amount of code, high complexity, and difficulty in maintenance.

[0115] In addition, implementation Figure 2 The described another control method of a dual-control solenoid valve simplifies the previous programming method and greatly reduces the workload of code writing.

[0116] In addition, implementation Figure 2 Another control method for a double-control solenoid valve described has the advantages of simple module calling and can be used by copying and pasting.

[0117] In addition, implementation Figure 2 The described another control method of a dual-control solenoid valve has the advantage of being easy to modify and can be completed by modifying the number of cycles according to the actual control quantity required.

[0118] In addition, implementation Figure 2 The described another control method of the double-control solenoid valve can be applied to flexibly control multiple groups of cylinders, and only the initial variables need to be modified.

[0119] In addition, implementation Figure 2 Another control method for a dual-control solenoid valve is described. The trigger variable and the trigger condition variable in this application can be called to external control, which is convenient for application.

[0120] Embodiment 3

[0121] See also Figure 3 , Figure 3 Schematic diagram of a control system disclosed in an embodiment of the present invention. Figure 3 As shown, the control system 300 may include a first definition unit 301, a second definition unit 302, a conversion unit 303, a judgment unit 304, a first calculation unit 305, a second calculation unit 306 and a setting and resetting unit 307, wherein:

[0122] The first definition unit 301 is used to define the indexed address as a first data register address when obtaining the indexed address for the current solenoid valve group.

[0123] The second definition unit 302 is used to define the quotient of the first data register address as the second data register address and the remainder of the first data register address as the third data register address after dividing the first data register address by the specified value.

[0124] The conversion unit 303 is used to convert the trigger variable and the trigger condition variable corresponding to the current solenoid valve according to the displacement address.

[0125] The judging unit 304 is used to judge whether the first data register address is an even number according to the value of the third data register address when both the trigger variable and the trigger condition variable meet the requirements.

[0126] The first calculation unit 305 is used to calculate the sum of the index address and the initial value of the control address when the judgment unit 304 judges that the first data register address is an even number, so as to serve as the first output control variable for controlling the current solenoid valve group to perform the first action.

[0127] The second calculation unit 306 is used to perform a calculation process of adding one to the sum to obtain a second output control variable used as a control variable for controlling the current solenoid valve group to perform a second action.

[0128] The setting and resetting unit 307 is used to set the first output control variable and reset the second output control variable.

[0129] As an optional implementation, in an embodiment of the present invention, the first data register address in the present application can be used to indirectly save the value change of the indexed address.

[0130] As an optional implementation, in an embodiment of the present invention, the present application may pre-define trigger variables and trigger condition variables outside the module, the trigger variable is used to trigger the output of the first output control variable and the second output control variable, the trigger condition variable is used to determine whether the trigger variable can be triggered, and the suffix of the trigger variable and the trigger condition variable can be added with a displacement address so that the conversion unit 303 can change according to the change of the displacement address.

[0131] As an optional implementation, in an embodiment of the present invention, when the trigger variable and the trigger condition variable meet the requirements, the corresponding first output control variable and the second output control variable can be set. After setting the corresponding first output control variable and the second output control variable, the solenoid valve on the corresponding hardware will also receive a signal to execute an action, thereby controlling the switching of the solenoid valve.

[0132] As an optional implementation, in an embodiment of the present invention, the second definition unit 302 can use division to calculate the first data register address, that is, divide the first data register address by 2, and save the quotient of the calculation result in the second data register address, and save the remainder of the calculation result in the third data register address. The function here is to enable the judgment unit 304 to judge whether the value of the first register address is an even number or an odd number based on the third data register address.

[0133] As an optional implementation, in the embodiment of the present invention, since each solenoid valve has two actions and the two actions cannot be executed at the same time, when the first output control variable is triggered to execute the first action, the execution of the second output control variable must be stopped. For example, if the action Y100 of the cylinder extension is required, then the action Y101 of the cylinder retracting needs to be stopped. The two output points Y cannot be executed at the same time. Therefore, after setting the first output control variable, the second output control variable needs to be reset.

[0134] As an optional implementation, in the embodiment of the present invention, it is assumed that the two output points of the first group of solenoid valves are the first output control variable Y100 and the second output control variable Y101. When the first output control variable Y100 is controlled to be output, the second output control variable Y101 must not be output. When the displacement address Z=0, the output of the first output control variable Y100 is controlled, and the second output control variable Y101 is not output. When the displacement address Z=1, the control is reversed, Y100 is not output, and Y101 is output. The solenoid valves of the second group are controlled to be Y102 and Y103. When the displacement address Z=2, Y102 is controlled to be output, and Y103 is not output. When the displacement address Z=3, the output of Y103 is controlled in reverse, and Y102 is not output. And so on and so forth, so that each output Y and the corresponding output Y+1 can be controlled in pairs.

[0135] As an optional implementation, in an embodiment of the present invention, the usage of the displacement address Z in this application, for example, Y100Z, can be regarded as Y(100+Z), so Z=0, that is, Y(100+0)=Y100, Z=1, that is, Y(100+1)=Y101, and this application does not impose any limitation on the Yn value, that is, the instruction address code.

[0136] As an optional implementation, in the embodiment of the present invention, when the operator needs to control Y101 to output, the operator can input the displacement address Z=1 into the system, and then according to Y100=Y(100+1)=Y101, the output of Y101 can be controlled at this time, but Y101=Y(101+1)=Y102, and Y102 belongs to the solenoid valve of the second group, which is obviously not the same group being controlled, and Y0FF=Y(0FF+1)=Y100, Y100 is the solenoid valve of the first group, so the parity characteristic is used to distinguish whether to control the non-output of Y101 or the non-output of Y0FF.

[0137] As an optional implementation, in the embodiment of the present invention, the first output control variable Y100 and the second output control variable Y101 belong to the same solenoid valve control, and the other target output addresses Y102 and Y103 belong to another solenoid valve control. According to the rule of address change, when the address change address Z=1, then Y100 Z=Y101, Y101 Z=Y102, and Y102 does not belong to the control variable of the same solenoid valve. Such control is not corresponding, so in this case, the third data register address remainder calculated above is required. The present application can judge according to whether the remainder is 0 or 1. When the third data register address=0, it is an even number. At this time, Y100Z is set, and the first action of the solenoid valve is controlled. Y101Z is reset, and the second action of the solenoid valve is controlled. When the third data register address=1, it is an odd number. At this time, Y100 Z is set, and the second action of the solenoid valve is controlled. The previous variable of Y100 Z is Y0FF Z, so Y0FF Z reset controls the first action of the solenoid valve. By reference, when the displacement address Z=0, Y100 controls the execution of the first action of the solenoid valve, and Y101 controls the stop of the second action of the solenoid valve. When the displacement address Z=1, Y101 controls the execution of the second action of the solenoid valve, and the previous displacement variable corresponding to Y100Z is Y0FFZ, so resetting Y0FFZ at this time will control the stop of the first action of the solenoid valve.

[0138] It can be seen that the implementation Figure 3 The control system described can integrate the target output address of each current solenoid valve group into the displacement address to ensure that the program module call is simple while being able to individually control the target output address of each current solenoid valve group, thereby solving problems such as large code volume, high complexity, and difficulty in maintenance.

[0139] In addition, implementation Figure 3 The control system described can modularize the program programming of the double-control solenoid valve, making the program module call simple, which not only reduces the workload of programmers but also makes the control modification more convenient.

[0140] Embodiment 4

[0141] See also Figure 4 , Figure 4 is a schematic diagram of the structure of another control system disclosed in an embodiment of the present invention. Figure 4 The control system shown is composed of Figure 3 The control system shown is optimized. Figure 3 Compared with the control system shown, Figure 4 The control system shown may also include:

[0142] The first execution unit 308 is used to calculate the sum of the displacement address and the initial value of the control address as the first output control variable for controlling the current solenoid valve group to perform the first action when the judgment unit determines that the first data register address is not an even number.

[0143] The third calculation unit 309 is used to perform a calculation process of subtracting one from the sum to obtain a second output control variable for controlling the current solenoid valve group to perform a second action.

[0144] As an optional implementation, in the embodiment of the present invention, the first output control variable Y100 and the second output control variable Y101 belong to the same solenoid valve control, and the other target output addresses Y102 and Y103 belong to another solenoid valve control. According to the rule of address change, when the address change address Z=1, then Y100 Z=Y101, Y101 Z=Y102, and Y102 does not belong to the control variable of the same solenoid valve. Such control is not corresponding, so in this case, the third data register address remainder calculated above is required. The present application can judge according to whether the remainder is 0 or 1. When the third data register address=0, it is an even number. At this time, Y100Z is set, and the first action of the solenoid valve is controlled. Y101Z is reset, and the second action of the solenoid valve is controlled. When the third data register address=1, it is an odd number. At this time, Y100 Z is set, and the second action of the solenoid valve is controlled. The previous variable of Y100 Z is Y0FF Z, so Y0FF Z reset controls the first action of the solenoid valve. By reference, when the displacement address Z=0, Y100 controls the execution of the first action of the solenoid valve, and Y101 controls the stop of the second action of the solenoid valve. When the displacement address Z=1, Y101 controls the execution of the second action of the solenoid valve, and the previous displacement variable corresponding to Y100Z is Y0FFZ, so resetting Y0FFZ at this time will control the stop of the first action of the solenoid valve.

[0145] As an optional implementation, in the embodiment of the present invention, when the operator needs to control Y101 to output, the operator can input the displacement address Z=1 into the system, and then according to Y100=Y(100+1)=Y101, the output of Y101 can be controlled at this time, but Y101=Y(101+1)=Y102, and Y102 belongs to the solenoid valve of the second group, which is obviously not the same group being controlled, and Y0FF=Y(0FF+1)=Y100, Y100 is the solenoid valve of the first group, so the parity characteristic is used to distinguish whether to control the non-output of Y101 or the non-output of Y0FF.

[0146] and Figure 3Compared with the control system shown, Figure 4 The control system shown may also include:

[0147] The reset unit 310 is used to reset the trigger variable after the setting and resetting unit 307 sets the first output control variable and resets the second output control variable.

[0148] As an optional implementation, in an embodiment of the present invention, after the trigger variable triggers the output of the first output control variable and the second output control variable, the reset unit 310 may reset the trigger variable to ensure that the first output control variable and the second output control variable are not always set.

[0149] and Figure 3 Compared with the control system shown, Figure 4 The control system shown may also include:

[0150] The fourth calculation unit 311 is used for performing a calculation process of adding one to the displacement address after the reset unit performs a reset process on the trigger variable, so as to obtain a next displacement address.

[0151] The detection unit 312 is used to detect whether the value of the next indexed address is greater than the loop preset value.

[0152] The third defining unit 313 is used to define the next indexed address as the first data register address when the detecting unit detects that the value of the next indexed address is not greater than the loop preset value.

[0153] The re-execution unit 314 is used to re-execute the operation of defining the quotient of the first data register address as the second data register address and the remainder of the first data register address as the third data register address after dividing the first data register address by the specified value.

[0154] and Figure 3 Compared with the control system shown, Figure 4 The control system shown may also include:

[0155] The second execution unit 315 is used for executing the operation of adding one to the displacement address to obtain the next displacement address if both the trigger variable and the trigger condition variable fail to meet the requirements.

[0156] As an optional implementation, in an embodiment of the present invention, the execution process of the system is mainly divided into three steps, input detection, program scanning, and output refresh. This is the working order of a working cycle of the system. During the scanning, some program segments need to be executed multiple times. At this time, the FOR instruction can be used to allow a certain section in the program to be repeatedly executed multiple times, and then scan down.

[0157] As an optional implementation, in an embodiment of the present invention, the control system can pre-specify the number of function cycles before outputting the two operating output points of the solenoid valve. The number of cycles is determined by the number of groups of cylinder actions that need to be controlled. For example, if there are 32 groups of cylinder actions in the solenoid valve, the specified function can be cycled 32 times.

[0158] As an optional implementation, in an embodiment of the present invention, the control system may pre-specify an address displacement address and set its initial value to 0, so as to provide an initial variable for the subsequent displacement of the first output control variable and the second output control variable.

[0159] As an optional implementation, in an embodiment of the present invention, when entering the loop process for the first time, since the initial setting number of the displacement address is 0, the address Y100Z can be changed to Y100, and then the displacement address Z is incremented by 1 through the add instruction, and then the second loop is entered, and so on, until the number of loops specified by the system is reached. In this way, a long and lengthy section is simplified into a short section, saving program steps and reducing programming time.

[0160] As an optional implementation, in an embodiment of the present invention, the cyclic scanning processing process can avoid the system from entering an infinite loop during the execution of a program, or causing a system failure due to the system executing an unpredicted program, thereby causing the system to crash. If the program runs normally, the displacement address can be reset and cleared during the internal processing stage of each scanning cycle. If the program runs abnormally and enters an infinite loop, the displacement address cannot be reset and cleared in time, and the system can immediately issue an alarm or stop working, thereby effectively ensuring the smooth logic of the system.

[0161] It can be seen that the implementation Figure 4 Another control system described can integrate the target output address of each current solenoid valve group into the displacement address to ensure that the program module call is simple while being able to individually control the target output address of each current solenoid valve group, thereby solving problems such as large code volume, high complexity, and difficult maintenance.

[0162] In addition, implementation Figure 4 Another control system described herein implements Figure 2 The described another control method of a dual-control solenoid valve simplifies the previous programming method and greatly reduces the workload of code writing.

[0163] In addition, implementation Figure 4 The described another control system has the advantages of simple module calling and can be used by copying and pasting.

[0164] In addition, implementation Figure 4The described another control system has the advantage of being easy to modify, and can be completed by modifying the number of cycles according to the actual control quantity required.

[0165] In addition, implementation Figure 4 Another control system described can be used to flexibly control multiple groups of cylinders by simply modifying the initial variables.

[0166] In addition, implementation Figure 4 In the another control system described, the trigger variables and trigger condition variables in this application can be called to external control, which is convenient for application.

[0167] Embodiment 5

[0168] See also Figure 5 , Figure 5 It is a structural schematic diagram of another control system disclosed in an embodiment of the present invention.

[0169] like Figure 5 As shown, the control system may include:

[0170] A memory 501 storing executable program codes;

[0171] a processor 502 coupled to the memory 501;

[0172] The processor 502 calls the executable program code stored in the memory 501 to execute Figure 1-2 Any control method of a double-control solenoid valve.

[0173] The embodiment of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute Figure 1-2 Any control method of a double-control solenoid valve.

[0174] The embodiments of the present invention further disclose a computer program product, wherein when the computer program product is run on a computer, the computer is enabled to execute part or all of the steps of the methods in the above method embodiments.

[0175] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0176] The control method and control system of a dual-control solenoid valve disclosed in an embodiment of the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A control method for a double-control solenoid valve, characterized in that: include: When the displacement address for the current solenoid valve group is obtained, the displacement address is defined as a first data register address; after dividing the first data register address by 2, the quotient obtained by dividing the first data register address is defined as a second data register address and the remainder obtained by dividing the first data register address is defined as a third data register address; according to the displacement address, the trigger variable and the trigger condition variable corresponding to the current solenoid valve group are converted; when both the trigger variable and the trigger condition variable meet the requirements, whether the first data register address is an even number is determined according to the value of the third data register address; if so, the sum of the displacement address and the initial value of the control address is calculated as a first output control variable for controlling the current solenoid valve group to perform the first action; the sum is added by one to obtain a second output control variable for controlling the current solenoid valve group to perform the second action; the first output control variable is set and the second output control variable is reset; If it is determined that the first data register address is not an even number, the operation of calculating the sum of the index address and the initial value of the control address as the first output control variable for controlling the current solenoid valve group to perform the first action is performed; Subtract one from the sum to obtain the second output control variable for controlling the current solenoid valve group to perform the second action; set the first output control variable and reset the second output control variable.

2. The method according to claim 1, characterized in that: After setting the first output control variable and resetting the second output control variable, the method further includes: resetting the trigger variable.

3. The method according to claim 2, characterized in that After resetting the trigger variable, the method further includes: performing a calculation process of adding one to the displacement address to obtain a next displacement address; detecting whether the value of the next displacement address is greater than a loop preset value; if not, defining the next displacement address as the first data register address; and re-executing the operation of defining the quotient obtained by dividing the first data register address by 2 as the second data register address and the remainder obtained by dividing the first data register address as the third data register address.

4. The method according to claim 3, characterized in that The method further includes: if both the trigger variable and the trigger condition variable fail to meet the requirements, performing the operation of adding one to the displacement address to obtain the next displacement address.

5. A control system, characterized in that: The control system includes: a first definition unit, which is used to define the displacement address of the current solenoid valve group as a first data register address when the displacement address is obtained; a second definition unit, which is used to define the quotient obtained by dividing the first data register address by 2 as a second data register address and the remainder obtained by dividing the first data register address as a third data register address; a conversion unit, which is used to convert the trigger variable and the trigger condition variable corresponding to the current solenoid valve group according to the displacement address; a judgment unit, which is used to judge whether the first data register address is an even number according to the value of the third data register address when both the trigger variable and the trigger condition variable meet the requirements; a first calculation unit, which is used to calculate the sum of the displacement address and the initial value of the control address as a first output control variable for controlling the current solenoid valve group to perform the first action when the judgment unit judges that the first data register address is an even number; a second calculation unit, which is used to perform a calculation process of adding one to the sum to obtain a second output control variable for controlling the current solenoid valve group to perform the second action; a setting and resetting unit, which is used to set the first output control variable and reset the second output control variable; In which, the control system also includes: a first execution unit, which is used to execute the operation of calculating the sum of the displacement address and the initial value of the control address as the first output control variable for controlling the current solenoid valve group to perform the first action when the judgment unit determines that the first data register address is not an even number; and a third calculation unit, which is used to perform a subtraction calculation on the sum to obtain the second output control variable for controlling the current solenoid valve group to perform the second action.

6. The control system according to claim 5, characterized in that: The control system further includes: a reset unit, configured to reset the trigger variable after the setting and resetting unit sets the first output control variable and resets the second output control variable.

7. The control system according to claim 6, characterized in that: The control system also includes: a fourth calculation unit, used to add one to the displacement address after the reset unit resets the trigger variable to obtain a next displacement address; a detection unit, used to detect whether the value of the next displacement address is greater than a loop preset value; a third definition unit, used to define the next displacement address as the first data register address when the detection unit detects that the value of the next displacement address is not greater than the loop preset value; and a re-execution unit, used to re-execute the operation of defining the quotient obtained by dividing the first data register address by 2 as the second data register address and the remainder obtained by dividing the first data register address as the third data register address.

8. The control system according to claim 7, characterized in that: The control system further comprises: a second execution unit, configured to execute the operation of adding one to the displacement address to obtain a next displacement address if both the trigger variable and the trigger condition variable fail to meet the requirements.