Programmable controller variable forcing method, system, device and storage medium
By receiving and responding to the mandatory signal in the programmable controller, the target variables are directly changed and the calculation results are adjusted, and the tedious problem of the compulsory variable rewriting process is solved, and the control operation efficiency and the flexibility of software design are improved.
Patent Information
- Application Number
- CN202111585077.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2041-12-22
AI Technical Summary
In the process of rewriting forced variables of programmable controllers, adding forced logic interface calls in the prior art is more cumbersome, which affects the control operation efficiency.
By receiving the mandatory signal issued by the main control terminal, the corresponding compulsory response operation is triggered, the value of the target variable is directly changed, and the mandatory operation results are sent after the user program is executed. Real -time monitoring and adjusting the compulsory operation results to match the target variable.
It improves the control operation efficiency when the programmable controller forces variables to be rewritten, simplifies the software design mechanism and process, and adapts to the characteristics of complex functions and flexible system deployment.
Smart Images

Figure CN114281407B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automation technology, and in particular to a programmable controller variable forcing method, system, device and storage medium. Background Art
[0002] Programmable controllers are widely used in the modern industrial automation industry. As the brain of industrial equipment and factories, they play an irreplaceable role in the field of modern industrial automation. As a key technology for debugging programmable controllers, forced technology is widely used in discrete and especially process control fields. In the process of automated debugging, due to the reasons that field sensors, instruments and other equipment are not installed or fail, some variables need to be forced to simulate the actual signal values on site to complete the debugging and function verification of a certain section of the program. Among them, the rewriting of forced variables can be done by adding forced logic interface calls after obtaining input and before refreshing output of each task of programmable control. During the debugging process, according to the forced list and forced value set by the user, the forced list is traversed through the forced logic call interface to achieve variable rewriting. However, adding a forced call interface after the input and before the output of each task is cumbersome to implement, and the forced interface needs to be called every time during the operation, which affects the control operation efficiency. Summary of the invention
[0003] The main purpose of the present invention is to provide a programmable controller variable forcing method, system, device and storage medium, aiming to solve the technical problem of how to improve the control operation efficiency when the programmable controller forces the variables to be rewritten.
[0004] To achieve the above object, the present invention provides a programmable controller variable forcing method, the programmable controller variable forcing method is applied to a programmable controller, and the programmable controller variable forcing method comprises:
[0005] If a first forced signal sent by the master control terminal is received, a first forced response operation associated with the first forced signal is triggered, and a variable value of a target variable in the programmable controller is changed according to the first forced response operation;
[0006] According to the changed target variable, the user program in the programmable controller is executed, and the forced operation result after executing the user program is sent to the main control terminal.
[0007] Optionally, after the step of sending the forced operation result after executing the user program to the main control terminal, the method further includes:
[0008] Real-time monitoring of whether a second mandatory signal sent by the main control terminal is received;
[0009] If the second forced signal is received, triggering a second forced response operation associated with the second forced signal, and determining a target variable according to the second forced response operation;
[0010] Detecting whether the forced operation result matches the target variable;
[0011] If the forced operation result does not match the target variable, then changing the forced operation result according to the variable value corresponding to the target variable until the changed forced operation result matches the target variable;
[0012] Refresh the external output status according to the changed forced operation result.
[0013] Optionally, after the step of triggering a first forced response operation associated with the first forced signal, the method further includes:
[0014] Real-time monitoring of whether a command to release forced variables issued by the master control terminal is received;
[0015] If the command to release the forced variable is received, the signal connection is disconnected and the forced response operation is deleted;
[0016] Acquire external input information, execute a user program according to the external input information, and acquire an execution operation result of the executed user program;
[0017] The external output state is refreshed according to the execution operation result.
[0018] Furthermore, to achieve the above object, the present invention also provides a programmable controller variable forcing method, the programmable controller variable forcing method is applied to a master control terminal, and the programmable controller variable forcing method comprises the following steps:
[0019] If an input forced command is received, determining a first forced signal for an associated operation based on the forced command, and sending the first forced signal to the programmable controller;
[0020] If the forced operation result fed back by the programmable controller based on the received first forced signal is monitored, a second forced signal for associated operation is determined based on the forced operation result, and the second forced signal is sent to the programmable controller.
[0021] Optionally, before the step of determining the first forced signal that has performed the associated operation based on the forced command and sending the first forced signal to the programmable controller, the step further includes:
[0022] Obtaining a mandatory list according to the mandatory order;
[0023] The target variables that need to be changed in the programmable controller are determined according to the forced list.
[0024] Optionally, the step of determining a first forced signal that has performed an associated operation based on the forced command and sending the first forced signal to the programmable controller includes:
[0025] registering a first force signal based on the force command, constructing a first force response operation associated with the first force signal according to the target variable, and sending the first force signal associated with the first force response operation to the programmable controller;
[0026] The step of determining the second forced signal having performed the associated operation based on the forced operation result and sending the second forced signal to the programmable controller comprises:
[0027] A second forcing signal is registered based on the forcing operation result, a second forcing response operation associated with the second forcing signal is constructed according to the target variable, and the second forcing signal associated with the second forcing response operation is sent to the programmable controller.
[0028] Optionally, the programmable controller variable forcing method further includes:
[0029] Detect whether the input release command is received;
[0030] If an input release command is received, a release forced variable command is constructed according to the release command, and the release forced variable command is sent to the programmable controller.
[0031] In addition, to achieve the above-mentioned purpose, the present invention also provides a programmable controller variable forcing system, the programmable controller variable forcing system comprising a main control terminal and a programmable controller,
[0032] The main control terminal is used for, if receiving an input forced command, determining a first forced signal for an associated operation based on the forced command, and sending the first forced signal to the programmable controller;
[0033] The programmable controller is configured to trigger a first forced response operation associated with the first forced signal upon receiving the first forced signal from the master control terminal, and to change the variable value of the target variable in the programmable controller according to the first forced response operation;
[0034] The programmable controller is further used to execute the user program in the programmable controller according to the changed target variable, and send the forced operation result after executing the user program to the main control terminal;
[0035] The main control terminal is also used to determine a second forced signal that has performed an associated operation based on the forced operation result fed back by the programmable controller based on the received first forced signal, and send the second forced signal to the programmable controller if it monitors the forced operation result fed back by the programmable controller based on the received first forced signal.
[0036] In addition, to achieve the above-mentioned purpose, the present invention also provides a programmable controller variable forcing device, which includes a memory, a processor, and a programmable controller variable forcing program stored in the memory and executable on the processor, wherein: when the programmable controller variable forcing program is executed by the processor, the steps of the programmable controller variable forcing method as described above are implemented.
[0037] In addition, to achieve the above-mentioned purpose, the present invention also provides a storage medium, on which a programmable controller variable forcing program is stored, and when the programmable controller variable forcing program is executed by a processor, the steps of the programmable controller variable forcing method as described above are implemented.
[0038] The present invention proposes a programmable controller variable forcing method, system, device and storage medium. The programmable controller monitors in real time whether a first forcing signal sent by a main control terminal is received, and determines whether variable forcing is required by monitoring the first forcing signal. After monitoring the first forcing signal, a first forcing response operation is triggered according to the first forcing signal. Triggering by the first forcing signal can adapt to the characteristics of complex programmable controller functions and flexible system deployment during programmable controller operation. The variable forcing action is started through the first forcing response operation, and the variable value of the target variable in the programmable controller is changed according to the first forcing response operation to achieve the forcing of the target variable, so as to execute the user program in the programmable controller according to the changed variable value, and send the forcing operation result after executing the user program to the main control terminal, which effectively improves the execution efficiency of programmable control, simplifies the software design mechanism and process, and effectively improves the control operation efficiency of the programmable controller when forcing variables to be rewritten. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a schematic diagram of the structure of a programmable controller variable forcing device in a hardware operating environment involved in an embodiment of the present invention;
[0040] Figure 2 It is a flow chart of the first embodiment of the programmable controller variable forcing method of the present invention;
[0041] Figure 3 This is a schematic diagram of a variable forced operation process according to an embodiment of the present invention;
[0042] Figure 4This is a schematic diagram of a variable forced application process according to an embodiment of the present invention;
[0043] Figure 5 A schematic diagram of a process flow of releasing variables for forced application according to an embodiment of the present invention;
[0044] Figure 6 A schematic diagram of a process flow of releasing variables for forced operation according to an embodiment of the present invention;
[0045] Figure 7 It is a flow chart of the third embodiment of the programmable controller variable forcing method of the present invention;
[0046] Figure 8 This is a schematic diagram of the structure of the programmable controller variable forcing system of the present invention.
[0047] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0048] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0049] Reference Figure 1 , Figure 1 The present invention is a schematic diagram of a programmable controller variable forcing device structure in a hardware operating environment according to an embodiment of the present invention.
[0050] like Figure 1 As shown, the programmable controller variable forcing device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0051] Those skilled in the art will understand that Figure 1The structure shown in does not constitute a limitation on the programmable controller variable forcing device, and may include more or less components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0052] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module and a programmable controller variable forcing program.
[0053] exist Figure 1 In the programmable controller variable forcing device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the programmable controller variable forcing device of the present invention can be set in the programmable controller variable forcing device, and the programmable controller variable forcing device calls the programmable controller variable forcing program stored in the memory 1005 through the processor 1001, and executes the programmable controller variable forcing method provided by the embodiment of the present invention.
[0054] The embodiment of the present invention provides a programmable controller variable forcing method, referring to Figure 2 , Figure 2 It is a flow chart of the first embodiment of the programmable controller variable forcing method of the present invention.
[0055] In this embodiment, the programmable controller variable forcing method includes:
[0056] Step S100, if a first forced signal sent by the master control terminal is received, a first forced response operation associated with the first forced signal is triggered, and a variable value of a target variable in the programmable controller is changed according to the first forced response operation;
[0057] In this embodiment, it should be noted that the programmable controller, also known as a programmable logic controller, is a digital operation electronic system specially designed for use in an industrial environment. It uses a programmable memory to store instructions for performing operations such as logical operations, sequential control, timing, counting and arithmetic operations, and controls various types of mechanical equipment or production processes through digital or analog input and output. When the programmable controller is put into operation, each task follows the IPO (In Process Out) model, and its working process is generally divided into three links: obtaining input, executing user programs, and refreshing output. Completing the above three links is called a scan cycle. During the entire operation period, the CPU (central processing unit) of the programmable controller repeatedly executes the above three stages at a certain scanning speed. The programmable controller variable forcing technology is a commonly used debugging technology. In the process of automated debugging, due to reasons such as the incomplete installation or failure of field sensors, instruments and other equipment, some variables need to be forced to simulate the actual signal values on site to complete the debugging and function verification of a certain section of the program. Variable forcing is achieved by forcing operations on some input and output points. The forcing function of programmable control is mainly used to forcibly give the state of an external input signal or forcibly control the state of an external output device. In this embodiment, a signal mechanism is used to implement variable forcing technology, wherein the signal refers to a first forcing signal, which is a trigger condition for triggering the execution of a forcing operation to implement the variable forcing function of the programmable controller. After the input acquisition link in the programmable controller operating environment, the execution of a forcing operation is triggered by responding to the first forcing signal, thereby implementing forced variable changes. Acquiring external input information refers to the information acquired by the programmable controller in the link of acquiring input during operation. In the link of acquiring input, the programmable logic controller reads all input states and data in sequence in a scanning manner and stores them in the corresponding units in the I / O image area. After the input acquisition is completed, the user program execution and output refresh link are entered.
[0058] In this embodiment, it should be noted that the programmable controller is connected to the main control terminal, and the main control terminal is used to send a forced signal to control the programmable controller to perform a variable forced operation. The first forced signal is a trigger signal. As a trigger condition, if the trigger signal exists, a forced response operation will be triggered. The forced response operation refers to the operation of rewriting the variable value corresponding to the variable in the programmable controller, and the first forced response operation is the forced response operation triggered by the first forced signal. The target variable refers to the variable whose variable value needs to be forced to change among the existing variables in the programmable controller. The target variable is a variable determined by the user according to actual needs. By changing the variable value of the target variable to achieve forced control of the state of the external output device, the user's intention is met. The first forced response operation triggered by the first forced signal received by the programmable controller is an operation that has been associated with the target variable that needs to be modified, that is, if the first forced response operation is performed, the variable modified corresponding to the first forced response operation is the target variable.
[0059] Specifically, after the programmable controller runs to the link of obtaining external input, if it receives the first forced signal sent by the main control terminal, it triggers the first forced response operation, and changes the variable value of the target variable determined in the programmable controller through the first forced response operation. If the first forced signal is not detected, after obtaining the external input, it enters the link of executing the user program and refreshing the output.
[0060] Step 200, execute the user program in the programmable controller according to the changed target variable, and send the forced operation result after executing the user program to the main control terminal.
[0061] In this embodiment, it should be noted that, in the execution of the user program link, the programmable logic controller always scans the user program (ladder diagram) in order from top to bottom. When scanning each ladder diagram, the control circuit composed of the contacts on the left side of the ladder diagram is always scanned first, and the control circuit composed of the contacts is logically operated in the order of left first, right second, top first, bottom second, and then according to the result of the logical operation, the state of the corresponding bit of the logic coil in the system RAM storage area is refreshed; or the state of the corresponding bit of the output coil in the I / O image area is refreshed; or it is determined whether to execute the special function instruction specified by the ladder diagram. Variables are forced before executing the user program, so that the user program is executed according to the forced variables, so as to output the user program logic operation result after the variable is forced, that is, the forced operation result. Specifically, after the variable is forced, the programmable controller executes the user program according to the changed target variable, and sends the forced operation result obtained after executing the user program to the main control terminal.
[0062] In an embodiment of the present invention, the programmable controller monitors in real time whether a first forcing signal issued by the main control terminal is received, and determines whether variable forcing is required by monitoring the first forcing signal, so that after receiving the first forcing signal, a first forcing response operation is triggered according to the first forcing signal. Triggering by the first forcing signal can adapt to the characteristics of complex functions of programmable controllers and flexible system deployment when programmable controllers are running. The variable forcing action is started through the first forcing response operation, so that the variable value of the target variable in the programmable controller is changed according to the first forcing response operation to achieve the forcing of the target variable, thereby executing the user program in the programmable controller according to the changed variable value, and sending the forced operation result after executing the user program to the main control terminal, which effectively improves the execution efficiency of programmable control, simplifies the software design mechanism and process, and effectively improves the control operation efficiency of the programmable controller when forcing variables to be rewritten.
[0063] Further, based on the first embodiment of the programmable controller variable forcing method of the present invention, a second embodiment of the programmable controller variable forcing method of the present invention is proposed, and the step S200, after executing the user program in the programmable controller according to the changed target variable and sending the forced operation result after executing the user program to the main control terminal, also includes:
[0064] Step a, monitoring in real time whether a second mandatory signal sent by the main control terminal is received;
[0065] In the present embodiment, it should be noted that after executing the user program, the programmable controller will enter the link of refreshing the external output state. During this period, the CPU refreshes all output latch circuits according to the corresponding state and data in the I / O image area, and then drives the corresponding peripherals through the output circuit. At this time, it is the real output of the programmable controller. If the second forced signal is detected after obtaining the external input link, the variable will be forced, and the user program will be executed after the variable is forced, and the refresh output will be entered at this time, but in the process of executing the user program, the variable value corresponding to the forced variable may be modified due to some logical operations of the user program. In order to ensure that the variable force can be accurately output, before refreshing the output link, after executing the user program, the variable is forced again, and the secondary variable force is executed, wherein the second forced signal refers to the trigger signal when the secondary variable is forced. The second forced signal is consistent with the first forced signal, and both are trigger signals, i.e., trigger conditions, used to trigger the execution of the forced operation. The forced operation result refers to the logical operation result obtained by executing the user program after the variable is forced. Specifically, after executing the user program, the forced operation result of executing the user program is obtained, the forced operation result after executing the user program is sent to the main control terminal, and it is monitored in real time whether the second forced signal sent by the main control terminal is received.
[0066] refer to Figure 3 When forcing variables, during the programmable control operation process that the programmable controller supports multi-task, each task executes the links of obtaining external input, executing user programs, and refreshing external outputs respectively, and after each task obtains external input and before refreshing external outputs, it executes the steps of sending a forcing signal, receiving a forcing signal, and completing the variable forcing operation respectively.
[0067] Step b: if the second forced signal is received, triggering a second forced response operation associated with the second forced signal, and determining a target variable according to the second forced response operation;
[0068] Step c, detecting whether the forced operation result matches the target variable;
[0069] In this embodiment, it should be noted that after executing the user program, a forced operation result will be output, and the forced operation result is obtained after calculating the logical operation based on the variable value after forcing the target variable. In order to determine whether the current forced operation result has modified the target variable that is desired to be forced again, the forced operation result is matched with the variable value corresponding to the target variable after forcing before the user program is executed. If the match is successful, it can be determined that the target variable has not been modified twice by executing the user program. If the match is unsuccessful, it can be determined that the logical operation performed when executing the user program has modified the target variable twice, and the current target variable is no longer the desired variable forced value. At this time, the target variable needs to be forced twice. When judging whether the forced operation result matches the target variable, it can be determined whether the forced operation result has the target variable, and whether the variable value in the forced operation result is consistent with the variable value of the target variable. Specifically, when the second forced signal is monitored, the second forced response operation associated with the second forced signal is triggered, the target variable in the second forced response operation is determined, and the obtained forced operation result is detected to match the target variable.
[0070] Step d, if the forced operation result does not match the target variable, then changing the forced operation result according to the variable value corresponding to the target variable until the changed forced operation result matches the target variable;
[0071] Step e: Refresh the external output state according to the modified forced operation result.
[0072] In this embodiment, the target variable carries a corresponding variable value. The variable value of the target variable is restricted in the forced list obtained after the master terminal obtains the forced command. The master terminal determines the target variable carrying the variable value according to the forced list, constructs a forced response operation based on it, and sends it to the programmable controller. After the programmable controller determines the target variable according to the second forced response operation, if it is detected that the output forced operation result does not match the determined target variable, it determines the variable that does not match the target variable among the variables of the forced operation result, performs a second forced operation on the variable, changes the variable value corresponding to the variable to the variable value carried by the target variable, and refreshes the external output state after the variable is forced twice. If the forced operation result matches the target variable, the variable is no longer forced twice.
[0073] By responding to the force signal again before refreshing the external output, the reliability of variable forcing is improved to ensure that the final output meets the desired variable forcing result.
[0074] refer to Figure 4 , the programmable controller receives the forced command, builds a forced signal response and completes the forced response operation; sequentially executes the steps of obtaining the external input of the programmable controller, sending a forced signal, receiving a forced signal, completing the forced response operation, executing the user program, sending a forced signal, receiving a forced signal, completing the forced response operation, and refreshing the external output status of the programmable controller.
[0075] Further, after the step of triggering a first forced response operation associated with the first forced signal, the method further includes:
[0076] Step f, real-time monitoring whether a command to release the forced variable issued by the master control terminal is received;
[0077] Step g, if the command to release the forced variable is received, disconnecting the signal connection and deleting the forced response operation;
[0078] In this embodiment, it should be noted that after forcing the variable, if the variable is no longer required to be forced due to a change in the application scenario, the variable must be released to restore the variable value before the variable is forced. The forced variable release command is a command issued by the main control terminal according to the actual needs of the input user, which is used to trigger the release of the variable force. Specifically, during the operation of the programmable controller, it is monitored in real time whether the forced variable release command issued by the main control terminal is received. When the forced variable release command is received, the signal connection is disconnected, the forced signal is no longer received, and all forced response operations are deleted.
[0079] By releasing the forced variable command and disconnecting the signal connection, the forced variable operation can be stopped, which improves the flexibility of programmable controller software design and the execution efficiency of programmable controllers. It adapts to the characteristics of complex programmable controller functions and flexible system deployment during programmable controller runtime.
[0080] refer to Figure 5 The programmable controller receives the command to release the forced variable, disconnects the signal connection and deletes the forced response operation; and sequentially executes the steps of obtaining the external input of the programmable controller, executing the user program, and refreshing the external output status of the programmable controller.
[0081] Step h, obtaining external input information, executing the user program according to the external input information, and obtaining the execution result of the user program;
[0082] Step i: Refresh the external output state according to the execution operation result.
[0083] In this embodiment, it should be noted that after the forced variable is released, the programmable controller will resume the normal execution state, which is mainly divided into three links, namely, the link of obtaining external input, the link of executing user program, and the link of refreshing external output state. Among them, the link of obtaining external input is mainly used to collect the current temperature, pressure, switch state, position and other information of field sensors, input devices, drivers and other devices. External input information refers to the information obtained by the link of obtaining external input. The link of executing user program mainly completes the input collection according to the field, completes the operation processing of user logic, and determines the state of the current external device to be controlled. The link of refreshing external output state realizes the execution state of controlling the field switch, valve and drive according to the operation result of executing user program. During the entire operation period, the CPU of the programmable controller repeatedly executes the above three links at a certain scanning speed.
[0084] After the forced operation on the variable is released, the normal operation of the programmable controller is automatically restored, which effectively improves the execution efficiency of the programmable control and simplifies the software design mechanism and process.
[0085] refer to Figure 6 When variables are not forced, the programmable controller supports multi-task programmable control operation, and each task executes the steps of obtaining external input, executing user programs, and refreshing external outputs.
[0086] Further, refer to Figure 7 In a third embodiment of the programmable controller variable forcing method of the present invention, the programmable controller variable forcing method comprises:
[0087] Step S300, if a forced command is received, determining a first forced signal for an associated operation based on the forced command, and sending the first forced signal to the programmable controller;
[0088] In this embodiment, it should be noted that when the user needs to force a variable according to actual needs, a force command will be input. The master control terminal triggers the variable force mechanism through the received input force command. After receiving the force command, the master control terminal will register a first force signal according to the received force command, and associate the first force signal with the force response operation to realize the triggering of the first force signal on the force response operation, thereby completing the rewriting of the variable value in the programmable controller. After determining the first force signal, the master control terminal sends the first force signal to the programmable controller.
[0089] Step S400: If it is monitored that the programmable controller feeds back a forced operation result based on the received first forced signal, a second forced signal for associated operation is determined based on the forced operation result, and the second forced signal is sent to the programmable controller.
[0090] After executing the user program, the forced operation result will be output. To ensure that the current forced operation result retains the modification of the target variable that you want to force, it is necessary to perform the variable forced operation again before the programmable controller refreshes the output. After receiving the forced operation result fed back by the programmable controller based on the received first forced signal, the master control terminal will register the second forced signal and associate the second forced signal with the forced response operation to trigger the forced response operation by the second forced signal, thereby completing the rewriting of the variable value in the programmable controller. After determining the second forced signal, the master control terminal sends the second forced signal to the programmable controller.
[0091] In this embodiment, the main control terminal controls the programmable controller to perform variable forced operation through a forced signal, thereby improving the flexibility of the programmable controller software design and the execution efficiency of the programmable controller, and adapting to the characteristics of complex programmable controller functions and flexible system deployment when the programmable controller is running.
[0092] Further, based on the third embodiment of the programmable controller variable forcing method of the present invention, a fourth embodiment of the programmable controller variable forcing method of the present invention is proposed. Specifically, before the step of determining the first forcing signal that has performed the associated operation based on the forcing command and sending the first forcing signal to the programmable controller, it also includes:
[0093] Step j, obtaining a mandatory list according to the mandatory command;
[0094] Step k, determining the target variables that need to be changed in the programmable controller according to the mandatory list.
[0095] In the present embodiment, it should be noted that the mandatory list refers to a mandatory list of programmable controller variables, and the mandatory list is obtained by modifying the values of certain operands in the state table of the programmable controller. After the master control terminal detects the mandatory command, it will determine the mandatory list, obtain all variables in the mandatory list and the corresponding variable values, and all the variables are target variables. The target variable carrying the variable value is constructed with the mandatory signal relationship to form a corresponding mandatory response operation. That is, when the variable is forced, the variable values of the programmable controller runtime variables corresponding to all the variables in the mandatory list will be rewritten. According to the mandatory list, the target variable that you want to rewrite can be determined, and the variable value after the target variable is rewritten can also be determined. That is, the target variable is rewritten according to the mandatory list, and is rewritten into the corresponding variable value in the mandatory list. After the variable force function is started, the programmable controller will scan the value that needs to be modified corresponding to the target variable every time it runs until the mandatory variable is canceled. The target variable refers to the variable that you want to modify.
[0096] In this embodiment, the main control terminal determines the corresponding target variable through the forced list, provides a variable value basis for variable forcing, and improves the execution efficiency of variable forcing.
[0097] Furthermore, before the step of obtaining the mandatory list according to the mandatory command, the method further includes:
[0098] Step f, obtaining a variable check instruction according to the mandatory command, and determining a mandatory variable according to the variable check instruction;
[0099] Step g: generating a mandatory list according to the mandatory variables.
[0100] In the present embodiment, it should be noted that when a variable is forcibly rewritten, the variable forced value is issued through the master control terminal, that is, the master control terminal will issue the variable value after the variable is rewritten. The variable forced value issued by the master control terminal is determined by obtaining the user's check on the variable to be forced. A forced variable refers to a variable that needs to be forced and is checked by the user through a variable check instruction. Specifically, the master control terminal obtains the corresponding variable check instruction based on the forced command, determines the forced variable corresponding to the variable check instruction, and obtains the variable forced value corresponding to the forced variable, associates all forced variables with the corresponding variable forced values, and determines a forced list.
[0101] In this embodiment, the mandatory list is determined according to the variable check instruction, and the mandatory list can be modified according to actual needs to improve the flexibility and practicality of software implementation.
[0102] Further, the step of determining a first forced signal that has performed an associated operation based on the forced command and sending the first forced signal to the programmable controller includes:
[0103] Step 1, registering a first force signal based on the force command, constructing a first force response operation associated with the first force signal according to the target variable, and sending the first force signal associated with the first force response operation to the programmable controller;
[0104] In the present embodiment, it should be noted that when the user needs to force a variable according to actual needs, it will be forcibly triggered through the system program. The variable forcing mechanism is triggered by issuing or obtaining a forced command input by the user through the system program. After the master control terminal detects the forced command, it will register a first forced signal based on the monitored forced command to achieve the triggering of the first forced response operation by the first forced signal. The first forced response operation refers to an operation that forcibly changes a variable, and the rewriting of the variable value in the programmable controller is completed through the forced response operation. After determining the target variable, the master control terminal will construct a first forced response operation associated with the first forced signal based on the target variable, that is, when the first forced response operation modifies the variable, the object of modification is the target variable.
[0105] Specifically, the main control terminal monitors in real time whether there is a forced command. If a forced command is detected, the first forced signal is registered after the forced command is detected, and the first forced response operation is constructed according to the determined target variable, and the first forced signal is associated with the first forced response operation. The first forced signal associated with the first forced response operation is sent to the programmable controller. If no forced command is detected, the first forced signal registration operation will not be triggered.
[0106] In this embodiment, a forced command is issued according to the actual intention of the user, so as to register the first forced signal through the forced command, thereby rewriting the programmable controller variables, thereby improving the flexibility and practicality of software implementation.
[0107] The steps of determining a second forced signal having performed an associated operation based on the forced operation result and sending the second forced signal to the programmable controller include:
[0108] Step m, registering a second forced signal based on the forced operation result, constructing a second forced response operation associated with the second forced signal according to the target variable, and sending the second forced signal associated with the second forced response operation to the programmable controller.
[0109] After executing the user program, the forced operation result will be output. The forced operation result is obtained after calculating the logical operation based on the variable value after forcing the target variable. In order to ensure that the current forced operation result retains the modification of the target variable that you want to force, it is necessary to perform the variable forced operation again before the programmable controller refreshes the output. After receiving the forced operation result, the master control terminal can determine that the programmable controller has completed executing the user program. At this time, it is necessary to send a second forced signal to the programmable controller. Specifically, if the master control terminal receives the forced operation result, it starts to register the second forced signal, and constructs a second forced response operation based on the determined target variable, and associates the second forced signal with the second forced response operation. The second forced signal associated with the second forced response operation is sent to the programmable controller.
[0110] By forcing the output signal again before refreshing the external output, it is ensured that the final output meets the desired variable forcing result, thus improving the reliability of variable forcing.
[0111] Furthermore, the programmable controller variable forcing method further includes:
[0112] Step o, detecting whether an input release command is received;
[0113] Step p: if a release command is received as input, a forced variable release command is constructed according to the release command, and the forced variable release command is sent to the programmable controller.
[0114] In this embodiment, it should be noted that after forcing the variable, if the variable is no longer required due to a change in the application scenario, the variable must be released to restore the variable value before the variable is forced. The release command is a command input by the user's actual needs, which is used to trigger the release of the variable force. Specifically, during the operation of the programmable controller, the main control terminal monitors in real time whether there is an input of the release command. When the release command is detected, a release force variable command recognizable by the programmable controller is constructed based on the release command and sent to the programmable controller.
[0115] By constructing a command to release forced variables and controlling the programmable controller to stop the forced operation of variables, the flexibility of programmable controller software design is improved, and the execution efficiency of the programmable controller is improved. This adapts to the characteristics of complex programmable controller functions and flexible system deployment during programmable controller runtime.
[0116] In addition, reference Figure 8 The present invention also proposes a programmable controller variable forcing system, the programmable controller variable forcing system comprising:
[0117] The main control terminal 2001 is used for, if receiving an input forced command, determining a first forced signal for an associated operation based on the forced command, and sending the first forced signal to the programmable controller;
[0118] The programmable controller 2002 is configured to trigger a first forced response operation associated with the first forced signal upon receiving the first forced signal from the master control terminal, and change the variable value of the target variable in the programmable controller according to the first forced response operation;
[0119] Optionally, the programmable controller 2002 is further used to execute the user program in the programmable controller according to the changed target variable, and send the forced operation result after executing the user program to the main control terminal;
[0120] Optionally, the main control terminal 2001 is also used to determine a second force signal that has performed an associated operation based on the forced operation result if it monitors the forced operation result fed back by the programmable controller based on the received first forced signal, and send the second forced signal to the programmable controller.
[0121] The specific implementation of the programmable controller variable forcing system of the present invention is basically the same as the various embodiments of the programmable controller variable forcing method described above, and will not be repeated here.
[0122] In addition, the present invention also proposes a programmable controller variable forcing device, characterized in that the programmable controller variable forcing device includes a memory, a processor, and a programmable controller variable forcing program stored in the memory and executable on the processor, wherein: when the programmable controller variable forcing program is executed by the processor, the programmable controller variable forcing method described in each embodiment of the present invention is implemented.
[0123] In addition, the present invention also proposes a storage medium, the storage medium includes a computer-readable storage medium. A programmable controller variable forcing program is stored thereon. The storage medium may be Figure 1 The memory 20 in the terminal may also be at least one of a ROM (Read-Only Memory) / RAM (Random Access Memory), a magnetic disk, and an optical disk. The storage medium includes a plurality of instructions for enabling a programmable controller variable forcing device having a processor to execute the programmable controller variable forcing method described in each embodiment of the present invention.
[0124] It is understood that, in the description of this specification, the description with reference to the terms "one embodiment", "another embodiment", "other embodiments", or "first to Nth embodiments" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0125] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0126] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0127] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0128] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A programmable controller variable forcing method, characterized in that: The programmable controller variable forcing method is applied to a programmable controller, and the programmable controller variable forcing method comprises the following steps: If a first forced signal sent by the master control terminal is received, a first forced response operation associated with the first forced signal is triggered, and a variable value of a target variable in the programmable controller is changed according to the first forced response operation; Executing the user program in the programmable controller according to the changed target variable, and sending the forced operation result after executing the user program to the main control terminal; Real-time monitoring of whether a second mandatory signal sent by the main control terminal is received; If the second forced signal is received, triggering a second forced response operation associated with the second forced signal, and determining a target variable according to the second forced response operation; Detecting whether the forced operation result matches the target variable; If the forced operation result does not match the target variable, then changing the forced operation result according to the variable value corresponding to the target variable until the changed forced operation result matches the target variable; Refresh the external output status according to the changed forced operation result; The step of changing the forced operation result according to the variable value corresponding to the target variable includes: Determine the variables in the forced operation result that do not match the target variable, and change the variables in the forced operation result that do not match the target variable according to the variable value corresponding to the target variable.
2. The programmable controller variable forcing method according to claim 1, characterized in that: After the step of triggering the first forced response operation associated with the first forced signal, the method further includes: Real-time monitoring of whether a command to release forced variables issued by the master control terminal is received; If the command to release the forced variable is received, the signal connection is disconnected and the forced response operation is deleted; Acquire external input information, execute a user program according to the external input information, and acquire an execution operation result of the executed user program; The external output state is refreshed according to the execution operation result.
3. A programmable controller variable forcing method, characterized in that: The programmable controller variable forcing method is applied to the master control terminal, and the programmable controller variable forcing method comprises the following steps: If an input forced command is received, a first forced signal that has been associated with the operation is determined based on the forced command, and the first forced signal is sent to the programmable controller, so that the programmable controller triggers a first forced response operation associated with the first forced signal after receiving the first forced signal, changes the variable value of the target variable in the programmable controller according to the first forced response operation, executes the user program in the programmable controller according to the changed target variable, and sends the forced operation result after executing the user program to the main control terminal; If it is monitored that the programmable controller feedbacks a forced operation result based on the received first forced signal, a second forced signal that has been associated with the operation is determined based on the forced operation result, and the second forced signal is sent to the programmable controller, so that the programmable controller triggers a second forced response operation associated with the second forced signal after receiving the second forced signal, determines a target variable according to the second forced response operation, detects whether the forced operation result matches the target variable, and if the forced operation result does not match the target variable, determines the variables in the forced operation result that do not match the target variable, changes the variables in the forced operation result that do not match the target variable according to the variable value corresponding to the target variable, until the changed forced operation result matches the target variable, and refreshes the external output state according to the changed forced operation result.
4. The programmable controller variable forcing method according to claim 3, characterized in that: Before the step of determining the first forced signal that has performed the associated operation based on the forced command and sending the first forced signal to the programmable controller, the method further includes: Obtaining a mandatory list according to the mandatory order; The target variables that need to be changed in the programmable controller are determined according to the forced list.
5. The programmable controller variable forcing method according to claim 4, characterized in that: The step of determining a first forced signal that has performed an associated operation based on the forced command and sending the first forced signal to the programmable controller includes: registering a first force signal based on the force command, constructing a first force response operation associated with the first force signal according to the target variable, and sending the first force signal associated with the first force response operation to the programmable controller; The step of determining the second forced signal having performed the associated operation based on the forced operation result and sending the second forced signal to the programmable controller comprises: A second forcing signal is registered based on the forcing operation result, a second forcing response operation associated with the second forcing signal is constructed according to the target variable, and the second forcing signal associated with the second forcing response operation is sent to the programmable controller.
6. The programmable controller variable forcing method according to claim 3, characterized in that: The programmable controller variable forcing method further comprises: Detect whether the input release command is received; If an input release command is received, a release forced variable command is constructed according to the release command, and the release forced variable command is sent to the programmable controller.
7. A programmable controller variable forcing system, characterized in that: The programmable controller variable forcing system comprises a main control terminal and a programmable controller. The main control terminal is used for, if receiving an input forced command, determining a first forced signal for an associated operation based on the forced command, and sending the first forced signal to the programmable controller; The programmable controller is configured to trigger a first forced response operation associated with the first forced signal upon receiving the first forced signal from the master control terminal, and to change the variable value of the target variable in the programmable controller according to the first forced response operation; The programmable controller is further used to execute the user program in the programmable controller according to the changed target variable, and send the forced operation result after executing the user program to the main control terminal; The main control terminal is further used to determine a second forcing signal that has been associated with the programmable controller based on the forcing operation result fed back by the programmable controller based on the received first forcing signal, and send the second forcing signal to the programmable controller; The programmable controller is also used to monitor in real time whether a second forced signal issued by the main control terminal is received; if the second forced signal is received, a second forced response operation associated with the second forced signal is triggered, and a target variable is determined based on the second forced response operation; whether the forced operation result matches the target variable is detected; if the forced operation result does not match the target variable, the variables in the forced operation result that do not match the target variable are determined, and the variables in the forced operation result that do not match the target variable are changed based on the variable value corresponding to the target variable until the changed forced operation result matches the target variable; and the external output state is refreshed based on the changed forced operation result.
8. A programmable controller variable forcing device, characterized in that: The programmable controller variable forcing device includes: a memory, a processor, and a programmable controller variable forcing program stored in the memory and executable on the processor, wherein the programmable controller variable forcing program is configured to implement the steps of the programmable controller variable forcing method as described in any one of claims 1 to 2 and 3 to 6.
9. A storage medium, characterized in that: The storage medium stores a programmable controller variable forcing program, which, when executed by a processor, implements the steps of the programmable controller variable forcing method as described in any one of claims 1 to 2 and 3 to 6.
Citation Information
Patent Citations
Variable compulsion method and system suitable for nuclear power station equipment
CN112530615A