Appendix A
A-25
A
NJ/NX-series Database Connection CPU Units User’s Manual (W527)
Map the variable MapVar_Update to the table Production of the DB Connection MyDB1 for the UPDATE operation.
DB_CreateMapping_Insert
_instance.Done
DB_CreateMapping
_Update_instance
MyDB1
‘Production’
MapVar_Update
_DBC_SQLTYPE_UPDATE
Execute
DBConnection
TableName
MapVar
SQLType
When the instruction is terminated due to an error, execute the error handler for the device (FaultHandler_Connect).
Program the FaultHandler_Connect according to the device.
DB_Connect_instance.Error
DB_CreateMapping_Insert_
instance.Error
DB_CreateMapping_Update_instance.Error
- Insert production data to the DB Connection MyDB1 when the variable Trigger_Insert changes to TRUE.
Check the completion of the DB_Insert instruction.
Accept the trigger for inserting DB records.
Create production data to insert.
MapVar_Insert.Name := Name;
MapVar_Insert.LotNo := UINT_TO_STRING(LotNo);
MapVar_Insert.Status := ’Busy’;
MapVar_Insert.ProductionDate := DT_TO_DATE(GetTime());
DB_Update (Update DB Record)
DB Connection Instructions