Tracing apparatus

A tracing apparatus communicably connected to a programmable logic controller (PLC) that inputs and outputs a signal based on a ladder program, includes a constituent element setting unit configured to set a plurality of constituent elements to be traced among the constituent elements of the ladder program, a tracing data acquisition unit configured to acquire tracing data indicating a signal state of the constituent element at a specified timing, at a predetermined sampling cycle, a section detection unit configured to detect a sampling cycle section in which two or more of the acquired tracing data corresponding to the constituent elements simultaneously change, a change sequence calculation unit configured to calculate change sequence of signals of the constituent elements simultaneously changing in the detected sampling cycle section, and a change sequence output unit configured to output the calculated change sequence of the signals of the constituent elements.

This application is based on and claims the benefit of priority from Japanese Patent Application No. 2018-146568, filed on 3 Aug. 2018, the content of which is incorporated herein by reference.

BACKGROUND OP THE INVENTION

Field of the Invention

The present invention relates to a tracing apparatus employing a sequence control program.

Related Art

Recently, a control system of a machine tool control apparatus using a programmable logic controller (PLC) has been known. For example, a machine tool and a robot used in machining are respectively controlled by a control apparatus. The machine tool control apparatus refers to a control apparatus for a common machine tool such as a lathe or a machining center. For a dedicated machine tool designed for a specific use, a PLC software is executed by a machine tool control apparatus.

A PLC controls a machine tool control apparatus by executing a ladder program. A debugging apparatus verifies whether control can be performed as expected with a ladder program (for example, see Patent Documents 1 and 2). Furthermore, when a phenomenon unexpected to a user occurs in the operation of a PLC, there is a known method of investigating a signal which causes the phenomenon by using a tracing function provided by a tracing apparatus.

SUMMARY OF THE INVENTION

The tracing function includes a sampling cycle, and signal changes within the cycle are treated as signal changes at the same timing. Therefore, the sequence of signal changes within the cycle cannot be determined from tracing results.

An object of the present invention is to provide a tracing apparatus which is capable of determining the sequence of signal changes within a cycle from tracing results.

(1) A tracing apparatus (for example, a tracing apparatus100described later) communicably connected to a programmable logic controller (PLC) (for example, a PLC400described later) that inputs and outputs a signal based on a sequence control program (for example, a ladder program described later) according to the present invention includes a constituent element setting unit (for example, a constituent element setting unit111described later) configured to set a plurality of constituent elements to be traced among the constituent elements of the sequence control program, a tracing data acquisition unit (for example, a tracing data acquisition unit112described later) configured to acquire tracing data indicating a signal state of the constituent element at a specified timing, at a predetermined sampling cycle, a section detection unit (for example, a section detection unit113described later) configured to detect a sampling cycle section in which two or more of the tracing data corresponding to the constituent elements acquired by the tracing data acquisition unit simultaneously change, a change sequence calculation unit (for example, a change sequence calculation unit114described later) configured to calculate change sequence of signals of the constituent elements simultaneously changing in the sampling cycle section detected by the section detection unit, and a change sequence output unit (for example, a change sequence output unit115described later) configured to output the change sequence of the signals of the constituent elements calculated by the change sequence calculation unit.

(2) In the tracing apparatus described in (1), the change sequence output unit may explicitly output the change sequence of the signals of the constituent elements together with the tracing data to a display unit (for example, a display unit140described later).

(3) In the tracing apparatus described in (2), the change sequence output unit may enlarge the sampling cycle section detected by the section detection unit to output the change sequence of the signals of the constituent elements.

(4) In the tracing apparatus described in (3), the change sequence output unit may output the change sequence of the signals of the constituent elements as an indication according to a change time.

(5) in the tracing apparatus described in any one of (2) to (4), the change sequence output unit may output a number corresponding to the change sequence of the signals of the constituent elements.

In the tracing apparatus described in any one of (1) to (5), the change sequence output unit may output the change sequence of the signals of the constituent elements together with the tracing data to a file.

(7) in the tracing apparatus described in any one of (1) to (6), the tracing apparatus may be included in the PLC.

According to the present invention, it is possible to provide a tracing apparatus which is capable of determining the sequence of signal changes within a cycle from tracing results.

DETAILED DESCRIPTION OF THE INVENTION

Embodiment

First, an outline of an embodiment of the present invention will be described. The present embodiment relates to a tracing apparatus communicably connected to a PLC that inputs and outputs a signal based on a ladder program, which indicates tracing results obtained as a result of executing the ladder program so as to determine the sequence of signal changes within a cycle.

The configurations of a tracing system1000and a tracing apparatus100according to the present embodiment will be described with reference toFIG. 1.FIG. 1is a schematic view of the basic configuration of and a functional block diagram of the tracing apparatus100of the present embodiment. The tracing system1000shown inFIG. 1as the basic configuration of the present embodiment includes the tracing apparatus100and a PLC400. In the tracing system1000, when a plurality of constituent elements to be traced are set among the constituent elements included in a ladder program executed in the PLC400, the tracing apparatus100displays the sequence in which the signals of the constituent elements to be traced change in a section in which the tracing data of the signals simultaneously change. The constituent elements refer to a contact and a coil (circuit) defined in the ladder program. The tracing apparatus100and the PLC400are communicably connected to each other through, for example, a direct connection via a connection interface.

The tracing apparatus100detects a sampling cycle section in which two or more of the tracing data corresponding to the constituent elements simultaneously change. The tracing apparatus100calculates the change sequence of the signals of the constituent elements simultaneously changing in the detected sampling cycle section. Then, the tracing apparatus100outputs the calculated change sequence of the signals of the constituent elements to, for example, a display unit140. The tracing apparatus100is, for example, a personal computer (PC).

The tracing apparatus100includes a control unit110, a storage unit120, an input unit130, a display unit140, and a communication interface unit150. The control unit110may be a central processing unit (CPU), and performs overall control of the tracing apparatus100by executing various programs for controlling the tracing apparatus100stored in the storage unit120. The control unit110includes a constituent element setting unit111, a tracing data acquisition unit112, a section detection unit113, a change sequence calculation unit114, and a change sequence output unit115. Each of these function units is fulfilled by the control unit110executing a program stored in the storage unit120.

In the constituent element setting unit111, a plurality of constituent elements to be traced are set through, for example, the input unit130among the constituent elements included in a ladder program executed in the PLC400. The constituent element setting unit111may set one or more contacts and one or more coils as the constituent elements, or may set only a plurality of contacts or coils. The control unit110has the set constituent elements stored in the constituent element storage unit122. The tracing data acquisition unit112acquires tracing data indicating a signal state of the constituent element at a specified timing, at a predetermined sampling cycle. The tracing data acquisition unit112acquires tracing data from, for example, the PLC400. The tracing data indicates a signal state (ON/OFF) of each of the set constituent elements and is acquired at a specified timing. The control unit110has the acquired tracing data stored in the tracing data storage unit123.

The section detection unit113detects a sampling cycle section in which two or more of the tracing data corresponding to the constituent elements acquired by the tracing data acquisition unit112simultaneously change. The change sequence calculation unit114calculates the change sequence of the signals of the constituent elements simultaneously changing in the sampling cycle section detected by the section detection unit113. The change sequence calculation unit114calculates the change sequence of the signals of the constituent elements simultaneously changing in the sampling cycle section based on, for example, a ladder diagram (ladder) representing the content of a ladder program. The change sequence output unit115outputs the change sequence of the signals of the constituent elements calculated by the change sequence calculation unit14to, for example, the display unit140. The change sequence output unit115may output, for example, the change sequence of the signals of the constituent elements together with the tracing data to the display unit140.

The storage unit120is a storage area that stores programs executed by the control unit110, and others. The storage unit120includes a program storage unit121, a constituent element storage unit122, and a tracing data storage unit123. The program storage unit121is, for example, a storage area that stores programs for executing various functions of the control unit110described above. The constituent element storage unit122is a storage area that stores the constituent elements to be traced set through the input unit130. The tracing data storage unit123is a storage area that stores acquired tracing data.

The input unit130is an input device such as a keyboard, a mouse, or a button such as a switch button. The display unit140is a display device, and is composed of, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), or the like. A touch panel or a display device in which the input unit130and the display unit140are integrated may be provided. The communication interface unit150is a communication control device composed of, for example, a predetermined connector such as a connector for RS232C and for directly connecting with the PLC400.

The tracing apparatus100may not be a PC, and may be provided in a machine tool control apparatus. For example, if the tracing apparatus100is provided in a machine tool control apparatus, it includes a function unit specific to a machine tool control apparatus in addition to the above-described function units, but the description is omitted because the function unit is known to those skilled in the art.

The PLC400is an apparatus that inputs and outputs a signal by executing a program that has been commanded, such as a ladder program. The PLC400includes a CPU, a memory, a communication unit, or the like for performing various controls, arithmetic processing, and communication processing according to a ladder program, but they are not shown.

Prior to describing the processing of the tracing apparatus100of the present embodiment, tracing results of a conventional tracing apparatus at the time of executing a ladder program will be described.FIG. 2is a diagram showing an example ladder used in the description of the present embodiment.FIG. 7is a graph showing tracing results of a conventional tracing apparatus. A ladder20shown inFIG. 2shows the content of the processing of a ladder program. Constituent elements A to E are indicated in the ladder20. In the ladder20, when the signal of the constituent element A becomes ON, the signals of the constituent elements B to D become ON and the signal of the constituent element E becomes OFF.

FIG. 7shows the tracing results90that are the execution results of the ladder program in the ladder20. As shown in the tracing results90inFIG. 7, in the sampling cycle section X, the signals of the constituent elements A to D changes from OFF to ON, the signal of the constituent element E changes from ON to OFF, and the signals of the constituent elements A to E simultaneously change. In this instance, for example, the sequence of the constituent elements A and E in the section X actually depends on the net sequence. However, the tracing results90show that the signal states of the constituent elements A and E change at the same time; thus, the sequence of the signal changes of the constituent elements A and E is not known.

The tracing results of the tracing apparatus100according to the present embodiment at the time of executing the ladder program will be described.FIG. 3is a flow chart showing the tracing processing of the tracing apparatus100according to the present embodiment.FIGS. 4 and 5are graphs showing tracing results of the tracing apparatus100according to the present embodiment.

In step S10(hereinafter, step S is simply referred to as S) inFIG. 3, the control unit110(the constituent element setting unit111) of the tracing apparatus100sets a plurality of constituent elements to be traced among the constituent elements of the ladder program through, for example, the input unit130. The control unit110may, for example, have the ladder (seeFIG. 2) of the ladder program to be traced displayed on the display unit140and accept a plurality of constituent elements through the input unit130to set the plurality of constituent elements. In addition, the control unit110may set a plurality of the constituent elements by setting all of the constituent elements of the ladder program and selecting constituent elements to be excluded. The control unit110has the set constituent elements stored in the constituent element storage unit122.

In S11, the control unit110(the tracing data acquisition unit112) acquires tracing data indicating a signal state of the constituent element at a specified timing, at a predetermined sampling cycle. The tracing data acquisition unit112, for example, acquires the tracing data of the respective constituent elements obtained by executing the ladder program to be traced from the PLC400. Then, the control unit110has the acquired tracing data stored in the tracing data storage unit123. In S12, the control unit110(the section detection unit113) detects a sampling cycle section in which two or more of the tracing data corresponding to the constituent elements acquired by the tracing data acquisition unit112simultaneously change. For example, in the case of the tracing data of the ladder20inFIG. 2, the section X of the tracing results90inFIG. 7is detected.

In S13ofFIG. 3, the control unit110(the change sequence calculation unit114) calculates the sequence in which the signals of the constituent elements change in the detected section. The control unit110analyzes the ladder and calculates the sequence in which the signals of the constituent elements change according to the processing flow. In the ladder20inFIG. 2, if all of the constituent elements A to E are set, the control unit110calculates the change sequence of the signal of the constituent element A as the first, that of the constituent elements B and C as the second, that of the constituent element D as the third, and that of the constituent element E as the fourth. In S14, the control unit110(the change sequence output unit115) outputs the calculated sequence in which the signals of the constituent elements change. For example, the control unit110has the change sequence displayed on the display unit140. Subsequently, the control unit110ends the present processing.

Specific examples of tracing results will be described.

Specific Example 1

FIG. 4shows an example of displayed tracing results. In the tracing results40inFIG. 4, the tracing data is displayed by enlarging the section X as compared to the other sections. The tracing results40indicate the sequence in which the signals of the constituent elements change using arrows, and indicate the ON/OFF of the signals by displacing the positions of the signal changes in the change sequence. The tracing results40indicate the tracing data corresponding to the constituent elements, and explicitly indicate the change sequence by displacing the positions of the signal changes. Therefore, in the tracing results40, the sequence in which the signals change within the cycle can be determined.

Specific Example 2

FIG. 5shows another example of displayed tracing results. In the tracing results50inFIG. 5, the sequence in which the signals of the constituent elements change is indicated in the section X, with numerals52ato52e. The change sequence display section51displays the change sequence in the form of “a constituent element→a constituent element”. The tracing results50explicitly indicate the change sequence by numerically indicating the change sequence on the tracing data corresponding to the constituent elements. Therefore, in the tracing results50, the sequence in which the signals change within the cycle can be determined.

Specific Example 3

A ladder program differing from the above-described specific examples 1 and 2 will be described.FIG. 6Ais a diagram showing another example ladder used in the description of the present embodiment.FIG. 6Bis a graph showing tracing results of the tracing apparatus100of the present embodiment. The ladder220shown inFIG. 6Ashows an example of the processing content of the ladder program at the sampling cycle221. In the ladder220, nets1,2,99, and100are shown, and constituent elements A to G are shown. In the ladder220, when the signal of the constituent element A becomes ON, the signals of the constituent elements B to D become ON, and the signal of the constituent element E becomes OFF. Furthermore, when the signal of the constituent element F becomes ON, the signal of the constituent element G becomes ON.

FIG. 6Bshows the tracing results240that are the execution results of the ladder program shown in the ladder220. Prior to the output of the tracing results240, constituent elements A to E are set as a plurality of constituent elements by the constituent element setting unit111. In the sampling cycle section Y, the signals of the constituent elements A to D change from OFF to ON, the signal of the constituent element E changes from ON to OFF, and the signals of the constituent elements A to E change at the same time. Then, the control unit110enlarges the section Y as compared to the other sections. The control unit110calculates an approximate time until the signal of each of the constituent elements changes based on the sampling cycle221and the position of the signal change on the program, and displays the tracing result240at a length based on the calculation result.

In this regard, if the sampling cycle is c and the total net is n, the time t until the signal of the constituent element in the mth net changes is represented by the following equation:
t=c×m/n

If the sampling cycle221is 10 msec and the total net is 100, the time until the signal of the constituent element B changes is 10× 1/100=0.1 msec. In contrast, the time until the signal of the constituent element E changes is 10× 99/100=9.9 msec. The length241between the constituent element A and the constituent element B is set at a length corresponding to 0.1 when the length of the section Y is set at 10. The length242between the constituent element A and the constituent element E is set at a length corresponding to 9.9 when the length of the section Y is set at 10. The tracing results240indicate the sequence in which the signals of the constituent elements change by using arrows. The tracing results240inFIG. 6Bindicate tracing data corresponding to the constituent elements, by displacing the position of the signal change by a length based on the approximate time until the signal change. Therefore, the tracing results240enable the sequence of the signal changes within the cycle to be determined in more detail, including the timing.

Thus, in the tracing system1000, the tracing apparatus100detects a sampling cycle section in which two or more of the tracing data of the constituent elements simultaneously change, and calculates and outputs the sequence in which the signals of the constituent elements change in the detected section. Therefore, the visibility of the tracing results output by the tracing apparatus100is improved. As a result, the time for analysis of signal correlation can be reduced.

In addition, in the present embodiment, the change sequence can be easily recognized by, in the tracing results, lengthening the section and showing the displaced positions of the signal changes in the change sequence or numerically indicating the change sequence. Furthermore, in the present embodiment, the tracing results are displayed not only in the change sequence but also by expressing the timing of change in terms of the ratio of length, thereby making it easier to recognize the timing of change.

Programs including operating programs used in the present invention may be stored using various types of non-transitory computer readable media and supplied to a computer. The non-transitory computer readable media include various types of tangible storage media. Examples of non-transitory computer readable media include magnetic recording media (e.g., flexible disks, magnetic tapes, hard disk drives), magneto-optical recording media (e.g., magneto-optical disks), CD-ROMs (read only memories), CD-Rs, CD-R/Ws, semiconductor memories (e.g., mask ROMs, PROMs (programmable ROMs), EPROMs (erasable PROMs), flash ROMs, RAMs (random access memories)). The programs may also be supplied to a computer by various types of transitory computer readable media. Examples of the transitory computer readable media include electric signals, optical signals, and electromagnetic waves. The transitory computer readable media can provide programs to a computer via wired communication paths such as electrical wires and optical fibers, or via radio communication paths.

The above-described embodiment is a preferred embodiment of the present invention, but the scope of the present invention is not limited to the above-described embodiment only. The present invention can be implemented in a form in which various modifications are made within a scope that does not depart from the gist of the present invention.

In the embodiment described above, the tracing apparatus is connected to the PLC, but the present invention is not limited thereto. The PLC may include a function of the tracing apparatus.

In the above-described embodiment, a ladder logic program is described as the sequence control program, but the present invention is not limited thereto. For example, the program may be another sequence control program such as a sequential function chart (SFC) logic.

In the above-described embodiment, tracing results including change sequence are displayed on the display unit, but the present invention is not limited thereto. The tracing results may be output to a file as data.

EXPLANATION OF REFERENCE NUMERALS

111CONSTITUENT ELEMENT SETTING UNIT

112TRACING DATA ACQUISITION

113SECTION DETECTION UNIT

114CHANGE SEQUENCE CALCULATION UNIT

115CHANGE SEQUENCE OUTPUT UNIT

122CONSTITUENT ELEMENT STORAGE UNIT

123TRACING DATA STORAGE UNIT