PLC system and control method of input and output refresh cycle thereof
By performing additional input and output refresh action at the end of the control program in the PLC system and comparing the result data between cycles, the problem of inability to extract the processed result data in the prior art is solved, and the management efficiency and reliability of the PLC system are improved .
Patent Information
- Application Number
- CN202080028873.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-04-15
- Filing Date
- 2020-03-27
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2040-03-27
AI Technical Summary
The existing PLC system cannot extract and confirm the processing result data of each expansion module in real time when executing the control program, resulting in insufficient management efficiency and reliability.
The accuracy and efficiency of the processing results are ensured by performing an input-output refresh action during the end of at least one control program and comparing the result data in different cycles to decide whether to perform the refresh action.
It improves the application efficiency and management efficiency of the PLC system, ensures the accurate extraction and confirmation of the processing result data when controlling multiple expansion modules, and enhances the reliability and user convenience of the system.
Smart Images

Figure CN113692558B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a PLC system capable of extracting and ensuring processing result data for at least one expansion module while a plurality of expansion modules are driven and controlled by the PLC (Programmable Logic Controller) and a control method for its input and output refresh cycle. Background Art
[0002] A PLC is a controller that controls individual modules (eg, expansion modules) according to a preset control sequence through digital / analog input / output modules.
[0003] The PLC provides services for controlling various functions of at least one expansion module, and such PLC services are processed based on an operating system (OS) mounted on a central processing unit of the PLC. Here, the central processing unit of the PLC may be composed of an MPU (Micro Processor Unit) including at least one microprocessor.
[0004] PLC compiles the program commands written by the user using PADT (Programming and Debugging Tool), such as LD (Ladder Diagram), IL (Instruction List), SFC (Sequential Function Chart), FBD (Function Block Diagram), ST (Structured Text), and ladder diagram programs, and stores them in each memory according to the control program of each expansion module. In addition, each expansion module is driven according to the command generated by the operation processing results of each control program executed in the central processing unit.
[0005] Figure 1 It is a flow chart showing the PLC service processing process in the prior art.
[0006] Reference Figure 1 First, the central processing unit of the PLC performs initialization processing such as resetting the input / output module, self-diagnosis, data clearing, and registration of the input / output module according to the compiled control program (S1).
[0007] Then, before starting to execute calculations and command controls based on various control programs, the central processing unit reads the action preparation status information of multiple input modules (or expansion modules) connected via the input and output ports respectively, and executes the input image area refresh action (S2) stored in the input image area.
[0008] Next, the central processing unit executes a control program processing process for sequentially executing calculations and command control from the start step to the end step of the control program based on the status of each connected input module (S3). Here, the processing result based on the control program will be stored in the output image area, and the central processing unit executes an output image area refresh action for outputting the result data stored in the output image area to each output module (S4).
[0009] Finally, in order to return to step S2 after finishing one cycle of the PLC service process, the central processing unit performs END processing such as self-diagnosis, updating of timers and counters, and data transmission (S5).
[0010] This existing PLC only performs the output image area refresh action (S4) at the time point of completing a cycle of PLC service processing, and then performs the input image area refresh action (S1) again. As a result, there is a problem that the processing result data for each expansion module cannot be ensured in real time during the period (S3) of executing the operation and command control based on the control program.
[0011] In other words, in the prior art, in order to drive a plurality of expansion modules with one PLC, a plurality of control programs are input and compiled through PADT to control the plurality of expansion modules, and the PLC service action is performed by executing the compiled control programs. However, there is a problem that during a cycle of processing in which all control programs are sequentially processed in this way, it is impossible to extract and confirm the processing result data for each control program. Summary of the invention
[0012] Problems to be solved by the invention
[0013] The present invention is proposed to solve the problems mentioned above and provides a method for controlling a PLC system and its input and output refresh cycle, which can support external input of input and output refresh execution commands during the period when at least one control program is executed. This method can control a plurality of expansion modules with one PLC.
[0014] In addition, the present invention provides a PLC system and a control method for its input / output refresh cycle, which can extract and ensure processing result data for at least one control program by additionally performing input / output refresh actions during the end of at least one control program during the process of driving multiple expansion modules according to multiple input control programs.
[0015] In addition, the present invention provides a PLC system and a method for controlling its input and output refresh cycle, which, in the process of additionally executing an input and output refresh action, compares the result data of each control program executed and extracted during a previous cycle with the result data of each control program executed and extracted during a current cycle, thereby being able to select whether to execute the input and output refresh action based on the comparison result.
[0016] The purpose of the present invention is not limited to the above-mentioned purpose, and other purposes and advantages of the present invention that are not mentioned can be understood by the following description, and can be more clearly understood by the embodiments of the present invention. In addition, it will be easily understood that the purposes and advantages of the present invention can be achieved by the means described in the claims and their combinations.
[0017] Technical solutions to problems
[0018] A PLC system of one embodiment of the present invention for realizing the above-mentioned technical problem comprises: a memory for storing an integrated driver compiled in a state where an input / output refresh execution command is added through a program support unit; and a central processing unit for controlling the driving of a plurality of expansion modules by sequentially performing operation processing on a plurality of control programs included in the integrated driver. Here, if the operation processing of at least one of the plurality of control programs is completed, the central processing unit outputs processing result data for at least one control program for which the operation processing is completed according to the input / output refresh execution command that is additionally input.
[0019] The program support unit includes: a code input program support unit, which is used to support the PADT (Programming and Debugging Tool) display program, so that the user can design and input the integrated driver program containing multiple input and output refresh execution commands in at least one loop unit, and set it to execute the integrated driver program repeatedly; and a PADT compiler, which compiles the integrated driver program containing multiple input and output refresh execution commands and provides it to the memory and the central processing unit.
[0020] The integrated driver is configured to sequentially arrange a start and initialization command, an input refresh command, a plurality of control programs, and an output refresh command, and is further configured such that the input and output refresh command is arranged between at least one pair of control programs among the plurality of control programs.
[0021] If the central processing unit reads an additional input / output refresh execution command after executing and computing at least one control program in the process of sequentially computing multiple control programs, the central processing unit sequentially executes an output refresh action and an input refresh action for outputting result data, and, if the next control program is read, executes the next control program.
[0022] If the central processing unit executes the integrated driver program in the first cycle and then executes the integrated driver program repeatedly in the next cycle, the central processing unit sequentially compares the result data obtained by executing the integrated driver program in the previous cycle with the result data obtained by executing the integrated driver program in the current cycle. Thus, the input / output refresh action process in the current cycle can be shortened compared to the input / output refresh action process in the previous cycle, and the input / output refresh action is executed.
[0023] The PLC system includes: an input port for sending the action status information of each expansion module to the central processing unit; and an output port for sending the processing result data of each of the plurality of control programs to the expansion modules.
[0024] In addition, an input / output refresh cycle method for a PLC system of one embodiment of the present invention for realizing the above-mentioned technical problem comprises: a step of storing an integrated driver compiled in a state where an input / output refresh execution command is added through a program support unit into a memory; and a step of controlling the driving of a plurality of expansion modules by sequentially performing calculations on a plurality of control programs contained in the integrated driver using a central processing unit.
[0025] The step of sequentially performing operation processing on the plurality of control programs includes the step of outputting processing result data for the at least one control program that has completed the operation processing according to an additional input / output refresh execution command when the operation processing on at least one of the plurality of control programs is completed.
[0026] The step of storing the integrated driver program in the memory includes: supporting the PADT (Programming and Debugging Tool) display program, allowing the user to design and input the integrated driver program containing a plurality of input and output refresh execution commands in at least one loop unit, and setting the integrated driver program to be repeatedly executed; and compiling the integrated driver program containing a plurality of input and output refresh execution commands and providing it to the memory and the central processing unit.
[0027] The integrated driver is configured to sequentially arrange a start and initialization command, an input refresh command, a plurality of control programs, and an output refresh command, and is further configured such that the input and output refresh command is arranged between at least one pair of control programs among the plurality of control programs.
[0028] The step of outputting the processing result data of at least one control program includes: if an additional input / output refresh execution command is read after executing and computing at least one control program in the process of sequentially computing multiple control programs, the steps of output refresh action and input refresh action for outputting the processing result data are sequentially executed; and, if the next control program is read, the steps of the next control program are executed.
[0029] The step of outputting the processing result data of at least one control program also includes: if the integrated driver is executed in the first cycle and then repeatedly executed in the next cycle, the result data obtained by executing the integrated driver in the previous cycle are compared with the result data obtained by executing the integrated driver in the current cycle in sequence, so that the input-output refresh action process in the current cycle can be shortened compared with the input-output refresh action process in the previous cycle, and the step of executing the input-output refresh action is performed.
[0030] In addition, the PLC control step further includes: a step of sending the action status information of each expansion module to the central processing unit; and a step of sending the processing result data of each of the plurality of control programs to each expansion module.
[0031] Effects of the Invention
[0032] According to the PLC system and the control method of the input and output refresh cycle of the embodiment of the present invention having the above-mentioned various technical features, it supports the control of multiple expansion modules by one PLC, thereby achieving the effect of improving the application efficiency and management efficiency of the PLC system.
[0033] Furthermore, in the process of inputting a plurality of control programs, in order to additionally perform an input / output refresh action during the end of execution of at least one control program, additional input of an input / output refresh execution command can be supported, so that a plurality of expansion modules can be controlled by one PLC.
[0034] Therefore, in the PLC system of the present invention, in the process of driving a plurality of expansion modules using one PLC, by additionally performing an input / output refresh action at the time point when the execution of at least one control program is finished, the processing result data for at least one control program that has been processed can be extracted and ensured. Therefore, the management efficiency and convenience of the user can be improved, and the reliability can be further improved.
[0035] Furthermore, in the PLC system of the present invention, in the process of additionally executing the input / output refresh action, the result data of each control program executed and extracted during the previous cycle is compared with the result data of each control program executed and extracted during the current cycle, so that the execution of the input / output refresh action can be selected based on the comparison result. Therefore, the influence of the increase in processing speed and processing period caused by the additional execution of the input / output refresh action can be minimized. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a flow chart showing the PLC service processing process in the prior art.
[0037] Figure 2 It is a block diagram specifically showing the configuration of a PLC system according to an embodiment of the present invention.
[0038] Figure 3 Yes means Figure 1 The figure shows the additional setting screen for input and output refresh of PADT supported in the program support unit.
[0039] Figure 4 Yes means Figure 3 Figure 2 shows the control program input and setting screen of PADT.
[0040] Figure 5 It means setting and storing in Figure 2 Diagram of the processing sequence and configuration structure of the integrated driver program for the memory and central processing unit expansion modules.
[0041] Figure 6 It is a flowchart for explaining the integrated driver processing method of the PLC system according to the embodiment of the present invention.
[0042] Figure 7 is used to explain more specifically Figure 6 The flowchart of the input and output refresh execution process is shown. DETAILED DESCRIPTION
[0043] The terms and words used in this specification and claims should not be interpreted as limited to the usual meaning or the meaning in the dictionary, but should only be interpreted as the meaning and concept that conforms to the technical idea of the present invention based on the principle that the inventor can appropriately define the concept of the term to explain his own invention in the most preferred way. In addition, the embodiments described in this specification and the configuration shown in the drawings are only the most preferred embodiments of the present invention and do not represent the entire technical idea of the present invention. Therefore, it should be understood that for this application, there may be various equivalents and modifications that can replace them.
[0044] Hereinafter, with reference to the accompanying drawings, a PLC system and a method for controlling an input and output refresh cycle thereof according to an embodiment of the present invention will be described in detail.
[0045] Figure 2 It is a block diagram specifically showing the configuration of a PLC system according to an embodiment of the present invention.
[0046] Figure 2 The PLC system shown includes: a memory 220, which is used to store an integrated driver compiled in a state where an input and output refresh execution command is added through the program support unit 100; a central processing unit 210, which sequentially performs calculations on a plurality of control programs included in the integrated driver, thereby controlling the driving of a plurality of expansion modules 300; an input port 230, which is used to send the action status information of each expansion module 300 to the central processing unit 210; and an output port 240, which is used to send the processing result data of each of the plurality of control programs to each expansion module 300.
[0047] The program support unit 100 supports a PADT (Programming and Debugging Tool) display program so that a user can preset a control sequence and a control operation of the PLC 200 for controlling a plurality of extension modules 300 .
[0048] The program support unit 100 includes a code input program support unit 110 and a PADT compiler 120. Here, the code input program support unit 110 supports the PADT display program so that the user includes a plurality of input / output refresh execution commands in the integrated driver and designs and inputs them in at least one cycle unit.
[0049] Specifically, the program support unit 100 supports the user to design and input an integrated driver program, which drives and controls the plurality of expansion modules 300 in at least one cycle unit in the PLC 200. The program support unit 100 supports the PADT display program so that the user can design and input the integrated driver program. At this time, the program support unit 100 supports the additional menu and code of the input and output refresh execution command, so that the user can add (append) the input and output refresh execution command in at least one control program unit during the process of setting and inputting the plurality of control programs included in the integrated driver program.
[0050] Therefore, the user executes the PADT display program on a terminal device such as a personal computer or a laptop computer, and writes commands and execution codes through the menu bar, toolbar and execution window of the PADT display program, so as to design an integrated driver that can drive and control multiple expansion modules 300 in at least one cycle unit.
[0051] When designing an integrated driver, the user can distinguish, compile and set the control programs for controlling each expansion module 300 through the menu selection function. Therefore, in the process of inputting and setting at least one control program, the user can use the additional menu and selection code of the input / output refresh execution command to add the input / output refresh execution command at the time point when the operation processing for at least one control program ends. With reference to the accompanying drawings, the adding support screen and the adding method for such an input / output refresh execution command will be further described in detail later.
[0052] The PADT compiler 120 compiles the integrated driver program that has the input / output refresh execution command added to at least one pair of control programs, i.e., the integrated driver program that includes a plurality of input / output refresh execution commands, according to the user's compile command, and provides the compiled integrated driver program to the memory 220 and the central processing unit 210.
[0053] The memory 220 is used to store the integrated driver compiled in the PADT compiler 120, and is shared with the central processing unit 210. In addition, the memory 220 stores the action state information of each expansion module 300 input via the input port 230, and shares the action state information with the central processing unit 210. In addition, the memory 220 can store the processing result data of each of the plurality of control programs executed in the central processing unit 210, and can be shared with the central processing unit 210 according to the request of the central processing unit 210.
[0054] The central processing unit 210 performs operation processing on the integrated driver compiled in the operation processing PADT compiler 120 according to each of the plurality of control programs, and controls the driving of each expansion module 300 according to the operation processing result data of each of the plurality of control programs.
[0055] In particular, when the operation processing for at least one control program is completed during the execution of the operation processing according to each of the plurality of control programs, the central processing unit 210 performs an input / output refresh operation according to the additionally input input / output refresh execution command. In addition, the processing result data for at least one control program for which the input / output refresh operation is completed is output to the output port 240 and the memory 220.
[0056] More specifically, if the start command and initialization command of the compiled integrated driver are read, the central processing unit 210 performs initialization processing such as resetting, self-diagnosis, clearing previous data, registering input and output codes for each expansion module 300, and registering data input and output pins for each expansion module 300.
[0057] Furthermore, before sequentially executing the plurality of control programs, the central processing unit 210 reads the action preparation state information for the plurality of expansion modules 300 connected via the input / output ports 230 and 240, respectively. Furthermore, the central processing unit 210 performs an input refresh operation of storing the action preparation state information in the image area set in each of the expansion modules 300 and in the image area set in each of the expansion modules 300.
[0058] Next, the central processing unit 210 performs operation processing on the first control program for controlling the driving of at least one of the plurality of extension modules 300, and calculates and stores first result data for controlling the driving of at least one of the plurality of extension modules 300. Here, if an input / output refresh execution command is read at the time point when the operation processing for the first control program is completed, an output refresh action for outputting the first result data is executed, and an input refresh action may be executed again.
[0059] However, if the second control program is read in a state where the input / output refresh execution command is not written and read, the second control program for controlling the driving of at least one of the plurality of expansion modules 300 is executed and arithmetic-processed. Furthermore, if the second result data for controlling the driving of at least one of the plurality of expansion modules 300 is calculated, the second result data is stored. Here, if the input / output refresh execution command is read at the time point when the arithmetic processing for the second control program is completed, the output refresh action for outputting all the first result data and the second result data is executed, and the input refresh action can be executed again.
[0060] On the contrary, if the third control program is read in a state where the input / output refresh execution command is not written and read after the operation processing for the second control program is executed, the third control program for controlling the driving of at least one of the plurality of expansion modules 300 is executed and operated. And, if the third result data for controlling the driving of at least one of the plurality of expansion modules 300 is calculated, the third result data is stored. Next, if the input / output refresh execution command is read at the time point when the operation processing for the third control program is completed, the output refresh action for outputting all the first result data to the third result data is executed. And, the input refresh action can be executed again. This execution and operation processing process for the integrated driver is executed during a cycle from the initialization process to the execution of the output refresh action for outputting all the first result data to the third result data.
[0061] If the integrated program is executed during one cycle from the initialization process to the output refresh action for outputting all the first result data to the third result data, and the integrated driver is executed again in the second cycle, the central processing unit 210 compares the result data obtained by executing the integrated driver in the previous first cycle with the result data obtained by executing the integrated driver in the current cycle. Thus, the input and output refresh action process in the current cycle can be shortened and the input and output refresh action can be executed compared with the input and output refresh action process in the previous cycle.
[0062] Specifically, after the integrated driver is executed in the first cycle, from the time point when the integrated driver is executed in the second cycle, when the input and output refresh action is executed, the central processing unit 210 compares the result data of each control program executed and extracted during the previous cycle with the result data of each control program executed and extracted during the current cycle time. And, if the result data of the control program executed in the previous cycle (for example, the integrated driver executed for the first time is circulated) is the same as the result data of the control program executed in the current cycle (for example, the cycle executed for the second time), only the same result data is output for the control program with the same result data. At this time, the input and output refresh action can be interrupted, and then the control program is executed. With reference to the accompanying drawings, the implementation and operation processing method of the integrated driver of this central processing unit 210 will be further specifically described later.
[0063] Figure 3 Yes means Figure 1 The figure shows the additional setting screen for input and output refresh of PADT supported in the program support unit.
[0064] Reference Figure 3 , as described below, explains how to add input support to the input and output refresh command.
[0065] That is, the program support unit 100 supports the user to implement the PADT display program using a terminal device such as a personal computer or a notebook computer. At this time, the program support unit 100 supports the user to sequentially add and select each control program (Program1 to Program3) through the menu bar of the PADT display program. In addition, if the user selects a control program (a program from Program1 to Program3) on the menu bar, an option selection toolbar is supported, and the option selection toolbar can selectively add (append) the input and output refresh command to the selected control program (Program1). Therefore, the user can select the input and output refresh command addition option according to the control program (Program1 to Program3) category.
[0066] Figure 4 Yes means Figure 3 Figure 2 shows the control program input and setting screen of PADT.
[0067] like Figure 4 As shown, if the user selects a control program (Program1 to Program3) and confirms whether to add the input and output refresh command, the program support unit 100 will provide an execution window, menu bar, and toolbar, etc., so that the selected control program (Program1 to Program1) can be designed and set.
[0068] Therefore, the user utilizes the execution window, menu bar, and toolbar of the PADT display program to write commands and execution codes, etc., so that each control program (Program1 to Program3) can be designed in at least one loop unit.
[0069] Figure 5 It means setting and storing in Figure 2 Diagram of the processing sequence and configuration structure of the integrated driver program for the memory and central processing unit expansion modules.
[0070] Reference Figure 5 In the integrated driver, starting with the start command and the initialization command, the input / output refresh command (or input refresh command) and the first control program (Program1) are sequentially configured. After configuring the first control program (Program1), the input / output refresh command (I / O Refresh) may be additionally configured.
[0071] At least one program may be configured in the first control program (Program1) or the input / output refresh command (I / O Refresh), for example, the second control program (Program2) and the third control program (Program3) may be configured in sequence. At this time, the input / output refresh command (I / O Refresh) may also be additionally configured between the second control program (Program2) and the third control program (Program3). In the manner described above, according to the expansion module 300, the output refresh command (I / O Refresh) may be configured at the end of all the configurations of the plurality of control programs and the input / output refresh command (I / O Refresh), thereby completing a cycle of actions.
[0072] Figure 6 It is a flowchart for explaining the integrated driver processing method of the PLC system according to the embodiment of the present invention.
[0073] Reference Figure 5 and Figure 6 , as described below, the implementation and processing of the compiled integrated driver are explained in sequence.
[0074] First, if the start command and initialization command of the compiled integrated driver are read, the central processing unit 210 performs initialization processing such as reset, self-diagnosis, clearing of previous data, registration of input and output codes for each expansion module 300, and registration of data input and output pins for each expansion module 300 (ST1). The initialization result data is stored in the memory 220.
[0075] Next, before sequentially executing the plurality of control programs (Program 1 to Program 3) according to the input / output refresh command (I / O Refresh), the central processing unit 210 reads the action preparation state information of the plurality of expansion modules 300 connected via the input / output ports 230 and 240. Then, an input image area is set in each of the expansion modules 300, and an input refresh operation for storing each action preparation state information in the set image area is executed (ST2).
[0076] Next, the central processing unit 210 executes and operates the first control program (Program1) for selectively controlling the driving of at least one of the plurality of extension modules 300, and calculates the first result data for controlling the driving of at least one of the plurality of extension modules 300 and stores the first result data (ST3). Here, if the input / output refresh execution command (ST4) is read at the time point when the operation processing for the first control program (Program1) is completed, the output image area for storing the first result data is set, and the first result data is stored in the output image area, and the output refresh action for outputting the first result data to the output port 240 and the memory 220 is performed. In addition, the input image area can be set again, and the input refresh action (ST5) of storing each action preparation state information in the set image area can be performed. Therefore, the memory 220 stores the first result data, and then, when the central processing unit 210 requests sharing, it can be sent to the central processing unit 210.
[0077] Next, if the second control program (Program2) for driving at least one of the plurality of expansion modules 300 is read after the input / output refresh action is executed, the central processing unit 210 executes the second control program and performs arithmetic processing, thereby selectively controlling the driving of at least one of the plurality of expansion modules 300 (ST6). In addition, if the second result data for controlling the driving of at least one expansion module is calculated, the second result data is stored. Here, if the input / output refresh execution command (ST7) is read at the time point when the arithmetic processing for the second control program is completed, the output refresh action for outputting all the first result data and the second result data to the output port 240 and the memory 220 is executed, and the input refresh action can be executed again (ST8).
[0078] Next, if the third control program (Program3) is read after the input / output refresh action is executed, the central processing unit 210 executes and calculates the third control program (Program3) for selectively controlling the driving of at least one expansion module among the plurality of expansion modules 300. In addition, if the third result data for controlling the driving of at least one expansion module is calculated, the third result data is stored. Next, if the input / output refresh execution command is read at the time point when the calculation processing for the third control program ends, the output refresh action for outputting all the first result data to the third result data to the output port 240 and the memory 220 is executed, and the input refresh action can be executed again. This execution and calculation processing process of the integrated driver is repeatedly executed during at least one cycle.
[0079] Figure 7 It is used to explain more specifically Figure 6 The flowchart of the input and output refresh execution process is shown.
[0080] As described above, if the integrated driver is executed again in a plurality of cycles after the integrated driver is executed in the first cycle, the central processing unit 210 will compare the result data obtained by executing the integrated driver in the previous cycle (for example, the previous first cycle) with the result data obtained by executing the integrated driver in the current cycle (for example, the second cycle) in sequence, thereby shortening the input and output refresh action process in the current cycle and performing the input and output refresh action compared to the input and output refresh action process in the previous cycle.
[0081] Specifically, refer to Figure 7 , as described below, a method for shortening and executing the input and output refresh action process is described in more detail.
[0082] If the integrated driver is executed again in a plurality of cycles after executing the integrated driver in the first cycle, the CPU 210 confirms the corresponding expansion module according to the input / output refresh command, for example, confirms the input / output type (SS1, SS2) of the first expansion module.
[0083] If the first expansion module is an input type, the input slot of the first expansion module is confirmed (SS3), and the first result data of the first control program executed and extracted during the previous cycle is compared with the first result data of the first control program executed and extracted during the current cycle (SS4). And, if the first result data obtained by executing the first control program during the previous cycle is the same as the first result data obtained by executing the control program in the current cycle, only the same first result data is output for the first control program with the same result data, and the input and output refresh action is interrupted, and then the control program can be executed (SS5).
[0084] On the contrary, only when the result data of executing the control program in the previous cycle is different from the result data of executing the control program in the current cycle, the output image area for storing the first result data is set, the first result data is stored in the output image area, and the output refresh action for outputting the first result data to the output port 240 and the memory 220 is performed. In addition, the input image area can be set again, and the input refresh action (ST6) of storing the state information of each action preparation state in the image area that has been set can be performed again.
[0085] If the result of confirming the input / output type of the first expansion module is the output type, the output slot of the first expansion module is confirmed (SS7), and the first result data of the first control program executed and extracted during the previous cycle is compared with the first result data of the first control program executed and extracted during the current cycle (SS8). In addition, if the first result data of the first control program executed during the previous cycle is the same as the first result data of the control program executed in the current cycle, only the same first result data is output for the first control program with the same result data, and the input / output refresh action is interrupted, and then the next control program can be executed (SS9).
[0086] On the contrary, only when the result data of the execution of the control program in the previous cycle is different from the result data of the execution of the control program in the current cycle, the output image area for storing the first result data is set, the first result data is stored in the output image area, and the output refresh action for outputting the first result data to the output port 240 and the memory 220 is performed. In addition, the input refresh action (ST10) of setting the input image area and storing each action preparation state information in the image area that has been set can be performed again.
[0087] As described above, the PLC system and the control method of the input and output refresh cycle thereof according to the embodiment of the present invention support one PLC to control a plurality of expansion modules, thereby improving the application efficiency and management efficiency of the PLC system.
[0088] Furthermore, in the process of inputting a plurality of control programs so as to control a plurality of expansion modules using one PLC, additional input of an input / output refresh execution command can be supported in order to additionally perform an input / output refresh action at the time when the execution of at least one control program ends.
[0089] Therefore, in the process of using one PLC to drive multiple expansion modules, the PLC system of the present invention can extract and ensure the processing result data for at least one control program by additionally performing an input and output refresh action at the time point when the execution of at least one control program ends. Therefore, the management efficiency and convenience of the user can be improved, and the reliability can be further improved.
[0090] In addition, when the PLC system of the present invention additionally executes an input / output refresh action, the result value of the control program executed during the previous cycle is compared with the result value of the control program executed in the current cycle, and whether to execute the input / output refresh action is selected based on the comparison result, thereby minimizing the impact of the increase in processing speed and processing period caused by executing the additional input / output refresh action.
[0091] It should be understood that the aforementioned embodiments are illustrative in all aspects and not restrictive, and the scope of the present invention is indicated in the following claims rather than the aforementioned detailed description. In addition, it should be interpreted that the meaning and scope of the following claims and all changes and deformable forms that can be derived from the equivalent concept are included in the scope of the present invention.
Claims
1. A PLC system, which is a PLC system that controls the input and output refresh cycle, wherein: include: A memory for storing an integrated driver compiled in a state where an input / output refresh execution command is added by a program support unit; as well as The central processing unit controls the driving of the plurality of expansion modules by sequentially performing calculations on the plurality of control programs included in the integrated driver. If the operation processing of at least one control program among the plurality of control programs is completed, the central processing unit outputs the processing result data of the at least one control program that has completed the operation processing according to the input / output refresh execution command that is additionally input, According to the plurality of control programs, the input and output refresh execution commands are set, If at least one of the plurality of control programs is completed, the central processing unit confirms whether the input / output refresh execution command is set, If the input / output refresh execution command is set, the central processing unit compares the data of the action status information of each expansion module input from the input port with the execution result data of at least one control program, If the data of the action status information of each expansion module is different from the execution result data of at least one control program, the central processing unit executes input and output refresh, If the data of the action status information of each expansion module is the same as the execution result data of at least one control program, the central processing unit does not perform input and output refresh but executes the next control program.
2. The PLC system according to claim 1, wherein: The program support department includes: A code input program support unit supports the PADT display program, so that the user can design and input the integrated driver program including a plurality of input and output refresh execution commands, and can be set to repeatedly execute the integrated driver program; and The PADT compiler compiles the integrated driver program including a plurality of the input and output refresh execution commands and provides the integrated driver program to the memory and the central processing unit.
3. The PLC system according to claim 1, wherein: The integrated driver is configured to sequentially configure a start and initialization command, an input refresh command, a plurality of control programs, and an output refresh command. The integrated driver is further configured such that the input / output refresh command is arranged between at least one control program among the plurality of control programs.
4. The PLC system according to claim 3, wherein: If the additional input / output refresh execution command is read after executing and computing at least one control program in the process of sequentially computing the plurality of control programs, the central processing unit sequentially executes an output refresh action and an input refresh action for outputting result data, If the next control program is read, the central processing unit executes the next control program.
5. The PLC system according to claim 4, wherein: If the integrated driver is executed repeatedly in the next cycle after the integrated driver is executed in the first cycle, the central processing unit will compare the result data obtained by executing the integrated driver in the previous cycle with the result data obtained by executing the integrated driver in the current cycle in sequence, so that the input-output refresh action process in the current cycle is shortened compared to the input-output refresh action process in the previous cycle and the input-output refresh action is performed.
6. The PLC system according to claim 1, wherein: include: The input port sends the action status information of each expansion module to the central processing unit; as well as The output port sends the processing result data of each of the plurality of control programs to the respective expansion modules.
7. A method for controlling the input and output refresh cycle of a PLC system, wherein: A step of storing the integrated driver compiled in a memory in a state where an input / output refresh execution command is added by a program support unit; as well as The step of using a central processing unit to sequentially process a plurality of control programs included in the integrated driver to control the driving of a plurality of expansion modules, The step of sequentially performing calculations on a plurality of control programs comprises: If the operation processing of at least one control program among the plurality of control programs is completed, the step of outputting the processing result data of the at least one control program that has completed the operation processing according to the input / output refresh execution command that is additionally input, The step of setting an input / output refresh execution command according to the plurality of control programs, and confirming whether the input / output refresh execution command is set if at least one control program among the plurality of control programs is completed; If the input / output refresh execution command is set, the step of comparing the data of the action status information of each expansion module input from the input port with the execution result data of at least one control program; If the data of the action status information of each expansion module and the execution result data of at least one control program are different, the step of refreshing input and output is executed; If the data of the operation status information of each expansion module is the same as the execution result data of at least one control program, the input / output refresh is not performed, but the step of the next control program is executed.
8. The method for controlling the input and output refresh cycle of a PLC system according to claim 7, wherein: The step of storing the integrated driver into a memory comprises: Supporting the PADT display program, allowing the user to design and input the integrated driver program including a plurality of input and output refresh execution commands, and being able to set the steps of repeatedly executing the integrated driver program; and The step of compiling an integrated driving program including a plurality of the input / output refresh execution commands and providing the integrated driving program to the memory and the central processing unit.
9. The method for controlling the input and output refresh cycle of a PLC system according to claim 7, wherein: The integrated driver is configured to sequentially configure a start and initialization command, an input refresh command, a plurality of control programs, and an output refresh command. The integrated driver is further configured such that the input / output refresh command is arranged between at least one control program among the plurality of control programs.
10. The method for controlling the input and output refresh cycle of a PLC system according to claim 9, wherein: The step of outputting processing result data for the at least one control program comprises: If the additional input / output refresh execution command is read after executing and computing at least one control program in the process of sequentially computing the plurality of control programs, the steps of sequentially executing an output refresh action and an input refresh action for outputting the processing result data are executed; and If the next control program is read, the steps of the next control program are executed.
11. The method for controlling the input and output refresh cycle of a PLC system according to claim 10, wherein: The step of outputting the processing result data for the at least one control program further comprises: If the integrated driver is executed again in the next cycle after the integrated driver is executed in the first cycle, the result data obtained by executing the integrated driver in the previous cycle will be compared with the result data obtained by executing the integrated driver in the current cycle in sequence, so that the input-output refresh action process in the current cycle is shortened compared to the input-output refresh action process in the previous cycle and the input-output refresh action steps are executed.
12. The method for controlling the input and output refresh cycle of a PLC system according to claim 7, wherein: Also includes: The step of sending the action status information of each expansion module to the central processing unit; as well as The step of transmitting the processing result data of each of the plurality of control programs to each of the expansion modules.
