PROGRAM GENERATION DEVICE, PROGRAM GENERATION METHOD, AND COMPUTER READABLE MEDIUM

A changed part identification unit (27) compares original data that is design data (41) before being changed with changed data is the design data (41) after being changed in terms of each piece of design information that is a constituent of each of the original data and the changed data. The changed part identification unit (27) thus identifies a changed part in a control program (51) generated from the original data. A change reflection unit (28) updates the control program (51) by setting a new program component generated from the changed data for the changed part identified by the changed part identification unit (27).

TECHNICAL FIELD

The present disclosure relates to a technology to automatically generate a program from design data.

BACKGROUND ART

Various devices are used in the manufacturing industry and so on. Device manufacturers develop control programs to realize control of devices. Developing a control program requires many man-hours. Therefore, in order to make this development more efficient, technologies to generate a control program from design data are being developed.

Patent Literature 1 describes a technology to generate a ladder program, which is a type of control program, based on a time chart that is design data of a device to be controlled. The ladder program is a program of a relay circuit type that combines an input device, an output device, an internal device, and so on. The input device indicates a memory address where the value of an input signal is stored. The output device indicates a memory address where an output signal is stored. The internal device indicates a memory address where a result of processing by the program or the like is stored.

CITATION LIST

Patent Literature

Patent Literature 1: JP 2021-149853 A

SUMMARY OF INVENTION

Technical Problem

With a technology to generate a control program from design data, it is difficult to generate the entire program. Therefore, in many cases, users add processes to generated control programs. The added processes are a process to link with an external device, an error process, a process to return to the home position, and so on.

After the user has added a process to the control program, rework may occur due to a change in the design of a device, for example. In this case, the control program is regenerated from the changed design data, and the user adds the process to the regenerated control program again. Alternatively, the user identifies the scope of impact of the design change on the control program and modifies the control program without regenerating the control program. In either case, a lot of work is involved.

When the control program is regenerated from the changed design data, the internal device number or the like assigned to a program component corresponding to a part with no change in the design may be changed due to the impact of a part where the design has been changed. The change in the internal device number or the like will also affect a process that is added by the user and is linked to the part of the program with no change in the design. Therefore, when the user adds a process to the regenerated control program, it is necessary to carefully check the presence or absence of impact.

An object of the present disclosure is to make it possible to simplify work to generate a control program from design data changed after a process is added to a control program.

Solution to Problem

A program generation device according to the present disclosure includesa changed part identification unit to identify a changed part in a control program generated from original data by comparing the original data with changed data in terms of each piece of design information that is a constituent of each of the original data and the changed data, the original data being design data before being changed, the changed data being the design data after being changed; anda change reflection unit to update the control program by setting a new program component generated from the changed data for the changed part identified by the changed part identification unit.

Advantageous Effects of Invention

In the present disclosure, original data and changed data are compared in terms of design information so as to identify a changed part in a control program. Then, the control program is updated by setting a new program component generated from the changed data for the changed part.

This allows the control program to be updated without affecting program components corresponding to unchanged parts in design data. As a result, it is possible to simplify work to generate a control program from design data changed after a process is added to a control program.

DESCRIPTION OF EMBODIMENTS

Referring toFIG.1, a configuration of a program generation device10according to Embodiment 1 will be described.

The program generation device10is a computer.

The program generation device10includes hardware of a processor11, a memory12, a storage13, and a communication interface14. The processor11is connected with other hardware components through signal lines and controls these other hardware components.

The processor11is an IC that performs processing. IC is an abbreviation for integrated circuit. Specific examples of the processor11are a CPU, a DSP, and a GPU. CPU is an abbreviation for central processing unit. DSP is an abbreviation for digital signal processor. GPU is an abbreviation for graphics processing unit.

The memory12is a storage device to temporarily store data. Specific examples of the memory12are an SRAM and a DRAM. SRAM is an abbreviation for static random access memory. DRAM is an abbreviation for dynamic random access memory.

The storage13is a storage device to store data. A specific example of the storage13is an HDD. HDD is an abbreviation for hard disk drive. Alternatively, the storage13may be a portable recording medium such as an SD (registered trademark) memory card, CompactFlash (registered trademark), a NAND flash, a flexible disk, an optical disc, a compact disc, a Blu-ray (registered trademark) disc, or a DVD. SD is an abbreviation for Secure Digital. DVD is an abbreviation for digital versatile disk.

The communication interface14is an interface for communicating with other devices. Specific examples of the communication interface14are an Ethernet (registered trademark) port, a USB port, and an HDMI (registered trademark) port. USB is an abbreviation for Universal Serial Bus. HDMI is an abbreviation for High-Definition Multimedia Interface.

The program generation device10includes, as functional components, an information acquisition unit21, a program generation unit22, a tracking information setting unit23, a program integration unit24, a generation source information setting unit25, a design data identification unit26, a changed part identification unit27, and a change reflection unit28. The functions of the functional components of the program generation device10are realized by software.

The storage13stores programs that realize the functions of the functional components of the program generation device10. These programs are read into the memory12by the processor11and executed by the processor11. This realizes the functions of the functional components of the program generation device10.

The storage13stores program component templates31.

InFIG.1, only one processor11is illustrated. However, there may be a plurality of processors11, and the plurality of processors11may cooperate to execute the programs that realize the functions.

Referring toFIGS.2to11, operation of the program generation device10according to Embodiment 1 will be described.

A procedure for the operation of the program generation device10according to Embodiment 1 is equivalent to a program generation method according to Embodiment 1. A program that realizes the operation of the program generation device10according to Embodiment 1 is equivalent to a program generation program according to Embodiment 1.

The operation of the program generation device10includes an initial generation process and a regeneration process. The initial generation process is a process that takes, as input, design data41and generates a control program51. The regeneration process is a process that takes, as input, original data42that is the design data41before being changed, changed data43that is the design data41after being changed, and the control program51corresponding to the original data42, and updates the control program51.

For example, the program generation device10displays a button representing the initial generation process and a button representing the regeneration process on a display device. Then, when the button representing the initial generation process is pressed, the program generation device10executes the initial generation process. When the button representing the regeneration process is pressed, the program generation device10executes the regeneration process.

Referring toFIG.2, an example of the design data41according to Embodiment 1 will be described.

The design data41indicated inFIG.2represents the following process. When X0 is turned ON, Y10 is turned ON. When X1 is turned ON, Y10 is turned OFF. Then, when X2 is turned ON, the process ends. A variable beginning with X represents an input signal to a control device. A variable beginning with Y represents an output signal from the control device.

For individual pieces of design information44that are elements of the design data41, IDs from 001 to 005 are respectively set. ID is an abbreviation for identifier. The ID is used to compare the design data41before being changed with the design data41after being changed. That is, the ID is used to compare the original data42with the changed data43. For example, by comparing pieces of the design information44with the same ID, whether or not this design information44has been changed is determined. The design information44that does not exist in the original data42but exists in the changed data43is identified as the design information44that has been newly added. Conversely, the design information44that does not exist in the changed data43but exists in the original data42is identified as the design information44that has been deleted.

The format of the design data41may be different from the format indicated inFIG.2, provided that it is a format that allows pieces of the design information44before and after being changed to be compared.

Referring toFIG.3, the initial generation process according to Embodiment 1 will be described.

The information acquisition unit21extracts information required to generate a control program51from design data41.

Specifically, when the initial generation process button is pressed, the information acquisition unit21prompts the user to specify the design data41to be used as input. The information acquisition unit21acquires the specified design data41. The information acquisition unit21acquires each piece of design information44included in the design data41.

The program generation unit22sets each piece of the design information44acquired in step S11as target design information44. The program generation unit22classifies the target design information44, and identifies a program component template31corresponding to this information. For example, the program generation unit22classifies the target design information44according to its structure or the like, such as whether it has a conditional branch structure or a repeat structure. The program generation unit22may classify the target design information44based on its content. The program component template31is a basis for a program component52corresponding to the design information44.

At this time, the tracking information setting unit23sets tracking information53for associating the design information44with the program component52. The tracking information setting unit23sets a unique value for each program component52as the tracking information53.

The tracking information setting unit23generates a list of the tracking information53, as indicated inFIG.4. The list of the tracking information53includes an ID, a name of the program component template31, and the tracking information53for each identification number.

There may be a case where one program component52is generated from one piece of the design information44. In this case, the value of the ID is directly set as the tracking information53, as in the record of the identification number “1”. There may also be a case where a plurality of pieces of the design information44are used together to generate one program component52. In this case, information that is common to the plurality of pieces of the design information44is set as the tracking information53, as in the record of the identification number “4”. In the record of the identification number “4”, Y10 is set as the tracking information53because a variable “Y10” is common to the design information44of ID “002” and ID “003”. In what case a plurality pieces of the design information44are grouped together to generate one program component52is set in advance. For example, when a plurality of pieces of the design information44have a specific structure and use the same variable, they may be grouped together to generate one program component52.

The information that is set as the tracking information53is not limited to the above. For example, the information that is set as the tracking information53may be information such as a combination of information included in the design information44and the name of the program component template31.

The program generation unit22sets, as a target record, a record that has not been processed among the records in the list of the tracking information53generated in step S12. The program generation unit22sets information from the design information44corresponding to the target record in the program component template31of the target record. Specifically, the program generation unit22sets a variable name in the target design information44as a variable name in the program component template31. The program generation unit22thus generates the program component52corresponding to the target design information44, as indicated inFIG.5. InFIG.5, a case where the program component52is a ladder program and a case where the program component52is written in the ST language are indicated. ST is an abbreviation for structured text.

At this time, the tracking information setting unit23adds a corresponding piece of the tracking information53to the program component52. For example, the tracking information setting unit23adds the tracking information53to the program component52using the comment function of the programming language. Alternatively, the tracking information setting unit23may add, to the program component52, information indicating that it is generated by the program generation device10. InFIG.5, “auto” is added as the information indicating that it is generated by the program generation device10.

The program generation unit22determines whether all the program components52have been generated. Specifically, the program generation unit22determines whether all the records in the list of the tracking information53have been processed. If all the records have been processed, the program generation unit22determines that all the program components52have been generated.

If all the program components52have been generated, the program generation unit22advances processing to step S15. If there is any program component52that has not been generated, the program generation unit22returns processing to step S13.

As indicated inFIG.6, the program integration unit24generates the control program51by arranging the program components52generated in step S13in the order indicated by the design data41.

(Step S16: Generation Source Information Setting Process)

The generation source information setting unit25adds generation source information54that indicates the design data41that is a generation source to the control program51generated in step S15. For example, the generation source information setting unit25uses the comment function of the programming language to add the generation source information54to the control program51. The generation source information54is, for example, a file path of the design data41. InFIG.6, a character string “source, C:¥A¥B¥design data” is the generation source information54.

Referring toFIG.7, the regeneration process according to Embodiment 1 will be described.

As indicated inFIG.8, it is assumed here that the user has added a process to the control program51generated in the initial generation process, as indicated by the part enclosed by dashed lines.

It is also assumed that the original data42has been changed to the changed data43, as indicated inFIG.9. The original data42is the same as the design data41indicated inFIG.2.

The design data identification unit26identifies the design data41that is a generation source from the control program51.

Specifically, when the regeneration process button is pressed, the design data identification unit26prompts the user to specify the control program51and the changed data43that are to be used as input. The design data identification unit26acquires the control program51and the changed data43that have been specified. The design data identification unit26identifies the original data42that is the design data41of the generation source based on the generation source information54included in the control program51.

The original data42is the design data41used when the control program51is generated. The changed data43is the design data41obtained by changing the original data42. The changed data43is the design data41based on which the control program51is to be regenerated.

The information acquisition unit21performs the same process as that of step S11inFIG.3, using the original data42and the changed data43as the target design data41.

The program generation unit22performs the same process as that of step S12inFIG.3, using the original data42and the changed data43as the target design data41.

The changed part identification unit27sets each piece of the design information44included in each of the original data42and the changed data43as the target design information44. The changed part identification unit27compares the original data42with the changed data43in terms of the target design information44. The changed part identification unit27thus identifies a part in which a change has been made to the control program51.

Here, the changed part identification unit27identifies whether each piece of the design information44is updated information, non-updated information, deleted information, or added information. Updated information is the design information44in which there is a difference between the original data42and the changed data43. Non-updated information is the design information44in which there is no difference between the original data42and the changed data43. Deleted information is the design information44that does not exist in the changed data43but exists in the original data42. Added information is the design information44that does not exist in the original data42but exists in the changed data43.

Then, the changed part identification unit27identifies updated information, deleted information, and added information as changed parts.

Specifically, the changed part identification unit27sets, as the target record, each record in the list of the tracking information53for each of the original data42and the changed data43generated in step S23. Note that with regard to records in which the same ID is set between the list of the tracking information53for the original data42and the list of the tracking information53for the changed data43, the changed part identification unit27sets only one of the records as the target record.

The changed part identification unit27compares the design information44of the target record with a corresponding piece of the design information44. When the target record is a record in the list of the tracking information53for the original data42, the corresponding piece of the design information44is the design information44in the changed data43in which the same tracking information53as that in the design information44of the target record is set. When the target record is a record in the list of the tracking information53for the changed data43, the corresponding piece of the design information44is the design information44in the original data42in which the same tracking information53as that in the design information44of the target record is set. Then, the changed part identification unit27identifies whether the design information44of the target record is updated information, non-updated information, deleted information, or added information.

It is assumed that the target record is a record in the list of the tracking information53for the original data42. In this case, if a record with the tracking information53in the target record is included in the list of the tracking information53generated for the changed data43and a change has been made to the design information44, it is updated information. In this case, if a record with the tracking information53in the target record is included in the list of the tracking information53generated for the changed data43and no change has been made to the design information44, it is non-updated information. In this case, if a record with the tracking information53in the target record is not included in the list of the tracking information53generated for the changed data43, it is deleted information. It is assumed that the target record is a record in the list of the tracking information53for the changed data43. In this case, if a record with the tracking information53in the target record is not included in the list of the tracking information53generated for the original data42, it is added information.

When the changed part identification process is performed on the original data42and the changed data43indicated inFIG.9, the result is as indicated inFIG.10. The design information44of ID “003” is updated information. The design information44of ID “001” and ID “005” is non-updated information. The design information44of ID “002” and ID “003” is deleted information. The design information44of ID “004” and ID “006” is added information.

The program generation unit22generates a new program component52for each piece of the design information44determined as updated information or added information in step S24.

Specifically, the program generation unit22sets, as the target record, a record that has been determined as updated information or added information and has not been processed among the records in the list of the tracking information53generated for the changed data43. The program generation unit22sets information from the design information44corresponding to the target record in the program component template31of the target record, as in step S13inFIG.3. The program generation unit22thus generates the program component52corresponding to the target design information44. At this time, when a record determined as updated information is the target record, the program generation unit22may generate a new program component52by reusing the internal device used when the existing control program51is generated. This makes it possible to prevent the internal device number from being changed and reduce the impact on other programs generated by the program generation device10and programs added by users.

The tracking information setting unit23adds the corresponding piece of the tracking information53to the program component52, as in step S13inFIG.3. The tracking information setting unit23may add, to the program component52, information indicating that it is generated by the program generation device10.

The program generation unit22determines whether the program components52have been generated for all the pieces of the design information44determined as updated information or added information.

If all the program components52have been generated, the program generation unit22advances processing to step S27. If there is any program component52that has not been generated, the program generation unit22returns processing to step S25.

The change reflection unit28sets, as the target record, each record in the list of the tracking information53generated for each of the original data42and the changed data43in step S23. With regard to records in which the same ID is set in the list of the tracking information53for the original data42and the list of the tracking information53for the changed data43, the change reflection unit28sets only one of the records as the target record.

The change reflection unit28performs the following processing to update the control program51, depending on the result determined in step S24.

<In the Case of Updated Information>

The change reflection unit28uses the tracking information53in the target record to identify the program component52corresponding to the updated information in the control program51. The change reflection unit28replaces the identified program component52with the new program component52. The new program component52is the program component52generated for the target record in step S25.

<In the Case of Added Information>

The change reflection unit28identifies the location where the added information is added based on the changed data43. The change reflection unit28uses the tracking information53in the target record to identify the location in the control program51that corresponds to the identified location. The change reflection unit28inserts the new program component52into the control program51at the identified location. The new program component52is the program component52generated for the target record in step S25.

<In the Case of Deleted Information>

The change reflection unit28uses the tracking information53in the target record to identify the program component52corresponding to the deleted information in the control program51. The change reflection unit28deletes the identified program component52from the control program51.

<In the Case of Non-Updated Information>

The change reflection unit28retains the program component52corresponding to the non-updated information in the control program51without any change.

(Step S28: Generation Source Information Setting Process)

The generation source information setting unit25adds the generation source information54indicating the changed data43used as the generation source to the control program51generated in step S15. For example, the generation source information setting unit25updates a path indicating the original data42to a path indicating the changed data43.

This updates the control program51as indicated inFIG.11. In the updated control program51, the process added by the user indicated inFIG.8remains. The process of ID “003”, which is updated information, is updated. The processes of ID “006” and ID “007”, which are added information, (the processes whose tracking information53is Y11) are added. The processes of ID “002” and ID “004”, which are deleted information, (the processes whose tracking information53is Y10) is deleted.

As described above, the program generation device10according to Embodiment 1 compares the original data42with the changed data43in terms of the design information44to identify a changed part in the control program51. Then, the control program51is updated by setting a new program component52generated from the changed data for the changed part.

This causes only the program component52corresponding to the changed part in the design data41to be updated. Therefore, the control program51can be updated without affecting the program components52corresponding to unchanged parts in the design data41. As a result, it is possible to simplify work to generate a control program51from design data41changed after a process is added to a control program51.

More specifically, in the regeneration process, the program generation device10according to Embodiment 1 classifies each piece of the design information44in the original data42and the changed data43as updated information, non-updated information, deleted information, or added information. Then, the program generation device10performs processing according to the classification so as to update the control program51. As a result, a process that is added by the user and does not correspond to the design information44remains unchanged.

This makes it possible, when a control program is generated from design data changed after a process is added to a control program, to retain the added process.

The program generation device10according to Embodiment 1 retains the program component52corresponding to a piece of the design information44classified as non-updated information without any change. Therefore, no change is made to the program component52whose design data has not been changed.

When generating the program component52corresponding to a piece of the design information44classified as updated information, the program generation device10according to Embodiment 1 reuses the internal device used when the existing control program51is generated. This can prevent the number of the internal device from being changed and reduce the impact on other program components52.

In Embodiment 1, the control program51generated in the initial generation process is updated in the regeneration process. However, even the control program51generated by a different system can also be updated by the regeneration process, provided that this control program51has substantially the same structure as the control program51generated in the initial generation process.

In Embodiment 1, the functional components are realized by software. However, as Variation 2, the functional components may be realized by hardware. With regard to this Variation 2, differences from Embodiment 1 will be described.

Referring toFIG.12, a configuration of the program generation device10according to Variation 2 will be described.

When the functional components are realized by hardware, the program generation device10includes an electronic circuit15in place of the processor11, the memory12, and the storage13. The electronic circuit15is a dedicated circuit that realizes the functions of the functional components, the memory12, and the storage13.

The electronic circuit15is assumed to be a single circuit, a composite circuit, a programmed processor, a parallel-programmed processor, a logic IC, a GA, an ASIC, or an FPGA. GA is an abbreviation for gate array. ASIC is an abbreviation for application specific integrated circuit. FPGA is an abbreviation for field-programmable gate array.

The functional components may be realized by one electronic circuit15, or the functional components may be distributed to and realized by a plurality of electronic circuits15.

As Variation 3, some of the functional components may be realized by hardware, and the rest of the functional components may be realized by software.

Each of the processor11, the memory12, the storage13, and the electronic circuit15is referred to as processing circuitry. That is, the functions of the functional components are realized by the processing circuitry.

In Embodiment 2, a case will be described where a control program51is applied to a 3D simulator used in device development. 3D is an abbreviation for three-dimensional. In Embodiment 2, differences from Embodiment 1 will be described, and description of the same aspects will be omitted.

In recent years, device manufacturers have been using 3D simulators to develop devices in order to reduce rework in device development. A 3D simulator is software that allows various verifications that would normally be performed using an actual device to be performed without using the actual device.

In order to perform verifications on devices using 3D simulators, it is necessary to control devices on the 3D simulators. Device manufacturers control the devices on the 3D simulators using developed control programs. In some cases, device manufacturers control the devices on the 3D simulators by creating control programs specifically for controlling the devices on the 3D simulators using a high-level language that can be handled by general-purpose PCs or the like. PC is an abbreviation for personal computer.

Referring toFIG.13, a configuration of the program generation device10according to Embodiment 2 will be described.

The program generation device10differs from the program generation device10indicated inFIG.1in that a link component generation unit29and a simulation unit30are included as functional components. The functions of the link component generation unit29are realized by software or hardware, as with the other functional components.

InFIG.13, the program generation device10includes the simulation unit30and realizes a 3D simulator. However, the functions of the simulation unit30may be included in another device. In this case, a control program51generated by the program generation device10is provided to the device that includes the simulation unit30.

Referring toFIGS.14to18, operation of the program generation device10according to Embodiment 2 will be described.

A procedure for the operation of the program generation device10according to Embodiment 2 is equivalent to the program generation method according to Embodiment 2. A program that realizes the operation of the program generation device10according to Embodiment 2 is equivalent to the program generation program according to Embodiment 2.

Referring toFIG.14, an example of the 3D simulator according to Embodiment 2 will be described.

Various verifications that have been performed using an actual device are performed without the actual device by preparing a verification target device on the 3D simulator. To do this, it is necessary to set at least the following three for the verification target device on the 3D simulator: “shape setting”, “action setting”, and “action condition setting”. InFIG.14, a pusher is indicated as the verification target device.

The shape setting is a setting that determines the shape or position of the device on the 3D simulator. For example, 3D data of the pusher designed using 3D-CAD or the like is imported into the 3D simulator. CAD is an abbreviation for computer aided design. Then, coordinates on the 3D simulator are specified. This sets the shape.

The action setting is a setting for an action of the 3D data that is set in the shape setting. For example, information such as a trigger for executing the action, a direction of movement, acceleration, and maximum speed are set. A specific example of the setting is that when a variable Y10 that is set for the pusher becomes TRUE, the tip of the pusher moves from a point A to a point B with an acceleration a and a maximum speed b.

The action condition setting is a setting for a condition for executing the action set in the action setting. For example, an action logic that rewrites the value of a variable that serves as a trigger for the action is set. A specific example of the setting is that when X0 becomes TRUE, Y10 is set to TRUE, and when X1 becomes TRUE, Y10 is set to FALSE.

That is, the action condition setting is equivalent to the control program51. A verification may be performed by using the 3D simulator in conjunction with a control device in which the control program51presented in Embodiment 1 is embedded as the action condition setting. A verification may also be performed by creating a program equivalent to the control program51using a high-level language that can be used on a general-purpose PC or a language unique to the 3D simulator.

In the latter case, by creating a program using an API or the like of the 3D simulator, the program can be operated in conjunction with the 3D simulator. API is an abbreviation for application programming interface. The latter program is also equivalent to the control program51, so that it can be generated by the same method as the method presented in Embodiment 1. In the latter program, a result of calculation by the 3D simulator, a simulation time, or the like can be obtained using the API of the 3D simulator.

Therefore, in order to output obtained information and use it for a verification, a process may be added to a part other than the part responsible for control. In the method presented in Embodiment 1, even if the control program51includes such a process added by the user, an “action condition setting” according to changed design can be regenerated while retaining the added process.

Referring toFIG.15, an example of the action condition setting created using a high-level language according to Embodiment 2 will be described.

In the action condition setting, the part enclosed by dashed lines inFIG.15is set to allow a variable that is set in a model or the like on the 3D simulator to be read from and written to using the API of the 3D simulator or the like. The part enclosed by dashed lines is called a link component55.

For example, the API is used with the 3D model name “pusher” and the variable name “Y10” set for the 3D model as arguments. This allows a value to be read from and written to the variable set in the 3D model through the action condition setting. The device on the 3D simulator is controlled by reading from and writing to this variable in the part of the control program inFIG.15. This part of the control program may be equivalent to the program in the ST language inFIG.6.

Referring toFIG.16, the initial generation process according to Embodiment 2 will be described.

The processes of steps S33to S37are the same as the processes of steps S12to S16inFIG.3.

The information acquisition unit21extracts information required for generating a control program51from design data41, as in step S11inFIG.3.

At this time, the information acquisition unit21acquires link data45that indicates correspondences between variables in a 3D model in a simulator in which the control program51is implemented and signals in the design data41. Specifically, the information acquisition unit21prompts the user to specify the link data45together with the design data41.

The link data45is data that indicates correspondences between variable names in the 3D model and signal names, as indicated inFIG.17, for example. Associations may be made by setting up a creation rule such as that the variable names in the 3D model are the same as the signal names used in the design data41. In this case, necessary data such as the 3D model name and variable names can be identified from the 3D simulator based on the signal names used in the design data41. Therefore, the link data45does not need to be acquired.

The link component generation unit29generates a link component55that links the control program51and the 3D simulator based on the link data45. At this time, the link component generation unit29may add, to the link component55, information indicating that it is the link component55using the comment function of the programming language or the like. For example, a character string such as “link” is added as the information indicating that it is the link component55.

Referring toFIG.18, the regeneration process according to Embodiment 2 will be described.

The processes of steps S43to S49are the same as the processes of steps S22to S28inFIG.7.

The design data identification unit26identifies the design data41that is the generation source from the control program51, as in step S21inFIG.7.

At this time, the design data identification unit26acquires the link data45, as in step S31inFIG.16. Specifically, the design data identification unit26prompts the user to specify the link data45together with the control program51and so on.

The link component generation unit29generates the link component55based on the link data45, as in step S22inFIG.7.

As described above, the program generation device10according to Embodiment 2 regenerates a program that realizes an action condition setting when the control program51is applied to a 3D simulator used in device development. At this time, a process that is added by the user is retained without any change, as described in Embodiment 1.

This makes it possible, when a program that realizes an action condition setting is generated from the design data41changed after a process is added to the control program51, to retain the added program.

“Unit” in the above description may be interpreted as “circuit”, “step”, “procedure”, “process”, or “processing circuitry”.

The embodiments and variations of the present disclosure have been described above. Two or more of these embodiments and variations may be implemented in combination. Alternatively, one of them or two or more of them may be partially implemented. The present disclosure is not limited to the above embodiments and variations, and various modifications can be made as necessary.

REFERENCE SIGNS LIST

10: program generation device,11: processor,12: memory,13: storage,14: communication interface,15: electronic circuit,21: information acquisition unit,22: program generation unit,23: tracking information setting unit,24: program integration unit,25: generation source information setting unit,26: design data identification unit,27: changed part identification unit,28: change reflection unit,29: link component generation unit,30: simulation unit,31: program component template,41: design data,42: original data,43: changed data,44: design information,45: link data,51: control program,52: program component,53: tracking information,54: generation source information,55: link component.