5 Other Functions
5-21
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
5
5-4 How to Prevent Losing SQL Statements
When a DB_Update instruction is being executed
Create a DB Map Variable
(for resend)
Resend processing
required?
DB_CreateMapping instruction
Read output parameters of Busy
and SendStatus output variables
Change the output parameters of Busy and
SendStatus output variables to initial values
Establish a DB Connection
1st cycle of the
operation?
Resend processing required
Busy = TRUE and
SendStatus = _DBC_SEND_SENDING
Values of output
parameters of Busy and
SendStatus output
variables
Resend processing not required
Re-execute the DB_Update
instruction
Precautions for Correct Use
The value of the SendStatus output variable is overwritten when the value of the Execute
input variable is evaluated regardless of the value of the Execute input variable.
Therefore, write the user program so that the value of the SendStatus output variable is
read before evaluating the value of the Execute input variable of the DB Connection
Instruction in the first cycle of the operation.
The DB Connection Instruction is not executed if the Execute input variable is already
TRUE at the operation start. You need to change the Execute input variable to FALSE to
execute the instruction.