970
7 APPLICATION INSTRUCTIONS
7.21 Database Access Instructions
■Search condition
*1 "0" to "3072" for a programmable controller CPU with firmware version earlier than "28"
Operand: (s4)
Device Item Description Setting
range
Set by Data
type
+0 Data size of the first
condition
Set the data size of the first search condition in units of words in (s4)+4. If 0 is
set in (s4), all records in the table are to be output.
• 0: No condition
• Other than 0: Data size of field
(When (s4) is set to 0, set (s4)+1 also to 0.)
0 to 125 User WORD
+1 Data size of the
second condition
Set the data size of the second search condition in (s4)+4.
• 0: No condition
• Other than 0: Data size of field
0 to 125 User
+2 Maximum output
size
Set the maximum output size in the search result (d1).
• 0: Default value (1024 words)
0 to
32768
*1
User
+3 Maximum number
of outputs
Set the maximum number of outputs in the search result (d1).
• 0: Default number of outputs (16 outputs)
0 to 64 User
+4 to + Search condition Set the search conditions. The last address in (s4) varies depending on the data
type of the determination value.
■Field name (1)
Specify field names, each fixed to 32 characters, by the number of fields with
Unicode character strings.
For the name less than 32 characters, the character string should be right-
justified and filled with 0000H to become a 32-character string.
■Condition number (2)
Set the number indicating a search condition.
• 1: = (Equal to the determination value)
• 2: != (Other than the determination value)
• 3: < (Smaller than the determination value)
• 4: > (Greater than the determination value)
• 5: =< (Equal to or less than the determination value)
• 6: >= (Equal to or greater than the determination value)
• 7: is NULL (NULL (no value is set))
• 8: is not NULL (Not NULL (a value is set))
■Logical operator setting value (3)
Set the operator with an adjacent condition.
• 0: No operator
•1: AND
• 2: OR
When one search condition is specified, set the logical operator setting value of
the first search condition to 0. In this case, the second search condition is
ignored if specified.
Be sure to set the logical operator setting value of the second update condition
to 0.
■Determination value (4)
Set the value used to determine the update condition.
Also when the condition number is 7 or 8, prepare a determination value area for
the data size.
User
(s4)+36
(s4)+37
(s4)+4
(s4)+35
(s4)+38
(s4)+
(1)
(2)
(3)
(4)