A step counting method for factory automation
By using the master-slave calculation method in factory automatic control, the steps calculation situation is processed, and the problems of skipping, repeated steps and dead cycles in the identification, marking and processing of execution steps are solved, and the accuracy and consistency of step calculation is achieved, which improves the reliability of factory automation control.
Patent Information
- Application Number
- CN202311845963.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2043-12-29
AI Technical Summary
During the factory automatic control process, there are problems such as skipping, repeated steps and vicious cycles in identification, marking and processing of execution steps.
The master-slave calculation method is used to process the calculation of abnormal synchronization such as parameter entry, pressure regulation and continued material collection. By setting initial conditions, trigger variables and temporary step count storage variables, the accurate calculation and processing of step count is achieved.
It effectively solves the problems of jumping, repeating steps and dead cycles, ensures the accuracy and consistency of step counting, and improves the reliability of factory automation control.
Smart Images

Figure CN117850309B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of factory automation control, and in particular relates to a step number calculation method for factory automation. Background Art
[0002] In order to reduce manual operation, the factory dedicated pipeline carries out the design of automatic product parameter control function. However, in the entire automatic control process, it must be executed strictly according to the sequential steps. Therefore, the execution steps need to be marked and processed into computer-recognizable information. In the process of step processing, problems such as skipping steps, repeated steps, and dead loops are often encountered. Summary of the invention
[0003] The technical problem solved by the present invention is to identify, mark and process the number of steps executed in the factory automatic control process. According to several different step calculation situations, the number of steps is converted into computer-recognizable marking information through master-slave calculation, and the problem of skipping steps, repeating steps and dead loops in the step processing process is solved.
[0004] The technical solution adopted by the present invention is:
[0005] A step calculation method for factory automation includes the following steps: S1, step calculation when entering parameters; S2, step calculation method when adjusting pressure; S3, step calculation when continuing to collect materials; using a master-slave calculation method, firstly taking the situation when entering parameters as the main line for calculation, when pressure adjustment occurs or when continuing to collect materials, switching to slave line calculation mode, and returning the final result to the main line calculation.
[0006] The step number calculation when the parameters are entered includes setting the initial conditions, setting the trigger variable LR, setting the integer variable N used as the step number mark, setting the temporary step number storage integer variable V; setting the LR trigger formula: V=N+1.
[0007] When LR is in the ON trigger state, the step calculation judgment when the parameters are entered is started, the trigger formula conditions are met, the value of the step variable N is increased by 1, and then the result is assigned to the temporary step storage integer variable V.
[0008] When LR has an ON transition, the internal clock starts timing immediately. When the timing reaches 2 seconds, LR is assigned an OFF value. The LR variable is reassigned to OFF, and the trigger formula condition is no longer met. The value of V is no longer affected by N+1, and only the current value is maintained, and the value of the intermediate variable V is locked.
[0009] When the variable LR is set to change from the ON state to the OFF state, a falling edge is generated. The falling edge is taken as the trigger condition, and the unlocked V value is assigned to the step variable N. The N value is replaced by the latest V value, which is equivalent to the formula N=N+1.
[0010] The step number calculation method during voltage regulation includes setting a voltage regulation trigger variable PJDOUT, setting a formula N=N+1 to perform a step number addition operation, using a computer scanning cycle to lock the number of executions, resetting the voltage regulation trigger variable PJDOUT, and when it jumps to ON for a computer cycle, immediately assigning a value to OFF and keeping it in a permanent state, at which time N=N+1 is no longer triggered. After the calculation is completed, return to S1 for calculation.
[0011] When PJDOUT is ON, the trigger step calculation condition is met. At this time, the calculation method jumps from S1 to S2.
[0012] The set step number N value cannot jump out of this loop, that is, N≤10, and the QDU_N loop variable remains unchanged.
[0013] The step calculation when continuing to receive materials includes setting the trigger variable JX for continuing to receive materials, setting the variable JX to the ON state as the trigger condition, starting the step variable N and the loop variable QDU_N setting judgment, that is, when JX=ON, the step variable N and the loop variable QDU_N are directly set to 0; setting the step setting method of the first record column, when JX=ON, delaying for 1 second, that is, when the variable JX jumps to the ON state for 3 seconds, N is set again, and at this time it is set to 1. Through this setting, it means that the continued material receiving work enters the first record column; after the calculation is completed, return to the S1 main line calculation.
[0014] The variable is triggered by a button. When it is necessary to continue collecting materials, click the button, and the continue collecting material trigger variable JX jumps from the normal OFF state to the ON state. At this time, the calculation from the main line S1 jumps to the slave line S3.
[0015] Compared with the prior art, the present invention has the following beneficial effects:
[0016] (1) The present invention provides a step calculation method for factory automation, which uses a master-slave calculation method to include the step calculation changes of the entire control link, and provides an automatic step calculation entry and return method under corresponding circumstances.
[0017] (2) The present invention provides a step counting method for factory automation, which can solve the problems of skipped steps, repeated steps and infinite loops.
[0018] (3) The present invention provides a step number calculation method for factory automation, which first assigns a constant value, then delays and stabilizes it for a period of time, and then adds 1 to it. This method can eliminate the problem of multiple triggering of the pre-trigger condition of accumulating 1; on the other hand, the constant value assignment can lock the assigned parameter to avoid subsequent interfering assignments.
[0019] (4) The present invention provides a step counting method for factory automation, which marks the trigger variable, turns on when triggered, turns off when falling, and sets a time difference between rising and falling. The temporary variable V and the falling edge trigger are used to prevent the problem of multiple assignments caused by the computer scanning cycle. The V value is locked and the falling edge is triggered to ensure that the target operation is only performed once in the locking stage and the assignment stage.
[0020] The present invention provides a step number calculation method for factory automation, a calculation method in which the first parameter can be maintained. The step number variable is assigned by cyclic accumulation, but when the maximum value of the cycle is 10, the number of cycles is only jumped to 2, ensuring that the various parameters of the first step number are unique. At the same time, in order to continue to receive materials, the parameter reset interface is opened, and the step number when continuing to receive materials is directly sent to 1.
[0021] (6) The step number calculation method for factory automation provided by the present invention takes into account that voltage regulation is an intervention operation carried out in this cycle. Therefore, the step number N value is set so that it cannot jump out of this cycle, that is, N≤10, and the QDU_N loop variable remains unchanged. This method can ensure that a new round of master-slave calculation is not performed during voltage regulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is a flow chart of the step number calculation method when entering parameters;
[0023] Figure 2 This is a flow chart of the method for calculating the number of steps during voltage regulation;
[0024] Figure 3 This is a flow chart of the method for calculating the number of steps when continuing to collect materials. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0027] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0028] An embodiment of the present invention provides a step counting method for factory automation, comprising the following contents:
[0029] According to the three situations of step number changes: 1) when parameters are entered 2) when pressure is adjusted 3) when material collection continues, the master-slave calculation method is adopted. First, the calculation is carried out based on the situation when parameters are entered as the main line. When pressure adjustment occurs or material collection continues, it is switched to slave line calculation mode and the final result is returned to the main line calculation.
[0030] The main calculation method is to calculate the number of steps when entering parameters. As long as the parameters are entered once, one step is executed, and this step is unique. The input action is associated by changing the variable state to ON. The number of steps is increased in a cyclic accumulation manner. When the maximum value is reached, it jumps to the preliminary number 2 for cyclic coverage. In particular, step 1 needs to be retained and cannot be overwritten. Furthermore, to ensure the execution of a unique step, the accumulation method is set to trigger the variable falling edge combined with the machine cycle lock to perform constant assignment to avoid the risk of repeated and cyclic assignment.
[0031] Furthermore, the main line calculation circuit provides a slave line jump function. Each time the parameters are entered, a voltage regulation judgment is performed. When the voltage regulation is triggered, it jumps to the slave line calculation.
[0032] Furthermore, the slave line that continues to receive materials has the highest entry authority and can enter the main line at any time and initialize the main line to the step number 1 of continuing to receive materials.
[0033] Specific:
[0034] like Figure 1 As shown, S1, the number of steps calculated when the parameters are entered
[0035] S101. Setting initial conditions
[0036] Set the trigger variable LR. When LR is in the ON trigger state, the step calculation and judgment when the parameters are entered are started; set the integer variable N as the step mark and set the temporary step storage integer variable V;
[0037] S102, set the LR trigger formula: V=N+1. The formula means that when the LR variable becomes ON, the formula trigger condition is met, the value of the step variable N is increased by 1, and then the result is assigned to the temporary step storage integer variable V. At this time, since the LR variable is always in the ON state, the V value is always equal to N+1.
[0038] S103, set the self-reset method of the trigger variable LR: when LR has an ON transition, the internal clock is immediately counted, and when the timing reaches 2 seconds, LR is assigned an OFF value. At this time, since the LR variable is reassigned to OFF, the LR trigger formula condition of "S102" is no longer met, and the value of V is no longer affected by N+1, and only the current value is maintained. In this way, the value of the intermediate variable V is locked.
[0039] S104, set the variable LR to generate a falling edge when it changes from the ON state to the OFF state, take the falling edge as the trigger condition, and assign the unlocked V value to the step variable N. The N value is replaced by the latest V value. Since the source of the V value is the N value at the previous moment plus 1, it is equivalent to the formula: N = N + 1. The temporary variable V and the falling edge trigger are used to prevent the problem of multiple assignments caused by the computer scanning cycle. Through the V value locking and the falling edge trigger, it is ensured that the target operation is only executed once in the locking stage and the assignment stage.
[0040] S105. In order to avoid the interference of monitoring and data reference caused by the infinite growth of N value, the formula N+1 pre-trigger condition is further set, that is, when the LR variable is ON triggered, the level 1 trigger condition is met, and then the level 2 trigger condition is judged: N < 10. Only after the level 2 trigger condition is met can the N+1 operation be executed. If N exceeds 10 when judging the level 2 trigger condition, the N=2 operation is executed. Set the loop variable QDU_N. When N exceeds 10, the loop variable QDU_N performs an addition operation and assigns the result to QDU_N for calculating the number of loops. When N exceeds 10, the purpose of directly assigning the N value to 2 is to ensure that the data history of the step number N=1 can be queried, that is, the parameters of the first execution remain unchanged.
[0041] like Figure 2 As shown in S2, the step calculation method for voltage regulation
[0042] S201, set the voltage regulation trigger variable PJDOUT. When PJDOUT is ON, the trigger step calculation condition is met. At this time, the calculation method jumps from S1 to S2.
[0043] S202. Since the voltage regulation trigger variable PJDOUT is executed only once in one computer cycle, the formula N=N+1 is set to perform a step increase operation, and the number of executions is locked using the computer scanning cycle.
[0044] S203, reset the voltage regulation trigger variable PJDOUT, and after it jumps to ON for one computer cycle, immediately set it to OFF and keep it in the state. At this time, N=N+1 is no longer triggered.
[0045] S204. Considering that voltage regulation is an intervention operation carried out in this cycle, the set step number N value cannot jump out of this cycle, that is, N≤10, and the QDU_N loop variable remains unchanged.
[0046] S205. After the calculation is completed, return to S1 main line calculation.
[0047] like Figure 3 As shown, S3, the number of steps for continuing to collect materials
[0048] S301, set the trigger variable JX for continuing to receive materials. This variable is triggered by a button. When you need to continue to receive materials, click the button, and the trigger variable JX for continuing to receive materials will jump from the normal OFF state to the ON state. At this time, the calculation of the main line S1 jumps to the slave line S3.
[0049] S302, set the JX variable to self-reset function, start timing when the variable JX becomes ON, and set it to OFF after 2 seconds.
[0050] S303, set the variable JX to ON as the trigger condition, start the step variable N and the loop variable QDU_N value setting judgment. That is, when JX = ON, the step variable N and the loop variable QDU_N are directly set to 0.
[0051] S304, set the first record column step value setting mode, when JX = ON, delay 1 second, that is, when the variable JX jumps to the ON state 3 seconds later, set N again, this time set it to 1. Through this setting, it means that the material receiving work continues to enter the first record column.
[0052] S305. After the calculation is completed, return to S1 main line calculation.
[0053] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
[0054] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A step counting method for factory automation, characterized in that: The following steps are included: S1, step calculation when entering parameters; S2, step calculation when adjusting pressure; S3, step calculation when continuing to collect materials; the master-slave calculation method is adopted, firstly, the calculation is carried out based on the situation when entering parameters as the main line, when pressure adjustment occurs or when continuing to collect materials, it is switched to the slave line calculation mode, and the final result is returned to the main line calculation; The step number calculation during parameter entry includes setting initial conditions, setting trigger variable LR, and setting integer variable N as step number mark; Set the temporary step number storage integer variable V; set the LR trigger formula: V = N + 1; When LR is in the ON trigger state, the step calculation judgment when the parameters are entered is started, the trigger formula condition is met, the value of the step variable N is increased by 1, and then the result is assigned to the temporary step storage integer variable V; When LR has an ON transition, the internal clock starts counting immediately. When the timing reaches 2 seconds, LR is assigned an OFF value. The LR variable is reassigned to OFF, and the trigger formula condition is no longer met. The value of V is no longer affected by N+1, and only the current value is maintained, and the value of the intermediate variable V is unlocked. When the variable LR is set to change from the ON state to the OFF state, a falling edge is generated. The falling edge is taken as the trigger condition, and the unlocked V value is assigned to the step variable N. The N value is replaced by the latest V value, which is equivalent to the formula N=N+1.
2. The step counting method for factory automation according to claim 1, characterized in that: The step calculation during voltage regulation includes setting the voltage regulation trigger variable PJDOUT, setting the formula N=N+1 to perform the step addition operation, using the computer scanning cycle to lock the number of executions, resetting the voltage regulation trigger variable PJDOUT, and when it jumps to ON for a computer cycle, it is immediately assigned to the OFF state and is kept in a permanent state. At this time, N=N+1 is no longer triggered. After the calculation is completed, return to S1 calculation.
3. The step counting method for factory automation according to claim 2, characterized in that: When PJDOUT is ON, the trigger step calculation condition is met. At this time, the calculation method jumps from S1 to S2.
4. The step counting method for factory automation according to claim 3, characterized in that: The set step number N value cannot jump out of this loop, that is, N≤10, and the QDU_N loop variable remains unchanged.
5. The step counting method for factory automation according to claim 1, characterized in that: The step calculation when continuing to receive materials includes setting the trigger variable JX for continuing to receive materials, setting the variable JX to the ON state as the trigger condition, starting the step variable N and the loop variable QDU_N setting judgment, that is, when JX=ON, the step variable N and the loop variable QDU_N are directly set to 0; setting the step setting method of the first record column, when JX=ON, delaying for 1 second, that is, when the variable JX jumps to the ON state for 3 seconds, N is set again, and at this time it is set to 1. Through this setting, it means that the continued material receiving work enters the first record column; after the calculation is completed, return to the S1 main line calculation.
6. The step counting method for factory automation according to claim 5, characterized in that: The variable is triggered by a button. When it is necessary to continue collecting materials, click the button, and the continue collecting material trigger variable JX jumps from the normal OFF state to the ON state. At this time, the main line calculation S1 jumps to the slave line calculation S3.
Citation Information
Patent Citations
Programmable automatic assembly system
US4163183A