WO2014184962A1 - プログラマブルコントローラとその周辺装置、およびプログラマブルコントローラのテーブルデータアクセスプログラム - Google Patents

プログラマブルコントローラとその周辺装置、およびプログラマブルコントローラのテーブルデータアクセスプログラム Download PDF

Info

Publication number
WO2014184962A1
WO2014184962A1 PCT/JP2013/063855 JP2013063855W WO2014184962A1 WO 2014184962 A1 WO2014184962 A1 WO 2014184962A1 JP 2013063855 W JP2013063855 W JP 2013063855W WO 2014184962 A1 WO2014184962 A1 WO 2014184962A1
Authority
WO
WIPO (PCT)
Prior art keywords
database
instruction
programmable controller
access
data
Prior art date
Application number
PCT/JP2013/063855
Other languages
English (en)
French (fr)
Inventor
新 谷出
Original Assignee
三菱電機株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 三菱電機株式会社 filed Critical 三菱電機株式会社
Priority to KR1020157034855A priority Critical patent/KR101821032B1/ko
Priority to US14/890,187 priority patent/US9841744B2/en
Priority to DE112013006971.7T priority patent/DE112013006971T5/de
Priority to CN201380076644.2A priority patent/CN105209986B/zh
Priority to JP2013541092A priority patent/JP5518266B1/ja
Priority to PCT/JP2013/063855 priority patent/WO2014184962A1/ja
Priority to TW102142790A priority patent/TWI509377B/zh
Publication of WO2014184962A1 publication Critical patent/WO2014184962A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0426Programming the control sequence
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • G05B19/056Programming the PLC
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/13Plc programming
    • G05B2219/13004Programming the plc
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/13Plc programming
    • G05B2219/13041Display ladder or logic diagram, mnemonics, switch between two display
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/15Plc structure of the system
    • G05B2219/15064MMU, memory management unit
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/22Pc multi processor system
    • G05B2219/2241Real time database, each processor stores in local memory used variables

Definitions

  • the present invention relates to a programmable controller and its peripheral devices, and a table data access program for the programmable controller.
  • Programmable controller reads / writes device data contained in the device according to the sequence program created by the user. Thereby, for example, the status of input devices such as relays, switches, and sensors connected to the programmable controller is acquired, and output devices such as actuators and valves are controlled.
  • the device data for example, recipe data such as the size and color of the product and record data such as the number of products produced and the number of defective products are stored. Therefore, the operator can flexibly change the product by creating a sequence program so as to acquire data necessary for controlling the input / output device from the recipe data. Further, if a sequence program is created so as to store the control results as actual data, inventory management of the members involved in production can be easily performed.
  • Data such as recipe data and performance data is stored in the programmable controller in a two-dimensional data table (hereinafter referred to as “table”) format, represented by CSV (Comma Separated Values), so that the host computer system can easily handle it. It is common to be done. In order for the programmable controller to access these data, these data must be read onto the device memory. In order to uniquely identify the table data (recipe data, actual data, etc.) that is an element in the table, the table row number and column number may be specified. However, device memory does not have the concept of rows and columns, and table data is continuously arranged on the device memory, so when the programmable controller accesses device data on the device memory, it calculates the device address. There must be.
  • Patent Document 1 a technique capable of handling one-dimensional data as data of a two-dimensional table even with a programmable controller (for example, Patent Document 1).
  • a table definition command having a table identification number, the number of table rows, the number of table columns, and the head device address of the table is defined for each table.
  • an element is extracted from the one-dimensional data by a table element read command for designating an element to be read using the row number and column number on the data of the two-dimensional table as arguments.
  • the device address of the element to be read is the device address of the element to be read on the device memory using the head device address and the number of table columns of the table definition instruction and the row number and column number of the table element read instruction. Calculate the address.
  • the present invention has been made in view of the above, and when reading data from a database, a programmable controller and a table data access program for the programmable controller that can reduce the number of steps of reading from the database as compared with the prior art.
  • the purpose is to obtain.
  • Another object of the present invention is to obtain a peripheral device capable of programming such a programmable controller program.
  • a programmable controller includes an instruction execution unit that sequentially executes a plurality of instructions in a user program, and a database that holds data used for processing in the instruction execution unit in a tabular format
  • a database storage means for storing the database inquiry instruction generation means for converting the access instruction into a database inquiry instruction in a database inquiry language when the instruction for accessing the database is included in the instruction;
  • Database management means for accessing the database in the database storage means and acquiring data specified by the database inquiry command.
  • the database query command generating means converts the database access command into the database query command in the database query language
  • the database management means accesses the database in the database storage means
  • the database query Since the data specified by the instruction for use is acquired and the acquired data is written by the END instruction processing means at the address specified by the instruction for access of the user data storage means at the time of END instruction processing in the user program,
  • the number of steps of reading from the database can be reduced as compared with the conventional case.
  • FIG. 1 is a block diagram schematically showing a functional configuration of the programmable controller according to the first embodiment.
  • FIG. 2 is a diagram schematically showing the configuration of the program storage unit.
  • FIG. 3 is a diagram illustrating an example of a database.
  • FIG. 4 is a diagram illustrating an example of the contents of the DB_OPEN instruction.
  • FIG. 5 is a diagram illustrating an example of the contents of the DB_SELECT instruction.
  • FIG. 6 is a diagram illustrating an example of the contents of the DB_CLOSE instruction.
  • FIG. 7 is a diagram illustrating an example of a database read instruction in the ladder program.
  • FIG. 8 is a flowchart illustrating an example of a procedure of overall processing of the programmable controller.
  • FIG. 8 is a flowchart illustrating an example of a procedure of overall processing of the programmable controller.
  • FIG. 9 is a flowchart illustrating an example of a procedure for executing a database access instruction.
  • FIG. 10 is a diagram schematically showing a state of processing of a database access instruction.
  • FIG. 11 is a diagram illustrating an example of processing for generating a database inquiry command from a database access command.
  • FIG. 12 is a flowchart illustrating an example of the procedure of the completion confirmation process during the END process.
  • FIG. 13 is a block diagram schematically showing a functional configuration of the programmable controller according to the second embodiment.
  • FIG. 14 is a diagram showing an example of the contents of the database access setting information according to the second embodiment.
  • FIG. 15 is a diagram illustrating an example of a user program for instructing database reading according to the second embodiment.
  • FIG. 16 is a diagram illustrating an example of command conversion information when generating a database query command from the database access setting information.
  • FIG. 17 is a diagram schematically illustrating a state where data is read from another programmable controller connected to the network.
  • FIG. 18 is a block diagram schematically illustrating an example of the functional configuration of the engineering tool.
  • FIG. 1 is a block diagram schematically showing a functional configuration of the programmable controller according to the first embodiment.
  • the programmable controller 10 includes a user program storage unit 11, a user data storage unit 12 that is a user data storage unit, a database storage unit 13 that is a database storage unit, a system program storage unit 14, a calculation unit 15, and system data. And a system data storage unit 16 as storage means.
  • the user program storage unit 11 stores a user program such as a ladder program executed by the programmable controller 10.
  • FIG. 2 is a diagram schematically showing the configuration of the program storage unit.
  • the user program 111 is a set of a plurality of instructions 111-1, 111-2, ..., 111-E. Assume that the commands 111-1, 111-2,..., 111-E include a database access command for accessing the database.
  • the instructions include normal instructions 111-1, 111-2,... That execute program execution processing, and an END instruction 111-E that is executed at the end of the user program 111.
  • the database access command will be described later.
  • the user program storage unit 11 includes a nonvolatile storage device such as a ROM (Read Only Memory) or an EEPROM (Electrically Erasable ROM).
  • the user data storage unit 12 is a device memory that stores data used when executing the user program.
  • the user data storage unit 12 includes a search condition storage area 121 that stores a search condition necessary for executing a database access instruction, and a save area that is an area for temporarily saving data when executing a user program. 122.
  • the search condition storage area 121 stores a storage location of a database having data to be acquired and a search condition for data to be acquired. This search condition is preset by the user via an engineering tool (not shown). These storage locations and search conditions are used as arguments for a database access command to be described later.
  • the save area 122 stores the execution result of the database inquiry command.
  • DRAM Dynamic Random Access Memory
  • SRAM Static RAM
  • the database storage unit 13 stores, for example, a database of recipe data such as the size and color of the product and performance data such as the number of products produced and the number of defective products.
  • the database is composed of two-dimensional table data.
  • FIG. 3 is a diagram illustrating an example of a database. Here, a product size table that defines the size for each type of product is illustrated. Column 0 stores the product number for identifying the product, and columns 1 to 3 store the length, width, and height of the product, respectively. Rows 0 to 4 store records for each product.
  • the database storage unit 13 is a secondary storage device and is configured by a nonvolatile storage device such as a flash memory or a hard disk.
  • the system program storage unit 14 stores a system program executed by the calculation unit 15, so-called firmware.
  • a system program an instruction execution program that executes a normal instruction in a user program, and a database access instruction in a user program are converted into a database inquiry instruction in a format in which the arithmetic unit 15 can access data in the database storage unit 13. Examples include a database query command generation program to be converted, a database management program that accesses the database storage unit 13 based on the database query command, and an END command processing program that executes an END command in the user program.
  • the system program storage unit 14 is configured by a nonvolatile storage device such as a ROM or an EEPROM.
  • the instruction execution program is a program that causes the arithmetic unit 15 to sequentially interpret and execute the user program 111 stored in the user program storage unit 11. More specifically, the first instruction 111-1 included in the user program 111 is executed in order, and the instruction immediately before the last END instruction 111-E is executed. If there is a database access command in the user program 111, the process is passed to the database query command generation program.
  • the database inquiry command generation program is a database access command written in the user program (for example, ladder program) format in the calculation unit 15 when there is a database access command in the user program 111 of the user program storage unit 11. From the above, it is a program for generating a database query command described in a database query language.
  • the database query language is, for example, SQL.
  • the database inquiry command is a command for actually accessing the database when the database management program is executed, and is specifically a SQL command.
  • the generated database inquiry command is stored in the system data storage unit 16.
  • the database management program is a program that causes the operation unit 15 to read, interpret, and execute a database inquiry command stored in the database inquiry command storage area 161 of the system data storage unit 16. Specifically, the database inquiry command is read, and the target data (element) is directly extracted from the database in the database storage unit 13.
  • the END instruction processing program is a program that causes the arithmetic unit 15 to execute the last END instruction 111-E in the user program stored in the system program storage unit.
  • the END command 111-E performs processing other than normal command execution, including communication processing with a personal computer or an external device and acquisition processing of a result of executing a database query command by the database management program.
  • the data extracted by the database management program is written at the location specified by the database access command in the save area 122 of the user data storage unit 12.
  • the calculation unit 15 executes a system program (firmware) stored in the system program storage unit 14.
  • the instruction execution means corresponds to the calculation section 15 that is executing the instruction execution program
  • the database inquiry instruction generation means corresponds to the calculation section 15 that is executing the database inquiry instruction generation program
  • the database management means is
  • the END command processing means corresponds to the computing unit 15 executing the END command processing program.
  • the system data storage unit 16 is a work memory in which the firmware temporarily stores data.
  • the database query command generated by the calculation unit 15 is temporarily stored.
  • a DRAM or SRAM can be used as the system data storage unit 16.
  • the programmable controller having such a configuration includes a CPU (Central Processing Unit), a ROM, a main storage device, a secondary storage device, and a network unit. Then, a function to be executed by the arithmetic unit 15 is described in a program, the program is stored in the system program storage unit 14, and the program is executed by the CPU, whereby the programmable controller having the above configuration can be obtained.
  • a CPU Central Processing Unit
  • ROM Read Only Memory
  • main storage device main storage device
  • secondary storage device a secondary storage device
  • the programmable controller 10 directly accesses and acquires target data in the database of the database storage unit 13 and stores the result in the save area 122 of the user data storage unit 12. Therefore, a database access instruction for realizing such processing is defined by a ladder program (user program).
  • a ladder program user program
  • three instructions are defined: a DB_OPEN instruction, a DB_SELECT instruction, and a DB_CLOSE instruction.
  • FIG. 4 is a diagram showing an example of the contents of the DB_OPEN instruction
  • (a) is a diagram showing an example of the structure of the DB_OPEN instruction
  • (b) is a diagram showing an example of the DB_OPEN instruction.
  • (C) is a figure which shows typically the relationship between a device memory and the argument of a DB_OPEN command.
  • the DB_OPEN command is a command for opening a database as an operation target in the database storage unit 13.
  • the DB_OPEN instruction includes three arguments A1 to A3.
  • the argument A1 specifies the database that is the operation target (open target)
  • the argument A2 specifies the database identifier that identifies the database to be opened
  • the argument A3 specifies the device that indicates that the open process has been completed.
  • the argument A1 specifies the database that is the operation target (open target)
  • the argument A2 specifies the database identifier that identifies the database to be opened
  • the argument A3 specifies the device
  • a device (address) in the user data storage unit 12 can be designated.
  • a device (address) in the user data storage unit 12 is input to the arguments A1 and A2, and information on the database to be opened is stored in the devices.
  • the values of the IP (Internet Protocol) address “127.0.0.1” of the device (programmable controller) having the database storage unit 13 are input to the devices D1000 to D1003.
  • the database name “MyDB” to be opened in the database storage unit 13 is input to the devices D1004 to D1006.
  • a completion device M0 that is turned on when the opening process of the database to be opened is completed is set.
  • FIG. 5 is a diagram showing an example of the contents of the DB_SELECT instruction
  • (a) is a diagram showing an example of the structure of the DB_SELECT instruction
  • (b) is a diagram showing an example of the DB_SELECT instruction.
  • (C) is a figure which shows typically the relationship between a device memory and the argument of a DB_SELECT command.
  • the DB_SELECT instruction is an instruction for extracting desired data from the database opened by the DB_OPEN instruction.
  • the DB_SELECT instruction includes five arguments B1 to B5. In the argument B1, a database identifier that designates the database to be operated is specified.
  • argument B2 a condition for specifying a record to be read from the operation target table in the operation target database is specified.
  • the argument is specified.
  • the field to be read is specified from the record specified by B2, the storage location of the data read by arguments B2 and B3 is specified by argument B4, and the device indicating that the read processing is completed is specified by argument B5.
  • arguments B1 to B4 devices (addresses) in the user data storage unit 12 can be designated.
  • the argument B1 is the same as the database identifier specified by the argument A2 of the DB_OPEN instruction.
  • a device in the user data storage unit 12 in which the read target table in the operation target database and the read target record specifying information including the read target record are stored is specified. In this example, as shown in FIG.
  • the read field designation information is “2”, which is the number of fields stored in “D0” in the user data storage unit 12, and “D1 to D3”.
  • the field name 1 to be stored includes “length” and the field name 2 to be stored in “D4 to D6” includes “height”. That is, a condition for extracting data corresponding to the two field names “length” and “height” from the record having the product number “3” in the product size table is stored.
  • Argument B4 is designated by arguments B2 and B3, and designates a position in the user data storage unit 12 where the read data is stored.
  • “1” indicating the number of read records is specified in “D100” in the user data storage unit 12, and specified in the argument B3 in “D101”.
  • the read data 1 “9000” corresponding to the field name 1 is stored, and the read data 2 “700” corresponding to the field name 2 specified by the argument B3 is stored in “D102”.
  • a completion device M1 that is turned on when the reading process from the operation target database is completed is set.
  • FIG. 6 is a diagram showing an example of the contents of the DB_CLOSE instruction
  • (a) is a diagram showing an example of the structure of the DB_CLOSE instruction
  • (b) is a diagram showing an example of the DB_CLOSE instruction.
  • the DB_CLOSE command is a command for closing the database that is the operation target in the database storage unit 13.
  • the DB_CLOSE instruction includes one argument C1.
  • a database identifier that specifies a database to be closed is specified.
  • This database identifier is the same as the database identifier specified by the argument A2 of the DB_OPEN instruction or the argument B1 of the DB_SELECT instruction.
  • As an argument C1 as shown in FIG. 6B, a device (address) in the user data storage unit 12 can be designated.
  • FIG. 7 is a diagram illustrating an example of a database read instruction in the ladder program. An outline of the operation of this ladder program will be described.
  • step S12 when an instruction to read a database is given (step S11), a DB_OPEN instruction is executed first (step S12).
  • the database named “MyDB” of the device whose IP address is “127.0.0.1” is opened from each device in the user data storage unit 12.
  • the device “M0” is turned on.
  • step S13 DB_SELECT instruction
  • the reading process is completed, the device “M1” is turned on.
  • step S14 the next DB_CLOSE command is executed (step S14).
  • MyDB which is the operation target database, is closed. This completes the database access process.
  • FIG. 8 is a flowchart illustrating an example of a procedure of overall processing of the programmable controller.
  • the calculation unit 15 of the programmable controller 10 performs a program execution process for executing a normal instruction in the user program 111 stored in the user program storage unit 11 (step S31).
  • the instruction 111-1 to the instruction before the END instruction 111-E in the user program 111 shown in FIG. 2 are executed in order.
  • the arithmetic unit 15 executes a normal instruction before the END instruction 111-E in the user program 111, it executes an END process by the END instruction 111-E based on the END instruction processing program (step S32).
  • the END processing performs processing other than communication with a personal computer or an external device connected to the programmable controller 10 via a communication line and execution of a normal command.
  • the process returns to step S31 again, and the process is executed by the arithmetic unit 15 in order from the instruction 111-1 of the user program 111.
  • the instructions 111-1 to 111-E in the user program 111 are repeatedly executed in order.
  • FIG. 9 is a flowchart illustrating an example of a procedure for executing a database access instruction
  • FIG. 10 is a diagram schematically illustrating a process of the database access instruction
  • FIG. 11 is a database access instruction. It is a figure which shows an example of the production
  • the database access instruction execution process of FIG. 9 is the same as the database access instruction detected by the operation unit 15 during the program execution process of step S31 of FIG. Is executed by passing
  • the computing unit 15 performs processing for opening the target database based on the database query command generation program, and acquires information necessary for generating SQL from the argument in the acquired database access command (DB_SELECT command) (Step S1). S51).
  • the operation target table, the records in the operation target table, and the fields to be extracted from the operation target records are extracted from the operation target database. As shown in the example of FIG. 5, these conditions are stored at addresses specified by the arguments B ⁇ b> 2 and B ⁇ b> 3 of the user data storage unit 12.
  • FIG. 11A shows an SQL statement generated from a database access instruction in the ladder program of FIG.
  • the SQL statement has a SELECT clause, a FROM clause, and a WHERE clause, and an argument is set in each clause.
  • the generation of the SQL statement from the database access instruction is performed based on the instruction conversion information in which the argument of the database access instruction is associated with the argument of the SQL statement.
  • FIG. 11B is a diagram illustrating an example of instruction conversion information.
  • the argument of the SQL statement is defined using the device of the user data storage unit 12. This makes it possible to generate a SQL statement (database query command) from the database access command shown in FIG. This is only an example, and it is only necessary to prepare instruction conversion information according to the type of SQL sentence.
  • the calculation unit 15 stores the generated SQL statement in the database inquiry command storage area 161 of the system data storage unit 16 (step S53).
  • the computing unit 15 issues the generated SQL statement to the database specified by the argument B1 of the DB_SELECT instruction that is a database access instruction based on the database management program (step S54).
  • the calculation unit 15 directly accesses the designated database in the database storage unit 13 according to the SQL statement, and acquires the target data.
  • the execution process of the database access instruction is completed, and the process returns to step S31 in FIG.
  • the database access instruction execution processing is completed without waiting for the database processing result after issuing the SQL.
  • the completion confirmation of the processing result of this database is performed by END processing.
  • FIG. 12 is a flowchart illustrating an example of the procedure of the completion confirmation process during the END process.
  • the calculation unit 15 determines whether or not an SQL has been issued (step S71). If the SQL has not been issued (No in step S71), no SQL has been issued and there is no need to confirm completion, so the processing ends.
  • step S71 it is determined whether or not the processing of the issued SQL is completed. If the issued SQL process is incomplete (No in step S72), no process is performed and the completion confirmation process ends. In this case, reconfirmation is performed at the next END processing.
  • step S72 when the issued SQL processing is completed (Yes in step S72), the calculation unit 15 stores the acquired SQL result in the user data storage unit 12 specified by the argument B4 of the DB_SELECT instruction. Store in the position (step S73). Thereafter, the computing unit 15 turns on the completion device specified by the argument B5 of the DB_SELECT instruction (step S74), and the target database is closed. Thus, the completion confirmation process during the END process is completed.
  • the database access command for reading data from the database has been described.
  • the present invention is not limited to this.
  • an instruction for writing data such as adding, changing, or deleting data in the database.
  • Such a database write command writes, as arguments, a database identifier (database specification information) for specifying the operation target database, a table name for adding data in the operation target database, and data in the operation target table. At least the name of the desired field and the content of the data to be written.
  • the database access command is a command for accessing the database such as reading or writing of data stored in the database.
  • a database access instruction used in a ladder program is defined, an argument designated by the database access instruction is associated with an argument of an SQL statement, and the database access instruction is included in the user program.
  • an SQL statement is generated from the database access command based on the association, and an SQL is issued.
  • the user data storage unit 12 since it is not necessary to develop the database in the user data storage unit 12, the user data storage unit 12 does not need to have a capacity considering the size of the database. That is, the data read from the database storage unit 13 to the user data storage unit 12 is limited to the minimum data necessary for processing. As a result, there is an effect that the capacity (usage amount) of the user data storage unit 12 can be reduced as compared with the conventional case.
  • the data storage location (address) when the two-dimensional structure database is expanded to the one-dimensional user data storage unit 12 is ladder-written. There is no need to calculate on the program. As a result, there is an effect that programming becomes easy. In addition, even when the data structure of the database is changed, it is not necessary to change the database access instruction created in the user program in order to acquire data of the same field.
  • the database can be accessed from the programmable controller 10, and even the user of the programmable controller 10 who does not know a language specific to the database such as SQL uses the data in the database.
  • the effect is that a program can be created.
  • Embodiment 2 the case of defining a database access instruction and incorporating it into a user program (ladder program) has been shown.
  • database operation setting information is defined, and when a database read instruction is executed, the database operation setting information is read and the same processing as in the first embodiment is performed. The case will be described.
  • FIG. 13 is a block diagram schematically showing a functional configuration of the programmable controller according to the second embodiment.
  • the user program in the user program storage unit 11 does not include a database access command
  • the system data storage unit 16 stores the database access setting information 161 in addition to the database inquiry command storage area 161.
  • a database access setting information storage area 162 to be stored is included.
  • the arithmetic unit 15 creates a database inquiry command based on the database access setting information 162A.
  • FIG. 14 is a diagram showing an example of the contents of the database access setting information according to the second embodiment.
  • the database access setting information 162A includes a target database, a target table, a relationship between a field name and a device, a read condition, and an execution trigger as setting items.
  • Target database specifies the database to be operated. For example, an address (IP address) of a device (programmable controller) in which a database to be operated is stored and a database name in the device specified by the IP address are specified.
  • IP address IP address
  • the target table specifies a table to be operated in the target database.
  • the relationship between the field name and the device specifies the field name of the data acquired from the target table and the storage location of the acquired data in the user data storage unit 12.
  • the read condition specifies a target row (record) to be read from the target table.
  • the execution trigger specifies the timing for storing the read data in the user data storage unit 12.
  • the operation target database is specified by the IP address and the database name of the “target database” item
  • the operation target table in the database is specified by the table name of the “target table” item.
  • the data specified by the field name of the “field name and device” item is read from the record specified by the field name of the “reading condition” item, and this data is the relationship between the field name and the device. It is stored in the device in the device memory specified by. The timing at which this data is read is when the trigger device in the “execution trigger” item is turned on.
  • FIG. 15 is a diagram showing an example of a user program for instructing database reading according to the second embodiment.
  • the user program stores “K3” indicating the product number of the product table in “D1212” of the user data storage unit 12 (step S92) and the device “M0”. ”Is turned on (step S93).
  • FIG. 16 is a diagram illustrating an example of command conversion information when generating a database query command from the database access setting information.
  • the argument of the SQL statement is defined using the contents of the database access setting information 162A.
  • the calculation unit 15 generates the SQL statement shown in FIG.
  • the “target database” item indicates a case where the own programmable controller 10 is specified, but the programmable controller 10 is normally connected via a network. It is also possible to acquire data from a database in the database storage unit 13 of another programmable controller 10 (or device).
  • FIG. 17 is a diagram schematically showing a state in which data is read from another programmable controller connected to the network.
  • FIG. 17A schematically illustrates a system configuration in which the programmable controllers 10 ⁇ / b> A and 10 ⁇ / b> B are connected to the network 30.
  • the network 30 includes a programmable controller 10A having a database storage unit 13A and an IP address “192.168.1.1” and a programmable controller 10B having an IP address “192.168.1.2”. Connected through.
  • the IP address and database name of the programmable controller 10A are set in the “target database” item of the database access setting information 152B.
  • FIG. 17C the user program shown in FIG. 17C is read, it is possible to access the database in the database storage unit 13A of the programmable controller 10A and acquire the data.
  • a database access condition is set in the database access setting information, and when the database read instruction is turned on during execution of the user program, the calculation unit 15 performs database processing based on the database access setting information. Generate a query command. The arithmetic unit 15 accesses the database according to the generated database inquiry command.
  • the access instruction to the database is not defined by the ladder program, it is possible for the user of the programmable controller 10 to easily set the access to the database. In addition to the effects of Form 1.
  • condition of data to be acquired can be specified by the database access setting information, it is not necessary to store the acquisition condition of the target data in the user data storage unit 12 as in the first embodiment. As a result, the user data storage unit 12 can be further reduced in capacity compared to the first embodiment.
  • the case of reading data from the database has been described as an example.
  • the conditions for writing to the setting information for database access Can be used to generate a database inquiry command based on the database access setting information.
  • Embodiment 3 An engineering tool for setting a user program in the first embodiment and setting database access setting information in the second embodiment will be described.
  • FIG. 18 is a block diagram schematically showing an example of the functional configuration of the engineering tool.
  • the engineering tool 50 includes a communication unit 51, an input unit 52, a display unit 53, a program creation screen display processing unit 54, a device memory setting screen display processing unit 55, a setting information setting screen display processing unit 56, and a setting.
  • the communication unit 51 communicates with the programmable controller 10.
  • the input unit 52 is an input interface with a user such as a keyboard or a pointing device.
  • the input unit 52 receives, for example, an input of a database access command or database access setting information set in the programmable controller 10.
  • the display unit 53 is a device that displays information to the user, such as a liquid crystal display device.
  • the program creation screen display processing unit 54 has a function of displaying a user program creation screen on the display unit 53.
  • a ladder program is used as the user program, an environment for creating the ladder program is presented to the user.
  • the database access command shown in the first embodiment is used as the user program, the database access command can be used on the user program creation screen.
  • the device memory setting screen display processing unit 55 has a function of displaying a device memory setting screen on the display unit 53.
  • the user data storage unit 12 stores the storage location of the database to be read as described above, the condition of data to be read from the database, the data read from the database, and the like.
  • the device memory setting screen is a setting screen for setting, for example, in which address of the device memory the information is stored.
  • the setting information setting screen display processing unit 56 has a function of displaying the setting information setting screen for database access on the display unit 53.
  • a setting screen for the database access setting information as shown in FIG. 14 is displayed on the display unit 53, for example.
  • the setting unit 57 is set (input) by the user via the input unit 52 in the program creation screen display processing unit 54, the device memory setting screen display processing unit 55, or the setting information setting screen display processing unit 56, and is confirmed. Is set in the programmable controller 10 via the communication unit 51.
  • the user program, device memory, and database access setting information are set for the user by the program creation screen display processing unit 54, the device memory setting screen display processing unit 55, and the setting information setting screen display processing unit 56. Screens to be displayed to the user, and the contents set on each screen are set in the programmable controller 10 by the setting unit 57.
  • the programmable controller 10 can directly create a database access command or database access setting information that can directly access the database in the database storage unit 13 and obtain desired data, and set it in the programmable controller 10. It has the effect of being able to.
  • the method for reading from the database in the user program including the database access command in the programmable controller 10 described above or the method for reading from the database based on the database access setting is configured as a program storing the processing procedure. Can do. And it is realizable by making this program run by above-mentioned programmable controller 10.
  • FIG. This program also includes hard disks, SSD (Solid State Drive), floppy (registered trademark) disks, CD (Compact Disk) -ROM, MO (Magneto-Optical disk), DVD (Digital Versatile Disk or Digital Video Disk), etc. It is recorded on a computer-readable recording medium.
  • the program may be read from the recording medium by the programmable controller 10 or may be read from the recording medium by an information processing terminal such as the engineering tool 50 connected to the programmable controller 10, and may be read from the recording controller via the network. 10 and may be read by the programmable controller 10.
  • This program can also be distributed through a network (communication line) such as the Internet.
  • the programmable controller according to the present invention is useful for a programmable controller that reads and processes data from a database stored in a secondary storage device.
  • 10, 10A, 10B programmable controller 11 user program storage unit, 12 user data storage unit, 13, 13A database storage unit, 14 system program storage unit, 15 operation unit, 16 system data storage unit, 30 network, 50 engineering tool, 51 communication unit, 52 input unit, 53 display unit, 54 program creation screen display processing unit, 55 device memory setting screen display processing unit, 56 setting information setting screen display processing unit, 57 setting unit, 58 control unit, 121 search condition storage Area, 122 save area, 152B database access setting information, 161 database inquiry command storage area, 162 database access setting information storage area.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Programmable Controllers (AREA)

Abstract

 プログラマブルコントローラ(10)は、ユーザプログラム中の複数の命令を順に実行する命令実行手段と、前記命令実行手段での処理に使用されるデータを表形式で保持するデータベースを格納するデータベース格納部(13)と、前記命令中に前記データベースへのアクセス用命令が含まれる場合に、前記アクセス用命令をデータベース問い合わせ言語によるデータベース問い合わせ用命令に変換するデータベース問い合わせ用命令生成手段と、前記データベース格納部(13)中の前記データベースにアクセスし、前記データベース問い合わせ用命令で指定されるデータを取得するデータベース管理手段と、を備える。

Description

プログラマブルコントローラとその周辺装置、およびプログラマブルコントローラのテーブルデータアクセスプログラム
 この発明は、プログラマブルコントローラとその周辺装置、およびプログラマブルコントローラのテーブルデータアクセスプログラムに関するものである。
 プログラマブルコントローラは、ユーザによって作成されたシーケンスプログラムに従い、内部に有するデバイスデータをリード/ライトする。これによって、たとえば、プログラマブルコントローラに接続されたリレー、スイッチ、センサ等の入力装置の状態取得が行われ、またアクチュエータ、バルブなどの出力装置の制御が行われる。デバイスデータには、たとえば生産品のサイズと色などのレシピデータと、生産品毎の生産個数、不良品個数などの実績データも格納されている。そのため、運用者は、入出力装置の制御に必要なデータを、レシピデータから取得するようにシーケンスプログラムを作成することによって、生産品の変更を柔軟に行うことができる。また、制御結果を、実績データとして格納するようにシーケンスプログラムを作成すれば、生産にかかる部材の在庫管理などを容易に行うこともできる。
 レシピデータや実績データなどのデータは、上位の計算機システムが扱いやすいように、CSV(Comma Separated Values)に代表される2次元のデータテーブル(以下、「テーブル」という)形式でプログラマブルコントローラ内に保存されるのが一般的である。プログラマブルコントローラがこれらのデータにアクセスするためには、これらのデータをデバイスメモリ上に読出さなければならない。テーブル内の要素であるテーブルデータ(レシピデータや実績データなど)を一意に特定するためには、テーブルの行(Column)番号と列(Row)番号を指定すればよい。しかし、デバイスメモリには行と列という概念が無くテーブルデータがデバイスメモリ上に連続的に配置されているため、プログラマブルコントローラがデバイスメモリ上のデバイスデータにアクセスする際には、デバイスアドレスを計算しなければならない。
 そこで、従来では、プログラマブルコントローラでも、1次元のデータを2次元のテーブルのデータとして扱うことができる技術が提案されている(たとえば、特許文献1)。ここでは、まず、テーブル識別番号、テーブル行数、テーブル列数およびテーブルの先頭デバイスアドレスを有するテーブル定義命令をテーブルごとに定義する。ついで、2次元のテーブルのデータ上での行番号および列番号を引数として用いて、読出し対象の要素を指定するテーブル要素読出し命令によって、1次元のデータから要素を抽出する。このとき、読出し対象の要素のデバイスアドレスは、テーブル定義命令の先頭デバイスアドレスおよびテーブル列数と、テーブル要素読出し命令の行番号および列番号と、を用いてデバイスメモリ上での読出し対象要素のデバイスアドレスを算出する。
特開2010-198132号公報
 しかしながら、特許文献1に記載のプログラマブルコントローラでは、テーブルデータ中の読出し対象要素を読出す場合に、テーブルデータをデバイスメモリ上に読出す工程と、デバイスメモリ上で読出し対象要素を検索する工程と、の2つの工程が必要であった。そのため、読出し対象要素を検索するのに時間がかかるという問題点があった。また、デバイスメモリは、テーブルデータを読出すことができるだけの記憶容量を有している必要があり、プログラマブルコントローラの製造コストが増加する要因となっていた。
 この発明は上記に鑑みてなされたもので、データベースからデータを読出す際に、従来に比してデータベースからの読出しの工程数を少なくすることができるプログラマブルコントローラとプログラマブルコントローラのテーブルデータアクセスプログラムを得ることを目的とする。また、そのようなプログラマブルコントローラのプログラムをプログラミングすることができる周辺装置を得ることも目的とする。
 上記目的を達成するため、この発明にかかるプログラマブルコントローラは、ユーザプログラム中の複数の命令を順に実行する命令実行手段と、前記命令実行手段での処理に使用されるデータを表形式で保持するデータベースを格納するデータベース格納手段と、前記命令中に前記データベースへのアクセス用命令が含まれる場合に、前記アクセス用命令をデータベース問い合わせ言語によるデータベース問い合わせ用命令に変換するデータベース問い合わせ用命令生成手段と、前記データベース格納手段中の前記データベースにアクセスし、前記データベース問い合わせ用命令で指定されるデータを取得するデータベース管理手段と、を備えることを特徴とする。
 この発明によれば、データベース問い合わせ用命令生成手段によって、データベースへのアクセス用命令がデータベース問い合わせ言語によるデータベース問い合わせ用命令に変換され、データベース管理手段によって、データベース格納手段中のデータベースにアクセスし、データベース問い合わせ用命令で指定されるデータが取得され、END命令処理手段によって、ユーザプログラム中のEND命令処理時に、取得されたデータがユーザデータ記憶手段のアクセス用命令で指定されるアドレスに書込まれるので、プログラマブルコントローラでデータベースからデータを読出す際に、従来に比してデータベースからの読出しの工程数を少なくすることができるという効果を有する。
図1は、実施の形態1によるプログラマブルコントローラの機能構成を模式的に示すブロック図である。 図2は、プログラム記憶部の構成を模式的に示す図である。 図3は、データベースの一例を示す図である。 図4は、DB_OPEN命令の内容の一例を示す図である。 図5は、DB_SELECT命令の内容の一例を示す図である。 図6は、DB_CLOSE命令の内容の一例を示す図である。 図7は、ラダープログラムにおけるデータベース読出し指示の一例を示す図である。 図8は、プログラマブルコントローラの全体処理の手順の一例を示すフローチャートである。 図9は、データベースアクセス用命令の実行処理の手順の一例を示すフローチャートである。 図10は、データベースアクセス用命令の処理の様子を模式的に示す図である。 図11は、データベースアクセス用命令からデータベース問い合わせ用命令の生成処理の一例を示す図である。 図12は、END処理時の完了確認処理の手順の一例を示すフローチャートである。 図13は、実施の形態2によるプログラマブルコントローラの機能構成を模式的に示すブロック図である。 図14は、実施の形態2によるデータベースアクセス用設定情報の内容の一例を示す図である。 図15は、実施の形態2によるデータベース読出し指示のユーザプログラムの一例を示す図である。 図16は、データベースアクセス用設定情報からデータベース問い合わせ用命令を生成する際の命令変換情報の一例を示す図である。 図17は、ネットワークに接続された他のプログラマブルコントローラからデータを読出す場合の様子を模式的に示す図である。 図18は、エンジニアリングツールの機能構成の一例を模式的に示すブロック図である。
 以下に添付図面を参照して、この発明にかかるプログラマブルコントローラとその周辺装置、およびプログラマブルコントローラのテーブルデータアクセスプログラムの好適な実施の形態を詳細に説明する。なお、これらの実施の形態によりこの発明が限定されるものではない。
実施の形態1.
 図1は、実施の形態1によるプログラマブルコントローラの機能構成を模式的に示すブロック図である。プログラマブルコントローラ10は、ユーザプログラム記憶部11と、ユーザデータ記憶手段であるユーザデータ記憶部12と、データベース格納手段であるデータベース格納部13と、システムプログラム記憶部14と、演算部15と、システムデータ記憶手段であるシステムデータ記憶部16と、を備える。
 ユーザプログラム記憶部11は、プログラマブルコントローラ10が実行するラダープログラムなどのユーザプログラムを記憶する。図2は、プログラム記憶部の構成を模式的に示す図である。ユーザプログラム111は、複数の命令111-1,111-2,・・・,111-Eの集合である。この命令111-1,111-2,・・・,111-Eの中に、データベースにアクセスするデータベースアクセス用命令が含まれているものとする。命令には、プログラム実行処理を実行する通常の命令111-1,111-2,・・・と、ユーザプログラム111の最後に実行されるEND命令111-Eと、がある。なお、データベースアクセス用命令については、後述する。ユーザプログラム記憶部11は、ROM(Read Only Memory)またはEEPROM(Electrically Erasable ROM)などの不揮発性記憶装置によって構成される。
 ユーザデータ記憶部12は、ユーザプログラムの実行時に使用されるデータを記憶するデバイスメモリである。ユーザデータ記憶部12は、データベースアクセス用命令の実行の際に必要な検索条件などを格納する検索条件格納領域121と、ユーザプログラムを実行する際に一時的にデータを退避する領域である退避領域122と、を有する。検索条件格納領域121には、取得するデータを有するデータベースの格納位置と、取得するデータの検索条件と、が格納される。この検索条件は、ユーザによって図示しないエンジニアリングツールを介して予め設定される。これらの格納位置と検索条件は、後述するデータベースアクセス用命令の引数となるものである。退避領域122には、データベース問い合わせ用命令の実行結果が格納される。ユーザデータ記憶部12として、DRAM(Dynamic Random Access Memory)またはSRAM(Static RAM)などを用いることができる。
 データベース格納部13は、たとえば生産品のサイズと色などのレシピデータと、生産品毎の生産個数、不良品個数といった実績データなどのデータベースを格納する。データベースは、2次元的なテーブルデータによって構成される。図3は、データベースの一例を示す図である。ここでは、製品の種類ごとにサイズを規定した製品サイズテーブルを例示している。列0には製品を識別する製品番号が格納され、列1~3にはそれぞれ製品の長さ、幅、高さが格納されている。行0~行4には、各製品のレコードが格納される。データベース格納部13は、2次記憶装置であり、フラッシュメモリやハードディスクなどの不揮発性記憶装置によって構成される。
 システムプログラム記憶部14は、演算部15が実行するシステムプログラム、いわゆるファームウェアを記憶する。システムプログラムとして、ユーザプログラム中の通常の命令を実行する命令実行プログラム、ユーザプログラム中のデータベースアクセス用命令を、データベース格納部13中のデータに演算部15がアクセス可能な形式のデータベース問い合わせ用命令に変換するデータベース問い合わせ用命令生成プログラム、データベース問い合わせ用命令に基づいてデータベース格納部13にアクセスするデータベース管理プログラム、およびユーザプログラム中のEND命令を実行するEND命令処理プログラムなどを挙げることができる。システムプログラム記憶部14は、ROMまたはEEPROMなどの不揮発性記憶装置によって構成される。
 命令実行プログラムは、演算部15に、ユーザプログラム記憶部11に記憶されるユーザプログラム111を逐次解釈し、実行させるプログラムである。具体的には、ユーザプログラム111中に含まれる最初の命令111-1から順に実行し、最後のEND命令111-Eの直前の命令までを実行させる。また、ユーザプログラム111中にデータベースアクセス用命令がある場合には、その処理をデータベース問い合わせ用命令生成プログラムに渡す。
 データベース問い合わせ用命令生成プログラムは、ユーザプログラム記憶部11のユーザプログラム111中にデータベースアクセス用命令がある場合に、演算部15に、ユーザプログラム(たとえばラダープログラム)形式で記述されているデータベースアクセス用命令から、データベース問い合わせ言語で記述されているデータベース問い合わせ用命令を生成させるプログラムである。データベース問い合わせ言語は、たとえばSQLである。また、データベース問い合わせ用命令は、データベース管理プログラムの実行時に実際にデータベースにアクセスする際のコマンドであり、具体的にはSQLのコマンドである。生成したデータベース問い合わせ用命令は、システムデータ記憶部16に記憶される。
 データベース管理プログラムは、演算部15に、システムデータ記憶部16のデータベース問い合わせ用命令格納領域161に記憶されたデータベース問い合わせ用命令を読み込ませ、解釈させ、実行させるプログラムである。具体的には、データベース問い合わせ用命令を読み込み、データベース格納部13のデータベースから目的とするデータ(要素)を直接に抽出する。
 END命令処理プログラムは、演算部15に、システムプログラム記憶部に記憶されているユーザプログラム中の最後のEND命令111-Eを実行させるプログラムである。END命令111-Eは、パーソナルコンピュータまたは外部機器との間の通信処理と、データベース管理プログラムによるデータベース問い合わせ用命令を実行した結果の取得処理と、を含む通常の命令の実行以外の処理を行う。データベース問い合わせ用命令を実行した結果の取得処理では、データベース管理プログラムによって抽出されたデータを、ユーザデータ記憶部12の退避領域122中のデータベースアクセス用命令で指定された位置に書込む。
 演算部15は、システムプログラム記憶部14中に格納されるシステムプログラム(ファームウェア)を実行する。なお、命令実行手段は、命令実行プログラムを実行中の演算部15に対応し、データベース問い合わせ用命令生成手段は、データベース問い合わせ用命令生成プログラムを実行中の演算部15に対応し、データベース管理手段は、データベース管理プログラムを実行中の演算部15に対応し、END命令処理手段は、END命令処理プログラムを実行中の演算部15に対応している。
 システムデータ記憶部16は、ファームウェアが一時的にデータを置くワークメモリである。ここでは、演算部15によって生成されたデータベース問い合わせ用命令が一時的に記憶される。システムデータ記憶部16として、DRAMまたはSRAMなどを用いることができる。
 このような構成のプログラマブルコントローラは、CPU(Central Processing Unit)、ROM、主記憶装置、2次記憶装置、ネットワークユニットを有する。そして、演算部15で実行する機能をプログラムに記述し、そのプログラムをシステムプログラム記憶部14に記憶し、CPUでそのプログラムを実行することによって、上記構成のプログラマブルコントローラを得ることができる。
 この実施の形態1では、プログラマブルコントローラ10は、データベース格納部13のデータベース中の目的とするデータに直接アクセスして取得し、その結果をユーザデータ記憶部12の退避領域122に格納する。そこで、このような処理を実現するデータベースアクセス用命令が、ラダープログラム(ユーザプログラム)で定義されている。ここでは、DB_OPEN命令、DB_SELECT命令、DB_CLOSE命令の3つの命令を定義する。
(1)DB_OPEN命令
 図4は、DB_OPEN命令の内容の一例を示す図であり、(a)はDB_OPEN命令の構造の一例を示す図であり、(b)はDB_OPEN命令の一例を示す図であり、(c)はデバイスメモリとDB_OPEN命令の引数との間の関係を模式的に示す図である。DB_OPEN命令は、データベース格納部13中の操作対象であるデータベースを開くための命令である。図4(a)に示されるように、DB_OPEN命令は、3つの引数A1~A3を含む。引数A1では、操作対象(オープン対象)であるデータベースが指定され、引数A2では、オープン対象のデータベースを識別するデータベース識別子が指定され、引数A3では、オープン処理が完了したことを示すデバイスが指定される。
 引数A1,A2として、図4(b)に示されるように、ユーザデータ記憶部12中のデバイス(アドレス)を指定することができる。たとえば、引数A1,A2には、ユーザデータ記憶部12中のデバイス(アドレス)が入力され、そのデバイスにオープン対象のデータベースの情報が格納される。図4(c)を参照すると、たとえば、デバイスD1000~D1003には、データベース格納部13を有する機器(プログラマブルコントローラ)のIP(Internet Protocol)アドレス「127.0.0.1」の値が入力され、デバイスD1004~D1006には、データベース格納部13中のオープン対象のデータベース名「MyDB」が入力される。また、引数A3には、オープン対象のデータベースのオープン処理が完了するとオンする完了デバイスM0が設定される。
(2)DB_SELECT命令
 図5は、DB_SELECT命令の内容の一例を示す図であり、(a)はDB_SELECT命令の構造の一例を示す図であり、(b)はDB_SELECT命令の一例を示す図であり、(c)はデバイスメモリとDB_SELECT命令の引数との間の関係を模式的に示す図である。DB_SELECT命令は、DB_OPEN命令でオープンされたデータベース中から所望のデータを取り出すための命令である。図5(a)に示されるように、DB_SELECT命令は、5つの引数B1~B5を含む。引数B1では、操作対象のデータベースを指定するデータベース識別子が指定され、引数B2では、操作対象データベース内の操作対象のテーブル中から読出すレコードを特定するための条件が指定され、引数B3では、引数B2で指定されたレコード中から読出すフィールドが指定され、引数B4では、引数B2,B3で読出したデータの格納位置が指定され、引数B5では、読出し処理が完了したことを示すデバイスが指定される。
 引数B1~B4として、図5(b)に示されるように、ユーザデータ記憶部12中のデバイス(アドレス)を指定することができる。引数B1は、DB_OPEN命令の引数A2で指定されたデータベース識別子と同じである。引数B2には、操作対象データベース中の読出し対象テーブルと読出し対象レコードを含む読出し対象レコード指定情報が記憶されているユーザデータ記憶部12中のデバイスが指定される。この例では、読出し対象レコード指定情報は、図5(c)に示されるように、ユーザデータ記憶部12中の「D1200~D1205」に格納される操作対象テーブル名である「製品サイズ」と、「D1206~D1210」に格納される条件フィールド名である「製品番号」と、「D1211~D1212」に格納される条件である「=」と、「D1213」に格納される条件の値である「3」と、を含む。つまり、製品サイズテーブル中の製品番号が「3」であるレコードを抽出するための条件が格納されている。
 引数B3には、引数B2で指定されるレコード中の取得するフィールド数とフィールド名を含む読出しフィールド指定情報が格納されるユーザデータ記憶部12中のデバイスが指定される。この例では、読出しフィールド指定情報は、図5(c)に示されるように、ユーザデータ記憶部12中の「D0」に格納されるフィールド数である「2」と、「D1~D3」に格納されるフィールド名1である「長さ」と、「D4~D6」に格納されるフィールド名2である「高さ」と、を含む。つまり、製品サイズテーブル中の製品番号が「3」であるレコードから、「長さ」と「高さ」という2つのフィールド名に対応するデータを抽出するための条件が格納されている。
 引数B4は、引数B2,B3で指定され、読出されたデータを格納するユーザデータ記憶部12中の位置を指定する。この例では、図5(c)に示されるように、ユーザデータ記憶部12中の「D100」に、読出したレコード数を示す「1」が指定され、「D101」に、引数B3で指定されたフィールド名1に対応する読出しデータ1「9000」が格納され、「D102」に、引数B3で指定されたフィールド名2に対応する読出しデータ2「700」が格納される。また、引数B5には、操作対象のデータベースからの読出し処理が完了するとオンする完了デバイスM1が設定される。
(3)DB_CLOSE命令
 図6は、DB_CLOSE命令の内容の一例を示す図であり、(a)はDB_CLOSE命令の構造の一例を示す図であり、(b)はDB_CLOSE命令の一例を示す図である。DB_CLOSE命令は、データベース格納部13中の操作対象であるデータベースを閉じるための命令である。図6(a)に示されるように、DB_CLOSE命令は、1つの引数C1を含む。引数C1では、クローズ対象のデータベースを指定するデータベース識別子が指定される。このデータベース識別子は、DB_OPEN命令の引数A2やDB_SELECT命令の引数B1で指定されたデータベース識別子と同じである。引数C1として、図6(b)に示されるように、ユーザデータ記憶部12中のデバイス(アドレス)を指定することができる。
 これらの3つのデータベースアクセス用命令を使用して、データベース格納部13へのアクセスを指示する命令がラダープログラムに書込まれる。図7は、ラダープログラムにおけるデータベース読出し指示の一例を示す図である。このラダープログラムの動作の概要について説明する。
 まず、データベース読出しの指示がなされると(ステップS11)、まずDB_OPEN命令が実行される(ステップS12)。図4で示したように、ユーザデータ記憶部12中の各デバイスから、IPアドレスが「127.0.0.1」である機器の「MyDB」という名前のデータベースを開く。そして、操作対象のデータベースのオープン処理が完了すると、デバイス「M0」をオンにする。
 デバイス「M0」がオンになると、つぎのDB_SELECT命令が実行される(ステップS13)。このDB_SELECT命令では、ユーザデータ記憶部12中の各デバイスから「製品サイズテーブル」の「製品番号」が「3」のレコードから「長さ」と「高さ」に対応するデータを読出す処理を行う。そして、読出し処理が完了すると、デバイス「M1」をオンにする。
 デバイス「M0」と「M1」がともにオンになると、つぎのDB_CLOSE命令が実行される(ステップS14)。このDB_CLOSE命令では、操作対象のデータベースである「MyDB」という名前のデータベースが閉じられることになる。以上によって、データベースへのアクセス処理が終了する。
 つぎに、このようなプログラマブルコントローラ10の動作処理について説明する。図8は、プログラマブルコントローラの全体処理の手順の一例を示すフローチャートである。まず、プログラマブルコントローラ10の演算部15は、ユーザプログラム記憶部11に記憶されているユーザプログラム111中の通常の命令を実行するプログラム実行処理を行う(ステップS31)。ここでは、図2に示されるユーザプログラム111中の命令111-1からEND命令111-Eの前の命令までが順に実行される。
 演算部15は、ユーザプログラム111中のEND命令111-Eの前までの通常の命令を実行すると、END命令処理プログラムに基づいて、END命令111-EによるEND処理を実行する(ステップS32)。END処理は、プログラマブルコントローラ10に通信回線を介して接続されるパーソナルコンピュータまたは外部機器との間の通信と、通常の命令の実行以外の処理を行う。
 END処理が終了すると、再びステップS31へと戻り、ユーザプログラム111の命令111-1から順に演算部15によって処理が実行される。このように、プログラマブルコントローラ10では、ユーザプログラム111中の命令111-1~111-Eが順に、繰り返し実行されることになる。
 ここで、ステップS31のプログラム実行処理で、データベースアクセス用命令を検出した場合には、データベースアクセス用命令の実行処理を実行する。図9は、データベースアクセス用命令の実行処理の手順の一例を示すフローチャートであり、図10は、データベースアクセス用命令の処理の様子を模式的に示す図であり、図11は、データベースアクセス用命令からデータベース問い合わせ用命令の生成処理の一例を示す図である。
 図9のデータベースアクセス用命令の実行処理は、図8のステップS31のプログラム実行処理中に、演算部15が、データベースアクセス用命令を検出し、データベース問い合わせ用命令生成プログラムに検出したデータベースアクセス用命令を渡すことによって、実行される。演算部15は、データベース問い合わせ用命令生成プログラムに基づいて、対象のデータベースのオープン処理を行い、取得したデータベースアクセス用命令(DB_SELECT命令)中の引数からSQLの生成に必要な情報を取得する(ステップS51)。
 ここでは、DB_SELECT命令の引数B2,B3を参照して、操作対象となるデータベースから操作対象テーブルと、操作対象テーブル中のレコードと、操作対象レコード中から抽出するフィールドと、を抽出する。図5の例に示されるように、これらの条件は、ユーザデータ記憶部12の引数B2,B3で指定されるアドレスに格納されている。
 ついで、演算部15は、取得した情報からデータベース問い合わせ用命令(SQL文)を生成する(ステップS52)。図11(a)は、図5(b)のラダープログラムにおけるデータベースアクセス用命令から生成されたSQL文である。SQL文は、SELECT句、FROM句およびWHERE句を有し、それぞれの句に引数が設定される。データベースアクセス用命令からのSQL文の生成は、データベースアクセス用命令の引数とSQL文の引数とを対応付けた命令変換情報に基づいて行われる。図11(b)は、命令変換情報の一例を示す図である。この命令変換情報では、SQL文の引数が、ユーザデータ記憶部12のデバイスを用いて定義される。これによって、図5(b)に示されるデータベースアクセス用命令からSQL文(データベース問い合わせ用命令)を生成することが可能になる。なお、これは一例であり、SQL文の種類に応じて命令変換情報を用意しておけばよい。
 ついで、演算部15は、生成したSQL文をシステムデータ記憶部16のデータベース問い合わせ用命令格納領域161に格納する(ステップS53)。
 その後、演算部15は、データベース管理プログラムに基づいて、データベースアクセス用命令であるDB_SELECT命令の引数B1で指定されたデータベースに対して、生成したSQL文を発行する(ステップS54)。これによって、演算部15は、SQL文にしたがって、データベース格納部13中の指定されたデータベースに直接アクセスして、目的とするデータを取得する。以上によって、データベースアクセス用命令の実行処理が終了し、図8のステップS31へと処理が戻る。
 一般的に、プログラマブルコントローラ10の実行処理に対して、データベースの処理は遅いため、データベースアクセス用命令の実行処理は、SQLを発行した後に、データベースの処理結果を待たずに処理を完了する。そして、このデータベースの処理結果の完了確認はEND処理で行う。
 そこで、図8のステップS32のEND処理で、SQLを発行した際の完了確認処理について説明する。図12は、END処理時の完了確認処理の手順の一例を示すフローチャートである。
 まず、演算部15は、SQLを発行済みか否かを判定する(ステップS71)。SQLを発行済みでない場合(ステップS71でNoの場合)には、SQLを発行しておらず、完了確認をする必要がないので、処理が終了する。
 また、SQLを発行済みである場合(ステップS71でYesの場合)には、発行したSQLの処理が完了したか否かを判定する(ステップS72)。発行したSQLの処理が未完了である場合(ステップS72でNoの場合)には、何も処理を行わず、完了確認処理が終了する。この場合には、次回のEND処理時に再確認が行われる。
 一方、発行したSQLの処理が完了した場合(ステップS72でYesの場合)には、演算部15は、取得したSQLの結果を、DB_SELECT命令の引数B4で指定されるユーザデータ記憶部12中の位置に格納する(ステップS73)。その後、演算部15は、DB_SELECT命令の引数B5で指定される完了デバイスをONにし(ステップS74)、対象のデータベースのクローズ処理が行われる。以上によって、END処理時の完了確認処理が終了する。
 なお、上記の例では、データベースからのデータの読出しを行うデータベースアクセス用命令について説明したが、この発明がこれに限定されるものではない。たとえば、データベースへのデータの追加、変更または削除などのデータの書込みを行う命令を定義することも可能である。このようなデータベースの書込命令は、引数として、操作対象のデータベースを指定するデータベース識別子(データベース指定情報)と、操作対象データベース内のデータを追加するテーブル名と、操作対象テーブル中のデータを書込みたいフィールド名と、書込みたいデータの内容と、を少なくとも含む。このように、データベースアクセス用命令は、データベース中に格納されるデータの読出しまたは書込みといった、データベースへのアクセスを行うための命令である。
 実施の形態1では、ラダープログラムで使用されるデータベースアクセス用命令を定義し、データベースアクセス用命令で指定される引数とSQL文の引数とを対応付けておき、ユーザプログラム中にデータベースアクセス用命令がある場合には、上記対応付けに基づいてデータベースアクセス用命令からSQL文を生成し、SQLを発行する。これによって、プログラマブルコントローラ10では、2次記憶装置であるデータベース格納部13中の2次元的な構造のデータベースを、従来のように1次元的な構造のユーザデータ記憶部12に展開することなく、直接にデータベースにアクセスして所望のデータを取得することができる。その結果、データベースからのデータの取得が1つの工程で行うことができ、データの取得を従来に比して早くすることができるという効果を有する。
 また、データベースをユーザデータ記憶部12に展開する必要がないので、ユーザデータ記憶部12をデータベースのサイズを考慮した容量にする必要がない。つまり、データベース格納部13からユーザデータ記憶部12に読み込むデータは、処理に必要な最小限のデータに絞られる。その結果、ユーザデータ記憶部12の容量(使用量)を従来に比して小さくすることができるという効果も有する。
 さらに、プログラマブルコントローラ10で必要なデータを取得する際にデータベースを活用することで、2次元構造のデータベースを1次元構造のユーザデータ記憶部12に展開したときのデータの格納場所(アドレス)をラダープログラム上で計算する必要がない。その結果、プログラミングが容易になるという効果を有する。加えて、データベースのデータ構造が変更された場合でも、同じフィールドのデータを取得する場合には、ユーザプログラムに作成したデータベースアクセス用命令を変更する必要がない。
 また、ユーザプログラムに専用の命令を定義することで、プログラマブルコントローラ10からデータベースにアクセスすることができ、SQLなどのデータベース特有の言語を知らないプログラマブルコントローラ10のユーザでも、データベース中のデータを利用したプログラムを作成することができるという効果を有する。
実施の形態2.
 実施の形態1では、データベースアクセス用命令を定義し、ユーザプログラム(ラダープログラム)に組み込んで使用する場合を示した。この実施の形態2では、データベースアクセス用命令の代わりに、データベース操作設定情報を定義し、データベース読出し指示が実行される場合に、データベース操作設定情報を読み込んで実施の形態1と同様の処理を行う場合について説明する。
 図13は、実施の形態2によるプログラマブルコントローラの機能構成を模式的に示すブロック図である。このプログラマブルコントローラ10は、ユーザプログラム記憶部11のユーザプログラムにはデータベースアクセス用命令が含まれておらず、システムデータ記憶部16にデータベース問い合わせ用命令格納領域161に加えて、データベースアクセス用設定情報を格納するデータベースアクセス用設定情報格納領域162が含まれる点が実施の形態1と異なる点である。また、演算部15は、ユーザプログラム(ラダープログラム)のデータベース読出し指示がオンになると、データベースアクセス用設定情報162Aに基づいて、データベース問い合わせ用命令を作成する。
 図14は、実施の形態2によるデータベースアクセス用設定情報の内容の一例を示す図である。データベースアクセス用設定情報162Aは、対象データベースと、対象テーブルと、フィールド名とデバイスの関係と、読出し条件と、実行トリガと、を設定項目として有する。
 対象データベースは、操作対象となるデータベースを指定する。たとえば、操作対象となるデータベースが格納されている機器(プログラマブルコントローラ)のアドレス(IPアドレス)と、そのIPアドレスで指定される機器中のデータベース名と、を指定する。対象テーブルは、対象データベース中の操作対象となるテーブルを指定する。
 フィールド名とデバイスの関係は、対象テーブル中から取得するデータのフィールド名と、取得したデータのユーザデータ記憶部12中での格納位置を指定する。読出し条件は、対象テーブルから読出す対象の行(レコード)を指定する。実行トリガは、読出したデータをユーザデータ記憶部12に格納するタイミングを指定する。
 つまり、「対象データベース」項目のIPアドレスとデータベース名で操作対象のデータベースが特定され、「対象テーブル」項目のテーブル名でデータベース中の操作対象のテーブルが特定される。また、「読出し条件」項目のフィールド名で特定されるレコードから、「フィールド名とデバイスの関係」項目のフィールド名で特定されるデータが読出されるデータとなり、このデータがフィールド名とデバイスの関係で指定されるデバイスメモリ中のデバイスに格納されることになる。そして、このデータが読出されるタイミングは「実行トリガ」項目中のトリガデバイスがオンになったときである。
 図15は、実施の形態2によるデータベース読出し指示のユーザプログラムの一例を示す図である。このユーザプログラムは、データベース読出し指示がオンになると(ステップS91)、製品テーブルの製品番号を示す「K3」をユーザデータ記憶部12の「D1212」に格納する処理(ステップS92)と、デバイス「M0」のビットをオンにする処理(ステップS93)と、が実行されることを示している。
 これによって、演算部15は、データベースアクセス用設定情報162Aに設定された条件にしたがって、データベース問い合わせ用命令を生成し、システムデータ記憶部16に記憶する。図16は、データベースアクセス用設定情報からデータベース問い合わせ用命令を生成する際の命令変換情報の一例を示す図である。この図に示されるように、命令変換情報では、SQL文の引数が、データベースアクセス用設定情報162Aの内容を用いて定義される。演算部15は、これによって図11(a)に示されるSQL文を生成する。
 なお、図14のデータベースアクセス用設定情報162Aの例では、「対象データベース」項目は、自プログラマブルコントローラ10を指定する場合を示しているが、プログラマブルコントローラ10は通常ネットワークを介して接続されるため、他のプログラマブルコントローラ10(または機器)のデータベース格納部13中のデータベースからデータを取得することも可能である。
 図17は、ネットワークに接続された他のプログラマブルコントローラからデータを読出す場合の様子を模式的に示す図である。図17(a)は、プログラマブルコントローラ10A,10Bがネットワーク30に接続されたシステム構成を模式的に示している。ここでは、データベース格納部13Aを有し、IPアドレスが「192.168.1.1」のプログラマブルコントローラ10Aと、IPアドレスが「192.168.1.2」のプログラマブルコントローラ10Bと、がネットワーク30を介して接続されている。ここで、プログラマブルコントローラ10Bには、図17(b)に示されるように、データベースアクセス用設定情報152Bの「対象データベース」の項目で、プログラマブルコントローラ10AのIPアドレスとデータベース名が設定される。その結果、図17(c)に示されるユーザプログラムが読み込まれると、プログラマブルコントローラ10Aのデータベース格納部13A中のデータベースにアクセスして、そのデータを取得することができる。
 実施の形態2では、データベースアクセス用設定情報にデータベースへのアクセス条件を設定し、ユーザプログラムの実行の際、データベース読出し指示がオン状態になると、演算部15がデータベースアクセス用設定情報に基づいてデータベース問い合わせ用命令を生成する。そして、演算部15は、生成されたデータベース問い合わせ用命令にしたがってデータベースにアクセスするようにした。これによって、実施の形態1のように、データベースへのアクセス命令をラダープログラムで定義することがないので、プログラマブルコントローラ10のユーザにとって、データベースへのアクセスの設定が容易になるという効果を、実施の形態1の効果に加えて有する。
 また、取得するデータの条件をデータベースアクセス用設定情報で指定できるので、実施の形態1のようにユーザデータ記憶部12に対象データの取得条件を格納する必要がない。その結果、実施の形態1に比してさらにユーザデータ記憶部12を小容量化することができるという効果も有する。
 なお、実施の形態2では、データベースからのデータの読出しの場合を例に挙げたが、データベースへのデータの追加、変更または削除を行う書込みの場合にも、データベースアクセス用設定情報に書込みの条件を設定することで、このデータベースアクセス用設定情報に基づいてデータベース問い合わせ用命令を生成することができる。
実施の形態3.
 実施の形態3では、実施の形態1でユーザプログラムを設定したり、実施の形態2でデータベースアクセス用設定情報を設定したりするエンジニアリングツールについて説明する。
 図18は、エンジニアリングツールの機能構成の一例を模式的に示すブロック図である。エンジニアリングツール50は、通信部51と、入力部52と、表示部53と、プログラム作成画面表示処理部54と、デバイスメモリ設定画面表示処理部55と、設定情報設定画面表示処理部56と、設定部57と、これらの各処理部を制御する制御部58と、を備える。
 通信部51は、プログラマブルコントローラ10との間で通信を行う。入力部52は、キーボードまたはポインティングデバイスなどのユーザとの間の入力インタフェースである。入力部52は、たとえばプログラマブルコントローラ10に設定するデータベースアクセス用命令またはデータベースアクセス用設定情報の入力を受け付ける。表示部53は、液晶表示装置などのユーザに対して情報を表示する装置である。
 プログラム作成画面表示処理部54は、ユーザプログラム作成画面を表示部53に表示する機能を有する。ユーザプログラムとしてラダープログラムを用いる場合には、ラダープログラムを作成する環境をユーザに対して提示する。ユーザプログラムとして、実施の形態1で示したデータベースアクセス用命令を使用する場合には、データベースアクセス用命令をユーザプログラム作成画面で使用可能な状態となる。
 デバイスメモリ設定画面表示処理部55は、デバイスメモリ設定画面を表示部53に表示する機能を有する。ユーザデータ記憶部12には、上記したように読出すデータベースの格納位置、データベース中から読出すデータの条件、およびデータベースから読出したデータなどが格納される。デバイスメモリ設定画面は、これらの情報をデバイスメモリのどのアドレスに格納するかなどの設定を行うための設定画面である。
 設定情報設定画面表示処理部56は、データベースアクセス用設定情報設定画面を表示部53に表示する機能を有する。実施の形態2のように、データベースアクセス用設定情報を用いてデータベースへのアクセスを行う場合には、たとえば図14に示されるようなデータベースアクセス用設定情報の設定画面を表示部53に表示する。
 設定部57は、プログラム作成画面表示処理部54、デバイスメモリ設定画面表示処理部55または設定情報設定画面表示処理部56でユーザによって、入力部52を介して設定(入力)され、確定された内容を、通信部51を介してプログラマブルコントローラ10に設定する。
 この実施の形態3では、プログラム作成画面表示処理部54、デバイスメモリ設定画面表示処理部55および設定情報設定画面表示処理部56でユーザに対してユーザプログラム、デバイスメモリおよびデータベースアクセス用設定情報を設定するための画面をユーザに対して表示し、それぞれの画面に設定された内容を設定部57でプログラマブルコントローラ10に設定するようにした。これによって、プログラマブルコントローラ10がデータベース格納部13中のデータベースに直接にアクセスして所望のデータを得ることができるデータベースアクセス用命令またはデータベースアクセス用設定情報を作成し、プログラマブルコントローラ10に設定することができるという効果を有する。
 なお、上述したプログラマブルコントローラ10でのデータベースアクセス用命令を含むユーザプログラムにおけるデータベースからの読出し方法、またはデータベースアクセス用設定に基づいたデータベースからの読出し方法は、その処理手順を格納したプログラムとして構成することができる。そして、このプログラムを上記したプログラマブルコントローラ10で実行させることによって実現することができる。また、このプログラムは、ハードディスク、SSD(Solid State Drive)、フロッピー(登録商標)ディスク、CD(Compact Disk)-ROM、MO(Magneto-Optical disk)、DVD(Digital Versatile DiskまたはDigital Video Disk)などのコンピュータで読取可能な記録媒体に記録される。この場合、プログラマブルコントローラ10によって記録媒体から読出されるようにしてもよいし、プログラマブルコントローラ10に接続されたエンジニアリングツール50などの情報処理端末で記録媒体から読出され、それをネットワークを介してプログラマブルコントローラ10にインストールしてプログラマブルコントローラ10によって読出されるようにしてもよい。また、このプログラムは、インタネットなどのネットワーク(通信回線)を介して配布することもできる。
 以上のように、この発明にかかるプログラマブルコントローラは、2次記憶装置に記憶されるデータベースからデータを読出して処理を行うプログラマブルコントローラに有用である。
 10,10A,10B プログラマブルコントローラ、11 ユーザプログラム記憶部、12 ユーザデータ記憶部、13,13A データベース格納部、14 システムプログラム記憶部、15 演算部、16 システムデータ記憶部、30 ネットワーク、50 エンジニアリングツール、51 通信部、52 入力部、53 表示部、54 プログラム作成画面表示処理部、55 デバイスメモリ設定画面表示処理部、56 設定情報設定画面表示処理部、57 設定部、58 制御部、121 検索条件格納領域、122 退避領域、152B データベースアクセス用設定情報、161 データベース問い合わせ用命令格納領域、162 データベースアクセス用設定情報格納領域。

Claims (16)

  1.  ユーザプログラム中の複数の命令を順に実行する命令実行手段と、
     前記命令実行手段での処理に使用されるデータを表形式で保持するデータベースを格納するデータベース格納手段と、
     前記命令中に前記データベースへのアクセス用命令が含まれる場合に、前記アクセス用命令をデータベース問い合わせ言語によるデータベース問い合わせ用命令に変換するデータベース問い合わせ用命令生成手段と、
     前記データベース格納手段中の前記データベースにアクセスし、前記データベース問い合わせ用命令で指定されるデータを取得するデータベース管理手段と、
     を備えることを特徴とするプログラマブルコントローラ。
  2.  前記アクセス用命令は、前記データベース格納手段中の前記データベースを指定するデータベース指定情報および前記データベース中のテーブル名を含むアクセス対象指定条件を引数として含むことを特徴とする請求項1に記載のプログラマブルコントローラ。
  3.  前記アクセス用命令は、前記データベース中から所望のデータを取得する命令であり、引数として、前記アクセス対象指定条件で検索した結果を格納する格納位置をさらに含み、
     前記アクセス対象指定条件は、前記テーブル内で取得するデータのフィールドを含むことを特徴とする請求項2に記載のプログラマブルコントローラ。
  4.  前記アクセス用命令は、前記データベース中にデータを書込む命令であり、引数として、書込みたい前記データをさらに含み、
     前記アクセス対象指定条件は、前記テーブル内で前記データを書込みたいフィールドを含むことを特徴とする請求項2に記載のプログラマブルコントローラ。
  5.  前記アクセス対象指定条件のそれぞれは、前記ユーザデータ記憶手段の所定の位置に格納され、
     前記引数は、前記アクセス対象指定条件の前記ユーザデータ記憶手段内での格納位置で表現されることを特徴とする請求項2に記載のプログラマブルコントローラ。
  6.  前記データベース問い合わせ用命令生成手段は、前記アクセス用命令の引数を前記データベース問い合わせ用命令の引数と対応付けた命令変換情報に基づいて前記アクセス用命令から前記データベース問い合わせ用命令を生成することを特徴とする請求項2に記載のプログラマブルコントローラ。
  7.  ユーザプログラム中の複数の命令を順に実行する命令実行手段と、
     前記命令実行手段での処理に使用されるデータを表形式で保持するデータベースを格納するデータベース格納手段と、
     前記データベース格納手段中の前記データベースに含まれるデータを取得する条件が規定されるデータベースアクセス用設定情報を記憶するシステムデータ記憶手段と、
     前記命令中にデータベースへのアクセス指示がある場合に、前記システムデータ記憶手段中の前記データベースアクセス用設定情報をデータベース問い合わせ言語によるデータベース問い合わせ用命令に変換するデータベース問い合わせ用命令生成手段と、
     前記データベース格納手段中の前記データベースにアクセスし、前記データベース問い合わせ用命令で指定されるデータへアクセスするデータベース管理手段と、
     を備えることを特徴とするプログラマブルコントローラ。
  8.  前記データベースアクセス用設定情報は、前記データベース格納手段中の前記データベースを指定するデータベース指定情報および前記データベース中のテーブル名を含むアクセス対象指定条件を含むことを特徴とする請求項7に記載のプログラマブルコントローラ。
  9.  前記データベースアクセス用設定情報は、前記データベース中から所望のデータを取得する命令を実行させる情報であり、前記アクセス対象指定条件で検索した結果を格納する格納位置をさらに含み、
     前記アクセス対象指定条件は、前記テーブル内で取得するデータのフィールドを含むことを特徴とする請求項8に記載のプログラマブルコントローラ。
  10.  前記データベース問い合わせ用命令生成手段は、前記データベースアクセス用設定情報の前記アクセス対象指定条件と前記格納位置を、前記データベース問い合わせ用命令の引数と対応付けた命令変換情報に基づいて前記データベースアクセス用設定情報から前記データベース問い合わせ用命令を生成することを特徴とする請求項9に記載のプログラマブルコントローラ。
  11.  前記データベースアクセス用設定情報は、前記データベース中にデータを書込む命令を実行させる情報であり、書込みたい前記データをさらに含み、
     前記アクセス対象指定条件は、前記テーブル内で前記データを書込みたいフィールドを含むことを特徴とする請求項8に記載のプログラマブルコントローラ。
  12.  前記データベース問い合わせ用命令生成手段は、前記データベースアクセス用設定情報の前記アクセス対象指定条件と前記書込みたいデータを、前記データベース問い合わせ用命令の引数と対応付けた命令変換情報に基づいて前記データベースアクセス用設定情報から前記データベース問い合わせ用命令を生成することを特徴とする請求項11に記載のプログラマブルコントローラ。
  13.  前記プログラマブルコントローラは、ネットワークを介してデータベースを有する他のプログラマブルコントローラと接続され、
     前記データベース指定情報には、ネットワークを介して接続される前記他のプログラマブルコントローラの前記データベース格納手段中の前記データベースを指定可能であることを特徴とする請求項8に記載のプログラマブルコントローラ。
  14.  ユーザデータ記憶手段と、通常の命令の実行処理に使用されるデータを表形式で保持するデータベースを格納するデータベース格納手段と、を備え、ユーザプログラム中の最初の通常の命令から最後に記述されたEND命令までを順に繰り返し実行するプログラマブルコントローラで、前記通常の命令の実行処理に前記データベースへアクセスするプログラマブルコントローラのテーブルデータアクセスプログラムであって、
     前記プログラマブルコントローラに、
     前記通常の命令中に前記データベースへのアクセス用命令が含まれる場合に、前記アクセス用命令をデータベース問い合わせ言語によるデータベース問い合わせ用命令に変換するデータベース問い合わせ用命令生成手順と、
     前記データベース格納手段中の前記データベースにアクセスし、前記データベース問い合わせ用命令で指定される前記データベース中のデータにアクセスして所定の処理を行うデータベース管理手順と、
     を実行させるためのプログラマブルコントローラのテーブルデータアクセスプログラム。
  15.  ユーザデータ記憶手段と、通常の命令の実行処理に使用されるデータを表形式で保持するデータベースを格納するデータベース格納手段と、前記データベース格納手段中の前記データベースに含まれるデータを取得する条件が規定されるデータベースアクセス用設定情報を記憶するシステムデータ記憶手段と、を備え、ユーザプログラム中の最初の通常の命令から最後に記述されたEND命令までを順に繰り返し実行するプログラマブルコントローラで、前記通常の命令の実行処理に前記データベースへアクセスするプログラマブルコントローラのテーブルデータアクセスプログラムであって、
     前記プログラマブルコントローラに、
     前記通常の命令中にデータベースアクセス指示がある場合に、前記システムデータ記憶手段中の前記データベースアクセス用設定情報をデータベース問い合わせ言語によるデータベース問い合わせ用命令に変換するデータベース問い合わせ用命令生成手順と、
     前記データベース格納手段中の前記データベースにアクセスし、前記データベース問い合わせ用命令で指定されるデータにアクセスして所定の処理を実行するデータベース管理手順と、
     を実行させるためのプログラマブルコントローラのテーブルデータアクセスプログラム。
  16.  入力手段と、
     表示手段と、
     プログラマブルコントローラと接続される通信手段と、
     前記プログラマブルコントローラで実行させるユーザプログラムを作成するプログラム作成画面を前記表示手段に表示させるプログラム作成画面表示処理手段と、
     前記プログラム作成画面表示処理手段で作成された前記ユーザプログラムを前記プログラマブルコントローラに設定する設定手段と、
     を備え、
     前記プログラマブルコントローラで実行される前記ユーザプログラムを構成する命令に、前記プログラマブルコントローラでの処理に使用されるデータを表形式で保持するデータベースにアクセスするアクセス用命令が定義され、
     前記プログラム作成画面表示処理手段は、前記入力手段を介してユーザによって作成された前記アクセス用命令を含む前記プログラム作成画面を前記表示手段に表示し、
     前記設定手段は、前記アクセス用命令を含む前記ユーザプログラムを前記プログラマブルコントローラに設定することを特徴とするプログラマブルコントローラの周辺装置。
PCT/JP2013/063855 2013-05-17 2013-05-17 プログラマブルコントローラとその周辺装置、およびプログラマブルコントローラのテーブルデータアクセスプログラム WO2014184962A1 (ja)

Priority Applications (7)

Application Number Priority Date Filing Date Title
KR1020157034855A KR101821032B1 (ko) 2013-05-17 2013-05-17 프로그래머블 컨트롤러와 그 주변 장치, 및 프로그래머블 컨트롤러의 테이블 데이터 액세스 프로그램
US14/890,187 US9841744B2 (en) 2013-05-17 2013-05-17 Programmable controller, peripheral device thereof, and table data access program of programmable controller
DE112013006971.7T DE112013006971T5 (de) 2013-05-17 2013-05-17 Programmierbare Steuerung, deren Peripheriegerät und Programm für Zugriff auf Tabellendaten der programmierbaren Steuerung
CN201380076644.2A CN105209986B (zh) 2013-05-17 2013-05-17 可编程控制器及其外围装置、以及可编程控制器的表数据访问方法
JP2013541092A JP5518266B1 (ja) 2013-05-17 2013-05-17 プログラマブルコントローラとその周辺装置、およびプログラマブルコントローラのテーブルデータアクセスプログラム
PCT/JP2013/063855 WO2014184962A1 (ja) 2013-05-17 2013-05-17 プログラマブルコントローラとその周辺装置、およびプログラマブルコントローラのテーブルデータアクセスプログラム
TW102142790A TWI509377B (zh) 2013-05-17 2013-11-25 可程式控制器及其周邊裝置、以及可程式控制器之表格資料存取程式

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2013/063855 WO2014184962A1 (ja) 2013-05-17 2013-05-17 プログラマブルコントローラとその周辺装置、およびプログラマブルコントローラのテーブルデータアクセスプログラム

Publications (1)

Publication Number Publication Date
WO2014184962A1 true WO2014184962A1 (ja) 2014-11-20

Family

ID=51031279

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2013/063855 WO2014184962A1 (ja) 2013-05-17 2013-05-17 プログラマブルコントローラとその周辺装置、およびプログラマブルコントローラのテーブルデータアクセスプログラム

Country Status (7)

Country Link
US (1) US9841744B2 (ja)
JP (1) JP5518266B1 (ja)
KR (1) KR101821032B1 (ja)
CN (1) CN105209986B (ja)
DE (1) DE112013006971T5 (ja)
TW (1) TWI509377B (ja)
WO (1) WO2014184962A1 (ja)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017151934A (ja) * 2016-02-26 2017-08-31 オムロン株式会社 プログラマブルコントローラ、プログラマブルコントローラの制御方法、プログラマブルコントローラの制御プログラム
WO2019176486A1 (ja) 2018-03-15 2019-09-19 オムロン株式会社 制御システム、コントローラ、および制御方法
WO2019176487A1 (ja) 2018-03-15 2019-09-19 オムロン株式会社 コントローラ、制御方法、および制御プログラム
WO2020189142A1 (ja) 2019-03-15 2020-09-24 オムロン株式会社 制御システム、制御方法、および制御プログラム

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE112014003082B4 (de) * 2014-06-02 2017-05-18 Mitsubishi Electric Corporation Programmierbares Steuerungssystem, programmierbare Steuerung, Programmanzeigevorrichtung und Programmanzeigeverfahren
JP5951123B2 (ja) * 2014-07-14 2016-07-13 三菱電機株式会社 制御装置
JP6366843B2 (ja) * 2015-07-10 2018-08-01 三菱電機株式会社 データ取得装置、データ取得方法及びデータ取得プログラム
JP6370503B1 (ja) * 2017-04-17 2018-08-08 三菱電機株式会社 プログラム作成装置
CN108763536B (zh) 2018-05-31 2020-04-14 阿里巴巴集团控股有限公司 数据库访问方法及装置
JP7180158B2 (ja) * 2018-07-13 2022-11-30 オムロン株式会社 プログラム開発装置、およびコントローラ
KR102150335B1 (ko) * 2019-01-17 2020-09-01 주식회사 쓰리데이즈 데이터베이스 관리 시스템
CN112233498B (zh) * 2020-10-14 2023-01-06 烟台鼎钰电子科技有限公司 一种表格式可编程显示控制器
CN112327744B (zh) * 2020-11-20 2021-10-22 深圳市海浦蒙特科技有限公司 用于可编程逻辑控制器的梯形图与指令表互相转换方法

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH103303A (ja) * 1996-06-14 1998-01-06 Mitsubishi Electric Corp インターフェース装置
JP2002023812A (ja) * 2000-07-05 2002-01-25 Mitsubishi Materials Corp 自動制御システムおよび自動制御方法
JP2004302849A (ja) * 2003-03-31 2004-10-28 Mitsubishi Electric Corp Faコントローラ
JP2007080286A (ja) * 2006-11-13 2007-03-29 Omron Corp データ収集装置
JP2009086863A (ja) * 2007-09-28 2009-04-23 Koyo Electronics Ind Co Ltd フロントエンドサーバ機能内蔵プログラマブルコントローラ
JP2010250584A (ja) * 2009-04-16 2010-11-04 Koyo Electronics Ind Co Ltd プログラマブル/ロジック&rfidコントローラ
JP2012108642A (ja) * 2010-11-16 2012-06-07 Fuji Electric Co Ltd データ収集システム、データ収集システムの異常要因判定方法

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000267703A (ja) 1999-03-15 2000-09-29 Omron Corp プログラマブルコントローラ
JP3155253B2 (ja) 1999-06-29 2001-04-09 株式会社デジタル データ転送システム、データ転送方法およびデータ転送のためのプログラムが記録された記録媒体
JP4694843B2 (ja) * 2002-09-30 2011-06-08 東京エレクトロン株式会社 半導体製作プロセスの監視とコンロトールのための装置
US7467018B1 (en) * 2002-11-18 2008-12-16 Rockwell Automation Technologies, Inc. Embedded database systems and methods in an industrial controller environment
JP2004280664A (ja) * 2003-03-18 2004-10-07 Yaskawa Electric Corp ビット演算装置
US7835806B2 (en) * 2007-01-29 2010-11-16 Rockwell Automation Technologies, Inc. Method for indirect access to controller data using name stored in string tag
JP4895036B2 (ja) 2007-05-14 2012-03-14 横河電機株式会社 分散型制御装置
JPWO2008146477A1 (ja) 2007-05-29 2010-08-19 光洋電子工業株式会社 通信機能を有するplc
JP5197431B2 (ja) 2009-02-23 2013-05-15 三菱電機株式会社 プログラマブルコントローラ
CN102193922B (zh) * 2010-03-04 2013-07-24 杭州华三通信技术有限公司 一种对数据库进行访问的方法和装置
US9128479B2 (en) * 2011-11-11 2015-09-08 Rockwell Automation Technologies, Inc. Automation control and monitoring system and method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH103303A (ja) * 1996-06-14 1998-01-06 Mitsubishi Electric Corp インターフェース装置
JP2002023812A (ja) * 2000-07-05 2002-01-25 Mitsubishi Materials Corp 自動制御システムおよび自動制御方法
JP2004302849A (ja) * 2003-03-31 2004-10-28 Mitsubishi Electric Corp Faコントローラ
JP2007080286A (ja) * 2006-11-13 2007-03-29 Omron Corp データ収集装置
JP2009086863A (ja) * 2007-09-28 2009-04-23 Koyo Electronics Ind Co Ltd フロントエンドサーバ機能内蔵プログラマブルコントローラ
JP2010250584A (ja) * 2009-04-16 2010-11-04 Koyo Electronics Ind Co Ltd プログラマブル/ロジック&rfidコントローラ
JP2012108642A (ja) * 2010-11-16 2012-06-07 Fuji Electric Co Ltd データ収集システム、データ収集システムの異常要因判定方法

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017151934A (ja) * 2016-02-26 2017-08-31 オムロン株式会社 プログラマブルコントローラ、プログラマブルコントローラの制御方法、プログラマブルコントローラの制御プログラム
US10353370B2 (en) 2016-02-26 2019-07-16 Omron Corporation Programmable logic controller, control method thereof and contorl program thereof
WO2019176486A1 (ja) 2018-03-15 2019-09-19 オムロン株式会社 制御システム、コントローラ、および制御方法
WO2019176487A1 (ja) 2018-03-15 2019-09-19 オムロン株式会社 コントローラ、制御方法、および制御プログラム
US11281650B2 (en) 2018-03-15 2022-03-22 Omron Corporation Control system, controller, and control method
US11334550B2 (en) 2018-03-15 2022-05-17 Omron Corporation Controller, control method, and control program for SQL statement generation in a factory automation database
WO2020189142A1 (ja) 2019-03-15 2020-09-24 オムロン株式会社 制御システム、制御方法、および制御プログラム
US11709826B2 (en) 2019-03-15 2023-07-25 Omron Corporation Control system, control method, and control program
US11829355B2 (en) 2019-03-15 2023-11-28 Omron Corporation Control system, control method, and control program

Also Published As

Publication number Publication date
CN105209986B (zh) 2017-03-08
DE112013006971T5 (de) 2016-02-18
CN105209986A (zh) 2015-12-30
KR20160006738A (ko) 2016-01-19
TWI509377B (zh) 2015-11-21
US9841744B2 (en) 2017-12-12
JPWO2014184962A1 (ja) 2017-02-23
JP5518266B1 (ja) 2014-06-11
KR101821032B1 (ko) 2018-01-22
US20160098028A1 (en) 2016-04-07
TW201445267A (zh) 2014-12-01

Similar Documents

Publication Publication Date Title
JP5518266B1 (ja) プログラマブルコントローラとその周辺装置、およびプログラマブルコントローラのテーブルデータアクセスプログラム
US10275221B2 (en) Systems and methods for generating data visualization applications
WO2014064819A1 (ja) システム構築支援ツール及びシステム
WO2013191275A1 (ja) 制御装置
JP4631562B2 (ja) 情報処理装置及び情報処理方法、並びにコンピュータ・プログラム
KR20170073604A (ko) 데이터 미리보기를 통한 작업 작성 기법
JP7054051B2 (ja) ソフトウェアロボット定義情報生成システム、ソフトウェアロボット定義情報生成方法、及びプログラム
EP3042254A1 (en) Systems and methods for virtualizing a programmable logic controller
WO2015075790A1 (ja) シーケンスプログラム作成支援装置
JP5755389B1 (ja) 作画ソフトウェア
CN103477291A (zh) 参数设定装置及参数设定系统
EP3009900B1 (en) Dynamic recommendation of elements suitable for use in an engineering configuration
WO2015136965A1 (ja) 制御機器、制御システム、制御機器の制御方法、および、制御システムの制御方法
JP5197431B2 (ja) プログラマブルコントローラ
WO2015140940A1 (ja) システム構築支援装置、方法、および記録媒体
WO2014108994A1 (ja) プロジェクトデータ作成装置
JP6770813B2 (ja) 情報管理装置、情報管理方法、及び情報管理プログラム。
JP7021401B1 (ja) ロギング支援装置、ロギングシステム、ロギング支援方法及びプログラム
JP5296724B2 (ja) 画面表示データ編集装置及び画面表示データ編集プログラム
US20230281216A1 (en) Systems and methods for a graphical user interface for data analysis and visualisation
JP6188634B2 (ja) プログラマブルコントローラ、プログラム及び周辺装置
JP5183150B2 (ja) 情報連携ウィンドウシステムおよびプログラム
JP4539532B2 (ja) バッチ処理装置、バッチ処理方法、及び、コンピュータプログラム
KR20170085600A (ko) 엔지니어링 툴 프로그램 및 엔지니어링 툴
JP2008052489A (ja) ファイル管理システム及びファイル管理方法

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2013541092

Country of ref document: JP

Kind code of ref document: A

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13884409

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14890187

Country of ref document: US

WWE Wipo information: entry into national phase

Ref document number: 1120130069717

Country of ref document: DE

Ref document number: 112013006971

Country of ref document: DE

ENP Entry into the national phase

Ref document number: 20157034855

Country of ref document: KR

Kind code of ref document: A

122 Ep: pct application non-entry in european phase

Ref document number: 13884409

Country of ref document: EP

Kind code of ref document: A1