LADDER PROGRAM EDITOR

20180314224 ยท 2018-11-01

Assignee

Inventors

Cpc classification

International classification

Abstract

Provided is a ladder program editor capable of appropriately pasting a partial circuit on a ladder program displayed on a screen, based on display elements of the ladder program. The ladder program editor is provided with an editing control unit configured to manage a virtual drawing area formed as a set of a plurality of rectangular areas, a pasting object specifying unit configured to specify a partial circuit as an object of pasting, a reference area specifying unit configured to specify a reference area to serve as a reference for pasting the partial circuit, a pasting method specifying unit configured to specify a pasting position and a pasting method for the partial circuit, a pasting area insertion unit configured to insert a pasting area for pasting the partial circuit into the virtual drawing area, a pasting processing unit configured to paste the partial circuit on the pasting area, and a connecting line adjustment unit configured to adjust connecting lines in the virtual drawing area.

Claims

1. A ladder program editor configured to edit a ladder program, the ladder program editor comprising: an editing control unit configured to manage a virtual drawing area or a space in which the ladder program is virtually located and which is formed as a set of a plurality of rectangular areas; a pasting object specifying unit configured to specify a partial circuit as an object of pasting; a reference area specifying unit configured to specify a reference area, in the virtual drawing area, to serve as a reference for pasting the partial circuit; a pasting method specifying unit configured to specify a pasting position and a pasting method for the partial circuit based on the reference area; a pasting area insertion unit configured to insert a pasting area for pasting the partial circuit into the virtual drawing area based on the pasting position and the pasting method specified by the pasting method specifying unit; a pasting processing unit configured to paste the partial circuit on the pasting area; and a connecting line adjustment unit configured to interpolate a connecting line or lines and delete a superfluous connecting line or lines in the virtual drawing area.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The above and other objects and features of the present invention will be obvious from the ensuing description of embodiments with reference to the accompanying drawings, in which:

[0029] FIG. 1 is a schematic hardware configuration diagram showing a principal part of a ladder program editor according to one embodiment of the present invention;

[0030] FIG. 2 is a schematic functional block diagram of the ladder program editor according to the one embodiment of the present invention;

[0031] FIG. 3 is a flowchart illustrating a processing flow in the case where insertion into the lower side in OR is specified as a pasting method;

[0032] FIG. 4 is a flowchart illustrating a processing flow in the case where insertion into the upper side in OR is specified as the pasting method;

[0033] FIG. 5 is a flowchart illustrating a processing flow in the case where insertion into the left side in AND is specified as the pasting method;

[0034] FIG. 6 is a flowchart illustrating a processing flow in the case where insertion into the right side in AND is specified as the pasting method;

[0035] FIG. 7 is a flowchart illustrating a flow of processing for inserting columns into the left side;

[0036] FIG. 8 is a flowchart illustrating a flow of processing for inserting columns into the right side;

[0037] FIG. 9 is a diagram showing an example of an insertion operation of the ladder program editor of the present invention for inserting a partial circuit into an incomplete ladder circuit;

[0038] FIG. 10 is a diagram showing another example of the insertion operation of the ladder program editor of the present invention for inserting the partial circuit into the incomplete ladder circuit;

[0039] FIG. 11 is a diagram showing another example of the insertion operation of the ladder program editor of the present invention for inserting the partial circuit into the incomplete ladder circuit;

[0040] FIG. 11 is a diagram showing an example of an insertion operation of the ladder program editor of the present invention for inserting a partial circuit into a plurality of contacts in OR-relationship;

[0041] FIG. 13 is a diagram snowing another example of the insertion operation of the ladder program editor of the present invention for inserting the partial circuit into the plurality of contacts in OR-relationship;

[0042] FIG. 14 is a diagram showing an example of a partial circuit pasting operation in prior art ladder program editing;

[0043] FIG. 15 is a diagram snowing another example of the partial circuit pasting operation in the prior art ladder program editing; and

[0044] FIG. 16 is a diagram showing another example of the partial circuit pasting operation in the prior art ladder program editing.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0045] The following is a description of an embodiment of a ladder program editor for implementing the present invention. The embodiment of the ladder program editor of the present invention is not limited to the following example.

[0046] FIG. 1 is a hardware configuration diagram showing a principal part of a ladder program editor according to one embodiment of the present invention. A ladder program editor 1 can be constructed as a PC, numerical controller or the like.

[0047] The ladder program editor 1 is mainly composed of a CPU 10. The CPU 10 controls the entire ladder program editor 1 according to a system program stored in a ROM 11. An EPROM or EEPROM is used for the ROM 11.

[0048] A DRAM or the like is used for a RAM 12 and is loaded with temporary calculation data, display data, input/output signals and the like. A CMOS or SRAM, which is backed up by a battery (not shown), or a storage device such as an HDD or an SDD is used for a non-volatile memory 13 and is stored with parameters, ladder programs and the like so be retained even after the power supply is turned off.

[0049] A user interface unit 18 is used to display data and graphics, to input data, and to operate the ladder program editor 1. A graphic control circuit 19 converts digital signals, such as numerical data and graphic data, into raster signals for display and delivers them to a display device 20, which displays these numerical values and graphics. While a liquid-crystal display device is mainly used for the display device 20, any other display device may alternatively be used only if it can display the ladder program.

[0050] An input device 21 comprises a keyboard, which is provided with numeric keys, symbolic keys, character keys, and function keys, and a pointing device such as a mouse and is used to create and edit the ladder program, for example.

[0051] A touch panel 22 has the function of detecting touching and dragging operations by an operator. The touch panel 22 is disposed superimposed on the screen of the display device 20. The operator can detect, by means of the touch panel 22, operations on software keys, software buttons, and software switches displayed on the screen of the display device 20. The touch panel 22 is not a constituent element essential to the ladder program editor 1 but may be provided as required. Alternatively, the touch panel 22 and the display device 20 may be combined into a single unit.

[0052] FIG. 2 is a schematic functional block diagram of the ladder program editor according to the one embodiment of the present invention, in which a system program for implementing a ladder program editing function is performed by the ladder program editor 1 shown in FIG. 1. Functional blocks shown in FIG. 2 are implemented as the CPU 10 of the ladder program editor 1 shown in FIG. 1 performs the system program to control the operations of various parts of the ladder program editor 1. The ladder program editor 1 of the present embodiment comprises an editing control unit 100, display control unit 110, and input processing unit 120. Moreover, the editing control unit 100 comprises a pasting object specifying unit 101, reference area specifying unit 102, pasting method specifying unit 103, pasting area insertion unit 104, pasting processing unit 105, and connecting line adjustment unit 106.

[0053] The editing control unit 100 reads out a ladder program 200 from the non-volatile memory 13 and displays it on the user interface unit 18 through the display control unit 110. Moreover, the editing control unit 100 accepts the operator's input operation input from the user interface unit 18 through the input processing unit 120 and controls editing of the ladder program 200 based on the input operation. The editing control unit 100 manages a virtual drawing area in which a ladder diagram is virtually drawn as a set of a plurality of rectangular areas on a memory such as she RAM 12. Elements (contacts, coils, horizontal connecting lines, etc.) of a ladder circuit included in the ladder program 200 can be arranged individually in the rectangular areas, while vertical connecting lines can be arranged between the rectangular areas that are located side by side. The editing control unit 100 can display a part or the whole of the virtual drawing area as the ladder diagram on the user interface unit 18 by issuing a command to the display control unit 110. Furthermore, based on the operator's operation from the user interface unit 18, the editing control unit 100 can freely change the area(s) (one or a plurality of rectangular areas) in the virtual drawing area to be displayed as the ladder diagram on the user interface unit 18. Moreover, the editing control unit 100 can determine the area(s) (one or a plurality of rectangular areas) in the virtual drawing area for which the operator operates the ladder program 200 displayed as the ladder diagram on the user interface unit 18. The editing control unit 100 may be configured to manage the rows and columns of the rectangular areas constituting the virtual drawing area by putting signs on them. If this is done, the operator can perform an operation, for the area(s) (one or a plurality of rectangular areas) in the virtual drawing area by designating the signs put on the rows and columns of the rectangular areas through the user interface unit 18. By performing control on the display, operation and the like of the ladder program 200, the editing control unit 100 can accept the operator's input operation input from the user interface unit 18 for each of the elements (contacts, coils, horizontal connecting lines, etc.) of the ladder circuit included in the ladder program 200.

[0054] The pasting object specifying unit 101 is a function means for specifying a partial circuit to be pasted on the ladder program 200 as a pasting destination. The pasting object specifying unit 101 may be configured to form the partial circuit as an object of pasting by combining the elements of the ladder circuit, based on the operator's operation for the user interface unit 18, for example. Alternatively, the pasting object specifying unit 101 may be configured to select the partial circuit as the object of pasting out of the ladder program 200 displayed on the user interface unit 18. The pasting object specifying unit 101 may be configured to store the partial circuit specified as the object of pasting into a temporary storage area on, for example, the RAM 12, for storing the partial circuit as the object of pasting.

[0055] The reference area specifying unit 102 is a function means for specifying a reference area to serve as a reference for pasting the partial circuit as the object of pasting, out of the ladder program 200 displayed on the user interface unit 18. The reference area specifying unit 102 can specify the reference area based on at least one or more of the rectangular areas, out of the area occupied by the ladder program 200. The reference area specified by the reference area specifying unit 102 may be allowed to be specified by selecting some rectangular areas of the area in which the ladder program 200 is displayed by operating, for example, a pointing device, such as a cursor key or a mouse, in the user interface unit 18. Alternatively, the reference area may be allowed to be specified by inputting the signs put on the rows and columns of the rectangular areas. The reference area specifying unit 102 may be configured to store the specified reference area into a temporary storage area on, for example, the RAM 12, for storing the reference area.

[0056] The pasting method specifying unit 103 is a function means for specifying a method for pasting the partial circuit as the object of pasting specified by the pasting object specifying unit 101, based on the reference area specified as a reference by the reference area specifying unit 102. The pasting method specifying unit 103 can specify at least the direction (upward, downward, leftward, or rightward) in which the partial circuit as the object of pasting is pasted on the reference area and the relationship (AND/OR) in which the partial circuit as the object of pasting is pasted on the reference area, as the specifying method. The pasting method specifying unit 103 may be configured to be able to specify the pasting method by operating a menu or the like displayed on the user interface unit 18 or by operating a function key or the like, for example. The pasting method specifying unit 103 may be configured to store the specified pasting method into a temporary storage area on, for example, the RAM 12, for storing the pasting method.

[0057] The pasting area insertion unit 104 is a function means for inserting a pasting area for pasting the partial circuit as the object of pasting, based on the reference area in the virtual drawing area specified as a reference position by the reference area specifying unit 102. The pasting area insertion unit 104 inserts the columns and rows of the rectangular areas into base point positions depending on the size of the partial circuit as the object of pasting, based on, as base points, the lower left corner of the reference area if the pasting method specified by the pasting method specifying unit 103 is insertion into the left side in AND, the upper right corner of the reference area if the specified pasting method is insertion into the upper side in OR, and the lower right corner of the reference area for other cases. If vertical connecting lines are drawn between the reference area and the rectangular areas outside the reference area in inserting the columns, the pasting area insertion unit 104 inserts the columns of the rectangular areas between the connecting lines (vertical lines) and the reference area.

[0058] The pasting processing unit 105 is a function means for pasting the partial circuit as the object of pasting on the pasting area in the virtual drawing area inserted by the pasting area insertion unit 104. If the pasting method specified by the pasting method specifying unit 103 is insertion into the left side in AND or insertion into the right side in AND, the pasting processing unit 105 pastes the partial circuit as the object of pasting on the pasting area so that the respective upper sides of the reference area and the partial circuit as the object of pasting are aligned with each other. Moreover, if the pasting method specified by the pasting method specifying unit 103 is insertion into the lower side in OR or insertion info the upper side in OR, the pasting processing unit 105 pastes the partial circuit as the object of pasting on the pasting area so that the respective left sides of the reference area and the partial circuit as the object of pasting are aligned with each other.

[0059] The connecting line adjustment unit 106 is a function means for adjusting (interpolating and deleting) the connecting lines drawn between the circuits when the pasting area is inserted by the pasting area insertion unit 104 and when the partial circuit as the object of pasting is inserted into the pasting area by the pasting processing unit 105. The connecting line adjustment unit 106 interpolates the connecting lines divided by the pasting area for the rectangular areas outside the range in which the circuit in the inserted pasting area is pasted when the pasting area is inserted by the pasting area insertion unit 104. Moreover, the connecting line adjustment unit 106 interpolates the vertical connecting lines divided by the insertion, by the pasting area insertion unit 104, of the columns of the rectangular areas between the reference area and the connecting lines (vertical lines) drawn between the rectangular areas, between the reference area and the inserted columns within the ranges of the selected areas.

[0060] Furthermore, the connecting line adjustment unit 106 deletes superfluous connecting lines at the left and right ends of the pasted circuit if the pasting method is insertion in AND when the partial circuit as the object of pasting is inserted into the pasting area by the pasting processing unit 105. If the pasting method is insertion in OR and if the partial circuit as the object of pasting is horizontally shorter than the reference area, the connecting line adjustment unit 106 interpolates horizontal connecting lines to deficient parts. Moreover, the connecting line adjustment unit 106 adds vertical connecting lines from the left and right ends of the pasted circuit toward the reference area within the range of the ladder circuit so that they are connected to any of the elements.

[0061] The following is an illustration of processing performed by the individual function means of the editing control unit 100.

[0062] FIG. 3 is a flowchart illustrating a processing flow in the case where insertion into the lower side in OR is specified as the pasting method, in processing performed by the function means of the editing control unit 100.

[0063] [Step SA01]

[0064] The pasting area insertion unit 104 acquires the rows and columns of the partial circuit as the object of pasting.

[0065] [Step SA02]

[0066] The pasting area insertion unit 104 acquires the rows and columns of the reference area.

[0067] [Step SA03]

[0068] The pasting area insertion unit 104 inserts a free row corresponding to the number of rows of the partial circuit as the object of pasting into the lower side of the reference area.

[0069] [Step SA04]

[0070] The connecting line adjustment unit 106 interpolates the vertical connecting lines divided by the insertion of the free row.

[0071] [Step SA05]

[0072] The pasting area insertion unit 104 determines whether or not the number of columns of the partial circuit as the object of pasting is larger than that of the reference area. If the number of columns of the partial circuit as the object of pasting is larger than that of the reference area, the processing proceeds to Step SA06. If not, the processing proceeds to Step SA08.

[0073] [Step SA06]

[0074] The pasting insertion unit 104 performs processing for inserting columns into the right side of the reference area. Details of this processing will be described later.

[0075] [Step SA07]

[0076] The connecting line adjustment unit 106 interpolates the horizontal connecting lines divided by the insertion of the free row.

[0077] [Step SA08]

[0078] The pasting processing unit 105 pastes the partial circuit as the object of pasting on the inserted pasting area.

[0079] [Step SA09]

[0080] The connecting line adjustment unit 106 determines whether or not the number of columns of the partial circuit as the object of pasting is smaller than that of the reference area. If the number of columns of the partial circuit as the object of pasting is smaller than that of the reference area, the processing proceeds to Step SA10. If not, the processing proceeds to Step SA11.

[0081] [Step SA10]

[0082] The connecting line adjustment unit 106 interpolates the horizontal connecting lines from the circuit at the upper right end in the partial circuit pasted on the pasting area to the right end of the reference area.

[0083] [Step SA11]

[0084] The connecting line adjustment unit 106 interpolates the vertical connecting lines upward from the circuits at opposite ends in the partial circuit pasted on the pasting area.

[0085] FIG. 4 is a flowchart illustrating a processing flow in the case where insertion into the upper side in OR is specified as the pasting method, in processing performed by the function means of the editing control unit 100.

[0086] [Step SB01]

[0087] The pasting area insertion unit 104 acquires the rows and columns of the partial circuit as the object of pasting.

[0088] [Step SB02]

[0089] The pasting area insertion unit 104 acquires the rows and columns of the reference area.

[0090] [Step SB03]

[0091] The pasting area insertion unite 104 inserts a free row corresponding to the number of rows of the partial circuit as the object of pasting into the upper side of the reference area.

[0092] [Step SB04]

[0093] The connecting line adjustment unit 106 interpolates the vertical connecting lines divided by the insertion of the free row.

[0094] [Step SB05]

[0095] The pasting area insertion unit 104 determines whether or not the number of columns of the partial circuit as the object of pasting is larger than that of the reference area. If the number of columns of the partial circuit as the object of pasting is larger than that of the reference area, the processing proceeds to Step SB06. If not, the processing proceeds to Step SB08.

[0096] [Step SB06]

[0097] The pasting area insertion unit 104 performs processing for inserting columns into the right side of the reference area. Details of this processing will be described later.

[0098] [Step SB07]

[0099] The connecting line adjustment unit 106 interpolates the horizontal connecting lines divided by the insertion of the free row.

[0100] [Step SB08]

[0101] The pasting processing unit 105 pastes the partial circuit as the object of pasting on the inserted pasting area.

[0102] [Step SB09]

[0103] The connecting line adjustment unit 106 determines whether or not the number of columns of the partial circuit as the object of pasting is smaller than that of the reference area. If the number of columns of the partial circuit as the object of pasting is smaller than that of the reference area, the processing proceeds to Step SB10. If not, the processing proceeds to Step SB11.

[0104] [Step SB10]

[0105] The connecting line adjustment unit 106 interpolates the horizontal connecting lines from the circuit at the upper right end in the partial circuit pasted on the pasting area to the right end of the reference area.

[0106] [Step SB11]

[0107] The connecting line adjustment unit 106 interpolates the vertical connecting lines downward from the circuits at opposite ends in the partial circuit pasted on the pasting area.

[0108] FIG. 5 is a flowchart illustrating a processing flow in the case where insertion into the left side in AND is specified as the pasting method, in processing performed by the function means of the editing control unit 100.

[0109] [Step SC01]

[0110] The pasting area insertion unit 104 acquires the rows and columns of the partial circuit as the object of pasting.

[0111] [Step SC02]

[0112] The pasting area insertion unit 104 acquires the rows and columns of the reference area.

[0113] [Step SC03]

[0114] The pasting area insertion unit 104 determines whether or not the number of rows of the partial circuit as the object of pasting is larger than that of the reference area. If the number of rows of the partial circuit as the object of pasting is larger than that of the reference area, the processing proceeds to Step SC04. If not, the processing proceeds to Step SC06.

[0115] [Step SC04]

[0116] The pasting area insertion unit 104 inserts a free row into the lower side of the reference area so that the partial circuit as the object of pasting can be inserted.

[0117] [Step SC05]

[0118] The connecting line adjustment unit 106 interpolates the vertical connecting lines divided by the insertion of the free row.

[0119] [Step SC06]

[0120] The pasting area insertion unit 104 performs processing for inserting columns into the left side of the reference area. Details of this processing will be described later.

[0121] [Step SC07]

[0122] The pasting processing unit 105 pastes the partial circuit as the object of pasting on the inserted pasting area.

[0123] [Step SC08]

[0124] The connecting line adjustment unit 106 deletes deletable vertical connecting lines.

[0125] FIG. 6 is a flowchart illustrating a processing flow in the case where insertion into the right side in AND is specified as the pasting method, in processing performed by the function means of the editing control unit 100.

[0126] [Step SD01]

[0127] The pasting area insertion unit 104 acquires the rows and columns of the partial circuit as the object of pasting.

[0128] [Step SD02]

[0129] The pasting area insertion unit 104 acquires the rows and columns of the reference area.

[0130] [Step SD03]

[0131] The pasting area insertion unit 104 determines whether or not the number of rows of the partial circuit as the object of pasting is larger than that of the reference area. If the number of rows of the partial circuit as the object of pasting is larger than that of the reference area, the processing proceeds to Step SD04. If not, the processing proceeds to Step SD06.

[0132] [Step SD04]

[0133] The pasting area insertion unit 104 inserts a free row into the lower side of the reference area so that the partial circuit as the object of pasting can be inserted.

[0134] [Step SD05]

[0135] The connecting line adjustment unit 106 interpolates the vertical connecting lines divided by the insertion of the free row.

[0136] [Step SD06]

[0137] The pasting area insertion unit 104 performs processing for inserting columns into the right side of the reference area. Details of this processing will be described later.

[0138] [Step SD07]

[0139] The pasting processing unit 105 pastes the partial circuit as the object of pasting on the inserted pasting area.

[0140] [Step SD08]

[0141] The connecting line adjustment unit 106 deletes deletable vertical connecting lines.

[0142] FIG. 7 is a flowchart illustrating a flow of processing for inserting columns into the left side.

[0143] [Step SE01]

[0144] The pasting area insertion unit 104 retrieves the lowest rectangular area in which an instruction and a horizontal connecting line are input for the left-end column in the reference area and stores it as an instruction end row.

[0145] [Step SE02]

[0146] The pasting area insertion unit 104 inserts columns into the left side of the reference area. If vertical connecting lines are drawn between the reference area and the rectangular areas outside the reference area in inserting the columns, the pasting area insertion unit 104 inserts the columns of the rectangular areas between the connecting lines (vertical lines) and the reference area.

[0147] [Step SE03]

[0148] The connecting line adjustment unit 106 interpolates the vertical connecting lines from a first row to the instruction end row at the left end of the reference area.

[0149] FIG. 8 is a flowchart illustrating a flow of processing for inserting columns into the right side.

[0150] [Step SF01]

[0151] The pasting area insertion unit 104 retrieves the lowest rectangular area in which an instruction and a horizontal connecting line are input for the right-end column in the reference area and stores it as an instruction end row.

[0152] [Step SF02]

[0153] The pasting area insertion unit 104 inserts columns into the right side of the reference area. If vertical connecting lines are drawn between the reference area and the rectangular areas outside the reference area in inserting the columns, the pasting area insertion unit 104 inserts the columns of the rectangular areas between the connecting lines (vertical lines) and the reference area.

[0154] [Step SF03]

[0155] The connecting line adjustment unit 106 interpolates the vertical connecting lines from the first row to the instruction end row at the right end of the reference area.

[0156] According to the ladder program editor 1 of the present embodiment described above, the insertion of the pasting area and the interpolation of the connecting lines, which have so far been performed manually, are performed automatically in the partial circuit pasting operation in the prior art ladder program editing shown in FIGS. 14 to 16, so that the burden on the operator who creates the ladder program can be reduced.

[0157] In the ladder program editor 1 of the present embodiment, as described above, the partial circuit can be inserted into the ladder circuit by processing on the virtual drawing area in which the ladder diagram is drawn. Therefore, as illustrated in FIGS. 9 to 11, the partial circuit can be inserted into the ladder circuit in the middle of editing. In the case of FIG. 9, for example, the logical relationship between a first-row, first-column contact and a second-row, second-column contact is not determined in the ladder circuit as the pasting destination, so that the insertion processing cannot be performed using a logical expression. However, according to the ladder program editor 1 of the present embodiment, the partial circuit can be inserted into an incomplete ladder circuit by securing the pasting area in the virtual drawing area, pasting the partial circuit, and interpolating the connecting lines.

[0158] Moreover, in the ladder program editor 1 of the present embodiment, as described above, the partial circuit can be inserted into the ladder circuit by the processing on the virtual drawing area in which the ladder diagram is drawn. Therefore, as illustrated in FIGS. 12 and 13, the partial circuit of which the relationship with a specified contact is defined can easily be inserted into a plurality of contacts in OR-relationship. In FIG. 12, the partial circuit is inserted into two upper ones of three contacts in OR-relationship so as to be in AND-relationship with them. In FIG. 13, the partial circuit is inserted into two lower ones of the three contacts in OR-relationship so as to be in AND-relationship with them. In either case, it can be ascertained that the partial circuit can be inserted in an appropriate configuration.

[0159] While an embodiment of the present invention has been described herein, the invention is not limited to the above-described embodiment and may be suitably modified and embodied in other forms.