ns=2;s=DEPRAG Smart/Devices/General/OpenProtocol/OpenProtocolDevices/0/Connect
Establishes the connection to an Open Protocol device. DEPRAG Smart acts as an Open Protocol client that establishes the connection to an Open Protocol server.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bOpenProtocolConnect : BOOL;
OutputDataOpenProtocolConnect : ST_VoidOutputData;
hrOpenProtocolConnect : HRESULT;
fbOpenProtocol : FB_OpenProtocol;
END_VAR
hrOpenProtocolConnect := fbOpenProtocol.Connect(
bExecute := bOpenProtocolConnect,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
sDeviceId := '0',
sIp := '000.000.000.000',
nPort := 4545,
nTimeOutInSeconds := 5,
bEnableKeepAlive := TRUE,
nRevision := 1,
OutputData => OutputDataOpenProtocolConnect);
IF hrOpenProtocolConnect <> S_FALSE THEN
bOpenProtocolConnect := 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".