Programmable logic controller
The PLC system allows dynamic sorting of lists on HMIs by separating processors and distributing the sorting process, addressing the lack of user flexibility in existing PLC systems and enhancing data management.
Patent Information
- Application Number
- JP2024024322
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-02-21
- Publication Date
- 2025-09-02
AI Technical Summary
Existing programmable logic controllers (PLCs) lack the ability to sort lists displayed on human-machine interfaces (HMIs) dynamically, limiting user flexibility in viewing and managing data.
A programmable logic controller system that separates the processor executing the user program from the processor handling the sorting process, allowing dynamic change of sort keys through a function block, and distributes the sorting process across multiple scans to minimize impact on the scanning of the user program.
Enables dynamic sorting of lists on HMIs based on user-defined criteria, reducing processing delays and enhancing user interaction with PLC data displays.
Smart Images

Figure 2025127558000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to a programmable logic controller. [Background technology]
[0002] In factory automation, a programmable logic controller (PLC) is a core controller that controls industrial machines. The rules for user programs executed by a PLC are specified by IEC 61131-3. IEC 61131-3 defines structure variables as user-defined variables. Patent Document 1 describes a user support technology for registering structure variables. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Japanese Patent Application Laid-Open No. 2009-223591 Summary of the Invention [Problem to be solved by the invention]
[0004] The data stored in the device memory held by a PLC is displayed on an HMI (human-machine interface), a display device connected to the PLC. The HMI can also be implemented using a web server and web client. The HMI is installed in a factory together with the industrial machinery controlled by the PLC, and is viewed by field workers who monitor the operation of the industrial machinery. For example, the HMI can display data stored in multiple device memories in a programmable logic controller in a list format. Field workers sometimes want to sort the list displayed on the HMI, but there has traditionally been no way to meet this need.
[0005] Therefore, an object of the present invention is to make it possible to sort a list displayed on an HMI or the like in a programmable logic controller. [Means for solving the problem]
[0006] The present invention is, for example, a program execution unit that executes a user program; a data memory that is accessed by the program execution unit in accordance with the user program executed by the program execution unit and is capable of storing structure-type array variables consisting of a plurality of members as variables that can be handled by the user program, The program execution unit receives specification of a first member among the plurality of members that serves as a sort key, and rearranges the array variables stored in the data memory using the first member as the sort key in accordance with a sort command that has a character string indicating the first member as an argument. [Effects of the Invention]
[0007] According to the present invention, in a programmable logic controller, it becomes possible to sort a list displayed on an HMI or the like. [Brief explanation of the drawings]
[0008] [Figure 1] Diagram explaining a PLC system [Figure 2] Diagram explaining the basic unit [Figure 3] Diagram explaining HMI [Figure 4] Diagram explaining a PC [Figure 5] A diagram explaining the sorting process executed by the first CPU core [Figure 6] A diagram explaining the auxiliary processing executed by the second CPU core [Figure 7] Diagram explaining the sort command [Figure 8]Diagram explaining alarm history [Figure 9] Diagram explaining alarm history [Figure 10] Diagram explaining the alarm history display screen [Figure 11] A diagram explaining the ladder program for executing sorting [Figure 12] Sequence diagram showing the alarm history display process DETAILED DESCRIPTION OF THE INVENTION
[0009] Hereinafter, the embodiments will be described in detail with reference to the accompanying drawings. Note that the following embodiments do not limit the scope of the invention as claimed, and not all combinations of features described in the embodiments are necessarily essential to the invention. Two or more of the features described in the embodiments may be arbitrarily combined. Furthermore, the same reference numerals are used for the same or similar components, and redundant explanations will be omitted.
[0010] <PLCシステム> FIG. 1 shows an example of a programmable logic controller system (hereinafter referred to as a PLC system 1) according to an embodiment of the present invention. As shown in FIG. 1, this PLC system 1 includes a base unit 2, which is a PLC (programmable logic controller) for comprehensively controlling various control devices installed in a factory or the like, and an expansion unit 3 connected to the base unit 2. One or more expansion units 3 (e.g., an I / O unit, an analog input unit, an analog output unit, a communication unit, an expansion unit 3, etc.) are connected to the base unit 2. The base unit 2 is sometimes called a CPU unit. An HMI 4, a PC 7 equipped with a web browser, etc. are further connected to the base unit 2. The base unit 2 and the expansion unit 3 can communicate with each other via a communication bus. A connector for interconnecting the communication bus may be provided on the connection surface between the base unit 2 and the expansion unit 3. The base unit 2, the HMI 4, and the PC 7 can communicate with each other via a communication cable or a wireless line. PC is an abbreviation for personal computer.
[0011] The basic unit 2 has a display unit 5 and an operation unit 6. The display unit 5 is a liquid crystal display or organic electroluminescence (EL) display that displays the operating status of the expansion unit 3. The display unit 5 may switch its display content depending on the operation of the operation unit 6. The display unit 5 typically displays the current values (device values) of devices in the PLC system 1 and error information (whether or not an alarm or warning has occurred) that has occurred within the PLC system 1. A device is a memory area provided for storing device values (device data) and is sometimes called data memory or device memory. Device values are information that indicates the input status from input devices, the output status to output devices, and the status of internal relays (auxiliary relays), timers, counters, data memories, etc. set in the user program. Device values are classified into bit and word types. A bit device stores a 1-bit device value. A word device stores a 1-word device value.
[0012] The PC 7 is a notebook computer or a tablet computer, and has a display unit 8 and an operation unit 9. The display unit 8 is a liquid crystal display, an organic EL display, or the like. The operation unit 9 can include a keyboard, a touch sensor, or the like.
[0013] <Basic unit> FIG. 2 shows the hardware configuration of the basic unit 2. The CPU 11 is a processor that controls the PLC system 1 according to a control program. The CPU 11 writes information to and reads information from the memory 14. The memory 14 includes a random access memory (RAM), a read-only memory (ROM), a hard disk drive (HDD), and a solid state drive (SSD), and may further include a removable memory card. The ROM area of the memory 14 stores a ladder program 21, which is an example of a user program executed by the CPU 11, and a web server program 27 executed by the CPU core 13. The web server 17 is realized when the CPU 11 executes the web server program 27. The data memory 22 includes a device memory 23 and a variable memory 24 as storage areas reserved for executing the ladder program 21. The structure memory 25 stores structure information 26 referenced by the ladder program 21. The structure information 26 may include, for example, the name of the structure, the names of the structure members that make up the structure, and the data type of each structure member. For example, when a predetermined event (alarm event, error event) occurs in the PLC system 1, the ladder program 21 stores in the memory 14 a structure variable (array) whose structure members include the type of the event (integer type), the event number (integer type), the content of the event (character string type), the date and time of occurrence (date and time type), the unit where the event occurred (integer type), the number of occurrences (integer type), etc. This may also be called logging.
[0014] The CPU 11 communicates with the HMI 4 and the PC 7 via the communication unit 15 and transmits display data for the structure-type variables. The HMI 4 and the PC 7 display the values of the structure-type variables in accordance with the display data. For example, the web server 17 may provide such display data to the HMI 4 and the PC 7 as web-format data (e.g., HTML files, CSS, image data).
[0015] The CPU 11 may have multiple CPU cores 12 and 13. For example, the CPU core 12 is a processing circuit that functions as a program execution unit that executes the ladder program 21. The CPU core 13 is a processing circuit that executes auxiliary processing to reduce the processing load of the CPU core 12. The CPU core 12 and the CPU core 13 may be mounted in separate, physically separated CPU packages. The timer 16 is used by the CPU 11 to determine the date and time, etc.
[0016] <hmi> 3 shows the structure of the HMI 4. The CPU 31 (display processing unit 36) executes a control program 37 stored in the memory 32, acquires device values or variable values from the basic unit 2 via the communication unit 33, and displays a list including the device values or variable values on the display unit 34. The operation unit 35 includes a switch, a touch sensor, or the like. For example, the CPU 31 may send a request to sort the event list to the basic unit 2 according to a user instruction (e.g., sort key, descending order, ascending order) input from the operation unit 35, receive the sorted results, and display them on the display unit 34.
[0017] <pc> FIG. 4 shows the structure of the PC 7. The CPU 41 functions as a Web client 46 by executing a Web client program 47 stored in the memory 42. For example, the Web client 46 accesses the Web server 17 running on the basic unit 2 via the communication unit 43, obtains display data for an event list, and displays the event list on the display unit 8. The operation unit 9 includes a keyboard, a pointing device, a touch sensor, or the like. For example, the CPU 41 (Web client 46) may send a sort request for the event list to the basic unit 2 according to a user instruction (e.g., sort key, descending order, ascending order) input from the operation unit 9, receive display data (e.g., HTML file, CSS data, etc.) for displaying the sorted results, and display the sorted event list on the display unit 8. HTML is an abbreviation for Hypertext Markup Language. CSS is an abbreviation for Cascading Style Sheets.
[0018] <Structure> In this embodiment, it is assumed that event data is stored as a history (log) using a structure-type array, and a list of events is displayed on the HMI 4 or the Web client 46. As an example, consider the following event (alarm) history.
[0019] Alarm No. Occurrence date and time Recovery date and time Number of occurrences Contents 1 2023 / 10 / 01 02:30:21 2023 / 10 / 01 02:50:05 4 Axis 1 motor overload 5 2023 / 10 / 01 01:15:01 2023 / 10 / 01 01:19:00 1 Upper communication error 20 2023 / 10 / 01 00:04:20 2023 / 10 / 01 01:24:20 10 Out of work 10 2023 / 09 / 30 22:10:11 2023 / 09 / 30 23:00:40 2 Air cylinder 1 timeout In the PLC system 1, an alarm refers to a pre-warning that does not result in an error. Alarm No. is a number that indicates the type of alarm. Occurrence date and time refers to the date and time when the alarm occurred. Recovery date and time refers to the date and time when the alarm was resolved. Occurrence count refers to the number of times the alarm occurred. Content refers to the specific content of the alarm.
[0020] In order to acquire such alarm history and manage it as log data, it is convenient to define a structure and use an array variable of the structure type. As an example, the following structure is shown below.
[0021] Structure “ST_ALARM” Member Name Data Type Comment AlarmNo UINT Alarm number. OccurrenceDate STRING Occurrence date and time RecoverTime STRING Recovery date and time OccurrenceNum UDINT Number of occurrences Comment STRING Contents Here, ST_ALARM is the name of the structure. AlarmNo is an unsigned integer structure member in which the alarm number is stored. OccurrenceDate is a string structure member in which the date and time the alarm occurred is stored. RecoverTime is a string structure member that stores the date and time the PLC system 1 recovered from the alarm. OccurrenceNum is an unsigned double-precision integer structure member that stores the number of times the alarm occurred. Comment is a string structure member that stores the content of the alarm. Below, astAlarm[i] is defined as an array of this structure type, where i is the index. In the above example, there are four alarm histories, so the four alarm histories are stored one-to-one in the four arrays from astAlarm[0] to astAlarm[3].
[0022] In this embodiment, one of the structure members is designated by the user as a sort key, and the alarm list is sorted according to the sort key.
[0023] <Flowchart> There are several issues when sorting a structure-type array in the PLC system 1. The CPU 11 of the basic unit 2 executes the ladder program 21 to control the PLC system 1, but we want to minimize the impact of the sorting process on the scanning of the ladder program 21. We also want to keep the sorting process short. Furthermore, we want to dynamically change the sort key.
[0024] Conventionally, a user of a PLC system 1 had to create a ladder program 21 for sorting in advance and specify a fixed sort key within the ladder program 21. Therefore, once the ladder program 21 for sorting was completed, the sort key could not be changed unless the ladder program 21 was modified. For example, in a factory (workplace) where the PLC system 1 controls industrial production machinery (e.g., a robot arm), a user could view a list of alarms on the HMI 4, but could not immediately view the results of sorting the alarm list using a different sort key.
[0025] Therefore, in this embodiment, the processor that executes the ladder program 21 is separated from the processor that executes the support process for the sorting process, thereby making it less likely that the sorting process will affect the scanning of the ladder program 21. Furthermore, even after the ladder program for sorting is completed, by preparing a command (e.g., function block) that can dynamically change the sort key, dynamic changes to the sort key can be accepted from the HMI 4 or the Web client 46.
[0026] (1) Processing of CPU core 12 FIG. 5 shows a series of processes executed by the CPU core 12. Hereinafter, the unique sort instruction proposed in this embodiment will be referred to as a structure sort instruction. The ladder program 21 also describes the structure sort instruction. The CPU core 12 requests the CPU core 13 to check whether the structure targeted by the structure sort instruction exists and whether the structure member serving as the sort key exists. The CPU core 13 checks whether the specified structure and structure member name exist by referencing the structure information 26, and sends the check result to the CPU core 12. The check result also includes member information required for sorting. The member information required for sorting includes, for example, the size of the elements (structure members) that make up the structure, the storage position of each member in the structure (byte offset relative to the beginning of the structure), the data type of each member, and, if the data type is a string type, the maximum character length.
[0027] In this way, by having the CPU core 13 assist in part of the sorting process, the CPU core 12 can efficiently execute the scan of the ladder program 21. Also, as will be described later, the sort key can be dynamically changed even while the ladder program 21 is being executed.
[0028] In S1, the CPU core 12 sets the setting parameters specified by the input arguments of the structure sort command in the member information acquisition request to determine whether there are any structure members that make up the structure and whether there are any structure members that serve as sort keys. A unique structure definition ID that is assigned to each structure to distinguish between multiple structures is set in the setting parameters. The structure definition ID is assigned by the compiler when the ladder program 21 is compiled.
[0029] In S2, the CPU core 12 transmits a member information acquisition request including the setting parameters to the CPU core 13.
[0030] In S3, the CPU core 12 determines whether or not it has received a member information acquisition completion notification from the CPU core 13. When it has received the acquisition completion notification, the CPU core 12 proceeds from S3 to S4.
[0031] In S4, the CPU core 12 determines whether the acquisition completion notification is a normal notification. A normal notification means that a structure with the specified structure definition ID exists, and that the structure has the specified sort key as a structure member. If the acquisition completion notification is not a normal notification, the CPU core 12 proceeds from S4 to S10 and executes abnormal completion processing of the instruction. The abnormal completion processing of the instruction may include, for example, displaying information indicating an error on the display unit 5. If the acquisition completion notification is a normal notification, the CPU core 12 proceeds from S4 to S5.
[0032] In S5, the CPU core 12 receives the member information from the CPU core 13.
[0033] In S6, the CPU core 12 determines whether the timing has arrived for executing a structure sort command, which occurs for each scan of the ladder program 21. Because the CPU core 12 repeatedly executes the ladder program 21, the structure sort command written in the ladder program 21 is also executed once per scan. When the timing for executing the structure sort command arrives, the CPU core 12 proceeds from S6 to S7.
[0034] In S7, the CPU core 12 executes a sorting process on the alarm history.
[0035] In S8, the CPU core 12 determines whether the sorting is complete. As the alarm history becomes enormous in size, the sorting time also increases. Therefore, the CPU core 12 limits the sorting time per scan to prevent the time extension of one scan. If the sorting of the alarm history is not complete, the CPU core 12 proceeds from S8 to S11. In S11, the CPU core 12 measures the execution time of the sorting process executed for each scan using the timer 16 and determines whether the execution time of the sorting process has exceeded a specified time (threshold time). The specified time is the maximum sorting time per scan. The specified time may be one of the input arguments of the structure sort command. If the execution time of the sorting process has not exceeded the specified time, the sorting process can still be continued during the current scan. Therefore, the CPU core 12 proceeds from S11 to S7. On the other hand, if the execution time of the sorting process has exceeded the specified time, there is no time remaining for the sorting process during the current scan, so the CPU core 12 proceeds from S11 to S12 and interrupts the sorting process. Thereafter, the CPU core 12 proceeds from S12 to S6 and waits for the timing to execute the sorting process in the next scan. When the timing to execute the sorting process in the next scan arrives, the CPU core 12 proceeds from S6 to S7 and resumes the sorting process. In other words, the sorting process is distributed (divided) and executed over multiple scans. By repeating S6, S7, S8, S11, and S12 in this manner, the sorting process of the alarm history is completed, and the CPU core 12 proceeds from S8 to S9.
[0036] In S9, the CPU core 12 executes normal completion processing of the structure sort command. The normal completion processing includes processing to turn on (TRUE) a relay device that indicates normal completion of the structure sort command. As a result, the display data displayed on the HMI 4 or the Web client 46 is updated, and the sorted alarm list is displayed on the HMI 4 or the Web client 46.
[0037] (2) Processing of CPU core 13 (checking the existence of the structure member specified as the sort key) FIG. 6 shows a series of processes executed by the CPU core 13.
[0038] In S21, the CPU core 13 receives a member status acquisition request accompanied by setting parameters (for example, a structure definition ID and a member name that serves as a sort key) from the CPU core 12.
[0039] In S22, the CPU core 13 refers to the structure information 26 based on the structure definition ID specified by the setting parameter, and identifies the structure. For example, the structure "ST_ALARM" is identified.
[0040] In S23, the CPU core 13 compares the member names of the members constituting the identified structure with the member names specified as sort keys by the setting parameters, and determines whether the identified structure includes a member that can serve as a sort key. If the identified structure includes a member that can serve as a sort key, the process proceeds from S23 to S24, where the CPU core 13 obtains member information of the member that can serve as the sort key from the structure information 26 (the size of the member, the storage position of the member in the structure (a byte offset based on the beginning of the structure), the data type of the member, and if the data type is a string, the maximum character length), and sends this to the CPU core 12. If the identified structure does not include a member that can serve as a sort key, the process proceeds from S23 to S25, where the CPU core 13 notifies the CPU core 12 of an error (abnormality).
[0041] <Structure sort command> 7 shows an example of a structure sort instruction 700. The structure sort instruction 700 is a function block type instruction. The left side of the structure sort instruction 700 indicates input arguments. The right side of the structure sort instruction 700 indicates output arguments.
[0042] In the ladder program 21, one of the input arguments, Execute, is connected to a relay device that indicates the start of sorting. When the timing for executing the sorting process arrives, this relay device changes from off to on, and the structure sort command 700 executes the sorting process.
[0043] InOut indicates the beginning of the structure array to be sorted. For example, if the alarm history is stored in four arrays from astAlarm[0] to astAlarm[3], astAlarm[0] is set to InOut.
[0044] Count indicates the number of elements (structure arrays) to be sorted. If the alarm history is stored in four arrays, from astAlarm[0] to astAlarm[3], Count will be 4.
[0045] Order indicates the sort order (descending / ascending), for example, FALSE indicates descending, TRUE indicates ascending.
[0046] MemberName indicates the name of the structure member specified as the sort key. MemberName is assigned a string variable called strSortKey, which stores the name of the structure member that will be the sort key. The sort key specified by MemberName can be dynamically changed even while the ladder program 21 is running.
[0047] MaxSortTime indicates the above-mentioned specified time (maximum sorting time per scan).
[0048] Of the output arguments, Done changes from OFF to ON when the execution of the structure sort instruction is completed. In the ladder program 21, Done may be connected to a relay device that indicates completion.
[0049] Busy indicates whether a sort command is being executed. Error indicates whether a sort command has failed. As mentioned above, if the member name to be used as the sort key does not exist, the status changes from Error to Off to On. ErrorID outputs the error identification code.
[0050] (1) Alarm history sorted by OccurrenceDate Figure 8 shows alarm history sorted in descending order using OccurrenceDate as the sort key. In this example, alarm history is stored in four arrays, from astAlarm[0] to astAlarm[3]. This sorts the alarm history so that the most recent alarm history is at the top. When a user wants to know the most recent alarm, they specify OccurrenceDate as the sort key and descending order as the sort order.
[0051] (2) Alarm history sorted by OccurrenceNum Figure 9 shows alarm history sorted in descending order using OccurrenceNum as the sort key. In this example, the alarm history is sorted so that alarms that occur more frequently are at the top. Users often consider alarms that occur more frequently to be alarms that should be resolved. For this reason, OccurrenceNum is sometimes specified as the sort key.
[0052] <User Interface> (1) Alarm list display screen 10 shows an alarm history screen 1000 displayed on the HMI 4 or the Web client 46. The alarm history screen 1000 has an alarm list display area 1001. As described above, the alarm history includes the alarm number, the date and time of occurrence, the date and time of recovery, the number of occurrences, and the details.
[0053] 10, the alarm history screen 1000 includes buttons 1011, 1012, 1013, and 1014 for specifying a sort key and a sort order. Button 1011 is a software switch for specifying OccurrenceDate as the sort key and descending order as the sort order. Button 1012 is a software switch for specifying OccurrenceDate as the sort key and ascending order as the sort order. Button 1013 is a software switch for specifying OccurrenceNum as the sort key and descending order as the sort order. Button 1014 is a software switch for specifying OccurrenceNum as the sort key and ascending order as the sort order.
[0054] Although omitted in this example, buttons 1011, 1012, 1013, and 1014 may be provided for specifying a sort key and a sort order for the alarm number and the recovery date and time.
[0055] (2) Describing sort keys in ladder programs FIG. 11 shows a part of the ladder program 21 that executes the sorting process when the sort buttons 1011 and 1103 are pressed.
[0056] The on (TRUE) / off (FALSE) state of the sort button 1011 is assigned to a one-bit device or variable called bOccurrenceDateDesc. When the sort button 1011 is turned on, OccurrenceDate is set as the input argument of the MOVE command, and OccurrenceDate is assigned to strSortKey, a string variable that holds the sort key.
[0057] The on / off state of the sort button 1013 is assigned to a one-bit device or variable called bOccurrenceNumDesc. When the sort button 1013 is turned on, OccurrenceNum is set as the input argument of the MOVE command, and OccurrenceNum is assigned to strSortKey, a string variable that holds the sort key.
[0058] Of the input arguments of the function block for sorting explained in Figure 7, the OccurrenceDate or OccurrenceNum held by strSortKey is set to MemberName. The input argument Order is set to FALSE, which indicates descending order.
[0059] Here, buttons 1011 and 1013 have been explained, but the ladder programs for buttons 1012 and 1014 are similar to the ladder program explained in Fig. 11. That is, when button 1012 is turned on, OccurrenceDate is substituted via strSortKey into MemberName of the sorting function block for which Order is set to TRUE. When button 1014 is turned on, OccurrenceNum is substituted via strSortKey into MemberName of the sorting function block for which Order is set to TRUE.
[0060] (3) Alarm history sorting sequence 12 shows the display process of an event list (e.g., a list of alarm history) executed between the basic unit 2 and the HMI 4 or Web client 46 (PC 7). In the following description, the HMI 4 can be substituted for the Web client 46 (PC 7).
[0061] In S31, the HMI 4 sends a read request for the device in which the alarm history is stored to the basic unit 2. The basic unit 2 receives the read request from the HMI 4.
[0062] In S32, the basic unit 2 sends the value (alarm history) of the specified device to the HMI 4. The HMI 4 receives the device value from the basic unit 2. Note that S31 and S32 may be executed when the ladder program 21 is refreshed.
[0063] In S33, the HMI 4 displays an alarm history screen 1000 showing the device values on the display unit 34.
[0064] In S34, the HMI 4 detects that the sort button 1011 has been pressed. The sort button 1011 may be any of the sort buttons 1012, 1103, and 1104.
[0065] In S35, the HMI 4 executes writing to the device (e.g., bOccurrenceDateDesc=TRUE) corresponding to the sort button 1011. As explained in Fig. 11, when the sort button 1011 becomes TRUE, the MOVE command assigns OccurrenceDate to strSortKey, and furthermore, OccurrenceDate is set to MemberName of the function block for sorting, Order is set to FALSE, and the sorting process is executed.
[0066] In S36, the HMI 4 displays on the display unit 34 a screen indicating that the sorting process is being executed.
[0067] In S37, basic unit 2 starts the sorting process.
[0068] In S38, the HMI 4 sends a device read request indicating the completion of execution of the sort command to the basic unit 2. The basic unit 2 receives the read request.
[0069] In S39, the basic unit 2 sends a device value indicating the completion of the sort command execution to the HMI 4. The HMI 4 receives a device value indicating the completion of the sort command execution from the basic unit 2. This device value is either TRUE (completed) or FALSE (not completed).
[0070] In S40, the basic unit 2 completes the sorting process. The value of the device indicating the completion of the sorting command is changed from FALSE to TRUE.
[0071] In S41, the HMI 4 sends a device read request indicating the completion of execution of the sort command to the basic unit 2. The basic unit 2 receives the read request.
[0072] In S42, the basic unit 2 sends to the HMI 4 a device value (completed) indicating that the execution of the sort command has been completed.
[0073] In S43, the HMI 4 sends a read request for the device in which the alarm history is stored to the basic unit 2. The basic unit 2 receives the read request from the HMI 4.
[0074] In S44, the basic unit 2 sends the value (alarm history) of the specified device to the HMI 4. The HMI 4 receives the device value from the basic unit 2.
[0075] In S45, the HMI 4 displays an alarm history screen 1000 showing the sorting results on the display unit 34.
[0076] <Technical ideas derived from examples> [Point 1] The CPU 11 and CPU core 12 are examples of a program execution unit that executes a user program (e.g., ladder program 21). The data memory 22 is accessed by the program execution unit (e.g., CPU 11, CPU core 12) in response to a user program executed by the program execution unit, and functions as a data memory that can store structure-type array variables consisting of multiple members as variables that the user program can handle. The program execution unit (e.g., CPU 11, CPU core 12) accepts specification of a first member among the multiple members that serves as a sort key, and sorts the array variables stored in the data memory using the first member as a sort key in accordance with a sort command (e.g., structure sort command 700) that takes as an argument a character string indicating the first member (e.g., OccurrenceDate, OccurrenceNum). This allows the programmable logic controller to sort lists displayed on the HMI 4, etc.
[0077] [Point 2] The HMI 4 and the Web client 46 are examples of a display that displays array variables (e.g., alarm history). The display may have an input device (e.g., operation unit 9, 35, sort buttons 1101 to 1104) that accepts the designation of a first member as a sort key. This allows the user to simply instruct sorting at the site where the PLC system 1 is installed.
[0078] [Point 3] The sort command may include, as an argument, a specification of ascending or descending order (e.g., Order) that is the sorting rule, allowing the user to specify ascending or descending order.
[0079] [Point 4] The display (e.g., HMI 4 or Web client 46) may display an operation object (e.g., sort buttons 1101 to 1104) for accepting a designation of ascending or descending order, thereby allowing the user to designate ascending or descending order.
[0080] [Point 5] The display (e.g., HMI 4 or Web client 46) may have a Web client 46 (CPU 41, Web client program 47) that communicates with a Web server (e.g., CPU 11, Web server program 27) implemented in the programmable logic controller to display array variables. In this way, the display may be realized on a Web basis.
[0081] [Point 6] A structure-type array variable may include data (eg, the date and time an alarm occurred, the number of occurrences, etc.) that is recorded when an event (eg, an alarm) to be monitored occurs in the programmable logic controller.
[0082] [Point 7] A structure-type array variable may include data to be logged in the programmable logic controller and recorded sequentially (e.g., coordinates of a motion unit in the expansion unit 3). The basic unit 2 and expansion unit 3 may sequentially log various device values and variable values. In this case, the data to be sorted may be such logged data.
[0083] [Point 8] The CPU 11 may acquire the operation record data of the programmable logic controller and store a predetermined range of the operation record data in an array variable. For example, if the number of devices involved in the ladder program 21 is very large, it may be more efficient to monitor only a portion of them using the HMI 4 or the like. In this case, the CPU 11 may allow the user to specify the range to be displayed on the HMI 4 or the like, store the data in the specified range in a structure-type array variable, and display it on the HMI 4 or the Web client 46.
[0084] [Point 9] The program execution unit (e.g., CPU 11, CPU core 12) executes the ladder program 21, which rearranges array variables, as a user program. The program execution unit (e.g., CPU 11, CPU core 12) may divide the rearrangement of the structure-type array variables into multiple scans of the ladder program 21 and execute it. This will reduce the delay in one scan.
[0085] [Point 10] The program execution unit (e.g., CPU 11, CPU core 12) may use the timer 16 to measure the time required to rearrange the array variables for each scan of the ladder program 21. When the rearrangement time measured by the timer 16 for each scan reaches a threshold time (e.g., a specified time), the program execution unit (e.g., CPU 11, CPU core 12) may suspend the rearrangement and resume the rearrangement in the next scan of the ladder program 21. This may realize divided execution of the rearrangement.
[0086] [Point 11] The program execution unit (e.g., CPU 11) may have a first processor (e.g., CPU 11, CPU core 12) that executes a user program, and a second processor (e.g., CPU core 13) that executes predetermined processing in accordance with instructions from the first processor. The first processor may send an acquisition request for information required for sorting (e.g., member information) to the second processor. The second processor may send the information required for sorting to the first processor in accordance with the acquisition request. The first processor may rearrange the array variables in accordance with the information required for sorting and store the rearranged array variables in the data memory 22. This distributes part of the sorting process to the CPU core 13, thereby reducing the load on the CPU core 12 and preventing a delay in the scan time of the ladder program 21.
[0087] The invention is not limited to the above-described embodiment, and various modifications and variations are possible within the scope of the gist of the invention.< / pc> < / hmi>
Claims
1. a program execution unit that executes a user program; a data memory that is accessed by the program execution unit in accordance with the user program executed by the program execution unit and is capable of storing structure-type array variables consisting of a plurality of members as variables that can be handled by the user program, the program execution unit accepts specification of a first member among the plurality of members that serves as a sort key, and rearranges the array variables stored in the data memory using the first member as the sort key in accordance with a sort command that has a character string indicating the first member as an argument.
2. a display for displaying the array variable; 2. The programmable logic controller according to claim 1, wherein said display device has an input device that accepts designation of said first member as said sort key.
3. 3. The programmable logic controller according to claim 2, wherein the sort command includes, as an argument, a specification of ascending order or descending order as a sorting rule.
4. 4. The programmable logic controller according to claim 3, wherein the display displays an operation object for accepting a designation of the ascending order or the descending order.
5. 3. The programmable logic controller according to claim 2, wherein the display device has a web client that communicates with a web server implemented in the programmable logic controller to display the array variables.
6. 2. The programmable logic controller according to claim 1, wherein the array variable contains data that is recorded when an event to be monitored occurs in the programmable logic controller.
7. 2. The programmable logic controller according to claim 1, wherein the array variables include data to be logged in the programmable logic controller and to be recorded sequentially.
8. 2. The programmable logic controller according to claim 1, wherein the program execution unit acquires driving record data of the programmable logic controller and stores a predetermined range of the driving record data in the array variable.
9. 2. The programmable logic controller according to claim 1, wherein the program execution unit executes a ladder program that rearranges the array variables as the user program, and divides the rearrangement of the array variables into multiple scans of the ladder program and executes it.
10. 10. The programmable logic controller according to claim 9, wherein the program execution unit measures the rearrangement time of the array variables for each scan of the ladder program, and when the rearrangement time reaches a threshold time, suspends the rearrangement and resumes the rearrangement in the next scan of the ladder program.
11. The program execution unit a first processor that executes the user program; a second processor that executes a predetermined process in accordance with an instruction from the first processor; the first processor transmits a request to the second processor to acquire information required for the rearrangement; the second processor transmits information required for the rearrangement to the first processor in accordance with the acquisition request; the first processor rearranges the array variables in accordance with the information required for the rearrangement, and stores the rearranged array variables in the data memory; 2. The programmable logic controller of claim 1.
Citation Information
Patent Citations
Program development support device for PLC
JP2009223591A