ns=2;s=DEPRAG Smart/Network/HTTP/REST/AddClient
Creates a new, fully parameterized REST client. The REST client can be retrieved from the "ActiveClients" list via the returned index.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bHttpAddClient : BOOL;
OutputDataHttpAddClient : ST_Int32OutputData;
hrHttpAddClient : HRESULT;
fbHttpRest : FB_HttpRest;
END_VAR
hrHttpAddClient := fbHttpRest.AddClient(
bExecute := bHttpAddClient,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
HostAddress := 'https://OpcUa.deprag.com/',
HostPort := 443,
ConnectionTimeOutInMilliseconds := 5000,
TlsVersion := SslProtocols.Tls12,
UserName := 'User1',
Password := 'Password1',
ApiToken := 'ApiToken1',
AcceptSelfSingedCertificates := TRUE,
Compression := DecompressionMethods.All,
ContentType := '',
OutputData => OutputDataHttpAddClient);
IF hrHttpAddClient <> S_FALSE THEN
bHttpAddClient := 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".