FB_DBConnectionAdd
The FB_DBConnectionAdd function block permits additional database connections to be added to the XML configuration file.
VAR_INPUT
VAR_INPUT
sNetID :T_AmsNetId;
eDBType :E_DBTypes;
eDBValueType :E_DBValueType;
sDBServer :T_MaxString;
sDBProvider :T_MaxString;
sDBUrl :T_MaxString;
sDBSystemDB :T_MaxString;
sDBUserId :T_MaxString;
sDBPassword :T_MaxString;
sDBTable :T_MaxString;
bExecute :BOOL;
tTimeout :TIME;
END_VAR
sNetID: String containing the AMS network ID of the target device, at which the ADS command is directed.
eDBType: Indicates the type of the database, e.g. 'Mobile server'.
eDBValueType: Indicates the form in which the values are or will be stored.
sDBServer: Provides the name of the server: Optional.
sDBProvider: Gives the provider of the database: Optional.
sDBUrl: Gives the path to the database.
sSystemDB: Only for Access databases. Indicates the path to the MDW file.
sUserId: Indicates the login user name.
sPassword: Indicates the password.
sDBTable: Gives the name of the table into which the values are to be written.
bExecute: The command is executed with a rising edge.
tTimeout: Indicates the time before the function is cancelled.
VAR_OUTPUT
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
bErrID : UDINT;
hDBID : UDINT;
END_VAR
bBusy: The command is in the process of being transmitted by ADS. No new command will be accepted as long as bBusy remains TRUE.
bError: Becomes TRUE, as soon as an error occurs.
nErrID: Returns the ADS error code if the bError output is set.
hDBID: Returns the ID of the database.
Requirements
Development environment |
Target system type |
PLC libraries to be linked |
---|---|---|
TwinCAT v3.0.0 |
PC or CX (x86) |
Tc2_Database |