7 APPLICATION INSTRUCTIONS
7.21 Database Access Instructions
953
7
• These instructions connect to the database stored in the folder path specified by (s) and makes it available.
• Specify "(drive number):(database folder path)" for the storage location. The drive number is fixed to 2 (SD memory card).
• Upon normal completion, the instruction stores the identification number of the connected database in the device (d1). The
completion signal in the completion device (d2)+0 is turned on and 0 is stored as the completion status in the device (d3).
• The following figure shows the operation of the completion device at completion of the DBOPEN(P) instruction.
• The DBOPEN(P) instruction enables connections to a maximum of four different databases at the same time.
• During transaction, the database cannot be newly opened.
• SM753 (File being accessed) turns on while the DBOPEN(P) instruction is executed.
*1
While SM753 is on, the DBOPEN(P)
instruction cannot be executed. If executed, no processing is performed. However, the instruction has been completed with
an error while the database access instruction is being executed.
• When "To Use or Not to Use the Built-in Database Access" is set to "Use" in the module parameter of the CPU module, the
DBOPEN(P) instruction cannot be executed while SM1498 (CPU module database start-up flag) is off.
*1
If executed, no
processing is performed.
*1 For the firmware versions supporting SM753 and SM1498, refer to the list of special relay areas. ( MELSEC iQ-R CPU Module
User's Manual (Application))
In the following cases, the error termination signal in (d2)+1 is turned on and an error code is stored in (d3).
• The DBOPEN(P) instruction is executed during execution of the database access instruction.
• The storage location specified by (s) does not exist.
• An attempt is made to connect to the database that has already been connected.
• The DBOPEN(P) instruction is executed for a database exceeding the maximum number of databases that can be
connected concurrently.
• The number of characters of the path (including the drive path character) specified by (s) exceeds 128.
• The database is opened during transaction.
For the error code stored in the completion status of the operand, refer to the following.
Page 986 Error codes related to database access instructions
Error code
(SD0)
Description
2820H The area specified by (d2) exceeds the applicable range of the device/label used.
2840H A numerical value other than 2 is specified for the drive number in (s).
OFF
OFF
ON
ON
Program
DBOPEN(P) instruction
Completion device (d2)
Completion device (d2)+1
END processing END processing END processing
Opening
the database
Error completion