ns=2;s=DEPRAG Smart/Devices/General/OpenProtocol/AddDevice
Adds a new device to the "OpenProtocolDevices" list.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bOpenProtocolAddDevice : BOOL;
OutputDataOpenProtocolAddDevice : ST_Int32OutputData;
hrOpenProtocolAddDevice : HRESULT;
fbOpenProtocol : FB_OpenProtocol;
END_VAR
hrOpenProtocolAddDevice := fbOpenProtocol.AddDevice(
bExecute := bOpenProtocolAddDevice,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
OutputData => OutputDataOpenProtocolAddDevice);
IF hrOpenProtocolAddDevice <> S_FALSE THEN
bOpenProtocolAddDevice := 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".