Omron NX701-1620 User Manual page 204

Machine automation controller nj/nx-series database connection cpu units
Hide thumbs Also See for NX701-1620:
Table of Contents

Advertisement

Appendix A
Function
This instruction is used to insert the values of the DB Map Variable specified in the MapVar input variable to the
table mapped by a DB_CreateMapping instruction as a record.
When the Spool function is enabled, the SQL statement is stored in the Spool memory in the following cases. In
these cases, _DBC_SEND_SPOOLED is set in the SendStatus output variable and the instruction is terminated
due to an error.
 When the values cannot be inserted to the DB due to a network failure or other causes (DB Connection
Disconnected Error Status)
 When the values cannot be inserted to the DB within the time specified in the TimeOut input variable (DB
Connection Instruction Execution Timeout)
 When one or more SQL statements are already stored in the Spool memory (Data Already Spooled)
If an instruction error (SQL Execution Error) occurs when the Spool function is enabled, the transmitted SQL
statement itself can be the cause of the SQL Execution Error. Therefore, the SQL statement is not stored in the
Spool memory because the SQL Execution Error may occur again when the SQL statement is resent.
When the Spool capacity for each DB Connection is exceeded by spooling the SQL statement, this instruction is
terminated due to an error (Spool Capacity Exceeded).
Precautions for Correct Use
 Execution of this instruction is continued until processing is completed even if the value of Execute changes to
FALSE or the execution time exceeds the task period. The value of Done changes to TRUE when processing
is completed. Use this to confirm normal completion of processing.
 Refer to Using this Section of the NJ/NX-series Instructions Reference Manual (Cat. No. W502) for a timing
chart for Execute, Done, Busy, and Error.
 This instruction cannot be used on an event task. A compiling error will occur.
 If the values cannot be registered to the DB, for example, because the SQL statement is invalid, this instruction
is terminated due to an error without storing the SQL statement into the Spool memory.
 When the DB Connection Service was started in Test Mode, this instruction is completed normally without
executing the INSERT operation for the DB actually.
 When the error code is 300B hex (SQL Execution Error), you can get the detailed information of the SQL
Execution Error by executing a DB_GetConnectionStatus instruction.
 The measurement error of timeout is +50 ms for a 100-column record when the percentage of task execution
time is 50% as a guide. However, the measurement error varies according to the percentage of task execution
time and the number of columns.
 When two or more DB Connection Instructions are executed for a DB Connection at the same time, the DB
Connection Service executes the instructions one by one. The measurement of timeout for the second and
later instructions is started when the instruction is executed by the DB Connection Service, not when the
Execute input variable is changed to TRUE. Therefore, the time from when the Execute input variable is
changed to TRUE to when the timeout occurs for the instruction is longer than the time set for the timeout.
 If a value of a DB Map Variable is changed before the DB Connection Instruction is actually executed, the new
value may be used when the DB Connection Instruction is executed. When changing a value of a DB Map
Variable, write the user program so that the value is changed after confirming completion of the DB Connection
Instruction.
 An error occurs for this instruction in the following cases. Error will be TRUE.
 When the instruction was executed when the DB Connection Service was not running
 When the instruction was executed while the initialization processing of the DB Connection Service
A-16
NJ/NX-series Database Connection CPU Units User's Manual (W527)

Advertisement

Table of Contents

Troubleshooting

loading

Table of Contents