Control system

The control system addresses the burden of accessing shared variables by generating libraries and converting control programs within the system, reducing user effort and eliminating the need for recompilation when shared variable definitions change.

WO2025079177A1PCT designated stage expired Publication Date: 2025-04-17FANUC LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/JP2023/036890
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-10-11
Publication Date
2025-04-17

AI Technical Summary

Technical Problem

Existing control systems require users to explicitly use calling processes to access shared variables, which is burdensome and necessitates recompilation of programs when shared variable definitions change.

Method used

A control system that includes a library generation unit to extract shared variable information and generate a library for accessing shared variables, and peripheral devices with analysis, conversion, and execution units to convert control programs and access shared variables without explicit calling processes.

Benefits of technology

Reduces the burden on users creating control programs by eliminating the need for explicit access to shared variables and automates the conversion of control programs, even when shared variable definitions change.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure JP2023036890_17042025_PF_FP_ABST
    Figure JP2023036890_17042025_PF_FP_ABST
Patent Text Reader

Abstract

The purpose of the present invention is to eliminate the need to explicitly use a call process for accessing a shared variable when creating a control program, and thereby reduce the burden on a user in creating the control program. This control system comprises a plurality of peripheral devices and a control device that includes shared variables that can be shared with the plurality peripheral devices. The control device is provided with a library generation unit that extracts shared variable information including at least offset and size information from the definitions of the shared variables, and generates a shared variable access library for accessing the shared variables on the basis of the shared variable information. Each of the plurality of peripheral devices is provided with: an analysis unit that analyzes a reference code that references a shared variable from a control program to be executed; a conversion unit that converts the control program by inserting, at the position of the reference code analyzed by the analysis unit, a call to the shared variable access library to access the shared variable referenced by the reference code; and an execution unit that executes the control program converted by the conversion unit.
Need to check novelty before this filing date? Find Prior Art

Description

Control System

[0001] The present disclosure relates to a control system having a plurality of peripheral machines and a control device that includes shared variables shared among the plurality of peripheral machines.

[0002] In a numerical control device (NC), shared variables are defined in a memory area to enable data sharing with applications running on peripheral devices, such as programmable logic controller (PLC) software, screen software, and network software, and are accessible from each application. For example, see Patent Document 1. In this case, access to the shared variable from each application is performed through a dedicated access function, within which exclusive control, communication, etc. are performed. The shared variable access function is executed using information about the variable to be accessed (offset, size, etc.) as input.

[0003] Japanese Patent Application Laid-Open No. 2020-064399

[0004] FIG. 10 illustrates an example of the relationship between the access functions 101A-101C of the numerical control device 100 and the access functions of the peripheral devices 200A-200C. In FIG. 10, the peripheral devices 200A-200C are illustrated as a communication device, a display device, and a PLC. While FIG. 10 illustrates an example in which the peripheral devices 200A-200C are included in the numerical control device 100, they may be different devices that are not included in the numerical control device 100 and are communicatively connected to the numerical control device 100. The access functions 101A-101C of the numerical control device 100 manage the resources of shared variables to prevent conflicts between accesses from the peripheral devices 200A-200C. Specifically, the access functions 101A-101C use semaphores or the like to perform exclusive control to prevent duplicate requests from the peripheral devices 200A-200C to access the same shared variable. Furthermore, if the other peripheral devices 200A-200C are not accessing a certain shared variable, the access functions 101A-101C return a notification to the peripheral devices 200A-200C indicating that a shared variable access request is executable. On the other hand, when a program in the peripheral devices 200A-200C accesses a shared variable, the program specifies the shared variable to be accessed using information such as offset and size, and notifies the numerical control device 100 of a shared variable access request. In this way, if the access request is accepted, the peripheral devices 200A-200C can access the shared variable in the numerical control device 100; if the access request is rejected, the peripheral devices 200A-200C cannot access the shared variable. Therefore, the access functions 101A-101C of the numerical control device 100 and the programs accessing the shared variables in the peripheral devices 200A-200C are capable of sending and receiving data to each other. At this time, if the numerical control device 100 and the peripheral devices 200A-200C are connected via a network, data transfer processing is also performed. However, in the prior art, when accessing a shared variable from an application program in each peripheral device, it is necessary to explicitly use a call process to access the shared variable, which places a programming burden on the user, such as calculating offsets and sizes.Furthermore, if the definition of a shared variable is changed, the program must be recompiled because the access to the shared variable will be incompatible with the definition of the shared variable.

[0005] Therefore, it is desired to reduce the burden on users in creating control programs by eliminating the need to explicitly use call processes that access shared variables when creating control programs.

[0006] One aspect of the control system of the present disclosure includes a plurality of peripheral devices and a control device including shared variables that can be shared among the plurality of peripheral devices, wherein the control device includes a library generation unit that extracts shared variable information including at least offset and size information from the definition of the shared variable and generates a shared variable access library that accesses the shared variable based on the shared variable information, and each of the plurality of peripheral devices includes an analysis unit that analyzes reference code that references the shared variable from a control program to be executed, a conversion unit that converts the control program by inserting a call to the shared variable access library that accesses the shared variable referenced in the reference code at the location of the reference code analyzed by the analysis unit, and an execution unit that executes the control program converted by the conversion unit.

[0007] FIG. 1 is a diagram showing an example of a functional block configuration of a control system according to a first embodiment. FIG. 2 is a diagram showing an example of a shared variable definition table. FIG. 3 is a diagram showing an example of a template. FIG. 4 is a diagram showing an example of a shared variable access library. FIG. 5 is a diagram showing an example of a sequence program as a control program when the peripheral device is a PLC. FIG. 6 is a diagram showing an example of a converted control program. FIG. 7 is a flowchart illustrating control processing of the control system. FIG. 8 is a diagram showing an example of a functional block configuration of a control system according to a second embodiment. FIG. 9 is a flowchart illustrating control processing of the control system. FIG. 10 is a diagram showing an example of the relationship between an access function of a numerical control device and an access function of a peripheral device.

[0008] First Embodiment A control system according to a first embodiment will be described in detail below with reference to the drawings. FIG. 1 is a diagram illustrating an example of a functional block configuration of a control system according to the first embodiment. Here, a control device is illustrated as a numerical control device that controls a machine tool. The present invention can also be applied to a robot control device that controls a robot. As shown in FIG. 1, the control system 1 includes a numerical control device 10 and N peripheral devices 20(1) to 20(N). The numerical control device 10 and the peripheral devices 20(1) to 20(N) are directly connected to each other via a connection interface (not shown). The numerical control device 10 and the peripheral devices 20(1) to 20(N) may also be interconnected and communicated via a network (not shown), such as a local area network (LAN) or the Internet. In this case, the numerical control device 10 and the peripheral devices 20(1) to 20(N) each include a communication unit (not shown) for communicating with each other via such a connection. Furthermore, although the numerical control device 10 and the peripheral devices 20(1) to 20(N) are described as being different devices, as will be described later, the peripheral devices 20(1) to 20(N) may be included in the numerical control device 10. In the following, when there is no need to distinguish between the peripheral devices 20(1) to 20(N), they will also be collectively referred to as "peripheral devices 20."

[0009] <Numerical control device 10> The numerical control device 10 is, for example, a numerical control device known to those skilled in the art that controls the operation of a machine tool (not shown). Note that if the machine tool (not shown) is a robot or the like, the numerical control device 10 may be a robot control device or the like. The numerical control device 10 has, for example, a control unit 11 and a storage unit 12. Furthermore, the control unit 11 has a library generation unit 110.

[0010] The storage unit 12 may be a read-only memory (ROM), a solid-state drive (SSD), a hard disk drive (HDD), or the like. The storage unit 12 includes a shared variable definition 120, shared variables 121, and a template storage unit 122, along with the operating system and application programs executed by the control unit 11. The shared variable definition 120 stores a shared variable definition table. FIG. 2 is a diagram illustrating an example of the shared variable definition table. The shared variable definition table includes information about the offset and size of each variable and has storage areas for "variable," "data type," "offset," "size," and the like. The "variable" storage area in the shared variable definition table stores variable names such as "X," "Y," and "Z." The "data type" storage area in the shared variable definition table stores data types such as "LINT," "REAL," and "STRING" of the variables stored in the "variable" storage area. The "Offset" storage area in the shared variable definition table stores the offset value of the variable stored in the "Variable" storage area. The "Size" storage area in the shared variable definition table stores the size of the variable stored in the "Variable" storage area.

[0011] The shared variable 121 stores the value of a variable (e.g., a numerical value, a character string, etc.) that is shared between two or more of the peripheral devices 20(1) to 20(N). For example, if the peripheral devices 20 are a display device and a PLC, the display device stores a character string input on the displayed screen as a shared variable in the shared variable 121, and the PLC can execute processing by receiving the character string input via the shared variable 121. The PLC also stores the processing result in the shared variable 121, and the display device can receive the processing result executed by the PLC via the shared variable 121 and display the processing result.

[0012] The template storage unit 122 stores templates in which codes for accessing the shared variables 121 are written in advance and in which shared variable information such as offsets and sizes can be input. Fig. 3 is a diagram showing an example of a template. The template shown in Fig. 3 stores variable names, offsets, and sizes extracted from the shared variable definitions 120 (shared variable definition table) by the library generation unit 110 (described later), and a library for accessing shared variables is generated.

[0013] The control unit 11 includes a CPU, ROM, RAM, CMOS memory, etc., which are configured to be able to communicate with each other via a bus and are well known to those skilled in the art. The CPU is a processor that controls the entire numerical control device 10. The CPU reads system programs and application programs stored in the ROM via the bus and controls the entire numerical control device 10 in accordance with the system programs and application programs. As a result, as shown in FIG. 1, the control unit 11 is configured to realize the functions of a library generation unit 110. The RAM stores various types of data, such as temporary calculation data and display data. The CMOS memory is backed up by a battery (not shown) and is configured as a non-volatile memory that retains its stored state even when the numerical control device 10 is powered off.

[0014] The library generation unit 110 extracts shared variable information, including at least information on the offset and size of a shared variable, from the shared variable definition 120, and generates a shared variable access library that accesses the shared variable based on the shared variable information. Specifically, the library generation unit 110 extracts shared variable information, including the offset and size of a variable named "Y" as a shared variable, from the shared variable definition 120 (shared variable definition table). The library generation unit 110 stores the extracted offset and size of the shared variable information in a template stored in the template storage unit 122, thereby generating a shared variable access library that accesses the shared variable "Y," as shown in FIG. 4. The library generation unit 110 transfers the generated shared variable access library to the peripheral device 20. Note that the library generation unit 110 may also extract shared variable information for an added or updated shared variable from the shared variable definition 120, and generate a shared variable access library that accesses the added or updated shared variable based on the shared variable information.

[0015] <Peripheral Device 20> The peripheral device 20 is, for example, a communication device, a display device, a PLC, etc., and includes, for example, a control unit 21 and a storage unit 22. The control unit 21 also includes an analysis unit 210, a conversion unit 211, and an execution unit 212. Note that while FIG. 1 only shows the functional blocks of the peripheral device 20(1), the peripheral devices 20(2) to 20(N) are similar to the peripheral device 20(1). In the following, the peripheral device 20(1) will be described as a PLC. However, the same applies to the peripheral device 20(1) being a communication device, a display device, or the like other than a PLC.

[0016] The storage unit 22 is a ROM, SSD, HDD, or the like. The storage unit 22 has a control program storage unit 220 along with an operating system and application programs executed by the control unit 21. The storage unit 22 may also store a shared variable access library transferred from the numerical control device 10. The control program storage unit 220 stores a control program created by a user and executed by the peripheral device 20. Figure 5 is a diagram showing an example of a sequence program as a control program when the peripheral device 20(1) is a PLC.

[0017] The control unit 21 includes a CPU, ROM, RAM, CMOS memory, etc., which are configured to be able to communicate with each other via a bus and are well known to those skilled in the art. The CPU is a processor that controls the entire peripheral device 20(1). The CPU reads system programs and application programs stored in the ROM via the bus and controls the entire peripheral device 20(1) in accordance with the system programs and application programs. As a result, as shown in FIG. 1, the control unit 21 is configured to realize the functions of an analysis unit 210, a conversion unit 211, and an execution unit 212. The RAM stores various data, such as temporary calculation data and display data. The CMOS memory is backed up by a battery (not shown) and is configured as a non-volatile memory that retains its stored state even when the peripheral device 20(1) is powered off.

[0018] The analysis unit 210 analyzes reference code that references a shared variable from a control program executed by the execution unit 212 (described later). Specifically, the analysis unit 210 reads, for example, a sequence program (control program) shown in FIG. 5 that is executed by the execution unit 212 (described later) from the control program storage unit 220, and searches for code that includes access to a shared variable (e.g., "Y") in the read sequence program. The analysis unit 210 outputs the relevant code (e.g., line 5 of the sequence program in FIG. 5) to the conversion unit 211 as the line position of the reference code.

[0019] The conversion unit 211 converts the control program by inserting a call to a shared variable access library that accesses the shared variable referenced in the reference code at the line position of the reference code analyzed by the analysis unit 210. Specifically, the conversion unit 211 receives, for example, a shared variable access library generated by the numerical control device 10 from the numerical control device 10. As shown in FIG. 6, the conversion unit 211 inserts a call to the shared variable access library of FIG. 4 at line 5 of the sequence program of FIG. 5. As shown in FIG. 6, the conversion unit 211 converts the code that accesses the shared variable "Y" into an access to a temporary variable "y'" that stores a value read by the shared variable access library of FIG. 4. The conversion unit 211 transfers the converted sequence program of FIG. 6 to the execution unit 212, which will be described later.

[0020] The execution unit 212 executes the sequence program (control program) converted by the conversion unit 211. The execution unit 212 executes the converted sequence program and accesses the shared variable "Y" stored in the shared variable 121 of the numerical control device 10. At this time, the control unit 11 (access function) in the numerical control device 10 may perform exclusive control to prevent conflict between access to the shared variable "Y" between peripheral device 20(1) and peripheral device 20(i) (where i is an integer from 2 to N). By doing so, the user of peripheral device 20(1) does not need to explicitly use the access function for the shared variable, thereby reducing the burden on the user in creating the control program.

[0021] <Control Processing of Control System 1> Next, the flow of the control processing of the control system 1 will be described with reference to Fig. 7. Fig. 7 is a flowchart illustrating the control processing of the control system 1.

[0022] In step S11, the numerical control device 10 (library generation unit 110) extracts shared variable information, such as the variable name, offset, and size of the shared variable, from the shared variable definition 120 (shared variable definition table).

[0023] In step S12, the numerical control device 10 (library generation unit 110) generates a library for accessing shared variables by storing the variable name, offset, and size of the shared variable information extracted in step S11 in a template stored in the template storage unit 122.

[0024] In step S13, the numerical control device 10 (library generation unit 110) transfers the shared variable access library generated in step S12 to the peripheral device 20(1).

[0025] In step S21, the peripheral device 20(1) (conversion unit 211) receives the shared variable access library transferred in step S13.

[0026] In step S22, the peripheral device 20(1) (analysis unit 210) reads the control program to be executed from the control program storage unit 220, and analyzes the reference code that accesses the shared variable 121 of the numerical control device 10 in the read control program.

[0027] In step S23, the peripheral device 20(1) (conversion unit 211) converts the control program read in step S22 by inserting a call to the shared variable access library received in step S21 into the line position of the reference code analyzed in step S22.

[0028] As described above, the control system 1 according to the first embodiment can reduce the burden on the user in creating a control program by eliminating the need to explicitly use a call process to access a shared variable when creating the control program. Furthermore, even when the shared variable definition 120 is added or changed, the control system 1 generates a shared variable access library and converts the control program each time, eliminating the need for the user to manually recompile the control program. The first embodiment has been described above.

[0029] Second Embodiment Next, a second embodiment will be described. As described above, in the first embodiment, the numerical control device 10 extracts at least offset and size shared variable information from the shared variable definition 120 and generates a shared variable access library for accessing the shared variable based on the shared variable information. The peripheral device 20 analyzes reference code that references the shared variable from the control program, converts the control program by inserting a call to the shared variable access library at the location of the analyzed reference code, and executes the converted control program. In contrast, in the second embodiment, the control system 1 includes a program editing device 30, and the numerical control device 10A outputs the shared variable definition 120 to the program editing device 30. This differs from the first embodiment in that the program editing device 30 creates control programs for each of the peripheral devices 20(1) to 20(N) that reference the shared variable from the shared variable definition 120 received from the numerical control device 10A based on a user's input operation, and outputs the control programs to each of the peripheral devices 20(1) to 20(N). As a result, the control system 1 can reduce the burden on the user in creating a control program without explicitly using a call process that accesses a shared variable when creating the control program. A second embodiment will now be described.

[0030] FIG. 8 is a diagram showing an example of a functional block configuration of a control system according to the second embodiment. Elements having similar functions to those of the control system 1 in FIG. 1 are designated by the same reference numerals, and detailed descriptions thereof will be omitted. As shown in FIG. 8, the control system 1 includes a numerical control device 10A, peripheral devices 20(1) to 20(N), and a program editing device 30. The numerical control device 10A, peripheral devices 20(1) to 20(N), and program editing device 30 are directly connected to each other via a connection interface (not shown). The numerical control device 10A, peripheral devices 20(1) to 20(N), and program editing device 30 may be interconnected and communicate with each other via a network (not shown), such as a LAN or the Internet. In this case, the numerical control device 10A, peripheral devices 20(1) to 20(N), and program editing device 30 each include a communication unit (not shown) for communicating with each other via such a connection. The peripheral devices 20(1) to 20(N) have similar functions to those of the peripheral devices 20(1) to 20(N) in the first embodiment.

[0031] The numerical control device 10A is a numerical control device known to those skilled in the art for controlling the operation of a machine tool (not shown), similar to the numerical control device 10 according to the first embodiment. If the machine tool (not shown) is a robot or the like, the numerical control device 10A may be a robot control device or the like. The numerical control device 10A includes, for example, a control unit 11a and a storage unit 12. The control unit 11a also includes a library generation unit 110 and a shared variable definition output unit 111. The storage unit 12 has the same functions as the storage unit 12 of the first embodiment. The shared variable definition 120, the shared variables 121, and the template storage unit 122 are the same as the shared variable definition 120, the shared variables 121, and the template storage unit 122 of the first embodiment.

[0032] The control unit 11a includes a CPU, ROM, RAM, CMOS memory, etc., which are configured to be able to communicate with each other via a bus and are well known to those skilled in the art. The CPU is a processor that controls the entire numerical control device 10A. The CPU reads system programs and application programs stored in the ROM via the bus and controls the entire numerical control device 10A in accordance with the system programs and application programs. As a result, as shown in FIG. 8, the control unit 11a is configured to realize the functions of a library generation unit 110 and a shared variable definition output unit 111. The library generation unit 110 has the same functions as the library generation unit 110 of the first embodiment.

[0033] The shared variable definition output unit 111 outputs the shared variable definition 120 to the program editing device 30, for example.

[0034] <Program editing device 30> The program editing device 30 is, for example, a computer or a tablet terminal, and is configured to include a compilation unit 31. Note that the program editing device 30 is equipped with a processing unit (not shown), such as a CPU, in order to realize the operations of the functional blocks in Fig. 8. The program editing device 30 also is equipped with an auxiliary storage device (not shown), such as a ROM, SSD, or HDD, in which various control programs are stored, and a main storage device (not shown), such as a RAM, for storing data temporarily required when the processing unit executes a program.

[0035] In the program editing device 30, the arithmetic processing unit reads the OS and application software from the auxiliary storage device, and executes arithmetic processing based on the OS and application software while loading the read OS and application software into the main storage device. Based on the results of this calculation, the program editing device 30 controls each piece of hardware. This realizes the processing by the functional blocks in Figure 8. In other words, the program editing device 30 can be realized by the cooperation of hardware and software.

[0036] The compiling unit 31 creates control programs for each of the peripheral devices 20(1) to 20(N) that reference the shared variables from the shared variable definitions 120 received from the numerical control device 10A, based on user input operations via an input device (not shown), such as a keyboard or touch panel, included in the program editing device 30. The compiling unit 31 compiles the created control programs and outputs them to each of the peripheral devices 20(1) to 20(N).

[0037] <Control Processing of Control System 1> Next, the flow of the control processing of the control system 1 will be described with reference to Fig. 9. Fig. 9 is a flowchart illustrating the control processing of the control system 1. Note that the processing of steps S11 to S13, step S21, and steps S22 to S24 is the same as the processing of steps S11 to S13, and steps S21 to S22 to S24 in Fig. 7, and therefore description thereof will be omitted.

[0038] In step S14, the numerical control device 10A (shared variable definition output unit 111) outputs the shared variable definition 120 to the program editing device 30. Note that the process of step S14 may be executed in parallel with the processes of steps S11 to S13.

[0039] In step S31, the program editing device 30 (compiler 31) receives the shared variable definition 120 output in step S14.

[0040] In step S32, the program editing device 30 (compiler 31) creates a control program for the peripheral device 20(1) that references the shared variables from the shared variable definition 120 received in step S31, based on the user's input operation.

[0041] In step S33, the program editing device 30 (compiler 31) compiles the control program created in step S32 and outputs it to the peripheral device 20(1).

[0042] In step S21a, the peripheral device 20(1) receives the control program output in step S33 and stores it in the control program storage unit 220 of the storage unit 22.

[0043] As described above, the control system 1 according to the second embodiment can reduce the burden on the user in creating a control program by eliminating the need to explicitly use a call process to access a shared variable when creating the control program. Furthermore, even when the shared variable definition 120 is added or changed, the control system 1 generates a shared variable access library and converts the control program each time, eliminating the need for the user to manually recompile the control program. The second embodiment has been described above.

[0044] As described above in the first and second embodiments, the control system 1 of the present disclosure can reduce the burden on users in creating control programs without explicitly using call processes to access shared variables when creating control programs.

[0045] <Modifications> In the first and second embodiments, the numerical control device 10, 10A and the peripheral devices 20(1) to 20(N) are different devices, but this is not limiting. For example, the numerical control device 10, 10A may include the peripheral devices 20(1) to 20(N).

[0046] Note that the functions included in the control system 1 in the first and second embodiments can be realized by hardware, software, or a combination of these. Here, "realized by software" means that the functions are realized by a computer reading and executing a program.

[0047] The program can be stored and supplied to a computer using various types of non-transitory computer-readable media. 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 Memory), CD-Rs, CD-R / Ws, and semiconductor memories (e.g., mask ROMs, PROMs (Programmable ROMs), EPROMs (Erasable PROMs), flash ROMs, and RAMs). The program may be provided to the computer by various types of transient computer-readable media. Examples of transient computer-readable media include electrical signals, optical signals, and electromagnetic waves. The transient computer-readable media can provide the program to the computer via a wired communication path such as an electrical wire or optical fiber, or via a wireless communication path.

[0048] The step of executing the program recorded on the recording medium includes not only processes that are performed in chronological order, but also processes that are not necessarily performed in chronological order but are performed in parallel or individually. Also, the step of writing the program may be performed by cloud computing.

[0049] Although the present disclosure has been described in detail, the present disclosure is not limited to the individual embodiments described above. Various additions, substitutions, modifications, partial deletions, etc. are possible in 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. These embodiments can also be implemented in combination. For example, in the above-described embodiments, the order of each operation and the order of each process are shown as examples and are not limited to these. The same applies when numerical values ​​or mathematical expressions are used in the description of the above-described embodiments.

[0050] The following supplementary note is further disclosed regarding the above embodiment and modified examples. (Supplementary Note 1) A control system (1) includes a plurality of peripheral devices (20(1) to 20(N)) and a control device (10) including shared variables that can be shared among the plurality of peripheral devices (20(1) to 20(N)), the control device (10) including a library generation unit (110) that extracts shared variable information including at least offset and size information from the definition of the shared variable and generates a shared variable access library for accessing the shared variable based on the shared variable information, and each of the plurality of peripheral devices (20(1) to 20(N)) includes an analysis unit (210) that analyzes reference code that references the shared variable from a control program to be executed, a conversion unit (211) that converts the control program by inserting a call to a shared variable access library that accesses the shared variable referenced in the reference code at the position of the reference code analyzed by the analysis unit (210), and an execution unit (212) that executes the control program converted by the conversion unit (211). (Supplementary Note 2) In the control system (1) of Supplementary Note 1, the control device (10) includes a template storage unit (122) that stores a template in which code for accessing shared variables is written in advance and into which shared variable information can be input, and the library generation unit (110) generates a library for accessing shared variables by inputting the offset and size of the extracted shared variable information into the template. (Supplementary Note 3) In the control system (1) of Supplementary Note 1 or Supplementary Note 2, the control device (10) includes a plurality of peripheral devices (20(1) to 20(N)). (Supplementary Note 4) The control system (1) of Supplementary Note 1 or Supplementary Note 2 includes a program editing device (30) that compiles control programs for each of a plurality of peripheral devices (20(1) to 20(N)) and outputs the control programs to each of the plurality of peripheral devices (20(1) to 20(N)), and the control device (10A) includes a shared variable definition output unit (111) that outputs definitions of shared variables to the program editing device (30), and the program editing device (30) creates control programs for each of the plurality of peripheral devices (20(1) to 20(N)) that reference shared variables from the shared variable definitions received from the control device (10A) based on a user's input operation.

[0051] 1 Control system 10, 10A Numerical control device 11, 11a Control unit 110 Library generation unit 111 Shared variable definition output unit 12 Storage unit 120 Shared variable definition 121 Shared variable 122 Template storage unit 20(1) to 20(N) Peripheral device 21 Control unit 210 Analysis unit 211 Conversion unit 212 Execution unit 22 Storage unit 220 Control program storage unit 30 Program editing device 31 Compilation unit

Claims

1. A control system comprising: a plurality of peripheral devices; and a control device including shared variables that can be shared among the plurality of peripheral devices, wherein the control device comprises a library generation unit that extracts shared variable information including at least offset and size information from the definition of the shared variable, and generates a shared variable access library for accessing the shared variable based on the shared variable information, and each of the plurality of peripheral devices comprises: an analysis unit that analyzes a reference code that references the shared variable from a control program to be executed; a conversion unit that converts the control program by inserting a call to the shared variable access library that accesses the shared variable referenced in the reference code at the position of the reference code analyzed by the analysis unit; and an execution unit that executes the control program converted by the conversion unit.

2. The control system of claim 1, wherein the control device includes a template storage unit that stores a template in which code for accessing the shared variables is written in advance and into which the shared variable information can be input, and the library generation unit generates the library for accessing the shared variables by inputting the offset and size of the extracted shared variable information into the template.

3. A control system as described in claim 1 or claim 2, wherein the control device includes the plurality of peripheral devices.

4. A control system as described in claim 1 or claim 2, further comprising a program editing device which compiles the control program for each of the multiple peripheral devices and outputs it to each of the multiple peripheral devices, wherein the control device comprises a shared variable definition output unit which outputs a definition of the shared variable to the program editing device, and the program editing device creates the control program for each of the multiple peripheral devices which references the shared variable from the shared variable definition received from the control device based on a user's input operation.

Citation Information

Patent Citations

  • Industrial controller and data sharing method for industrial controller

    JP2018185772A

  • Control device and control method

    JP2020008941A

  • Control system, control device, terminal device, and program

    JP2020064399A

  • Setting method for shared memory and computer

    JP2022016031A