PLC API PROGRAM MAIN VAR FB_DBRecordArraySelect1 : FB_DBRecordArraySelect; cmd : T_Maxstring := 'SELECT * FROM myTable'; (* Unter ARM*) (*cmd : T_Maxstring := 'SELECT ID,Timestamp,Value,Name FROM myTable'*) (*----------*) recordArray : ARRAY [1..5] OF ST_Record; busy : BOOL; err : BOOL; errid : UDINT; sqlstate : ST_DBSQLError; recAnz :
UDINT; END_VAR PLC program FB_DBRecordArraySelect1( sNetID:= , hDBID:= 1, cbCmdSize:= SIZEOF(cmd), pCmdAddr:= ADR(cmd), nStartIndex:= 0, nRecordCount:= 5, cbRecordArraySize:= SIZEOF(recordArray), pDestAddr:= ADR(recordArray), bExecute:= TRUE, tTimeout:= T#15s, bBusy=> busy, bError=> err, nErrID=> errid, sSQLState=> sqlstate, nRecords=> recAnz); Requirements 7.1.18 FB_DBStoredProcedures With this function block FB_DBStoredProcedures you are able to start stored procedures. It is possible to declare parameters which will be used in the stored procedures. VAR_INPUT VAR_INPUT sNetID : T_AmsNetID :=''; hDBID : UDINT :=1; sProcedureName : T_MaxString :=''; cbParameterList : UDINT; pParameterList :
POINTER TO ARRAY[0..MAX_STORED_PROCEDURES_PARAMETERS] OF ST_DBParameter; bExecute : BOOL; tTimeout : TIME := T#15s; END_VAR sNetID : Is a string containing the AMS network identifier of the target device to which the ADS command is directed. TS6420 78 Version: 1.2 Development environment Target system type PLC libraries to be linked TwinCAT v2.10.0 PC or CX (x86) TcDatabase.Lib TwinCAT v2.10.0 CX (ARM)