WO2001059532A1 - Control program generating method, apparatus thereof, storage medium, and program - Google Patents

Control program generating method, apparatus thereof, storage medium, and program Download PDF

Info

Publication number
WO2001059532A1
WO2001059532A1 PCT/JP2001/000897 JP0100897W WO0159532A1 WO 2001059532 A1 WO2001059532 A1 WO 2001059532A1 JP 0100897 W JP0100897 W JP 0100897W WO 0159532 A1 WO0159532 A1 WO 0159532A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
state
code
control program
dfd
Prior art date
Application number
PCT/JP2001/000897
Other languages
French (fr)
Japanese (ja)
Inventor
Kenji Obata
Koji Mishima
Yutaka Yamada
Original Assignee
Daikin Industries, Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Daikin Industries, Ltd. filed Critical Daikin Industries, Ltd.
Priority to AU32249/01A priority Critical patent/AU3224901A/en
Publication of WO2001059532A1 publication Critical patent/WO2001059532A1/en

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0426Programming the control sequence
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/23Pc programming
    • G05B2219/23292Use of model of process, divided in part models with IN, OUT and actuator

Definitions

  • the present invention relates to a program generation method, a device thereof, and a storage medium, and more particularly, to a control program generation method capable of easily, accurately, and in a short time creating a control program, a device thereof, and a control program generation.
  • the present invention relates to a storage medium storing a program for performing the above. Background art
  • the present invention has been made in view of the above problems, and a control program generation method, an apparatus thereof, and a control program capable of preventing erroneous creation of a control program due to an interpretation error and improving productivity of the control program. It aims to provide storage media. Disclosure of the invention
  • the control program generation method is a data flow diagram representing the input / output relationship of data between processes, and a state that is paired with each data flow diagram, and that the start / stop of the process and the data processing are represented in a condition-driven manner.
  • control program generation method wherein the structured model further includes a data processing description diagram representing a data processing method for determining output data from input data in a corresponding process. This is a method of generating condition judgment code and action code in consideration of the above.
  • the control program generation device is a data flow diagram representing the input / output relationship of data between processes, and a state that is paired with each data flow diagram, and represents a process start, a Z stop, and data processing in a condition-driven manner.
  • Input data including transition diagram A structured model holding means for creating and holding a hierarchical structured model using multiple processes that determine output data from the data, and for making a judgment on the current state based on a state transition diagram And a function code generating means for generating an action code responsive to the result of the condition determination.
  • the control program generation device is a dictionary managing unit that creates and holds dictionary data for interpreting a description included in a structured model including a data flow diagram and a state transition diagram.
  • the control program generation device further comprising a data processing description diagram representing a data processing method for determining output data from input data in a corresponding process, as the structured model.
  • the condition determination code generation means and the action code generation means which generate a condition determination code and an action code in consideration of a data processing method are also adopted.
  • a storage medium according to claim 6 stores a computer program for executing the processing procedure according to claim 1 or 2.
  • the program of claim 7 causes a computer to execute the processing procedure of claim 1 or claim 2.
  • control program generation method of claim 1 it is paired with the data flow diagram showing the data input / output relationship between the processes and each data flow diagram, and also starts the process Z stop and conditionally drives the data processing.
  • the control program generation device of claim 3 it is paired with the data flow diagram showing the data input / output relationship between processes and each data malo diagram, and starts the process Z stop and drives data processing conditionally Including a state transition diagram represented by a type, a hierarchical structured model is created using a plurality of processes for determining output data from input data, and the hierarchical model is held in the structured model holding means. Based on the state transition diagram, it is possible to generate a condition determination code for making a determination on the current state, and to generate an action code responding to the condition determination result by the action code generation means.
  • the structured model can be created and maintained in a clear and complete state, and the condition determination code and the action code can be easily and accurately generated, and the control program Can be prevented from malfunctioning, and productivity can be improved.
  • control program generating apparatus in the control program generating apparatus according to claim 4, as the structured model holding means, dictionary data for interpreting a description included in a structured model including a data flow diagram and a state transition diagram is created. Since the system further includes a dictionary management unit that retains the dictionary, it is possible to eliminate the restriction on the language for the description included in the structured model and to achieve the function of claim 3. .
  • the control program generation device wherein the structured model is a data processing that determines output data from input data in a corresponding process.
  • a method that further includes a data processing description diagram representing a method is employed, and the condition determination code generation means and the action code generation means generate a condition determination code and an action code by considering a data processing method. Since this is adopted, a more accurate control program can be generated in addition to the effect of claim 3 or claim 4.
  • the storage medium of claim 6 achieves the same operation as that of claim 1 or claim 2 by causing a computer to execute a computer program that executes the processing of claim 1 or claim 2 using a computer. be able to.
  • FIG. 1 is a schematic diagram showing an example of a structured model.
  • FIG. 2 is a schematic diagram showing a conventional notation and a notation of the present invention in a state transition diagram.
  • Figure 3 is a schematic diagram showing a configuration of an air conditioner n
  • FIG. 4 is a diagram showing a top-level DFD chart corresponding to the air conditioner (air conditioner) in FIG.
  • FIG. 5 is a diagram showing a lower layer DFD chart corresponding to a process of controlling an air conditioner.
  • FIG. 6 is a view showing a CSPEC chart corresponding to the DFD chart of FIG.
  • FIG. 7 is a diagram showing a PSP ECC lower-order layer corresponding to the process of stopping a fan.
  • Fig. 8 shows the PSPEC key in the lower hierarchy corresponding to the process of operating the fan. It is a figure which shows a chart.
  • FIG. 9 is a diagram showing a PSPEC chart of the lower hierarchy corresponding to the process of closing the flap.
  • FIG. 10 is a diagram showing a lower layer DFD chart corresponding to the process of adjusting the wind direction.
  • FIG. 11 is a diagram showing a CSPEC chart corresponding to the DFD chart of FIG.
  • FIG. 12 is a schematic diagram showing a generated code created from a DFD chart and a corresponding CSPEC chart.
  • FIG. 13 is a schematic diagram showing an example of a DFD chart and a corresponding CSPEC chart.
  • FIG. 14 is a schematic diagram showing the generated code created from the DFD chart of FIG. 13 and the corresponding CSPEC chart.
  • FIG. 15 is a schematic diagram showing a refinement of the DFD chart of FIG. 13 and the corresponding CSPEC chart.
  • Figure 16 is a schematic diagram showing the generated code created for each refinement in Figure 15
  • FIG. 1 is a schematic diagram showing another example of a CSPEC chart.
  • FIG. 18 is a diagram for explaining the correspondence between the state of the CSPEC chart and the classes.
  • FIG. 19 is a schematic diagram showing a generated code of the DFD activator function.
  • C FIG. 20 is a schematic diagram showing a generated code of the pass 1 in the DFD execution function.
  • FIG. 21 is a schematic diagram showing a generated code of the bus 2 among the DFD execution functions.
  • FIG. 22 is a schematic diagram illustrating the execution order of the transition flow.
  • FIG. 23 is a schematic diagram for explaining the execution order of the parallel group.
  • FIG. 24 is a schematic diagram showing a generation code of the always-on process.
  • FIG. 25 is a schematic diagram showing a state transition diagram of a parallel group and a corresponding generated code.
  • FIG. 26 is a schematic diagram showing a state transition diagram using a dynamic timer and corresponding generated code.
  • FIG. 27 is a schematic diagram showing a state transition diagram using an integration timer.
  • FIG. 28 is a schematic diagram showing a part of the generated code corresponding to the state transition diagram of FIG. 27,
  • FIG. 29 is a schematic diagram showing the rest of the generated code corresponding to the state transition diagram of FIG.
  • FIG. 30 is a schematic diagram showing a state transition table and a corresponding state transition diagram.
  • FIG. 31 is a schematic diagram showing the generated code corresponding to FIG.
  • FIG. 32 is a schematic diagram showing a function corresponding to the branching process from the switch connector shown in FIG. 30 (b) and a coding corresponding to the activator function shown in FIG. 30 (a).
  • FIG. 33 is a schematic diagram showing the coding corresponding to the pass 1 function and the pass 2 function in (a) of FIG. 30,
  • FIG. 34 is a schematic diagram showing an action table.
  • FIG. 35 is a schematic diagram showing the coding corresponding to FIG.
  • FIG. 36 is a block diagram showing an embodiment of the control program generation device of the present invention.
  • FIG. 37 is a block diagram showing another embodiment of the control program generation device of the present invention. BEST MODE FOR CARRYING OUT THE INVENTION S
  • FIG. 1 is a schematic diagram showing an example of a structured model.
  • the highest level (first level) of this structured model is a process 1 that inputs data A and outputs data B and data C, and a process 2 that inputs data C and data D and outputs data E.
  • a state transition diagram CS PEC corresponding to the data flow diagram DFD.
  • the next higher level (second level) corresponds to process 1, which is process 1 1 that inputs data A and outputs data X, and process 1 that inputs data X and outputs data B and data C 2
  • a data flow diagram DFD 1 having the following, a second data flow diagram A state transition diagram CSPEC 1 corresponding to DFD 1, and a processing method for determining data E from data C and data D corresponding to process 2. It has a data processing description diagram PSPEC 2 that describes the method.
  • the third layer corresponds to the process 11 and includes a process 111 that outputs data Y with data A as an input and a process 111 that outputs data X with data Y as an input.
  • Flow diagram DFD 11 and this data flow diagram State transition diagram corresponding to DFD 11 CS PEC 11 and corresponding to process 12 Data 1000 and data B and output data G and C And a state transition diagram CS PEC 12 corresponding to the data flow diagram DFD 12.
  • a data flow diagram (DFD chart) that mainly describes the data input / output relationship between processes is paired with a DFD chart for each layer, and the processes in the DFD chart are activated.
  • CSP EC chart State transition diagram
  • a process that represents a plurality of sub-processes is composed of a DFD chart that describes the sub-process and a CSP EC chart that describes the start / stop of the sub-process in this DFD chart. You will have it as
  • a process that represents simple data processing has no subprocess, and has only a data processing description diagram (PSPEC chart) that describes data processing as its lower hierarchy. However, the PSPEC chart has no lower hierarchy.
  • the process that represents the state transition diagram that performs data processing includes a DFD chart that has no subprocess and describes the input / output relationship of data to and from the state transition diagram, and a state transition diagram that describes the data processing below its own. It will have in the hierarchy.
  • the main is.
  • FIG. 2 is a diagram comparing the conventional state transition diagram ⁇ see FIG. 2 (A) ⁇ with the state transition diagram of the present invention ⁇ see FIG. 2 (B) ⁇ .
  • the state transition diagram in (2) in Fig. 2 it is not possible to confirm the state in which the process is started unless all transitions are verified.
  • the state transition diagram in (2) in Fig. 2 it is clear that the process is started only by describing the process start in the state. Therefore, good visibility can be achieved with respect to unauthorized multiple activation of a process.
  • the conventional state transition diagram is described as an event driven type
  • the state transition diagram of the present invention is described as a condition driven type.
  • the description of the event is omitted because it is assumed that only a single type of event (process execution) exists. Therefore, only the transition condition is described in the condition transition flow.
  • a state based on each of the parent-child processes in the hierarchical state If there is a transition, the transition condition from the parent process is determined first, and the transition condition based on the state of the lower layer is determined in order.
  • the input editing support function of the structured model be provided with a function for automatically securing necessary variables, so that the operator does not need to secure variables.
  • the necessary memory is allocated so that the state within that class can be identified.
  • the independent name can be identified for each gel.
  • the transition condition that needs to be determined differs depending on the current state (current state). Therefore, first, a judgment block relating to the current state (current state judgment block) is created, and in the current state judgment block, judgment of a transition condition based on the state (occurrence of state transition) is performed.
  • condition judgment code for judging the transition condition and the action code when the condition judgment is satisfied are described.
  • Event that causes state transition (omitted single-type event) Since only one transition occurs at a time, if any transition condition determination block is satisfied, no further transition determination is performed.
  • the change code of the state variable accompanied by the transition and the execution code of the transition function are generated.
  • an action can be described in a state.
  • the described action is performed if the current state is in that state. Strictly speaking, the actions in the state are executed immediately after the transition to that state due to a certain transition, and when the state remains in that state due to the failure of the transition condition.
  • code is generated to execute the actions in the child state in order after executing the in-state actions in the parent state.
  • a process can be described in the function in the state.
  • the process described in the function in the state is started at the time of transition to that state, and is always started as long as the state transition stays at that state:
  • the behavior of such a process is decomposed into two processes of process initialization and process execution to generate a code.
  • the process initialization is an initialization process for initializing a process, for example, initializing state variables in a state transition diagram and initializing internal data of the process.
  • code is generated as a process initialization function (activator).
  • Process execution is the process execution of a process, and executes the part as an event of the state transition and the in-state action after the transition (including when there is no transition).
  • the process is initialized at the time of transition to the state where the process is described or the child's state, and the process is executed when there is a process described in the state after the transition.
  • the start and stop of multiple processes can be represented by a state transition diagram. Even in a hierarchical process, the execution of multiple processes can be controlled in the same way by executing the process (single event) for the top-level process.
  • the air conditioner together with and an indoor unit 1 and the outdoor unit 2, reference and a remote control 3 for performing far ⁇ operation (in FIG. 3 (A) ⁇ and r,
  • the non-lap operation is set to 0 (deg) when stopped, and to be 20 to 120 (deg) when swinging 60 (deg) at the start of operation (see (B) in Fig. 3).
  • the specifications of this air conditioner are set as follows.
  • the second air conditioner is exclusively for cooling.
  • Pressing the operation button starts operation, and pressing it again stops operation. However, operation cannot be resumed for 1 minute after the stop.
  • Wind is emitted from the indoor unit during operation, and does not come out when stopped
  • the flap While stopped, the flap is closed ⁇ 0 (d e g) ⁇ . At the start of operation, it is opened up to 60 (deg) once.
  • the flap swings in the range of 20 to 120 ⁇ d e g). If you press the swing button again during the swing, the flap stops immediately. When the swing button is pressed again, it starts moving in the direction it was moving before stopping and restarts the swing.
  • the process of controlling the air conditioner, the process of managing Monitoring process and running the fan It has a process, a “moving outdoor unit” process, and a “moving flap” process. Then, the operation request, set temperature, swing request, and off timer request are supplied from the “remote control” process to the “air conditioner” process, and the “room temperature control” process “controls the air conditioner”. Room temperature is supplied to the process, the fan is switched from the “control the air conditioner” process to the “activate the fan” process, and the outdoor unit is supplied to the process from the “control the air conditioner” to the “activate the outdoor unit” process.
  • the target flap angle is supplied from the “controlling the air conditioner” process to the “moving the flap” process, and the flap angle is currently supplied from the “moving the flap” process to the “controlling the air conditioner” process.
  • the second layer DFD chart DFD 1 corresponding to the “controlling the air conditioner” process is as shown in Fig. 5, and the CS PEC chart CS PEC 1 corresponding to this DFD chart DFD 1 is the sixth chart.
  • This DFD chart DFD 1 has a process of “stopping the fan”, a process of operating the fan, a process of “closing the flap”, and a process of “adjusting the wind direction”.
  • Request, set temperature, room temperature, off Shows a state transition diagram that outputs the outdoor unit operation with the timer request as input, and the CS PEC chart CSP EC 1 starts / stops these processes and inputs
  • a state transition diagram for enabling data as output data is described.
  • the DFD 1.4 of the 3rd hierarchy corresponding to the “adjust wind direction” process is shown in Fig. 10, and the swing request, the flap movement method, and the current flap angle are used as inputs. Output the flap angle, It shows a state transition diagram in which the flap movement direction is input and the flap movement direction is output.
  • the CS PEC chart CSPEC 1.4 corresponding to the DFD chart DFD 1.4 is as shown in Fig. 11, and the description corresponding to the above state transition diagram is made.
  • the structured model is generated as a set of functions in units of DFD charts and PSPEC charts.
  • the DFD chart is code-generated as one function, and the control structure of that function is made to correspond to the contents of the corresponding CSPEC chart (see Fig. 12).
  • the access to the tough word described in the DFD chart is coded as the access to the global variable.
  • the DFD chart shown in Fig. 13 has process X and process Y, where process X has a lower-level PSPEC chart and process Y has a lower-level DFD chart and CS PEC chart. (Refer to Fig. 15) c
  • the structured model refines functions by layering charts. When generating code, the details down to the lower layer are coded in the form of “function calls”. Become
  • the code generation of “Detailing by DFD chart” (detailing of process Y in FIG. 15) is performed by coding the initialization processing and the start-up processing respectively (in FIG. 16 (A)).
  • the code generation of the “state transition table” requires the same initialization processing as the code generation of “DFD chart refinement”.
  • the processing of pass 1 state transition processing
  • the refinement of the state transition table It is necessary to start the chart (pass 2) (processing of the state action) (see (C) in Fig. 16).
  • the coding of the "action table” is different from the initialization processing and bus. No processing is required, only pass 2 processing is required (see (D) in Fig. 16).
  • FIG. 17 is a diagram showing another specific example of the CSPEC chart. Then, Q describing the execution order of the state transition diagram with reference to the second CSPEC Chiya one DOO
  • the execution order in the CSPEC chart is the always-on process (before), the process in the one-state transition diagram ⁇ the always-on process (after).
  • the execution order of the state transition diagram is determined by the following conditions.
  • the common header includes the header file included at the beginning of the generated code, including header files commonly required in automatically generated code, such as type declarations, variable declarations, constant definitions, timer-related definitions, and prototype declarations. It is described as follows.
  • a state variable is a variable that holds information about which “state” on the chart is being executed, and is declared as a structure having members as many as the required class IDs. That is, one state variable is assigned to one chart.
  • the class ID is an identifier assigned on a CSPEC channel basis, and indicates to which layer of the “state” the “state” belongs.
  • the DFD activator function is a function for performing initialization processing of the DFD execution function, and performs processing for transferring execution to an “initial state specifier” connected to “state belonging to the highest hierarchy” on the chart.
  • the state variables are set to "undefined” and the processing of the "DFD execution function" is initialized. Coding (see the part surrounded by the solid line) and the processing of the “undefined state”, that is, the coding of the processing of the initial state specifier at chart startup (see the part surrounded by the dotted line) Done.
  • DFD execution function is a function called after execution of DFD activator function
  • coding is performed as shown in (A) and (B) in FIG.
  • the coding in (A) in FIG. 21 is performed for states 1 to 4, and the coding in (B) in FIG. 21 shows only a part of the coding in an enlarged manner.
  • the portion surrounded by a solid line is a “state” determination process and a “state action” process in order from the top.
  • the execution order of the generated code can be specified at a predetermined position in the structured model, and the generated code changes according to the specified order.
  • the execution order of the generated code can be specified at a predetermined position in the structured model, and the generated code changes according to the specified order.
  • multiple “transition flows” are described in a certain state, it is possible to specify which transition flow to evaluate from in the execution order.
  • it is not explicitly specified it is assumed that any transition flow may be evaluated, and evaluation is performed in an appropriate order.
  • the “parallel group” is a notation that indicates that there is a “child state” that transitions in parallel within a certain “state”, it is necessary to always specify the execution order.
  • the code for "pass 2" changes.
  • the control structure is divided into groups.
  • Condition 2 and condition 1 are evaluated first and condition 1 is evaluated first.
  • the generated code is generated as shown in (A) and (B) in Fig. 22, respectively. Also, of the concurrent groups (concurrent A that transitions from state A to state B and parallel B that transitions from state C to state D), the parallel ⁇ is evaluated first and the parallel ⁇ is evaluated. In the case where the evaluation is required first, the generated codes are generated as shown in (A) and (B) in FIG. 23, respectively.
  • the process that is always running is the “always running process”, and this “always running process” is not controlled by the state transition diagram of the CSPEC cast. It is executed before and after “Pass 1” processing and “Pass 2” processing in “Function”.
  • the code corresponding to the activation of the “always-on access acces” is the portion enclosed by the solid line in FIG.
  • state 1 includes a parallel group / lave 1 that transitions from state 3 to state 4 and a parallel group 2 that transitions from state 5 to state 6, and furthermore, transitions from state 1 to state 2.
  • the code corresponding to the "parallel group” ⁇ see Fig. 25 (A) ⁇ is as shown in Fig. 25 (B).
  • “dynamic timers” may be used in “transition flows”.
  • the second “Dynamic Timer” is initialized when transitioning to “Dynamic Timer Use State”, and is checked in the transition flow conditioned on waiting for the dynamic timer.
  • the initial state specifier transits to "state 1”
  • the initialization by "set T 1 mer” and the start of the timer (start of counting) by "start T lmer” are performed. Done.
  • '' ⁇ check T 2c imer "is waiting for the" operation timer ".
  • the code corresponding to the transition flow in (A) in FIG. 26 is as shown in (B) in FIG.
  • the parts surrounded by solid lines are, from the top, the processing of timer initialization, processing of timer count start, and processing of timer check.
  • an “integration timer” may be used. This “integration timer” is initialized when it transits to “state” in the “integration timer group”, and is checked in a transition flow that is conditioned on waiting for the “integration timer”. If the “destination state when transitioning from the integration timer use state j” is “state” in the “integration timer group”, the “integration timer” is suspended, and the “state” in the “integration timer group” If the transition to the “integration timer use state” is made, the “integration timer” restarts. In the example shown in Fig.
  • the part enclosed by the solid line is the processing of timer initialization, processing of timer initialization, processing of timer checking, in the order of Fig. 28 and Fig. 29, and from top to bottom.
  • timer stop processing timer stop processing
  • timer count start processing timer initialization processing
  • timer initialization processing timer initialization processing
  • timer count start processing timer count start processing
  • state transition table (“state transition table”) is an abbreviated table of a state transition diagram, and is described as a table including three items of “judgment order”, “transition condition”, and “action”. (See (A) in Fig. 30).
  • the “state transition table” is shown in Fig. 30. It is coded as an equivalent state transition diagram as shown in (B). Then, the code corresponding to the state transition table of (A) in FIG. 30 is as shown in FIG.
  • the part surrounded by a solid line in this coding is, from the top, processing for activating the state transition table, processing for path 1 of the state transition table, and processing for path 2 of the state transition table. .
  • the activator function of the state transition diagram in (B) of Fig. 30 is as shown in (B) of Fig. 32.
  • the function corresponding to the branching process in Fig. 32 is as shown in (A) in Fig. 32.
  • the part surrounded by the dotted line is The transition condition judgment of (d) in (B) of FIG. 30, the transition condition judgment of (B) ⁇ e in FIG. 30, and the transition condition judgment of (c) in (B) of FIG.
  • the bus 1 function in the state transition diagram of B 1 is as shown in FIG. 33 (A, and the path 2 function in the state transition diagram of FIG.
  • FIG. 33 is in FIG. 33. As shown in (B), and after the coding in (A) in Fig. 33, the parts surrounded by dotted lines are activated in order from the top in the state transition diagram in (B) in Fig. 30. Transition judgment when The transition condition judgment of (g) in (B), the transition condition judgment of (h) in (B) of FIG. 30, and the transition condition judgment of (f) in (B) of FIG. The part enclosed by the dotted line in the coding of (B) is the transition condition judgment of (d) in (B) of Fig. 30, and the (B) '. This is the transition condition judgment of (c) in (B) of Fig. 30.
  • action table is one action described in the state, and is executed according to the condition. It is used to change the action, and the relationship between the condition and the action is represented as a table consisting of three items: “judgment order”, “execution condition”, and “action” (see Fig. 34).
  • judgment order “execution condition”
  • action “action”
  • the structured model can be configured clearly and accurately with the DFD chart and the CSPEC chart as a pair, and the code can be automatically generated based on the structured model. Therefore, it is possible to automate code generation that requires the most man-hours, to achieve a significant reduction in man-hours as a whole of control program development, and to prevent program errors caused by human error.
  • the entire structured model, models below a certain process, state transition diagrams, generated code, etc. can be reused according to the required level, and reusability can be improved.
  • FIG. 36 is a block diagram showing an embodiment of the control program automatic generation device of the present invention.
  • This control program automatic generation device has a structured model storage unit 1 that holds a structured model, a header file created based on the structured model Based on the structured model, the state variable definition creation unit 3 that creates state variable definition codes based on the state model is connected to the state that belongs to the highest level, and the execution is transferred to the initial state specifier.
  • DFD activator function creation unit 4 that creates a DFD activator function code for the DFD execution function creation unit 4 that creates a DFD execution function code to be called after the execution of the DFD activator function based on the structured model
  • An always-on process creation unit 6 that creates an always-on process code based on the structured model, a created header file, state variable definition code, and DFD factories.
  • the structured model is held by the structured model holding unit 1, and the header file is created by the header file creating unit 2 based on the held structured model.
  • Creates DFD activator function code creates DFD execution function code to be called after execution of DFD activator function by DFD execution function creation unit 5, creates always-on process code by always-on process creation unit 6, and holds code Part 7 holds these created source codes.
  • the source code can be converted into an actual operation form (binary code) by compiling it.
  • the DFD execution function creating unit 5 creates a state determination processing code, a transition condition determination processing code, a transition action processing code, a processing code for setting a state variable to a transition destination state, and the like.
  • Adopted is one that has a path 1 creation section, a path 2 creation section that creates state judgment processing code, state action processing code, etc., a transition flow, and an execution order setting section that sets the execution order of parallel groups. Is preferred.
  • FIG. 37 is a block diagram showing another embodiment of the control program automatic generation device of the present invention.
  • the control program automatic generation device includes a structured model management unit 11 including a chart management unit and a dictionary management unit, and a chart / dictionary editing unit 1 for exchanging data between the structured model management unit 11 and the structured model management unit 11. 2, a chart / dictionary check unit 13 that receives data from the structured model management unit 11 as input, and a code generation chart group setting holding unit 14 that receives data from the chart management unit. And the character 4- State variable definition creation unit that receives data from the management unit, initialization block creation unit that receives data from the ticket management unit, and state transition determination that uses data from the channel management unit as input.
  • a code generation unit 15 including a state transition diagram conversion unit including a creation unit, a replacement unit that receives data from the chart management unit and the dictionary management unit, and a code generation parameter holding unit 16 , A chart that receives data from the structured model management unit 11 and the print setting holding unit 18, a Z dictionary printing unit 17, a print setting holding unit 18, a state variable definition creation unit, and an initialization block creation Department State transition judgment and execution block (pass 1) creation unit, in-state processing block (.pass 2) creation unit, state-independent processing block (always running process) Program that inputs data from creation unit and replacement unit And a source code holding unit 19 including a header file holding unit that receives data from the file holding unit and the replacement unit.
  • control program automatic generation device having the above configuration
  • the same operation as the control program automatic generation method or the control program automatic generation device can be achieved.
  • control program generation method and apparatus of the present invention it is possible to prevent erroneous creation of a control program due to an erroneous interpretation, and to increase the productivity of control programs.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Stored Programmes (AREA)

Abstract

A control program generating apparatus comprising a section (1) for holding a structured model, a section (2) for creating a heard file based on the structured model, a section (3) for defining a definition code of state variables based on the structured model, a DFD activator function defining section (4) for defining a DFD activator function code for moving the execution to an initial state designator connected with a state belonging to the highest level based on the structured model, and a DFD execution function defining section (5) for defining a DFD execution function code to be called after executing the DFD activator function. Erroneous write of a control program due to misinterpretation is prevented and the productivity of control program increases.

Description

明細書 制御プログラム生成方法、 その装置、 記憶媒体およびプログラム 技術分野  Description Control program generation method, device thereof, storage medium, and program
この発明はプログラム生成方法、 その装置および記憶媒体に関し、 さらに 詳細にいえば、 制御プログラムを簡単に、 正確に、 かつ短時間で作成するこ とができる制御プログラム生成方法、 その装置および制御プログラム生成の ためのプログラムを格納した記憶媒体に関する。 背景技術  The present invention relates to a program generation method, a device thereof, and a storage medium, and more particularly, to a control program generation method capable of easily, accurately, and in a short time creating a control program, a device thereof, and a control program generation. The present invention relates to a storage medium storing a program for performing the above. Background art
従来、 制御プログラムの開発を行うに当たって、 要求仕様の検討を行って 機能仕様書を作成し、 この機能仕様書に基づいて設計仕様を検討して外部仕 様書を作成し、 この外部仕様書に基づいてプロダラミングを行ってソースコ 一ドからなる制御プログラムを作成する一連の作業を行うことが一般的であ る。 もちろん、 作成された制御プログラムのテス トを行い、 不都合がある場 合にはデバッグを行い、 デバッグ結果に基づいて上記の一連の作業を行うよ うにしている。  Conventionally, when developing a control program, the required specifications were examined to create a functional specification, and based on this functional specification, the design specifications were examined and an external specification was created. It is common to perform a series of operations to create a control program consisting of source codes by performing programming based on the source code. Of course, the created control program is tested, and if there is any inconvenience, debugging is performed, and the above series of work is performed based on the debugging result.
上記の制御プログラム開発工程を採用した場合には、 機能仕様書作成者、 外部仕様書作成者、 プログラマーが別人であり、 しかも、 各仕様書の作成者 と解釈者とが互いに異なるのであるから、 各仕様書が正確であっても、 表現 があいまいであったり、 不完全であったりすれば、 誤った解釈が行われる可 能性が高く、 このような場合には、 作成された制御プログラムが正しく動作 しなくなつてしまう。  When the above-mentioned control program development process is adopted, the creator of the functional specification, the creator of the external specification, and the programmer are different people, and the creator and interpreter of each specification are different from each other. Even if each specification is accurate, if the expression is ambiguous or incomplete, there is a high possibility that misinterpretation will be performed. In such a case, the created control program will It will not work properly.
また、 人間がプログラミングを行うのであるから、 制御プログラムに間違 いが埋め込まれる可能性がかなり高く、 この場合にも、 作成された制御プロ グラムが正しく動作しなくなってしまう。 In addition, since humans perform programming, it is highly likely that mistakes will be embedded in the control program. Gram does not work properly.
これらの結果、 デバッグ処理、 デバッグ処理結果に基づく各仕様書の修正、 修正された仕様書に基づくプロダラミングを反復しなければならない。 そし て、 修正箇所が多くなることに伴って、 制御プ口グラムの信頼性が低くなる だけでなく、 これらの修正のために長時間がかかって生産性が低下してしま ラ。  As a result, the debugging process, the modification of each specification based on the debugging process results, and the programming based on the revised specification must be repeated. And, as the number of corrections increases, not only does the reliability of the control program decrease, but these corrections take a long time and reduce productivity.
この発明は上記の問題点に鑑みてなされたものであり、 解釈の誤りに起因 する制御プログラムの誤作成を防止できるとともに、 制御プログラムの生産 性を高めることができる制御プログラム生成方法、 その装置および記憶媒体 を提供することを目的としている。 発明の開示  SUMMARY OF THE INVENTION The present invention has been made in view of the above problems, and a control program generation method, an apparatus thereof, and a control program capable of preventing erroneous creation of a control program due to an interpretation error and improving productivity of the control program. It aims to provide storage media. Disclosure of the invention
請求項 1の制御プログラム生成方法は、 プロセス間のデータの入出力関係 を表すデータフロー図、 および各データフロー図と対になり、 かつプロセス の起動/停止、 データ加工を条件駆動型で表す状態遷移図を含み、 入力デー タから出力データを決定する複数のプロセスを用いて階層化された構造化モ デルを作成し、 状態遷移図に基づいて、 現在状態に関する判定を行うための 条件判定コ一ドを生成し、 条件判定結果に応答するァクションコードを生成 する方法である。  The control program generation method according to claim 1 is a data flow diagram representing the input / output relationship of data between processes, and a state that is paired with each data flow diagram, and that the start / stop of the process and the data processing are represented in a condition-driven manner. Creates a hierarchically structured model that includes a transition diagram and uses multiple processes to determine output data from input data, and provides a condition judgment code for making judgments on the current state based on the state transition diagram. This is a method for generating an action code that responds to the condition determination result.
請求項 2の制御プログラム生成方法は、 前記構造化モデルとして、 該当す るプロセスにおいて入力データから出力データを決定するデータ加工方法を 表すデータ加工記述図をさらに含むものを採用し、 データ加工方法をも考慮 して条件判定コ一ド、 アクションコードを生成する方法である。  The control program generation method according to claim 2, wherein the structured model further includes a data processing description diagram representing a data processing method for determining output data from input data in a corresponding process. This is a method of generating condition judgment code and action code in consideration of the above.
請求項 3の制御プログラム生成装置は、 プロセス間のデータの入出力関係 を表すデータフロー図、 および各データフロー図と対になり、 かつプロセス の起動 Z停止、 データ加工を条件駆動型で表す状態遷移図を含み、 入力デー タから出力データを決定する複数のプ口セスを用いて階層化された構造化モ デルを作成して保持する構造化モデル保持手段と、 状態遷移図に基づいて、 現在状態に関する判定を行うための条件判定コードを生成する条件判定コー ド生成手段と、 条件判定結果に応答するァクションコードを生成するァクシ ヨンコード生成手段とを含むものである。 The control program generation device according to claim 3 is a data flow diagram representing the input / output relationship of data between processes, and a state that is paired with each data flow diagram, and represents a process start, a Z stop, and data processing in a condition-driven manner. Input data including transition diagram A structured model holding means for creating and holding a hierarchical structured model using multiple processes that determine output data from the data, and for making a judgment on the current state based on a state transition diagram And a function code generating means for generating an action code responsive to the result of the condition determination.
請求項 4の制御プログラム生成装置は、 前記構造化モデル保持手段として. データフロー図、 状態遷移図を含む構造化モデルに含まれる記述を解釈する ための辞書データを作成して保持する辞書管理手段をさらに含むものを採用 請求項 5の制御プログラム生成装置は、 前記構造化モデルと して、 該当す るプロセスにおいて入力データから出力データを決定するデータ加工方法を 表すデータ加工記述図をさらに含むものを採用し、 前記条件判定コード生成 手段、 アクションコード生成手段として、 データ加工方法をも考慮して条件 判定コード、 ァクションコードを生成するものを採用するものである。  5. The control program generation device according to claim 4, wherein the structured model holding unit is a dictionary managing unit that creates and holds dictionary data for interpreting a description included in a structured model including a data flow diagram and a state transition diagram. The control program generation device according to claim 5, further comprising a data processing description diagram representing a data processing method for determining output data from input data in a corresponding process, as the structured model. And the condition determination code generation means and the action code generation means which generate a condition determination code and an action code in consideration of a data processing method are also adopted.
請求項 6の記憶媒体は、 請求項 1または請求項 2の処理手順を実行するコ ンピュータプログラムが格納されたものである。  A storage medium according to claim 6 stores a computer program for executing the processing procedure according to claim 1 or 2.
請求項 7のプログラムは、 コンピュータに請求項 1または請求項 2の処理 手順を実行させるものである。  The program of claim 7 causes a computer to execute the processing procedure of claim 1 or claim 2.
請求項 1の制御プログラム生成方法であれば、 プロセス間のデータの入出 力関係を表すデータフロー図、 および各データフロー図と対になり、 かつプ 口セスの起動 Z停止、 データ加工を条件駆動型で表す状態遷移図を含み、 入 力データから出力データを決定する複数のプロセスを用いて階層化された構 造化モデルを作成し、 状態遷移図に基づいて、 現在状態に関する判定を行う ための条件判定コードを生成し、 条件判定結果に応答するアクショ ンコード を生成するのであるから、 構造化モデルを明確、 かつ完全な状態で作成する ことができ、 しかも、 簡単に、 かつ正確に条件判定コードおよびアクション コードを生成することができ、 ひいては、 制御プログラムの誤動作を防止す ることができるとともに、 生産性を高める二とができる。 According to the control program generation method of claim 1, it is paired with the data flow diagram showing the data input / output relationship between the processes and each data flow diagram, and also starts the process Z stop and conditionally drives the data processing. Creates a hierarchical structured model using multiple processes that determine output data from input data, including a state transition diagram expressed in terms of types, and performs judgment on the current state based on the state transition diagram Since the condition judgment code is generated and the action code that responds to the condition judgment result is generated, the structured model can be created in a clear and complete state, and easily and accurately. And actions Code can be generated, which can prevent a malfunction of the control program and increase productivity.
請求項 2の制御プログラム生成方法であれば、 前記構造化モデルとして、 該当するプロセスにおいて入力データから出力データを決定するデータ加工 方法を表すデータ加工記述図をさらに含むものを採用し、 データ加工方法を も考慮して条件判定コード、 アクションコードを生成するのであるから、 言青 求項 1の作用に加え、 より正確な制御プログラムを生成することができる。 請求項 3の制御プログラム生成装置であれば、 プロセス間のデータの入出 力関係を表すデータフロー図、 および各データマロ一図と対になり、 かつブ 口セスの起動 Z停止、 データ加工を条件駆動型で表す状態遷移図を含み、 入 力データから出力データを決定する複数のプロセスを用いて階層化された構 造化モデルを作成して構造化モデル保持手段に保持し、 条件判定コード生成 手段によって、 状態遷移図に基づいて、 現在状態に関する判定を行うための 条件判定コ --ドを生成するとともに、 アクションコ一ド生成手段によって条 件判定結果に応答するアクションコードを生成することができる。  3. The control program generating method according to claim 2, wherein the structured model further includes a data processing description diagram representing a data processing method for determining output data from input data in a corresponding process. Since the condition judgment code and the action code are generated in consideration of the above, a more accurate control program can be generated in addition to the effect of the wording request 1. With the control program generation device of claim 3, it is paired with the data flow diagram showing the data input / output relationship between processes and each data malo diagram, and starts the process Z stop and drives data processing conditionally Including a state transition diagram represented by a type, a hierarchical structured model is created using a plurality of processes for determining output data from input data, and the hierarchical model is held in the structured model holding means. Based on the state transition diagram, it is possible to generate a condition determination code for making a determination on the current state, and to generate an action code responding to the condition determination result by the action code generation means.
したがって、 構造化モデルを明確、 かつ完全な状態で作成して保持するこ とができ、 しかも、 簡単に、 かつ正確に条件判定コードおよびアクションコ ードを生成することができ、 ひいては、 制御プログラムの誤動作を防止する ことができるとともに、 生産性を高めることができる。  Therefore, the structured model can be created and maintained in a clear and complete state, and the condition determination code and the action code can be easily and accurately generated, and the control program Can be prevented from malfunctioning, and productivity can be improved.
請求項 4の制御プログラム生成装置であれば、 前記構造化モデル保持手段 として、 デ一タフ口一図、 状態遷移図を含む構造化モデルに含まれる記述を 解釈するための辞書データを作成して保持する辞書管理手段をさらに含むも のを採用するのであるから、 構造化モデルに含まれる記述のための言語の制 約を排除することができるほか、 請求項 3の作用を達成することができる。 請求項 5の制御プログラム生成装置であれば、 前記構造化モデルとして、 該当するプロセスにおいて入力データから出力データを決定するデータ加工 方法を表すデータ加工記述図をさらに含むものを採用し、 前記条件判定コー ド生成手段、 アクションコード生成手段として、 データ加工方法をも考盧し て条件判定コード、 ァクションコードを生成するものを採用するのであるか ら、 請求項 3または請求項 4の作用に加え、 より正確な制御プログラムを生 成することができる。 In the control program generating apparatus according to claim 4, as the structured model holding means, dictionary data for interpreting a description included in a structured model including a data flow diagram and a state transition diagram is created. Since the system further includes a dictionary management unit that retains the dictionary, it is possible to eliminate the restriction on the language for the description included in the structured model and to achieve the function of claim 3. . The control program generation device according to claim 5, wherein the structured model is a data processing that determines output data from input data in a corresponding process. A method that further includes a data processing description diagram representing a method is employed, and the condition determination code generation means and the action code generation means generate a condition determination code and an action code by considering a data processing method. Since this is adopted, a more accurate control program can be generated in addition to the effect of claim 3 or claim 4.
請求項 6の記憶媒体であれば、 請求項 1または請求項 '2の処理を実行する コンピュータプログラムをコンピュータを用いて実行させることにより、 請 求項 1または請求項 2と同様の作用を達成することができる。  The storage medium of claim 6 achieves the same operation as that of claim 1 or claim 2 by causing a computer to execute a computer program that executes the processing of claim 1 or claim 2 using a computer. be able to.
請求項 7のプログラムであれば、 コンピュータに請求項 1または請求項 2 の処理手順を実行させることにより、 請求項 1または請求項 2と同様の作用 を達成することができる。 図面の簡単な説明  With the program of claim 7, the same operation as that of claim 1 or claim 2 can be achieved by causing a computer to execute the processing procedure of claim 1 or claim 2. BRIEF DESCRIPTION OF THE FIGURES
第 1図は、 構造化モデルの一例を示す概略図である。  FIG. 1 is a schematic diagram showing an example of a structured model.
第 2図は、 状態遷移図における従来の表記とこの発明の表記とを示す概略 図である。  FIG. 2 is a schematic diagram showing a conventional notation and a notation of the present invention in a state transition diagram.
第 3図は、 空気調和機の構成を示す概略図である n Figure 3 is a schematic diagram showing a configuration of an air conditioner n
第 4図は、 第 3図の空気調和機 (エアコン) に対応する最上位階層の D F Dチヤ一トを示す図である„  FIG. 4 is a diagram showing a top-level DFD chart corresponding to the air conditioner (air conditioner) in FIG.
第 5図は、 エアコンを制御するプロセスに対応する下位階層の D F Dチヤ 一トを示す図である。  FIG. 5 is a diagram showing a lower layer DFD chart corresponding to a process of controlling an air conditioner.
第 6図は、 第 5図の D F Dチヤ一卜に対応する C S P E Cチヤ一トを示す 図である。  FIG. 6 is a view showing a CSPEC chart corresponding to the DFD chart of FIG.
第 7図は、 ファンを停止するプロセスに対応する下位階層の P S P E Cキ ヤー卜を示す図である。  FIG. 7 is a diagram showing a PSP ECC lower-order layer corresponding to the process of stopping a fan.
第 8図は、 ファンを運転するプロセスに対応する下位階層の P S P E Cキ ら ャ一トを示す図である。 Fig. 8 shows the PSPEC key in the lower hierarchy corresponding to the process of operating the fan. It is a figure which shows a chart.
第 9図は、 フラップを閉じるプロセスに対応する下位階層の P S P E Cチ ヤートを示す図である。  FIG. 9 is a diagram showing a PSPEC chart of the lower hierarchy corresponding to the process of closing the flap.
第 1 0図は、 風向を調節するプロセスに対応する下位階層の D F Dチヤ一 卜を示す図である。  FIG. 10 is a diagram showing a lower layer DFD chart corresponding to the process of adjusting the wind direction.
第 1 1図は、 第 1 0図の DFDチヤ一卜に対応する C S P E Cチャートを 示す図である。  FIG. 11 is a diagram showing a CSPEC chart corresponding to the DFD chart of FIG.
第 1 2図は、 DFDチヤ一トおよび対応する C S P E Cチヤ一卜から作成 される生成コードを示す概略図である。  FIG. 12 is a schematic diagram showing a generated code created from a DFD chart and a corresponding CSPEC chart.
第 1 3図は、 D F Dチャートおよび対応する C S P E Cチャートの一例を 示す概略図である。  FIG. 13 is a schematic diagram showing an example of a DFD chart and a corresponding CSPEC chart.
第 1 4図は、 第 1 3図の D F Dチヤ一トおよび対応する C S P E Cチヤ一 卜から作成された生成コードを示す概略図である。  FIG. 14 is a schematic diagram showing the generated code created from the DFD chart of FIG. 13 and the corresponding CSPEC chart.
第 1 5図は、 第 1 3図の DFDチヤ一トおよび対応する C S P E Cチヤ一 トの詳細化を示す概略図である。  FIG. 15 is a schematic diagram showing a refinement of the DFD chart of FIG. 13 and the corresponding CSPEC chart.
第 1 6図は、 第 1 5図の各詳細化に対応して作成される生成コードを示す 概略図である  Figure 16 is a schematic diagram showing the generated code created for each refinement in Figure 15
第 1 Ί図は、 C S P E Cチヤ一卜の他の例を示す概略図である。  FIG. 1 is a schematic diagram showing another example of a CSPEC chart.
第 1 8図は、 C S P E Cチヤ一卜の状態とクラスとの対応を説明する図で ある。  FIG. 18 is a diagram for explaining the correspondence between the state of the CSPEC chart and the classes.
第 1 9図は、 D FDァクティベータ関数の生成コードを示す概略図である c 第 2 0図は、 DFD実行関数のうち、 パス 1の生成コードを示す概略図で ある。 FIG. 19 is a schematic diagram showing a generated code of the DFD activator function. C FIG. 20 is a schematic diagram showing a generated code of the pass 1 in the DFD execution function.
第 2 1図は、 D FD実行関数のうち、 バス 2の生成コードを示す概略図で ある。  FIG. 21 is a schematic diagram showing a generated code of the bus 2 among the DFD execution functions.
第 2 2図は、 遷移フローの実行順番を説明する概略図である。 第 2 3図は、 並行グループの実行順番を説明する概略図である。 FIG. 22 is a schematic diagram illustrating the execution order of the transition flow. FIG. 23 is a schematic diagram for explaining the execution order of the parallel group.
第 2 4図は、 常時起動プロセスの生成コ一ドを示す概略図である。  FIG. 24 is a schematic diagram showing a generation code of the always-on process.
第 2 5図は、 並行グループの状態遷移図と対応する生成コードとを示す概 略図である。  FIG. 25 is a schematic diagram showing a state transition diagram of a parallel group and a corresponding generated code.
第 2 6図は、 動的タイマを用いる状態遷移図と対応する生成コードとを示 す概略図である。  FIG. 26 is a schematic diagram showing a state transition diagram using a dynamic timer and corresponding generated code.
第 2 7図は、 積算タイマを用いる状態遷移図を示す概略図である。  FIG. 27 is a schematic diagram showing a state transition diagram using an integration timer.
第 2 8図は、 第 2 7図の状態遷移図に対応する生成コードの一部を示す概 略図である,,  FIG. 28 is a schematic diagram showing a part of the generated code corresponding to the state transition diagram of FIG. 27,
第 2 9図は、 第 2 7図の状態遷移図に対応する生成コードの残部を示す概 略図である。  FIG. 29 is a schematic diagram showing the rest of the generated code corresponding to the state transition diagram of FIG.
第 3 0図は、 状態遷移表および対応する状態遷移図を示す概略図である。 第 3 1図は、 第 3 0図に対応する生成コードを示す概略図である。  FIG. 30 is a schematic diagram showing a state transition table and a corresponding state transition diagram. FIG. 31 is a schematic diagram showing the generated code corresponding to FIG.
第 3 2図は、 第 3 0図の (b ) のスィッチコネクタからの分岐処理に対応 する関数、 (a ) のァクティベータ関数に対応するコード化を示す概略図で ある。  FIG. 32 is a schematic diagram showing a function corresponding to the branching process from the switch connector shown in FIG. 30 (b) and a coding corresponding to the activator function shown in FIG. 30 (a).
第 3 3図は、 第 3 0図の ( a ) のパス 1関数、 パス 2関数に対応十るコー ド化を示す概略図である,  FIG. 33 is a schematic diagram showing the coding corresponding to the pass 1 function and the pass 2 function in (a) of FIG. 30,
第 3 4図は、 ァクションテーブルを示す概略図である。  FIG. 34 is a schematic diagram showing an action table.
第 3 5図は、 第 3 4図に対応するコード化を示す概略図である。  FIG. 35 is a schematic diagram showing the coding corresponding to FIG.
第 3 6図は、 この発明の制御プログラム生成装置の一実施態様を示すプロ ック図である。  FIG. 36 is a block diagram showing an embodiment of the control program generation device of the present invention.
第 3 7図は、 この発明の制御プログラム生成装置の他の実施態様を示すブ 口ック図である。 発明を実施するための最良の形態 S FIG. 37 is a block diagram showing another embodiment of the control program generation device of the present invention. BEST MODE FOR CARRYING OUT THE INVENTION S
以下、 添付図面を参照して、 この発明の制御プログラム生成方法およびそ の装置の実施の態様を詳細に説明する。 Hereinafter, with reference to the accompanying drawings, embodiments of a control program generation method and an apparatus thereof according to the present invention will be described in detail.
第 1図は構造化モデルの一例を示す概略図である。  FIG. 1 is a schematic diagram showing an example of a structured model.
この構造化モデルの最上位の階層 (第 1階層) は、 データ Aを入力として データ B、 データ Cを出力するプロセス 1 と、 データ C、 データ Dを入力と してデータ Eを出力するプロセス 2とを有するデータフロー図 DFD 0と、 このデ一タフロー図 D F Dに対応する状態遷移図 C S PECとを有している。 次に上位の階層 (第 2階層) は、 プロセス 1に対応して、 データ Aを入力 としてデータ Xを出力するプロセス 1 1 と、 データ Xを入力としてデータ B、 データ Cを出力するプロセス 1 2とを有するデータフロー図 D F D 1 と、 二 のデータフロー図 DFD 1に対応する状態遷移図 C S P E C 1 と、 プロセス 2に対応して、 データ Cとデータ Dとからデータ Eを決定するための加工方 法を記述するデータ加工記述図 P S P E C 2とを有している。  The highest level (first level) of this structured model is a process 1 that inputs data A and outputs data B and data C, and a process 2 that inputs data C and data D and outputs data E. And a state transition diagram CS PEC corresponding to the data flow diagram DFD. The next higher level (second level) corresponds to process 1, which is process 1 1 that inputs data A and outputs data X, and process 1 that inputs data X and outputs data B and data C 2 A data flow diagram DFD 1 having the following, a second data flow diagram A state transition diagram CSPEC 1 corresponding to DFD 1, and a processing method for determining data E from data C and data D corresponding to process 2. It has a data processing description diagram PSPEC 2 that describes the method.
第 3階層は、 プロセス 1 1に対応して、 デ一タ Aを入力としてデータ Yを 出力するプロセス 1 1 1 と、 データ Yを入力としてデータ Xを出力するプロ セス 1 1 2とを有するデータフロー図 DFD 1 1と、 このデータフロー図 D FD 1 1に対応する状態遷移図 C S PEC 1 1 と、 プロセス 1 2に対応して、 千'ータ Xを入力としてデータ B、 ギータ Cを出力することを表すデータマ口 一図 D F D 1 2と、 このデータフロー図 D F D 1 2に対応する状態遷移図 C S PEC 1 2とを有している。  The third layer corresponds to the process 11 and includes a process 111 that outputs data Y with data A as an input and a process 111 that outputs data X with data Y as an input. Flow diagram DFD 11 and this data flow diagram State transition diagram corresponding to DFD 11 CS PEC 11 and corresponding to process 12 Data 1000 and data B and output data G and C And a state transition diagram CS PEC 12 corresponding to the data flow diagram DFD 12.
なお、 プロセス 1 1 1、 プロセス 1 1 2に対応するさらに下位の階層が存 在するが、 これらは図示を省略している。 また、 グローバル変数の宣言へッ ダ、 グローバル変数の定義ヘッダを含むデータ辞書、 および定数の定義へッ ダを含む定数辞書も図示を省略している。 これらの辞書は、 構造化モデルの デ一タフ口一図、 状態遷移図、 データ加工記述図における各記述 (自然言語 による記述を含む) を解釈するために用いられる。 上記の構造化モデルにおいては、 入力データから出力データを決定するプ 口セスを中心として階層化されたモデルを記述しており、 ソフトウェア全体 を把握し易くすることができる。 また、 この構造化モデルでは、 各階層毎に、 主としてプロセス間のデータの入出力関係を記述するデータフロー図 (DF Dチャート) と、 D FDチャートと対になり、 DFDチャート中のプロセス の起動/停止やデ一タ加工を記述する状態遷移図 (C S P ECチャート) と を有している。 It should be noted that there are further lower layers corresponding to the processes 111 and 112, but these are not shown. In addition, the illustration of a global variable declaration header, a data dictionary including a global variable definition header, and a constant dictionary including a constant definition header is omitted. These dictionaries are used to interpret each description (including descriptions in natural language) in the structured data model data diagram, state transition diagram, and data processing description diagram. In the structured model described above, a hierarchical model is described centering on the process of determining output data from input data, so that the entire software can be easily grasped. In this structured model, a data flow diagram (DFD chart) that mainly describes the data input / output relationship between processes is paired with a DFD chart for each layer, and the processes in the DFD chart are activated. / State transition diagram (CSP EC chart) describing stop and data processing.
そして、 DFDチャートでは、 状態遷移図の入出力データに関しても記述 できるようにしている。 また、 D F Dチャート内のプロセスは、 複数の廿ブ プロセスを代表するもの (プロセス 1参照) 、 単純なデータ加工を表すもの (プロセス 2参照) 、 データ加工を行う状態遷移図を表すもの (プロセス 1 2参照) に大別される。  In the DFD chart, input / output data of the state transition diagram can be described. The processes in the DFD chart are representative of multiple processes (see process 1), those that represent simple data processing (see process 2), and those that represent state transition diagrams that perform data processing (process 1). 2).
したがって、 複数のサブプロセスを代表するプロセスは、 サブプロセスを 記述した DFDチャートと、 この DFDチヤ一ト内のサブプロセスの起動/ 停止などを記述した C S P ECチャートとを対として、 自己の下位階層とし て持つことになる。  Therefore, a process that represents a plurality of sub-processes is composed of a DFD chart that describes the sub-process and a CSP EC chart that describes the start / stop of the sub-process in this DFD chart. You will have it as
単純なデータ加工を表すプロセスは、 サブプロセスを持たず、 ータ加工 を記述したデータ加工記述図 (P S PE Cチャート) のみを自己の下位階層 として持つことになる。 ただし、 P S P E Cチャートはそれ以上の下位階層 を持たない。  A process that represents simple data processing has no subprocess, and has only a data processing description diagram (PSPEC chart) that describes data processing as its lower hierarchy. However, the PSPEC chart has no lower hierarchy.
データ加工を行う状態遷移図を表すプロセスは、 サブプロセスを持たない 、 状態遷移図へのデータの入出力関係を記述した DFDチヤ一卜と、 デー タ加工を記述した状態遷移図を自己の下位階層に持つことになる。  The process that represents the state transition diagram that performs data processing includes a DFD chart that has no subprocess and describes the input / output relationship of data to and from the state transition diagram, and a state transition diagram that describes the data processing below its own. It will have in the hierarchy.
次いで、 構造化モデルからのプログラム生成を説明する。 なお、 以下の説 明においては、 プログラムの構成単位であるコード生成を説明する。 また、 P S P ECチヤ一卜からのコード生成を除けば、 状態遷移図からのコー ド生 i o Next, generation of a program from a structured model will be described. In the following description, code generation which is a structural unit of a program will be described. In addition, except for code generation from the PSP EC channel, code generation from state transition diagrams io
成が主となる。 The main is.
第 2図は従来の状態遷移図 {第 2図中 (A) 参照 } とこの発明の状態遷移 図 {第 2図中 (B ) 参照 } とを対比する図である。  FIG. 2 is a diagram comparing the conventional state transition diagram {see FIG. 2 (A)} with the state transition diagram of the present invention {see FIG. 2 (B)}.
第 2図中 (A ) の状態遷移図では、 プロセス起動状態に遷移する全ての遷 移でプロセスの初期化とプロセス起動の記述が必要であり、 プロセス起動状 態から遷移する全ての遷移にプロセス停止の記述が必要である。 これに対し て、 第 2図中 (Β ) の状態遷移図では、 これらの記述が不要である。  In the state transition diagram (A) in Fig. 2, the initialization of the process and the description of the process activation are required for all transitions to the process activation state, and the process transition is applied to all transitions from the process activation state. A stop description is required. On the other hand, these descriptions are unnecessary in the state transition diagram in (2) in FIG.
また、 第 2図中 (Α ) の状態遷移図では、 新たに状態や遷移フローを追加 ナる際に、 プロセス操作 (初期化, 起動/停止) の記述が必要であり、 二の 記述を忘れた場合には、 異なる状態遷移図になってしまう危険性がある。 こ れに対して、 第 2図中 (Β ) の状態遷移図では、 元々これらの記述が不要で あるから、 このような危険性は全くない。  In addition, in the state transition diagram (第) in Fig. 2, when adding a new state or transition flow, the process operation (initialization, start / stop) must be described, and the second description is forgotten. In such a case, there is a risk that the state transition diagram will be different. On the other hand, in the state transition diagram of (Β) in Fig. 2, these dangers do not exist at all because these descriptions are unnecessary from the beginning.
さらに、 第 2図中 (Α) の状態遷移図では、 全ての遷移を検証しないとプ 口セスが起動されている状態を確認することができない。 これに対して、 第 2図中 (Β ) の状態遷移図では、 状態内にプロセス起動が記述されているこ とのみにより、 プロセスが起動されることが明らかになる。 したがって、 プ 口セスの不正な多重起動に関して良好な視認性を達成することができる。 第 2図から分かるように、 従来の状態遷移図はィベント駆動型と して記述 されているのに対して、 この発明の状態遷移図は条件駆動型として記述して いる。 この条件駆動型の状態遷移図では、 単一種類のイベン ト (ブロセス実 行) のみが存在すると考えてイベン トの記述を省略する。 したがって、 条件 遷移フローでは遷移条件のみを記述する。  Furthermore, in the state transition diagram in (2) in Fig. 2, it is not possible to confirm the state in which the process is started unless all transitions are verified. On the other hand, in the state transition diagram in (2) in Fig. 2, it is clear that the process is started only by describing the process start in the state. Therefore, good visibility can be achieved with respect to unauthorized multiple activation of a process. As can be seen from FIG. 2, the conventional state transition diagram is described as an event driven type, whereas the state transition diagram of the present invention is described as a condition driven type. In this condition-driven state transition diagram, the description of the event is omitted because it is assumed that only a single type of event (process execution) exists. Therefore, only the transition condition is described in the condition transition flow.
また、 ある状態から複数の遷移が存在する場合に、 複数の遷移条件が同時 に成立する場合には、 同一状態からの遷移に判定順序を記述することによつ て同時成立時の問題を解決する。  In addition, when there are multiple transitions from a certain state and multiple transition conditions are satisfied at the same time, the problem at the time of simultaneous establishment is solved by describing the judgment order for the transitions from the same state. I do.
さらに、 階層化された状態の親子のプロセスのそれぞれを基点とする状態 遷移が存在する場合には、 親のプロセスからの遷移条件を先に判定し、 順に 下位階層の状態を基点とする遷移条件の判定を行う。 Furthermore, a state based on each of the parent-child processes in the hierarchical state If there is a transition, the transition condition from the parent process is determined first, and the transition condition based on the state of the lower layer is determined in order.
さらに説明する。  Further explanation will be given.
状態遷移図中の現在状態を示す状態変数は、 存在する状態数および状態階 層に合わせて状態識別が可能な最低限の変数を用意することが必要である。 この要求に対しては、 構造化モデルの入力編集支援機能に、 必要な変数を自 動的に確保する機能を持たせることが好ましく、 オペレータによる変数の確 保作業が不要になる。 具体的には、 状態の階層クラス (レベル) ごとに、 そ のクラス内の状態の識別ができるように必要なメモリを割り付ける。 但し、 並行グルーマについては、 ゲル一 ごとに独立名識別ができるよ -、 迚立に 必要なメモリを割り付ける。  For the state variables indicating the current state in the state transition diagram, it is necessary to prepare the minimum number of variables that can identify the state according to the number of existing states and the state hierarchy. In response to this request, it is preferable that the input editing support function of the structured model be provided with a function for automatically securing necessary variables, so that the operator does not need to secure variables. Specifically, for each hierarchical class (level) of state, the necessary memory is allocated so that the state within that class can be identified. However, for the parallel groomer, the independent name can be identified for each gel.
遷移条件/遷移ァクション部の動作  Operation of transition condition / transition function part
この発明では、 イベン ト種類を単一と考えているので、 遷移条件の判定は、 現在どの状態にあるか (現在状態) によって判定が必要な遷移条件が異なる。 したがって、 先ず現在状態に関する判定ブロック (現在状態判定ブロック) を作成し、 現在状態判定ブロック内において、 その状態を基点とする遷移条 件の判定 (状態遷移の発生) を行う。  In the present invention, since the event type is considered to be a single type, the transition condition that needs to be determined differs depending on the current state (current state). Therefore, first, a judgment block relating to the current state (current state judgment block) is created, and in the current state judgment block, judgment of a transition condition based on the state (occurrence of state transition) is performed.
遷移条件の判定部では、 遷移条件の判定を行う条件判定コードと条件判定 が成立した場合のアクショ ンコードを記述する。 状態遷移を起こすィベン 卜 (省略された単一種類のィベン卜) 1回につき遷移は 1回しか起こらないた め、 何れかの遷移条件判定ブロックが成立すると、 それ以上の遷移の判定は 行わない„  In the transition condition judgment part, the condition judgment code for judging the transition condition and the action code when the condition judgment is satisfied are described. Event that causes state transition (omitted single-type event) Since only one transition occurs at a time, if any transition condition determination block is satisfied, no further transition determination is performed „
遷移条件判定成立時のァクシヨ ンコード部分では、 遷移を伴う状態変数の 変更コードおよび遷移ァクションの実行コードを生成する。  In the action code part when the transition condition judgment is satisfied, the change code of the state variable accompanied by the transition and the execution code of the transition function are generated.
状態内ァクション部の動作  Operation of the action part in the state
この発明では、 状態内にアクショ ンを記述することができる。 状態内に記 述されたアクションは、 現在状態がその状態に存在する場合に実行される。 厳密には、 ある遷移によってその状態に遷移した直後と、 遷移条件不成立に よってその状態に留まった場合に、 状態内のアクションを実行する。 In the present invention, an action can be described in a state. Note in state The described action is performed if the current state is in that state. Strictly speaking, the actions in the state are executed immediately after the transition to that state due to a certain transition, and when the state remains in that state due to the failure of the transition condition.
また、 階層化された親子の状態のそれぞれに状態内ァクションが記述され た場合は、 親状態の状態内アクションを実行した後、 順に子供状態内のァク ションを実行するようにコードを生成する。  If the in-state action is described in each of the hierarchical parent-child states, code is generated to execute the actions in the child state in order after executing the in-state actions in the parent state. .
プロセスの言己述  Self-declaration of the process
二の発明では、 状態内のァクションにプロセスを記述することができる。 状態内ァクションに記述されたプロセスはその状態への遷移時に起動され、 状態遷移がその状態に留まる間常に起動され続ける:,  In the second invention, a process can be described in the function in the state. The process described in the function in the state is started at the time of transition to that state, and is always started as long as the state transition stays at that state:
二の発明では、 このようなプロセスの振る舞いを、 ァロセス初期化、 プロ セス実行の 2つの処理として分解してコ一ドを生成する。  In the second invention, the behavior of such a process is decomposed into two processes of process initialization and process execution to generate a code.
プロセス初期化は、 プロセスを初期化するための初期化処理であり、 状態 遷移図の状態変数の初期化ゃプ口セス内部データの初期化などを行う。 好ま しくは、 プログラム自動生成機能において、 プロセスの初期化関数 (ァクテ ィベータ) としてコードを生成する。  The process initialization is an initialization process for initializing a process, for example, initializing state variables in a state transition diagram and initializing internal data of the process. Preferably, in the automatic program generation function, code is generated as a process initialization function (activator).
プロセス実行は、 プロセスの実行処理であり、 状態遷移のイベン トとして の部分と遷移後 (遷移しない場合も含む) の状態内アクションの実行を行う。 二の発明では、 プロセス記述されている状態またはその子供の状態への遷 移時にプロセスの初期化を行い、 遷移後の状態に記述されたプロセスが存在 する場合にプロセスの実行処理を行う。  Process execution is the process execution of a process, and executes the part as an event of the state transition and the in-state action after the transition (including when there is no transition). In the second invention, the process is initialized at the time of transition to the state where the process is described or the child's state, and the process is executed when there is a process described in the state after the transition.
この方法でコードの生成を行うことにより、 複数のプロセスの起動、 停止 を状態遷移図で表現することができる。 また、 階層化されたプロセスにおい ても、 最上位プロセスに対するプロセス実行 (単一ィベン ト) によって同様 に複数のプロセスの実行を制御することができる。  By generating code in this way, the start and stop of multiple processes can be represented by a state transition diagram. Even in a hierarchical process, the execution of multiple processes can be controlled in the same way by executing the process (single event) for the top-level process.
また、 状態内アクションにプロセスの記述が可能であるから、 状態遷移図 い 3 In addition, since the process can be described in the action in the state, the state transition diagram 3
作成時の効率 Z安全性を向上させることができる。 Efficiency at creation Z safety can be improved.
次いで、 空気調和機を例にとって構造化モデルの作成を説明する。  Next, creation of a structured model will be described using an air conditioner as an example.
なお、 この空気調和機は室内機 1 と室外機 2とを有しているとともに、 遠 隔操作を行うためのリモコン 3を有している (第 3図中 (A) 参照 } r し て、 不ラップの動作は、 停止時に 0 ( d e g) 、 運転開始時に 60 (d e g) スイング時に 20〜1 20 (d e g) となるように設定されている {第 3図 中 (B) 参照) 。 また、 この空気調和機の仕様は次のとおり設定されてい 二の空気調和機は冷房専用である。 Incidentally, the air conditioner together with and an indoor unit 1 and the outdoor unit 2, reference and a remote control 3 for performing far隔操operation (in FIG. 3 (A)} and r, The non-lap operation is set to 0 (deg) when stopped, and to be 20 to 120 (deg) when swinging 60 (deg) at the start of operation (see (B) in Fig. 3). The specifications of this air conditioner are set as follows. The second air conditioner is exclusively for cooling.
運転ボタンを押すと運転を開始し、 もう一度押すと停止する。 ただし . 亭 止後の 1分間は運転を再開できない  Pressing the operation button starts operation, and pressing it again stops operation. However, operation cannot be resumed for 1 minute after the stop.
運転中は室内機から風が出、 停止中は出ないつ  Wind is emitted from the indoor unit during operation, and does not come out when stopped
停止中はフラップは閉じている { 0 (d e g) } 。 運転開始時は一旦 60 (d e g) まで開く。 スイングボタンを押すとフラップは 20〜 1 20 ■ d e g) の範囲でスイングする。 スイング中に再度スイングボタンを押すと、 フラップはその場で停止する。 再度スイングボタンを押すと、 止める前に動 いていた方向に動き出し、 スィングを再開する。  While stopped, the flap is closed {0 (d e g)}. At the start of operation, it is opened up to 60 (deg) once. When the swing button is pressed, the flap swings in the range of 20 to 120 ■ d e g). If you press the swing button again during the swing, the flap stops immediately. When the swing button is pressed again, it starts moving in the direction it was moving before stopping and restarts the swing.
運転中は室温が設定温度になるように、 室外機を動かして温度調節を行う, ただし、 室外機の運転、 停止のハンチングを防ぐため、 室内温度が設定温荬 より上がれば室外機を動かし、 室内温度が設定温度より 1°C下がったら室外 機を止める。  During operation, adjust the temperature by moving the outdoor unit so that the room temperature becomes the set temperature. However, to prevent hunting of the operation and stop of the outdoor unit, move the outdoor unit when the indoor temperature rises above the set temperature. When the indoor temperature drops 1 ° C below the set temperature, stop the outdoor unit.
運転中に切タイマボタンを押すと、 1時間後に停止する。 1時間経過十る 前に再度切タイマボタンを押せば、 タイマは解除される。  If you press the OFF timer button during operation, it will stop after one hour. If the timer button is pressed again before one hour has passed, the timer is released.
上記の仕様に基づいて作成される第 1階層の D F Dチヤ一ト D F D 0 第 4図に示すとおりになり、 「エアコンを制御する」 プロセスと、 「リモニ ノ を管理する」 プロセスと、 「室温を監視する」 プロセスと、 「ファンを動 プロセスと、 「室外機を動かす」 プロセスと、 「フラップを動かす」 プ 口セスとを有している。 そして、 「リモコンを管理する」 プロセスから 「ェ アコンを制御する」 プロセスに運転要求、 設定温度、 スイング要求、 切タイ マ要求が供給され、 「室温を監視する」 プロセスから 「エアコンを制御する」 プロセスに室温が供給され、 「エアコンを制御する」 プロセスから 「ファン を動かす」 プロセスにファン SWが供給され、 「エアコンを制御する」 プロ セスから 「室外機を動かす」 プロセスに室外機運転が供給され、 「エアコン を制御する」 プロセスから 「フラップを動かす」 プロセスに目標フラップ角 度が供給され、 「フラップを動かす」 プロセスから 「エアコンを制御する」 プロセスに現在フラップ角度が供給されている。 The first-level DFD chart created based on the above specifications DFD 0 As shown in Fig. 4, the process of controlling the air conditioner, the process of managing Monitoring process and running the fan It has a process, a “moving outdoor unit” process, and a “moving flap” process. Then, the operation request, set temperature, swing request, and off timer request are supplied from the “remote control” process to the “air conditioner” process, and the “room temperature control” process “controls the air conditioner”. Room temperature is supplied to the process, the fan is switched from the “control the air conditioner” process to the “activate the fan” process, and the outdoor unit is supplied to the process from the “control the air conditioner” to the “activate the outdoor unit” process. The target flap angle is supplied from the “controlling the air conditioner” process to the “moving the flap” process, and the flap angle is currently supplied from the “moving the flap” process to the “controlling the air conditioner” process.
「エアコンを制御する」 プロセスに対応する第 2階層の DFDチヤ一卜 D F D 1は第 5図に示すとおりになるとともに、 この D F Dチャート D F D 1 に対応する C S PECチヤ一卜 C S PEC 1は第 6図に示すとおりになる。 この D F Dチャート D F D 1は、 「ファンを停止する」 プロセスと、 了 ンを運転する」 プロセスと、 「フラップを閉じる」 プロセスと、 「風向を調 節する」 プロセスとを有しているとともに、 運転要求、 設定温度、 室温、 切 タイマ要求を入力として室外機運転を出力する状態遷移図を表している, そ して、 C S PECチャート C S P EC 1は、 これらのプロセスの起動/''停止、 入力データを出力データに可能するための状態遷移図を記述している。  The second layer DFD chart DFD 1 corresponding to the “controlling the air conditioner” process is as shown in Fig. 5, and the CS PEC chart CS PEC 1 corresponding to this DFD chart DFD 1 is the sixth chart. As shown in the figure. This DFD chart DFD 1 has a process of “stopping the fan”, a process of operating the fan, a process of “closing the flap”, and a process of “adjusting the wind direction”. Request, set temperature, room temperature, off Shows a state transition diagram that outputs the outdoor unit operation with the timer request as input, and the CS PEC chart CSP EC 1 starts / stops these processes and inputs A state transition diagram for enabling data as output data is described.
「ファンを停止する」 プロセス、 「ファンを運転する」 プロセス、 「フラ ップを閉じる」 プロセスのそれぞれに対応する第 3階層の P S P ECチヤ一 卜 P S PEC 1. 1、 P S PEC 1. 2、 P S PEC 1. 3は第 7図、 第 8 図、 第 9図に示すとおりになる。  Third-level PSP EC tickets corresponding to the “Stop Fan” process, “Run Fan” process, and “Flap Close” process PS PEC 1.1, PS PEC 1.2, PS PEC 1.3 is shown in Fig. 7, Fig. 8, and Fig. 9.
「風向を調節する」 プロセスに対応する第 3階層の DFDチヤ一卜 D FD 1. 4は第 1 0図に示すとおりであり、 スイング要求、 フラップ移動方冋ぉ よび現在フラップ角度を入力として目標フラップ角度を出力するとともに、 フラップ移動方向を入力としてフラップ移動方向を出力する状態遷移図を表 している。 そして、 この DFDチャート DFD 1. 4に対応する C S PEC チャート C S P E C 1. 4は第 1 1図に示すとおりであり、 上記の状態遷移 図に対応する記述を行っている。 The DFD 1.4 of the 3rd hierarchy corresponding to the “adjust wind direction” process is shown in Fig. 10, and the swing request, the flap movement method, and the current flap angle are used as inputs. Output the flap angle, It shows a state transition diagram in which the flap movement direction is input and the flap movement direction is output. The CS PEC chart CSPEC 1.4 corresponding to the DFD chart DFD 1.4 is as shown in Fig. 11, and the description corresponding to the above state transition diagram is made.
次いで、 構造化モデルからのコード生成を説明する。  Next, code generation from the structured model will be described.
構造化モデルは、 DFDチャートや P S PECチヤ一トを単位とする関数 の集まりとしてコード生成される。 ここで、 DFDチャートは 1つの関数と してコ一ド生成され、 その関数の制御構造は対応する C S PECチャー トの 内容に対応させられる (第 1 2図参照) 。 そして、 DFDチャートに記述さ れたギ一タフ口一に対するアクセスはグローバル変数に対するアクセスとし てコードィ匕され.る。  The structured model is generated as a set of functions in units of DFD charts and PSPEC charts. Here, the DFD chart is code-generated as one function, and the control structure of that function is made to correspond to the contents of the corresponding CSPEC chart (see Fig. 12). The access to the tough word described in the DFD chart is coded as the access to the global variable.
具体的には、 プロセス Xとゴロセス Yとを有する D F Dチヤ一 卜と、 この D F Dチヤ一トに対応する C S P E Cチャートとが第 1 3図に示すように与 えられた場合には、 第 1 4図に示すように、 「共通へッダインクルード宣言」 「状態変数の定義と宣言」 、 「D FDァクティベータ関数の宣言」 、 および 「 D F D実行関数の宣言」 からなるコードを生成する。  Specifically, if a DFD chart having a process X and a process Y and a CSPEC chart corresponding to the DFD chart are given as shown in FIG. As shown in the figure, code consisting of "Common header include declaration", "Definition and declaration of state variable", "Declaration of DFD activator function", and "Declaration of DFD execution function" is generated.
さらに詳細に説明する。  This will be described in more detail.
第 1 3図に示す D F Dチャートはプロセス Xとプロセス Yとを有しており、 プロセス Xが下位階層の P S P E Cチャートを、 プロセス Yが下位階層の D FDチヤ一卜と C S PECチャートとを有している (第 1 5図参照) c 構造化モデルはチヤ一トを階層化することで機能を詳細化しており、 コー ド生成時には、 下階層への詳細化を 「関数呼び出し」 の形でコード化する。 The DFD chart shown in Fig. 13 has process X and process Y, where process X has a lower-level PSPEC chart and process Y has a lower-level DFD chart and CS PEC chart. (Refer to Fig. 15) c The structured model refines functions by layering charts. When generating code, the details down to the lower layer are coded in the form of “function calls”. Become
「D F Dチャートによる詳細化」 (第 1 5図においては、 プロセス Yの詳 細化) のコード生成は、 初期化処理と起動処理とをそれぞれコード化するこ とにより行われる {第 1 6図中 (A) 参照) 。  The code generation of “Detailing by DFD chart” (detailing of process Y in FIG. 15) is performed by coding the initialization processing and the start-up processing respectively (in FIG. 16 (A)).
「P S P E Cチャートによる詳細化」 のコード生成は、 初期化処理が必要 ί b Initialization processing is required for code generation of "Details by PSPEC chart" ί b
なく、 起動処理のみを行えばよい (第 1 6図中 (B ) 参照 } : Instead, only the startup process needs to be performed (see (B) in Fig. 16):
「状態遷移テーブル」 のコード生成は、 「D F Dチャートによる詳細化」. のコード生成と同様に初期化処理が必要であるとともに、 状態遷移テーブル のパス 1の処理 (状態遷移の処理) および詳細化したチャート (パス 2 ) (状態アクションの処理) の起動処理が必要である {第 1 6図中 (C ) 参照 } 「アクションテーブル」 のコード化は、 状態遷移テーブルと異なり、 初期 化処理とバス 1処理が必要なく、 パス 2処理のみが必要である (第 1 6図中 ( D ) 参照) 。  The code generation of the “state transition table” requires the same initialization processing as the code generation of “DFD chart refinement”. In addition, the processing of pass 1 (state transition processing) and the refinement of the state transition table It is necessary to start the chart (pass 2) (processing of the state action) (see (C) in Fig. 16). Unlike the state transition table, the coding of the "action table" is different from the initialization processing and bus. No processing is required, only pass 2 processing is required (see (D) in Fig. 16).
第 1 7図は C S P E Cチャートの他の具体例を示す図である。 そして、 二 の C S P E Cチヤ一トを参照して状態遷移図の実行順序を説明する Q FIG. 17 is a diagram showing another specific example of the CSPEC chart. Then, Q describing the execution order of the state transition diagram with reference to the second CSPEC Chiya one DOO
C S P E Cチヤ一ト内の実行順序は、 常時起動プロセス (前) 一状態遷移 図の処理→常時起動プロセス (後) である。  The execution order in the CSPEC chart is the always-on process (before), the process in the one-state transition diagram → the always-on process (after).
そして、 状態遷移図の実行順序は、 以下の条件により定められる。  The execution order of the state transition diagram is determined by the following conditions.
( 1 ) 遷移フローの条件やアクションの処理は 「親状態」 から —子状態」 の順序で行う。  (1) Processing of transition flow conditions and actions is performed in the order of “parent state” to —child state ”.
( 2 ) 互いに平行処理される並行グルーブが存在する場合には、 並行ゲ 'レ ープに設定されている 「実行順番」 の小さい順に評価する。  (2) If there are parallel grooves that are processed in parallel with each other, evaluation is performed in ascending order of “execution order” set in the parallel group.
ί 3 ) 1つの 「状態」 から複数の遷移フローが出ている場合には、 遷移— ローに設定されている 「実行順番」 の小さい順に評価する。  ί 3) When multiple transition flows are issued from one “state”, evaluation is performed in ascending order of “execution order” set in the transition-row.
したがって、 第 1 7図の場合には、 以下の順番で遷移フローが評価される c Therefore, in the case of Fig. 17, the transition flow is evaluated in the following order c
( 1 ) 「トリガ条件 E」 の遷移フロー、 「ト リガ条件 A」 の遷移フロー (ただし、 遷移フローの 「実行順番」 の設定にしたがう) (1) Transition flow of "Trigger condition E", transition flow of "Trigger condition A" (However, according to the setting of "Execution order" of transition flow)
( 2 ) 「 ト リガ条件 D」 の遷移フ口一  (2) Trigger condition D
( 3 ) 「トリガ条件 C」 の遷移フロー  (3) Trigger condition C transition flow
次いで、 生成コードを詳細に説明する。  Next, the generated code will be described in detail.
'「共通へッダインクルード宣言」 \ 共通ヘッダは生成コードの先頭でィンクルードされるヘッダファ り、 型宣言、 変数宣言、 定数の定義、 タイマ関係の定義、 プロ トタイプ宣言 など、 自動生成コードで共通に必要となるヘッダファイルをィンクルードす るように記述される。 ''"Common header include declaration" \ The common header includes the header file included at the beginning of the generated code, including header files commonly required in automatically generated code, such as type declarations, variable declarations, constant definitions, timer-related definitions, and prototype declarations. It is described as follows.
「状態変数の定義と宣言」  "Definition and Declaration of State Variables"
状態変数はチヤ一ト上のどの 「状態」 を実行中であるかの情報を保持する 変数であり、 必要なクラス I Dの数だけメンバを持つ構造体として宣言され る。 すなわち、 1チャートに 1つ状態変数が割付られる。 二こで、 クラス I Dは C S P E Cチヤ一ト単位で割り振る識別子であり、 「状態」 が階層化さ れた 「状態」 のどの階層に属するかを示すものである。  A state variable is a variable that holds information about which “state” on the chart is being executed, and is declared as a structure having members as many as the required class IDs. That is, one state variable is assigned to one chart. Here, the class ID is an identifier assigned on a CSPEC channel basis, and indicates to which layer of the “state” the “state” belongs.
具体的には、 C S P E Cチャートとクラスとが第 1 8図中 (A) ( B ) に 示すように対応付けられている場合には、 第 1 8図中 (C ) に示すように状 態変数の定義がコード化される (ここでは u n s 〖 g n e d c h a r型に 割付られているが、 必要最小限の b i tに割り付けることも可能である) 。 また、 状態変数の宣言は第 1 8図中 (D ) に示すようにコード化される。 「D F Dァクティベータ関数の宣言」  Specifically, when the CSPEC chart and the class are associated as shown in (A) and (B) in FIG. 18, the state variables are displayed as shown in (C) in FIG. Is coded (it is assigned to uns 〖gnedchar type here, but it can be assigned to the minimum necessary bits). The declaration of the state variable is coded as shown in Fig. 18 (D). "Declaration of DF activator function"
D F Dァクティベータ関数は、 D F D実行関数の初期化処理を行う関数で あり、 チャート上の 「最上位の階層に属する状態」 に接続されている 初期 状態指定子」' に実行を移す処理を行う。  The DFD activator function is a function for performing initialization processing of the DFD execution function, and performs processing for transferring execution to an “initial state specifier” connected to “state belonging to the highest hierarchy” on the chart.
具体的には、 第 1 3図に示す C S P E Cチヤ一トを例にとれば、 第 1 9図 に示すように、 状態変数を 「不定状態に設定し、 「D F D実行関数」 の処理 を初期化するためのコード化 (実線で囲まれた部分参照) と、 「不定状態」 の処理、 すなわち、 チャート起動時の初期状態指定子の処理のコード化 (点 線で囲まれた部分参照) とが行われる。  Specifically, taking the CSPEC chart shown in Fig. 13 as an example, as shown in Fig. 19, the state variables are set to "undefined" and the processing of the "DFD execution function" is initialized. Coding (see the part surrounded by the solid line) and the processing of the “undefined state”, that is, the coding of the processing of the initial state specifier at chart startup (see the part surrounded by the dotted line) Done.
「D F D実行関数の宣言」  "Declaration of DFD execution function"
D F D実行関数は D F Dァクティベータ関数の実行後に呼び出される関数 であり、 C S P E Cチヤ一卜に対応する制御構造をコー DFD execution function is a function called after execution of DFD activator function The control structure corresponding to the CSPEC
そして、 状態遷移の処理 ( 「状態の遷移判定」 や 「遷移アクショ ンの実行」 を行う処理) を行う 「パス 1」 と、 状態アクションを処理する 「パス 2」 から構成されている。 It consists of “Path 1” that performs state transition processing (processing that performs “state transition judgment” and “execution of transition action”), and “path 2” that performs state action processing.
具体的には、 第 1 3図に示す C S P E Cチャートを例にとれば、 「パス 1 」 については、 第 2 0図中 (A ) ( B ) に示すようにコード化が行われる。 な お、 第 2 0図中 (A) のコード化は、 状態 1〜4について行われており、 第 2 0図中 (B ) のコード化は一部のみを拡大して示している。 そして、 第 2 0図中 (B ) のコード化のうち、 実線で囲まれた部分は、 上から順に、 「状 態」 の判定処理、 「遷移条件」 の判定処理、 「遷移アクション'」 の処理、 状 態変数を遷移先 「状態」 に設定する処理である。  Specifically, taking the CSPEC chart shown in FIG. 13 as an example, "pass 1" is coded as shown in (A) and (B) in FIG. The coding in (A) in FIG. 20 is performed for states 1 to 4, and the coding in (B) in FIG. 20 shows only a part of the coding in an enlarged manner. In the coding of (B) in FIG. 20, the portion surrounded by a solid line indicates, in order from the top, the determination processing of “state”, the determination processing of “transition condition”, and the determination processing of “transition action”. This is the process of setting the process and status variables to the transition destination “status”.
「パス 2」 については、 第 2 1図中 (A ) ( B ) に示すようにコード化が 行われる。 なお、 第 2 1図中 (A ) のコード化は、 状態 1〜4について行わ れており、 第 2 1図中 (B ) のコード化は一部のみを拡大して示している。 そして、 第 2 1図中 (B ) のコード化のうち、 実線で囲まれた部分は、 上か ら順に、 「状態」 の判定処理、 「状態アクション」 の処理である。  For "pass 2", coding is performed as shown in (A) and (B) in FIG. The coding in (A) in FIG. 21 is performed for states 1 to 4, and the coding in (B) in FIG. 21 shows only a part of the coding in an enlarged manner. In the coding shown in (B) in FIG. 21, the portion surrounded by a solid line is a “state” determination process and a “state action” process in order from the top.
また、 構造化モデルの所定箇所には生成したコードの実行順番を指定する 二とができ、 指定した順番により生成コードが変化する。 すなわち、 ある状 態に複数の 「遷移フロー」 が記述されている場合には、 どの遷移フローから 評価するかを実行順番で指定できる。 ただし、 明示的に指定していない場合 には、 どの遷移フローから評価してもよいと見なして適当な順番で評価する。 また、 「並行グループ」 はある 「状態」 の内部に並行的に遷移する 「子状態」 があることを示す表記であるから必ず実行順番を指定する必要があり、 その 順番によって 「パス 1」 と 「パス 2」 のコードが変化する。 もちろん、 ダル ープ単位に制御構造が分割される。  In addition, the execution order of the generated code can be specified at a predetermined position in the structured model, and the generated code changes according to the specified order. In other words, if multiple “transition flows” are described in a certain state, it is possible to specify which transition flow to evaluate from in the execution order. However, if it is not explicitly specified, it is assumed that any transition flow may be evaluated, and evaluation is performed in an appropriate order. Also, since the “parallel group” is a notation that indicates that there is a “child state” that transitions in parallel within a certain “state”, it is necessary to always specify the execution order. The code for "pass 2" changes. Of course, the control structure is divided into groups.
具体的には、 「状態 A」 から状態 B、 状態 Cへの遷移フローが存在してい る場合において、 条件 2を先に評価したい場合と条件 1を先に評価 Specifically, there is a transition flow from “state A” to state B and state C. Condition 2 and condition 1 are evaluated first and condition 1 is evaluated first.
合とでは、 生成されるコードがそれぞれ第 2 2図中 (A) ( B ) に示すよう に生成される。 また、 並行グループ (状態 Aから状態 Bへの遷移を行う並行 Aと、 状態 Cから状態 Dへの遷移を行う並行 Bとを含むもの) のうち、 並行 Αを先に評価したい場合と並行 Βを先に評価したい場合とでは生成されるコ ードがそれぞれ第 2 3図中 (A ) ( B ) に示すように生成される。 In this case, the generated code is generated as shown in (A) and (B) in Fig. 22, respectively. Also, of the concurrent groups (concurrent A that transitions from state A to state B and parallel B that transitions from state C to state D), the parallel Α is evaluated first and the parallel Β is evaluated. In the case where the evaluation is required first, the generated codes are generated as shown in (A) and (B) in FIG. 23, respectively.
さらに、 D F Dチャートが起動されている間、 常に起動状態にあるプロセ スが 「常時起動プロセス」 であり、 この 「常時起動プロセス」 は C S P E C キヤ一 卜の状態遷移図では制御されないので、 「D F D実行関数」 中の 「パ ス 1」 処理、 「パス 2」 理の前後で実行される。 この 「常時起動アコセス」 の起動に対応するコードは、 第 2 4図中において実線で囲まれた部分である。 また、 状態 1が、 状態 3から状態 4への遷移を行う並行グ /レーブ 1 と状態 5から状態 6への遷移を行う並行グループ 2とを含み、 しかも、 状態 1から 状態 2への遷移を行うようにしている 「並行グループ」 {第 2 5図中 (A ) 参照 } に対応するコードは第 2 5図中 (B ) に示すとおりになる。 このコー ド化のうち、 実線で囲まれた部分は、 上から順に、 「並行グループ 1」 の処 理、 「並行グループ 1」 に属する状態から状態 1の外の状態 2に遷移した場 台に 「並行グルーフ = 2」 の処理を行わないための判定、 「並行グ'レー 2」 の処理である。 すなわち、 「並行グループ 1」 と 「並行グルーブ 2」 を判定 する制御構造が別々に生成される c Furthermore, while the DFD chart is running, the process that is always running is the “always running process”, and this “always running process” is not controlled by the state transition diagram of the CSPEC cast. It is executed before and after “Pass 1” processing and “Pass 2” processing in “Function”. The code corresponding to the activation of the “always-on access acces” is the portion enclosed by the solid line in FIG. In addition, state 1 includes a parallel group / lave 1 that transitions from state 3 to state 4 and a parallel group 2 that transitions from state 5 to state 6, and furthermore, transitions from state 1 to state 2. The code corresponding to the "parallel group" {see Fig. 25 (A)} is as shown in Fig. 25 (B). In this coding, the part surrounded by a solid line is, in order from the top, the processing of “parallel group 1” and the platform that transitioned from state belonging to “parallel group 1” to state 2 outside state 1. This is a determination to not perform the processing of “parallel groove = 2”, and the processing of “parallel gray 2”. That, c the control structure to determine the "parallel grooves 2" and "parallel group 1" is generated separately
さらに、 「遷移フロー」 では、 「動的タイマ」 が使用される可能性がある。 二の 「動的タイマ」 は、 「動的タイマ使用状態」 に遷移した時に初期化され、 動的タイマ待ちを条件とする遷移フローでチェックされる。 第 2 6図中 (A ) の例では、 初期状態指定子から 「状態 1」 に遷移した時に" s e t T 1 m e r " による初期化と" s t a r t T l m e r " によるタイマの起動 (カウン ト開始) が行われる。 また、 「状態 2」 への遷移フローでは'' c h e c k T 2c i m e r " で 「運転タイマ」 待ちを行っている。 そして、 第 2 6図中 (A ) の遷移フローに対応するコードは第 2 6図中 (B ) に示すとおりになる。 こ のコード化のうち、 実線で囲まれた部分は、 上から順に、 タイマ初期化の処 理、 タイマカウント開始の処理、 タイマチェックの処理である。 In addition, “dynamic timers” may be used in “transition flows”. The second “Dynamic Timer” is initialized when transitioning to “Dynamic Timer Use State”, and is checked in the transition flow conditioned on waiting for the dynamic timer. In the example of (A) in Fig. 26, when the initial state specifier transits to "state 1", the initialization by "set T 1 mer" and the start of the timer (start of counting) by "start T lmer" are performed. Done. In the transition flow to `` state 2, '' `` check T 2c imer "is waiting for the" operation timer ". Then, the code corresponding to the transition flow in (A) in FIG. 26 is as shown in (B) in FIG. In this coding, the parts surrounded by solid lines are, from the top, the processing of timer initialization, processing of timer count start, and processing of timer check.
さらにまた、 「遷移フロー」 では、 「積算タイマ」 が使用される可能性が ある。 この 「積算タイマ」 は、 「積算タイマグループ」 内にある 「状態」 に 遷移した時に初期化され、 「積算タイマ」 待ちを条件とする遷移フローでチ エックされる。 「積算タイマ使用状態 j からの遷移時に遷移先 状態」 が 「積算タイマグループ」 内の 「状態」 であれば 「積算タイマ」 が一時停止さ れ、 「積算タイマグルーブ」 内の 「状態」 から 「積算タイマ使用状態」 への 遷移であれば 「積算タイマ」 が再スタートする。 第 2 7図中の例では、 「状 態 1」 から 「状態 2」 への遷移時、 「状態 4」 から 「状態 3」 への遷移時、 または初期状態指定子から 「状態 2」 への遷移時に" s e t T 1 m e r " に よる初期化と" s t a r t T i m e r " によるタイマの起動 (カウント開始) が行われる。 また、 「状態 3」 から 「状態 2」 への遷移フローでは" c h e c k T i m e r " で 「運転タイマ」 待ちを行っており、 その遷移時には 「積 算タイマ」 が一時停止される。 さらに、 「状態 2」 から 「状態 3」 に遷移し た時には 「積算タイマ」 が再スタートされる。 そして、 第 2 7図の遷移フロ 一に対応するコードは第 2 8図、 第 2 9図に示すとおりになる。 二のコード 化のうち、 実線で囲まれた部分は、 第 2 8図、 第 2 9図の順、 かつ上から順 に、 タイマ初期化の処理、 タイマ初期化の処理、 タイマチェックの処理、 タ イマ停止の処理、 タイマ停止の処理、 タイマカウン ト開始の処理、 タイマ初 期化の処理、 タイマカウン卜開始の処理である。  Furthermore, in the “transition flow”, an “integration timer” may be used. This “integration timer” is initialized when it transits to “state” in the “integration timer group”, and is checked in a transition flow that is conditioned on waiting for the “integration timer”. If the “destination state when transitioning from the integration timer use state j” is “state” in the “integration timer group”, the “integration timer” is suspended, and the “state” in the “integration timer group” If the transition to the “integration timer use state” is made, the “integration timer” restarts. In the example shown in Fig. 27, the transition from "state 1" to "state 2", the transition from "state 4" to "state 3", or the transition from the initial state specifier to "state 2" At the time of transition, initialization by "setT1mer" and start of timer (start of counting) by "startTimer" are performed. In the transition flow from “State 3” to “State 2”, the “operation timer” is waited for in “checkTimer”, and during this transition, the “accumulation timer” is temporarily stopped. Furthermore, when transitioning from “state 2” to “state 3”, the “integration timer” is restarted. The codes corresponding to the transition flow in FIG. 27 are as shown in FIGS. 28 and 29. Of the two encodings, the part enclosed by the solid line is the processing of timer initialization, processing of timer initialization, processing of timer checking, in the order of Fig. 28 and Fig. 29, and from top to bottom. These are timer stop processing, timer stop processing, timer count start processing, timer initialization processing, and timer count start processing.
前記 「状態遷移テーブル」 ( 「状態遷移表」 ) は状態遷移図の略記表であ り、 「判定順序」 と 「遷移条件」 と 「アクション」 との 3つを含む表として 記述される {第 3 0図中 (A ) 参照) 。 また、 「状態遷移表」 は第 3 0図中 (B) に示すような等価な状態遷移図としてコード化される。 そして、 第 3 0図中 (A) の状態遷移表に対応するコードは第 3 1図に示すとおりに る。 このコー ド化のうち、 実線で囲まれた部分は、 上から順に、 状態遷移表をァ クティべ一トする処理、 状態遷移表のパス 1の処理、 状態遷移表のパス 2の 処理である。 The “state transition table” (“state transition table”) is an abbreviated table of a state transition diagram, and is described as a table including three items of “judgment order”, “transition condition”, and “action”. (See (A) in Fig. 30). The “state transition table” is shown in Fig. 30. It is coded as an equivalent state transition diagram as shown in (B). Then, the code corresponding to the state transition table of (A) in FIG. 30 is as shown in FIG. The part surrounded by a solid line in this coding is, from the top, processing for activating the state transition table, processing for path 1 of the state transition table, and processing for path 2 of the state transition table. .
また、 第 30図中 (B) の状態遷移図のァクティべ一タ関数は第 3 2図中 (B) に示すとおりであり、 第 30図中 (B) の状態遷移図のスィ ッチニネ クタからの分岐処理に対応する関数は第 3 2図中 (A) に示すとおりであるつ そして、 第 3 2図中 (A.) のコード化のうち、 点線で囲まれた部分は、 ニ^ ら順に、 第 30図中 (B) の (d ) の遷移条件判定、 第 30図中 B) { e の遷移条件判定、 第 30図中 (B) の (c ) の遷移条件判定である: さらに、 第 30図中 ( B 1 の状態遷移図のバス 1関数は第 3 3図中 ( A に 示すとおりであり、 第 30図中 ( B ) の状態遷移図のパス 2関数は第 33図 中 (B) に示すとおりである。 そして、 第 3 3図中 (A) のコード化の ち. 点線で囲まれた部分は、 上から順に、 第 30図中 (B) の状態遷移図が起動 した時の遷移判定、 第 30図中 (B) の (g) の遷移条件判定、 第 30図中 (B) の (h) の遷移条件判定、 第 30図中 (B) の ( f ) の遷移条件判定 であり、 第 3 3図中 (B) のコード化のうち、 点線で囲まれた部分は、 二 ら順に、 第 30図中 (B) の (d) の遷移条件判定、 第 30図中 (B) '. (e ) の遷移条件判定、 第 30図中 (B) の (c) の遷移条件判定である, さらに、 「アクショ ンテ一ブル」 は、 状態内に記述されるアクショ ン 1 つであり、 条件によって実行するァクションを変化させる場合に利用するも のであって、 条件とアクションとの関係を 「判定順序」 、 「実行条件」 、 「アクション」 の 3項目からなる表として表している (第 34図参照) - そ し 、 第 35図中 (A) のコード化のうち、 実線で囲まれた部分が 「ァク ン'  The activator function of the state transition diagram in (B) of Fig. 30 is as shown in (B) of Fig. 32. From the switch connector in the state transition diagram of (B) of Fig. 30, The function corresponding to the branching process in Fig. 32 is as shown in (A) in Fig. 32. In the coding in (A.) in Fig. 32, the part surrounded by the dotted line is The transition condition judgment of (d) in (B) of FIG. 30, the transition condition judgment of (B) {e in FIG. 30, and the transition condition judgment of (c) in (B) of FIG. In FIG. 30, the bus 1 function in the state transition diagram of B 1 is as shown in FIG. 33 (A, and the path 2 function in the state transition diagram of FIG. 30 (B) is in FIG. 33. As shown in (B), and after the coding in (A) in Fig. 33, the parts surrounded by dotted lines are activated in order from the top in the state transition diagram in (B) in Fig. 30. Transition judgment when The transition condition judgment of (g) in (B), the transition condition judgment of (h) in (B) of FIG. 30, and the transition condition judgment of (f) in (B) of FIG. The part enclosed by the dotted line in the coding of (B) is the transition condition judgment of (d) in (B) of Fig. 30, and the (B) '. This is the transition condition judgment of (c) in (B) of Fig. 30. Furthermore, the "action table" is one action described in the state, and is executed according to the condition. It is used to change the action, and the relationship between the condition and the action is represented as a table consisting of three items: “judgment order”, “execution condition”, and “action” (see Fig. 34). In the coding of (A) in Fig. 35, the part surrounded by a solid line is "
7ル」 の処理である。 第 3 5図中 (B) はこの処理を詳細に示すコ /ヨンテーブル」 の 1行目の処理実行、 2行目の処理 実行、 3行目の処理実行を示している。 したがって、 第 3 5図中 (B ) から 分かるように、 生成コードは、 単純な i ί文の羅列になる 7 ”processing. (B) in Fig. 35 shows the details of this process. / Yon table ”shows execution of the first line, execution of the second line, and execution of the third line. Therefore, as can be seen from (B) in Fig. 35, the generated code is a sequence of simple i ί sentences.
上記の実施態様を採用すれば、 構造化モデルを、 D F Dチャートと C S P E Cチャートを対として明確、 かつ正確に構成することができ、 この構造化 モデルに基づいて自動的にコード生成を行うことができるので、 最も多大な 工数を必要とするコード生成を自動化して制御プログラム開発全体としての 工数の大幅な削減を達成することができるとともに、 人為的ミスに起因する プログラムミスを防止することができる。 また、 構造化モデル全体、 あるブ ロセス以下のモデル、 状態遷移図、 生成コードなど、 必要なレベルに応じた 再利用が可能であり、 再利用性を向上させることができる。  By adopting the above embodiment, the structured model can be configured clearly and accurately with the DFD chart and the CSPEC chart as a pair, and the code can be automatically generated based on the structured model. Therefore, it is possible to automate code generation that requires the most man-hours, to achieve a significant reduction in man-hours as a whole of control program development, and to prevent program errors caused by human error. In addition, the entire structured model, models below a certain process, state transition diagrams, generated code, etc. can be reused according to the required level, and reusability can be improved.
第 3 6図はこの発明の制御プログラム自動生成装置の一実施態様を示すブ 口ック図である。  FIG. 36 is a block diagram showing an embodiment of the control program automatic generation device of the present invention.
この制御プログラム自動生成装置は、 構造化モデルを保持する構造化モデ 'レ保持部 1 と、 構造化モデルに基づいてへッダファィルを作成するへ ''/ダフ アイル作成部 2と、 構造化モデルに基づいて状態変数の定義コードを作成す る状態変数定義作成部 3と、 構造化モデルに基づいて、 最上位の階層に属す る状態に接続されてし、る初期状態指定子に実行を移すための D F Dァクティ ベータ関数コ一ドを作成する D F Dァクティベータ関数作成部 4 と、 構造化 モデルに基づいて、 D F Dァクテノベータ関数の実行後に呼び出されるべき D F D実行関数コ一ドを作成する D F D実行関数作成部 5と、 構造化モデル に基づいて常時起動プロセスコードを作成する常時起動プロセス作成部 6 と、 作成されたヘッダファイル、 状態変数の定義コード、 D F Dァクティベータ 関数コード、 D F D実行関数コー ド、 および常時起動プロセスコー ドを所定 の順序で保持するコード保持部 7とを有している。 なお、 各部における処理 は、 上記の制御プログラム生成方法の説明において既に説明されてレ、るので, ぅ ここでは説明を省略する。 This control program automatic generation device has a structured model storage unit 1 that holds a structured model, a header file created based on the structured model Based on the structured model, the state variable definition creation unit 3 that creates state variable definition codes based on the state model is connected to the state that belongs to the highest level, and the execution is transferred to the initial state specifier. DFD activator function creation unit 4 that creates a DFD activator function code for the DFD execution function creation unit 4 that creates a DFD execution function code to be called after the execution of the DFD activator function based on the structured model , An always-on process creation unit 6 that creates an always-on process code based on the structured model, a created header file, state variable definition code, and DFD factories. Over data function code, and a code holding unit 7 for holding DFD executed function code, and the permanent boot process code in a predetermined order. The processing in each unit has already been described in the above description of the control program generation method. 説明 The description is omitted here.
この構成の制御プログラム自動生成装置を採用した場合には、 先ず構造化 モデル保持部 1により構造化モデルを保持する そして、 保持した構造化モ デルに基づいて、 ヘッダファイル作成部 2によりヘッダファイルを作成し、 状態変数定義作成部 3により状態変数の定義コードを作成し、 D F Dァクテ ィベータ関数作成部 4により、 最上位の階層に属する状態に接続されている 初期状態指定子に実行を移すための D F Dァクティベータ関数コードを作成 し、 D F D実行関数作成部 5により、 D F Dァクティベータ関数の実行後に 呼び出されるべき D F D実行関数コードを作成し、 常時起動プロセス作成部 6により常時起動プロセスコードを作成し、 コード保持部 7にこれらの作成 されたソースコードを保持する。 したがって、 その後は、 ソースコードをコ ンパイルすることにより、 実動作形態 (バイナリコー ド) に変換することが できる。  When the control program automatic generation device having this configuration is adopted, first, the structured model is held by the structured model holding unit 1, and the header file is created by the header file creating unit 2 based on the held structured model. To create the definition code of the state variable by the state variable definition creation part 3 and to transfer the execution to the initial state specifier connected to the state belonging to the highest hierarchy by the DFD activator function creation part 4. Creates DFD activator function code, creates DFD execution function code to be called after execution of DFD activator function by DFD execution function creation unit 5, creates always-on process code by always-on process creation unit 6, and holds code Part 7 holds these created source codes. After that, the source code can be converted into an actual operation form (binary code) by compiling it.
ただし、 前記 D F D実行関数作成部 5としては、 状態の判定処理コード、 遷移条件の判定処理コー ド、 遷移アクショ ンの処理コー ド、 状態変数を遷移 先の状態に設定する処理コードなどを作成するパス 1作成部、 状態の判定処 理コー ド、 状態アクショ ンの処理コ一ドなどを作成するパス 2作成部、 遷移 フロー、 並行グループの実行順番を設定する実行順番設定部を有するものを 採用することが好ましい。  However, the DFD execution function creating unit 5 creates a state determination processing code, a transition condition determination processing code, a transition action processing code, a processing code for setting a state variable to a transition destination state, and the like. Adopted is one that has a path 1 creation section, a path 2 creation section that creates state judgment processing code, state action processing code, etc., a transition flow, and an execution order setting section that sets the execution order of parallel groups. Is preferred.
第 3 7図はこの発明の制御プログラム自動生成装置の他の実施態様を示す ブロック図である。  FIG. 37 is a block diagram showing another embodiment of the control program automatic generation device of the present invention.
この制御プログラム自動生成装置は、 チヤ一ト管理部および辞書管理部を 含む構造化モデル管理部 1 1 と、 構造化モデル管理部 1 1 との間でデータ授 受を行うチャート/辞書編集部 1 2と、 構造化モデル管理部 1 1からのデー タを入力とするチャート/辞書チェック部 1 3と、 キヤート管理部からのデ ータを入力とするコード生成チヤ一トグループ設定保持部 1 4と、 キヤ一卜 4- 管理部からのデータを入力とする状態変数定義作成部、 チヤ一ト管理部から のデータを入力とする初期化プロック作成都、 チヤ一卜管理部からのデータ を入力とする状態遷移判定および実行ブ口ック (パス 1 ) 作成部、 チャート 管理部からのデータを入力とする状態内処理ブロック (パス 2 ) 作成部、 キ ヤート管理部からのデータを入力とする状態非依存処理ブロック (常時起動 プロセス) 作成部を含む状態遷移図変換部、 およびチャート管理部、 辞書管 理部からのデータを入力とする置換部を含むコード生成部 1 5と、 コード生 成パラメータ保持部 1 6と、 構造化モデル管理部 1 1、 印刷設定保持部 1 8 からのデータを入力とするチャート Z辞書印刷部 1 7と、 印刷設定保持部 1 8と、 状態変数定義作成部、 初期化ブロック作成部、 状態遷移判定および実 行ブロック (パス 1 ) 作成部、 状態内処理ブロック (.パス 2 ) 作成部、 状態 非依存処理ブロック (常時起動プロセス) 作成部、 置換部からのデータを入 力とするプログラムフアイル保持部および置換部からのデータを入力とする ヘッダファイル保持部を含むソ一スコード保持部 1 9とを有している。 なお、 各部の機能は前記制御プログラム自動生成方法の説明から明らかで あるから詳細な説明を省略する。 また、 「G U I」 はユーザーインターフニ ースを表している。 The control program automatic generation device includes a structured model management unit 11 including a chart management unit and a dictionary management unit, and a chart / dictionary editing unit 1 for exchanging data between the structured model management unit 11 and the structured model management unit 11. 2, a chart / dictionary check unit 13 that receives data from the structured model management unit 11 as input, and a code generation chart group setting holding unit 14 that receives data from the chart management unit. And the character 4- State variable definition creation unit that receives data from the management unit, initialization block creation unit that receives data from the ticket management unit, and state transition determination that uses data from the channel management unit as input. And execution block (pass 1) creation block, state-independent processing block that receives data from the chart management section (pass 2) creation block, state-independent processing block that receives data from the cache management section (Continuous startup process) A code generation unit 15 including a state transition diagram conversion unit including a creation unit, a replacement unit that receives data from the chart management unit and the dictionary management unit, and a code generation parameter holding unit 16 , A chart that receives data from the structured model management unit 11 and the print setting holding unit 18, a Z dictionary printing unit 17, a print setting holding unit 18, a state variable definition creation unit, and an initialization block creation Department State transition judgment and execution block (pass 1) creation unit, in-state processing block (.pass 2) creation unit, state-independent processing block (always running process) Program that inputs data from creation unit and replacement unit And a source code holding unit 19 including a header file holding unit that receives data from the file holding unit and the replacement unit. The function of each part is clear from the description of the control program automatic generation method, and therefore, detailed description is omitted. “GUI” indicates user interface.
上記の構成の制御プログラム自動生成装置を採用した場合には、 前記制御 プログラム自動生成方法または前記制御プログラム自動生成装置と同様の作 用を達成することができる。 産業上の利用可能性  When the control program automatic generation device having the above configuration is employed, the same operation as the control program automatic generation method or the control program automatic generation device can be achieved. Industrial applicability
この発明の制御プログラム生成方法、 装置を採用することによって、 解釈 の誤りに起因する制御プログラムの誤作成を防止できるとともに、 制御アコ グラムの生産性を高めることができる  By employing the control program generation method and apparatus of the present invention, it is possible to prevent erroneous creation of a control program due to an erroneous interpretation, and to increase the productivity of control programs.

Claims

-5 請求の範囲 -5 Claims
1. プロセス間のデータの入出力関係を表すデータフロー図、 および各 データフロー図と対になり、 かつプロセスの起動 z停止、 データ加工を条件 駆動型で表す状態遷移図を含み、 入力データから出力データを決定する複数 のプロセスを用いて階層化された構造化モデルを作成し、 1. Includes a data flow diagram that represents the input / output relationship of data between processes, and a state transition diagram that is paired with each data flow diagram, and that represents process start, stop, and data processing in a condition-driven manner. Create a hierarchical structured model using multiple processes to determine output data,
状態遷移図に基づいて、 現在状態に関する判定を行うための条件判定コー ドを生成し、  Based on the state transition diagram, a condition judgment code for making a judgment on the current state is generated,
条件判定結果に応答するァクシヨ コ一ドを生成する  Generate a fax code that responds to the result of the condition judgment
二とを特徴とする制御プログラム生成方法。  A control program generation method characterized by the following two points.
2. 前記構造化モギルは、 該当するプロセスにおいて入力データから出 力データを決定するデータ加工方法を表すデータ加工記述図をさらに含み、 データ加工方法をも考慮して条件判定コード、 ァクションコードを生成する 請求項 1に記載の制御プログラム生成方法。  2. The structured mogil further includes a data processing description diagram representing a data processing method for determining output data from input data in a corresponding process, and a condition determination code and an action code are also taken into consideration in consideration of the data processing method. The control program generation method according to claim 1, wherein the control program is generated.
3. プロセス間のデータの入出力関係を表すデータフロー図、 および各 ータフロー図と対になり、 かつプロセスの起動 Z停止、 データ加工を条件 駆動型で表す状態遷移図を含み、 入力データから出力データを決定する複数 のプロセスを用いて階層化された構造化モデルを作成して保持する構造化モ デル保持手段 ( 1) ( 1 1 ) と、  3. Includes a data flow diagram that represents the input / output relationship of data between processes, and a state transition diagram that is paired with each data flow diagram and that indicates the process start, Z stop, and data processing in a condition-driven manner, and outputs from input data. A structured model holding means (1) (11) for creating and holding a hierarchical structured model using a plurality of processes for determining data;
状態遷移図に基づいて、 現在状態に関する判定を行うための条件判定コー ドを生成する条件判定コード生成手段 ( 5) (1 5) と、  Condition judgment code generation means (5) (15) for generating a condition judgment code for making a judgment on the current state based on the state transition diagram;
条件判定結果に応答するァクシヨンコ一ドを生成するァクシヨンコー ド生 成手段 (5) ( 1 5) とを含む  Function code generating means (5) (15) for generating an action code responding to the condition determination result
ことを特徴とする制御プログラム生成装置。  A control program generation device characterized by the above-mentioned.
4. 前記構造化モデル保持手段 ( 1 5) は、 データフロー図、 状態遷移 図を含む構造化モデルに含まれる記述を解釈するための辞書データを作成し 2fc て保持する辞書管理手段をさらに含むものである請求項 3に記載の制御ブ口 グラム生成装置。 4. The structured model holding means (15) creates dictionary data for interpreting the description included in the structured model including the data flow diagram and the state transition diagram. 4. The control program generation device according to claim 3, further comprising a dictionary management unit that holds the data in 2fc.
5. 前記構造化モデルは、 該当するプロセスにおいて入力データから出 力データを決定するデータ加工方法を表すデ一タ加工記述図をさらに含み、 前記条件判定コ一ド生成手段 (5) ( 1 5) 、 アクショ ンコード生成手段 5. The structured model further includes a data processing description diagram representing a data processing method for determining output data from input data in a corresponding process, and the condition determination code generating means (5) (15) ), Action code generation means
(5) ( 1 5) は、 デ一タ加工方法をも考慮して条件判定コー ド、 ァクショ ンコードを生成するものである請求項 3または請求項 4に記載の制御プ口グ ラム生成装置。 (5) The control program generation device according to claim 3 or 4, wherein the condition generation code and the function code are generated in consideration of a data processing method.
6. 請求項 1または請求項 2の処理手順を実行するコンピュータプコ ゲ ラムが格納されて I.、ることを特徴とする記憶媒体  6. A storage medium storing a computer program for executing the processing procedure of claim 1 or claim 2.
7. コンビュータに請求項 1または請求項 2の処理手順を実行させるた 口グラム。  7. A gram that causes the computer to execute the processing procedure of claim 1 or claim 2.
PCT/JP2001/000897 2000-02-10 2001-02-08 Control program generating method, apparatus thereof, storage medium, and program WO2001059532A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
AU32249/01A AU3224901A (en) 2000-02-10 2001-02-08 Control program generating method, apparatus thereof, storage medium, and program

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2000-38254 2000-02-10
JP2000038254 2000-02-10

Publications (1)

Publication Number Publication Date
WO2001059532A1 true WO2001059532A1 (en) 2001-08-16

Family

ID=18562016

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2001/000897 WO2001059532A1 (en) 2000-02-10 2001-02-08 Control program generating method, apparatus thereof, storage medium, and program

Country Status (2)

Country Link
AU (1) AU3224901A (en)
WO (1) WO2001059532A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009015557A (en) * 2007-07-04 2009-01-22 Mitsubishi Electric Corp Program development support device
JP2009271770A (en) * 2008-05-08 2009-11-19 Sumitomo Heavy Ind Ltd Programming device
JP2009271768A (en) * 2008-05-08 2009-11-19 Sumitomo Heavy Ind Ltd Programming device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1991019237A1 (en) * 1990-05-30 1991-12-12 Allen-Bradley Company, Inc. Graphical programming interface for machine/process controllers
JPH04313104A (en) * 1991-01-30 1992-11-05 Toshiba Corp Controller
JPH0553641A (en) * 1991-08-23 1993-03-05 Hitachi Ltd Screen display method and man-machine interface device for process control system
WO1993008516A1 (en) * 1991-10-14 1993-04-29 Siemens Aktiengesellschaft Automatic control for a power station
JPH05241617A (en) * 1992-02-26 1993-09-21 Toshiba Corp Meta specification generating method and specification generating method in control specification generator
US5940617A (en) * 1996-09-17 1999-08-17 Kabushiki Kaisha Toshiba Debugger for controlling execution of software installed in object to be controlled on the basis of state transition model, debugging method thereof, record medium thereof, and method for correlating function specifications and code addresses
GB2334596A (en) * 1998-02-23 1999-08-25 Denno Co Ltd Modular, hierarchical control system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1991019237A1 (en) * 1990-05-30 1991-12-12 Allen-Bradley Company, Inc. Graphical programming interface for machine/process controllers
JPH04313104A (en) * 1991-01-30 1992-11-05 Toshiba Corp Controller
JPH0553641A (en) * 1991-08-23 1993-03-05 Hitachi Ltd Screen display method and man-machine interface device for process control system
WO1993008516A1 (en) * 1991-10-14 1993-04-29 Siemens Aktiengesellschaft Automatic control for a power station
JPH05241617A (en) * 1992-02-26 1993-09-21 Toshiba Corp Meta specification generating method and specification generating method in control specification generator
US5940617A (en) * 1996-09-17 1999-08-17 Kabushiki Kaisha Toshiba Debugger for controlling execution of software installed in object to be controlled on the basis of state transition model, debugging method thereof, record medium thereof, and method for correlating function specifications and code addresses
GB2334596A (en) * 1998-02-23 1999-08-25 Denno Co Ltd Modular, hierarchical control system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009015557A (en) * 2007-07-04 2009-01-22 Mitsubishi Electric Corp Program development support device
JP2009271770A (en) * 2008-05-08 2009-11-19 Sumitomo Heavy Ind Ltd Programming device
JP2009271768A (en) * 2008-05-08 2009-11-19 Sumitomo Heavy Ind Ltd Programming device

Also Published As

Publication number Publication date
AU3224901A (en) 2001-08-20

Similar Documents

Publication Publication Date Title
US6880107B1 (en) Software configuration monitor
AU635550B2 (en) An apparatus and method for decreasing the memory requirements for bios in a personal computer system
CN100461128C (en) Self-monitoring and updating of firmware over a network
US6327706B1 (en) Method of installing software on and/or testing a computer system
CN100547549C (en) Carry out the system and method for secure operating system guiding from the password protection hard disk
JP3607049B2 (en) Apparatus and method for enabling motherboard replacement while protecting serial number in computer system
Calinescu et al. Compositional reverification of probabilistic safety properties for large-scale complex IT systems
JP2002508561A (en) Automatic configuration generation
US6279155B1 (en) Method of installing software on and/or testing a computer system
CN113342590B (en) NVMe device debugging function implementation method, device, equipment and storage medium
Lang et al. A study of the applicability of existing exception-handling techniques to component-based real-time software technology
US7269820B2 (en) Program code generator and program
WO2001059532A1 (en) Control program generating method, apparatus thereof, storage medium, and program
JP2005267644A (en) Address support for resource in common-language runtime language
JP2000010666A (en) Computer system and flash rom rewriting method
CN101192164A (en) Computer platform built-in products data unification updating process method and system
EP3336626B1 (en) Memory analysis for industrial controllers
CN111159123B (en) Embedded reliable parameter storage file system and method
Karaila Evolution of a Domain Specific Language and its engineering environment–Lehman’s laws revisited
AU3583999A (en) A method of installing software on and/or testing a computer system
US6769075B2 (en) Method and apparatus for performing emergency shutdown of a malfunctioning computer system saving all open files, data, and work in progress
JP2003122409A (en) Method for checking program, sequence program editing device, recording medium, and program
US20050033533A1 (en) Method for verifying the calculator core of a microprocessor or a microcontroller
US20020129178A1 (en) State pattern enhancement
Lawrie et al. An Architecture Based Design Process for Deploying Control Software on Production Hardware Using RapidHawk

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BY BZ CA CH CN CR CU CZ DE DK DM DZ EE ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NO NZ PL PT RO RU SD SE SG SI SK SL TJ TM TR TT TZ UA UG US UZ VN YU ZA ZW

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): GH GM KE LS MW MZ SD SL SZ TZ UG ZW AM AZ BY KG KZ MD RU TJ TM AT BE CH CY DE DK ES FI FR GB GR IE IT LU MC NL PT SE TR BF BJ CF CG CI CM GA GN GW ML MR NE SN TD TG

121 Ep: the epo has been informed by wipo that ep was designated in this application
REG Reference to national code

Ref country code: DE

Ref legal event code: 8642

122 Ep: pct application non-entry in european phase
WWE Wipo information: entry into national phase

Ref document number: 2001558800

Country of ref document: JP