ns=2;s=DEPRAG Smart/Devices/DEPRAG/AST/AddDevice
Adds a new device to the ActiveDevices list. The device type is specified via the "AstType" variable.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bAstAddDevice : BOOL;
outputAstAddDevice : ST_Int32OutputData;
hrAstAddDevice : HRESULT;
fbAst : FB_AST;
END_VAR
hrAstAddDevice := fbAst.AddDevice(
bExecute := bAstAddDevice,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
AstType := AstTypes.Ast12,
sIpAddress := '0.0.0.0',
sUserName := 'username',
sPassword := 'password',
OutputData => outputAstAddDevice);
IF hrAstAddDevice <> S_FALSE THEN
bAstAddDevice := FALSE;
END_IF
For examples and explanations regarding the calls of nodes via Siemens TIA Portal please refer to the sub-menu "Siemens TIA Portal" in section "Getting Started".