FB_PLCDBCmd

Function block with two methods. Users can define and transfer their own SQL commands. Placeholders in the SQL command can correlate with structures in the PLC, which reflect the table structure. The Database Server ultimately enters the current data of the structure into the SQL command.
Syntax
Definition:
FUNCTION_BLOCK FB_PLCDBCmd
VAR_INPUT
sNetID: T_AmsNetID := '';
tTimeout: TIME := T#5S;
END_VAR
VAR_OUTPUT
bBusy: BOOL;
bError: BOOL;
ipTcResultEvent: Tc3_EventLogger.I_TcResultEvent;
END_VAR
Inputs
Name | Type | Description |
---|---|---|
sNetID | T_AmsNetID | AMS network ID of the target device at which the ADS command is directed. |
tTimeout | TIME | Indicates the time before the function is cancelled. |
Outputs
Name | Type | Description |
---|---|---|
bBusy | BOOL | TRUE as soon as a method of the function block is active. |
bError | BOOL | TRUE when an error occurs. |
ipTcResultEvent | Tc3_EventLogger.I_TcResultEvent | Result interface with detailed information on the return value. |
Methods
Name | Definition location | Description |
---|---|---|
Local | Sends any SQL commands to the database. Returned records cannot be read. | |
Local | Sends any SQL commands to the database. A specified number of records can be read. |
Requirements
Development environment |
Target platform |
PLC libraries to be linked |
---|---|---|
TwinCAT v3.1 Build 4020.10 |
PC or CX (x86) |
Tc3_Database |