974
7 APPLICATION INSTRUCTIONS
7.21 Database Access Instructions
• These instructions search the records in the table specified by (s2) in the database corresponding to the identification
number specified by (s1). The maximum number of outputs is 64.
• Specify the field name of the record to be searched for in (s3).
• Specify the search conditions in (s4). A maximum of two conditions can be specified.
• The search result is stored in (d1).
• Even when executed from the interrupt program, this instruction performs a record search.
• When the DBSELECT(P) instruction retrieves and outputs a table recipeA record which matches the conditions in which the
output fields are 2 and 3, and the condition is field 1=2, the following occurs.
• Upon normal completion, the completion signal in the completion device (d2) 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 DBSELECT(P) instruction.
• SM753 (File being accessed) turns on while the DBSELECT(P) instruction is executed.
*1
While SM753 is on, the
DBSELECT(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
DBSELECT(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))
1
2
3
ProductA 100
ProductB 200
ProductB 200
ProductC 300
Field 1
WORD
Field 2
WSTRING
(16 characters
maximum)
Field 3
INT
Table recipeA
OFF
OFF
ON
ON
Program
DBSELECT(P) instruction
END processing END processing
Searching data
in the database
Completion device (d2)
Completion device (d2)+1
END processing
Error completion