Appendix A
A-73
A
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
DB_ControlSpool (Resend/Clear Spool Data)
An error occurs for this instruction in the following cases. Error will be TRUE.
When the Resend Spool Data operation was executed by this instruction when the DB Connection
Service was not running
When the instruction was executed while the initialization processing of the DB Connection Service
was in progress
When the instruction was executed while the DB Connection Service was stopped due to an error
When the instruction was executed after the DB Connection Service was shut down or while the DB
Connection Service was being shut down
When the value of the DBConnection input variable is invalid or the specified DB Connection is
already closed
When a value that is not defined as an enumerator was specified in the Cmd input variable
When the executed SQL statement resulted in an error in the DB
When the DB Connection Service cannot communicate with the DB due to a network failure or other
causes
When more than 32 DB Connection Instructions were executed at the same time
Sample Programming
This section gives sample programming for resending the SQL statements stored in the Spool memory if the
status of the DB Connection is Connected when the trigger variable changes to TRUE
Ladder Diagram
Main Variables
DB_GetConnectionStatus_instance DB_GetConnectionStatus --- Instance of DB_GetConnectionStatus
DB_ControlSpool_instance DB_ControlSpool --- Instance of DB_ControlSpool
Trigger BOOL FALSE Variable used as a trigger for
Operating BOOL FALSE When this variable is TRUE, the
resending processing of Spool data is
OperatingEnd BOOL FALSE This variable changes to TRUE when
the resending processing of Spool
Instance of RS instruction
MyStatus _sDBC_CONNECTION_STATUS --- This variable is assigned to the
ConnectionStatus output variable
from
DB_GetConnectionStatus_instance.
Resend BOOL FALSE This variable changes to TRUE when
the status of the DB Connection is
Nosent BOOL FALSE This variable changes to TRUE when
the status of the DB Connection is not
ControlSpool_OK BOOL FALSE This variable changes to TRUE when
the DB_ControlSpool instruction is
DB Connection Instructions