Programming device
The programming device uses extraction and determination units to identify and notify errors in PLC ladder programs, addressing the challenge of mistakenly placed reference circuits, improving editing efficiency and accuracy.
Patent Information
- Application Number
- PCT/JP2024/006085
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-02-20
- Publication Date
- 2025-08-28
AI Technical Summary
Existing PLC programming devices struggle to quickly and accurately detect errors in ladder programs where a reference circuit is mistakenly placed before an output circuit due to program editing errors, making it difficult to identify and correct such issues promptly.
A programming device equipped with a reference circuit extraction unit, output circuit extraction unit, and positional relationship determination unit to identify and warn users when a reference circuit is positioned before an output circuit, providing notifications based on variable names or addresses.
The device efficiently detects and alerts users to such errors, reducing the time required to identify and correct programming mistakes, thereby enhancing the accuracy and efficiency of ladder program editing.
Smart Images

Figure JP2024006085_28082025_PF_FP_ABST
Abstract
Description
programming device
[0001] The present disclosure relates to programming devices, and more particularly to PLC programming devices that detect signal references from previous cycles.
[0002] Programmable logic controllers (PLCs) used for sequence control, etc., often use an execution method in which the same control program is executed repeatedly in cycles. In particular, ladder programs often use programs that store the calculation results of the previous cycle in static variables and refer to them in the next cycle.
[0003] The ladder diagram in Figure 1 shows an example of a ladder program that is executed repeatedly (periodic processing). The vertical lines on both the left and right ends of the ladder diagram are called "buses," and the horizontal lines connecting the buses are called "rules" or "nets." The way the two buses are connected by multiple nets resembles a ladder, which is why it is called a "ladder diagram" or "ladder program." In a ladder program, processing generally proceeds from left to right and from top to bottom of the ladder diagram.
[0004] In the ladder diagram of Figure 1, "contacts" are located to the left of the nets. The contacts take two states, connected or disconnected, depending on the reference signal. The contact symbols are modeled after the contacts of electromagnetic relays, pushbuttons, and other devices used in electrical control before the advent of PLC. There are two types of contacts: contacts that are open (disconnected) when no reference signal is applied (e.g., when a reference current above a certain level is not flowing) (also called "A contacts" or "normally open contacts"), and contacts that are closed (connected) when no reference signal is applied (also called "B contacts" or "normally closed contacts"). In the ladder diagram of Figure 1, contact X1 in the first net is an A contact, and contact R1 is a B contact. Furthermore, contacts Y1 and R1 in the second net are both A contacts. Contacts can be arranged in series (AND) as in the first net in the ladder diagram of Figure 1, or in parallel (OR) as in the second net.
[0005] Also, in the ladder diagram of Figure 1, a "coil" is placed to the right of the net. The "coil" is modeled after the coil wound around the iron core of an electromagnet, which is a component of an electromagnetic relay. The output signals of the coils (e.g., Y1 in the first net and R1 in the second net) are signal-referenced from contacts of the same name. For example, in the ladder program shown in Figure 1, the output signal of coil Y1 in the first net is signal-referenced from contact Y1 in the second net, and the output signal of coil R1 in the second net is signal-referenced from contact R1 in the first net and contact R1 in the second net.
[0006] In the ladder diagram of Figure 1, the character strings "X1", "Y1", and "R1" written above the contacts and coils are names given to signals (signals referenced by the contacts or signals output by the coils) and correspond to variable names in general programming languages. Furthermore, signals are managed by their own addresses, so variable names and addresses always come in pairs.
[0007] The time it takes for the ladder program to complete one cycle from left to right and top to bottom is called one "cycle (scan)." If the PLC is still running after the first scan, the ladder program will usually not stop, but will continue to run (cyclically process) the second scan, third scan, and so on.
[0008] The operation of the cyclically processed ladder program shown in Figure 1 is as follows: Suppose a reference signal (for example, a reference current above a certain level) is applied to A-contact X1 in the first net of the first cycle (first scan), resulting in a connected state (hereinafter, a state in which a current above a certain level is flowing will be logically expressed as "ON," and a state in which it is not will be expressed as "OFF.") At this time, if no reference signal is applied to B-contact R1 and it is closed (in a connected state), the output signal of coil Y1 will be ON, and in the second net, A-contact Y1, which references the output signal of coil Y1, will be in a connected state, and the output signal of coil R1 will be ON.
[0009] In the first net of the next cycle (second scan), the output signal of coil R1 in the previous cycle is given as a reference signal, so B contact R1 opens (goes into a disconnected state) and the output of coil Y1 turns OFF, and A contact Y1 of the second net opens (goes into a disconnected state), but the A contact R1 in parallel (OR) with A contact Y1 is closed (in a connected state), so the output signal of coil R1 remains ON. In subsequent cycles (third scan and beyond), the reference signal (ON) continues to be given to B contact R1 of the first net, so it is always in an open state (disconnected state), and the output signal of coil Y1 remains OFF.
[0010] To summarize the above, in the periodically processed ladder program shown in Figure 1, after the reference signal of contact X1 turns ON, the output signal of coil Y1 turns ON only in the first scan (first scan), as shown in the right diagram of Figure 1, and from the second scan onwards the output signal of coil Y1 turns OFF.
[0011] In the ladder diagram of Figure 1, B contact R1 of the first net is sometimes called the "reference circuit" because it references the output signal of coil R1. Also, coil R1 of the second net is sometimes called the "output circuit" because it outputs a reference signal to B contact R1 of the first net. The ladder program shown in Figure 1 can be said to be a program intentionally designed by a user of a PLC programming device to have B contact R1 of the first net reference the output signal of coil R1 of the second net in the previous cycle by placing a reference circuit in the first net and an output circuit in the second net for the address of variable R1 or signal R1.
[0012] In ladder programs, the reference circuit is generally placed after the output circuit because its connection / disconnection is controlled by referencing the output signal of the output circuit. However, as in the program shown in Figure 1, there are also programs in which the reference circuit is intentionally placed before the output circuit in order to refer to the calculation results of the previous cycle in the next cycle, so even if the reference circuit is mistakenly placed before the output circuit due to a program editing error, the error is difficult to notice.
[0013] In other words, even if a person debugging a ladder program notices that a reference circuit is placed before an output circuit, it is not possible to immediately determine whether the error is due to a mistake in the program editing process or whether the person who created the ladder program intentionally edited the ladder program in this way. Therefore, even if the error is actually due to a mistake in the program editing process, confirmation is required, which results in the problem that it takes time to notice the error.
[0014] In view of the above problems, there is a need for the development of technology (PLC programming devices) that can quickly and accurately detect errors in programs and issue warnings (warnings) as necessary.
[0015] A programming device for editing a sequence program for a PLC according to one embodiment of the present disclosure includes a reference circuit extraction unit that extracts the position and reference address of a reference circuit in the sequence program, an output circuit extraction unit that extracts the position and destination address of an output circuit in the sequence program, and a positional relationship determination unit that compares the extracted position of the reference circuit with the position of the output circuit and determines the chronological relationship between the reference circuit and the output circuit for the same address, and notifies the device if the reference circuit is located before the output circuit.
[0016] FIG. 1 is a diagram for explaining an example of a ladder program in the background (conventional) technology. FIG. 2 is a block diagram showing a configuration of a PLC programming device (embodiment 1) according to an embodiment of the present disclosure. FIG. 3 is a diagram explaining an example of operation of the PLC programming device (embodiment 1) according to an embodiment of the present disclosure. FIG. 4 is a block diagram showing a configuration of a PLC programming device (embodiment 2) according to another embodiment of the present disclosure. FIG. 5 is a diagram explaining an example of operation of the PLC programming device (embodiment 2) according to another embodiment of the present disclosure. FIG. 6 is a block diagram showing a configuration of a PLC programming device (embodiment 3) according to yet another embodiment of the present disclosure. FIG. 7 is a diagram explaining an example of operation of the PLC programming device (embodiment 3) according to yet another embodiment of the present disclosure.
[0017] Example 1 Hereinafter, one embodiment (Example 1) of the present disclosure will be described with reference to the drawings.
[0018] The sequence program programming device 1 may be realized by one or more computers having hardware such as a processor, memory (ROM, RAM), a large-capacity storage device (HDD, SSD), and an input / output interface connected to a common bus, and executing an appropriate control program. The large-capacity storage device may store a control program (OS and application programs) for causing the hardware to function as the program editing device 1 of this embodiment. As shown in FIG. 2 , when the control program is running, the programming device 1 includes at least the following functional blocks: a sequence program storage unit 10, a reference circuit extraction unit 20, an output circuit extraction unit 30, and a positional relationship determination unit 40. Note that these functional blocks of the programming device 1 merely categorize the functions of the programming device 1 and may not necessarily be clearly distinguishable in terms of the physical configuration and / or program configuration.
[0019] The sequence program storage unit 10 stores a sequence program for the PLC. The stored sequence program is a ladder program written in a ladder language. The sequence program storage unit 10 may be a large-capacity storage device such as a hard disk drive (HDD) or a solid-state drive (SSD). The programming device stores the sequence program in the sequence program storage unit 10 while it is being edited or after it has been edited.
[0020] 2 shows the programming device 1 itself as including the sequence program storage unit 10, but this merely represents one possible embodiment, and this figure should not be interpreted as indicating that the sequence program storage unit 10 is an essential component of the programming device 1. For example, the sequence program storage unit 10 may be implemented on a server external to the programming device 1. In other words, it should be noted that the present disclosure does not particularly limit where and how the sequence program storage unit 10 is implemented, and the sequence program storage unit 10 may be implemented anywhere as long as it is accessible from the programming device 1 in a timely manner.
[0021] The reference circuit extraction unit 20 extracts the position (net) and reference address of the reference circuit from the sequence program being edited or after editing that is stored in the sequence program storage unit 10, and temporarily stores the extracted position (net) and reference address of the reference circuit (details will be described later). The output circuit extraction unit 30 extracts the position (net) and output destination address of the output circuit from the sequence program being edited or after editing that is stored in the sequence program storage unit 10, and temporarily stores the extracted position (net) and output destination address of the output circuit (details will be described later).
[0022] The positional relationship determination unit 40 refers to the position (net) and reference address of the reference circuit temporarily stored by the reference circuit extraction unit 20 and the position (net) and output destination address of the output circuit temporarily stored by the output circuit extraction unit 30 to determine whether the reference circuit is located before the output circuit, and issues a warning if the reference circuit is located before the output circuit (details will be described later).
[0023] Next, with reference to FIG. 3, an example of operation will be described in which the programming device 1 of the sequence program shown in FIG. 2 issues a warning that the reference circuit is located before the output circuit.
[0024] The ladder program shown in the left diagram of Fig. 3 is an example of a sequence program that is being edited or has been edited and is stored in the sequence program storage unit 10. The left diagram of Fig. 3 shows a portion of the ladder program for one cycle (one scan), and the ladder program is processed cyclically over multiple scans.
[0025] The reference circuit extraction unit 20 extracts from the ladder program the position of the circuit that references the signal corresponding to variable B and the address (reference address) of that signal. Specifically, the fifth net (Net5) and the 100th net (Net100) are extracted as positions (nets), and as shown in Figure 3, these positions (nets) are associated with variable B and the reference address and temporarily stored in the reference circuit extraction unit 20.
[0026] The output circuit extraction unit 30 extracts from the ladder program the position (net) of the circuit that outputs the signal corresponding to variable B and the address (output destination address) of the signal. Specifically, the 151st net (Net151) is extracted as the position, and as shown in Figure 3, the position (net) is associated with variable B and the output destination address and temporarily stored in the output circuit extraction unit 30.
[0027] The positional relationship determination unit 40 compares the position (net) temporarily stored in the reference circuit extraction unit 20 with the position (net) temporarily stored in the output circuit extraction unit 30 for the address of the signal corresponding to variable B, and determines the order of the positions. In this case, it is determined that the positions of the reference circuit (Net5 and Net100) are before the position of the output circuit (Net151), so a warning (warning message) is issued to the address of the signal corresponding to variable B, which uses the calculation result of the previous cycle as input data.
[0028] Since it is often easier for users to understand if they are notified of variable names rather than signal addresses, the warning message may include variable names. For example, as shown in the right diagram of Figure 3, a warning message such as "Warning: Net5: Variable B has a reference circuit before the output circuit. Net100: Variable B has a reference circuit before the output circuit" may be displayed on the screen of a display showing a ladder diagram.
[0029] Of course, the manner of warning notification is not limited to this; the message may include the address of the signal instead of the variable name, or both the variable name and the address. Furthermore, various notification modes commonly used for warning notification are possible, including displaying the message in a color that attracts the user's attention, flashing the message, or devising the message content. Notification may also be made by a combination of a screen display and audio. Conversely, if there is no need to particularly emphasize that it is a warning, for example, it may be possible to not display "Warning:" and simply display the fact that the reference circuit is located before the output circuit.
[0030] As a result, if a reference circuit is mistakenly placed before an output circuit due to an operational error or the like during program editing, the programming device can quickly and reliably detect and notify the operator of the error.
[0031] (Example 2) As shown in Figure 4, the programming device 1 may be configured to include, as functional blocks, a sequence program storage unit 10, a reference circuit extraction unit 20, an output circuit extraction unit 30, and a positional relationship determination unit 40, as well as a notification suppression address acquisition unit 51 and a notification suppression unit 60.
[0032] The functions of the sequence program storage unit 10, the reference circuit extraction unit 20, the output circuit extraction unit 30, and the positional relationship determination unit 40 are the same as those in the first embodiment, and therefore will not be described here. The notification suppression address acquisition unit 51 acquires a notification suppression instruction (comment) that the user of the programming device 1 has set in advance to a specific variable and address. The notification suppression instruction (comment) can be set, for example, when the user intentionally places a reference circuit before an output circuit, and is paired with a variable and an address as shown in FIG. 5. The notification suppression address acquisition unit 51 outputs the variable and address that suppress warning notifications, which are paired with the acquired notification suppression instruction (comment), to the notification suppression unit 60.
[0033] The notification suppression unit 60 suppresses output of messages relating to variables and addresses that suppress notification of the warning received from the notification suppression address acquisition unit 51, among the warnings (warning messages) received from the positional relationship determination unit 40. In Fig. 5, the left diagram shows an example of a notification when there is no notification suppression instruction, the middle diagram shows an example of a notification suppression instruction (comment), and the right diagram shows an example of a notification when there is a notification suppression instruction.
[0034] In the example notification on the left side of Fig. 5, there is no notification suppression instruction, so a warning message is displayed on the screen saying "Warning: Net100: Variable B has a reference circuit that precedes the output circuit. Net150: Variable B has a reference circuit that precedes the output circuit." In the example notification on the right side of Fig. 5, a comment for the notification suppression instruction has been set in the addresses of variable B and signal B, so no warning message is displayed at all.
[0035] This allows the user to set variables and addresses for which they want to suppress warning notifications, so if they want to intentionally place a circuit that references a signal corresponding to a specific variable and address before a circuit that outputs the signal corresponding to that variable and address, they can set a notification suppression instruction (comment) to prevent unnecessary warning messages from being displayed, eliminating the need to waste time checking.
[0036] (Example 3) As shown in Figure 6, the programming device 1 may be configured to include, as functional blocks, a sequence program storage unit 10, a reference circuit extraction unit 20, an output circuit extraction unit 30, and a positional relationship determination unit 40, as well as a notification suppression reference circuit acquisition unit 52 and a notification suppression unit 60.
[0037] The functions of the sequence program storage unit 10, the reference circuit extraction unit 20, the output circuit extraction unit 30, and the positional relationship determination unit 40 are the same as those in the first embodiment, so a description thereof will be omitted. The notification suppression reference circuit acquisition unit 52 acquires a notification suppression instruction (net comment) set in advance for a specific net by the user of the programming device 1. The notification suppression instruction (net comment) can be set, for example, when the user intentionally places a reference circuit before an output circuit for the same address, and is set at the position (net) to which the reference circuit placed before the output circuit belongs, as shown in FIG. 7. The notification suppression reference circuit acquisition unit 52 outputs the position (net) of the reference circuit for which the notification of the warning specified in the acquired notification suppression instruction (net comment) is to be suppressed to the notification suppression unit 60.
[0038] The notification suppression unit 60 suppresses output of a message relating to the position (net) of the reference circuit for which notification of the warning received from the notification suppression reference circuit acquisition unit 52 is to be suppressed, among the warnings (warning messages) received from the positional relationship determination unit 40. Fig. 7 shows an example of a notification when there is no notification suppression instruction in the left diagram, and an example of a notification when there is a notification suppression instruction in the right diagram.
[0039] In the notification example on the left side of Fig. 7, since there is no notification suppression instruction, a warning message is displayed on the screen saying "Warning: Net100: Variable B has a reference circuit earlier than the output circuit. Net150: Variable B has a reference circuit earlier than the output circuit." In the notification example on the right side of Fig. 7, since a notification suppression instruction comment is set for Net150, the warning message "Net150: Variable B has a reference circuit earlier than the output circuit." is not displayed, and only the warning message "Warning: Net100: Variable B has a reference circuit earlier than the output circuit." is displayed.
[0040] This allows the user to set the position (net) of the reference circuit for which they want to suppress warning notifications. Therefore, if you want to intentionally place the reference circuit at a specific position (net) before the output circuit, you can set a notification suppression instruction (net comment) to prevent unnecessary warning messages from being displayed, eliminating the need to waste time checking.
[0041] In the second embodiment, for example, when the same variable or signal address is used in multiple places in a single sequence program, notifications related to the variable or signal address can be suppressed all at once. In contrast, in the third embodiment, the positions (nets) of the reference circuit for which notifications are to be suppressed can be individually set, which makes the usability different. Therefore, the second and third embodiments are not mutually exclusive, and although not shown, the programming device 1 may be provided with both the notification suppression address acquisition unit 51 and the notification suppression reference circuit acquisition unit 52.
[0042] According to the above-described embodiments (Examples 1 to 3), the programming device can quickly and accurately detect errors in programs caused by operational errors during program editing, etc., and can issue warnings as necessary.
[0043] The following supplementary note is further disclosed regarding the above embodiment: (Supplementary note 1) A programming device (1) for editing a sequence program for a PLC includes a reference circuit extraction unit (20) that extracts the position and reference address of a reference circuit in the sequence program, an output circuit extraction unit (30) that extracts the position and destination address of an output circuit in the sequence program, and a positional relationship determination unit (40) that compares the extracted positions of the reference circuit and the output circuit and determines the anteroposterior relationship between the reference circuit and the output circuit for the same address, and notifies the user if the reference circuit is located before the output circuit.
[0044] (Supplementary Note 2) The programming device (1) for a sequence program of Supplementary Note 1 may further include a notification suppression address acquisition unit (51) that acquires a notification suppression instruction set at an address used in the sequence program, and a notification suppression unit (60) that suppresses notifications when the address at which the positional relationship determination unit (40) determines that the reference circuit is located before the output circuit matches the address at which the notification suppression instruction acquired by the notification suppression address acquisition unit (51) is set, and the notification related to the address at which the notification suppression instruction is set may be suppressed.
[0045] (Supplementary Note 3) The programming device (1) for a sequence program of Supplementary Note 1 may further include a notification suppression reference circuit acquisition unit (52) that acquires a notification suppression instruction set in a reference circuit of the sequence program, and a notification suppression unit (60) that suppresses a notification when the position of the reference circuit determined by the positional relationship determination unit (40) to be before the output circuit matches the position of the reference circuit for which the notification suppression instruction set is acquired by the notification suppression reference circuit acquisition unit, and may suppress the notification related to the reference circuit for which the notification suppression instruction is set.
[0046] (Supplementary Note 4) A programming method for editing a sequence program for a PLC includes a reference circuit extraction step for extracting the position and reference address of a reference circuit in the sequence program, an output circuit extraction step for extracting the position and destination address of an output circuit in the sequence program, and a positional relationship determination step for comparing the extracted position of the reference circuit with the position of the output circuit to determine the anteroposterior relationship between the reference circuit and the output circuit for the same address, and notifying when the reference circuit is located before the output circuit.
[0047] (Supplementary Note 5) The computer program causes one or more computer devices to function as a programming device for editing a sequence program of a PLC, which includes a reference circuit extraction unit that extracts the position and reference address of a reference circuit in the sequence program, an output circuit extraction unit that extracts the position and destination address of an output circuit in the sequence program, and a positional relationship determination unit that compares the extracted position of the reference circuit with the position of the output circuit and determines the anteroposterior relationship between the reference circuit and the output circuit for the same address, and notifies when the reference circuit is located before the output circuit.
[0048] Although the programming device of the present disclosure has been described in detail above, the present disclosure is not limited to the individual embodiments described above. Various additions, substitutions, modifications, partial deletions, etc. are possible to these embodiments without departing from the gist of the present disclosure or the spirit of the present disclosure derived from the content of the claims and their equivalents.
[0049] REFERENCE SIGNS LIST 1 sequence program programming device 10 sequence program storage unit 20 reference circuit extraction unit 30 output circuit extraction unit 40 positional relationship determination unit 51 notification suppression address acquisition unit 52 notification suppression reference circuit acquisition unit 60 notification suppression unit
Claims
1. A programming device for editing a PLC sequence program, comprising: a reference circuit extraction unit that extracts the position and reference address of a reference circuit in the sequence program; an output circuit extraction unit that extracts the position and destination address of an output circuit in the sequence program; and a positional relationship determination unit that compares the extracted positions of the reference circuit and the output circuit and determines the anteroposterior relationship between the reference circuit and the output circuit for the same address, and notifies the user if the reference circuit is located before the output circuit.
2. The programming device of claim 1, further comprising: a notification suppression address acquisition unit that acquires a notification suppression instruction set at an address used in the sequence program; and a notification suppression unit that suppresses notifications when the address at which the positional relationship determination unit determines that the reference circuit is located before the output circuit matches the address at which the notification suppression instruction acquired by the notification suppression address acquisition unit is set, and suppresses the notifications related to the address at which the notification suppression instruction is set.
3. The programming device of claim 1, further comprising: a notification suppression reference circuit acquisition unit that acquires a notification suppression instruction set in a reference circuit of the sequence program; and a notification suppression unit that suppresses notifications when the position of the reference circuit determined by the positional relationship determination unit to be before the output circuit matches the position of the reference circuit for which the notification suppression instruction set is acquired by the notification suppression reference circuit acquisition unit, and suppresses the notifications related to the reference circuit for which the notification suppression instruction is set.
4. A programming method for editing a PLC sequence program, comprising: a reference circuit extraction step for extracting the position and reference address of a reference circuit in the sequence program; an output circuit extraction step for extracting the position and destination address of an output circuit in the sequence program; and a positional relationship determination step for comparing the extracted position of the reference circuit with the position of the output circuit and determining the ante-ante relationship between the reference circuit and the output circuit for the same address, and notifying the user if the reference circuit is located before the output circuit.
5. A computer program for causing one or more computer devices to function as a programming device for editing a PLC sequence program, comprising: a reference circuit extraction unit that extracts the position and reference address of a reference circuit in a PLC sequence program; an output circuit extraction unit that extracts the position and destination address of an output circuit in the sequence program; and a positional relationship determination unit that compares the extracted positions of the reference circuit with the position of the output circuit and determines the ante-ante relationship between the reference circuit and the output circuit for the same address, and notifies the user if the reference circuit is located before the output circuit.
Citation Information
Patent Citations
Development support device
JP2006146955A
Ladder program syntactic analysis tool
JP2016212710A
Trace device and programmable controller
JP2020077150A
Information processing device
WO2023248478A1