ReceiveTimeoutInMilliseconds

Write Read TwinCAT TIA
Network TCP/IP client ActiveClients One client

ns=2;s=DEPRAG Smart/Network/TCP/IP/ActiveClients/0/ReceiveTimeoutInMilliseconds

Maximum time in milliseconds that the client waits for the reception of a message. If the message cannot be received completely within the time interval, an error is issued.

Examples:

In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:

Beckhoff parameter:

    bTcpIpReadReceiveTimeoutInMilliseconds
    A boolean variable that can be used to trigger the execution of the ReadReceiveTimeoutInMilliseconds command.
    bTcpIpWriteReceiveTimeoutInMilliseconds
    A boolean variable that can be used to trigger the execution of the WriteReceiveTimeoutInMilliseconds command.
    TcpIpReceiveTimeoutInMilliseconds
    A DINT variable that holds the maximum time in milliseconds that the client will wait to receive a message.
    hrTcpIpReceiveTimeoutInMilliseconds
    This can be used to monitor the execution of the command. Error codes have the type HRESULT.
    fbTcpIp
    An instance of the "FB_TcpIp" function block supplied with the DEPRAG Smart library.
    ClientId
    A STRING(255) variable representing the ID of the client.
    PointerToNodeValue
    A variable of the type "POINTER TO BYTE", in which the value to be set is stored.
    SizeOfNodeValue
    A UINT variable containing the length of the value to be set.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
   bTcpIpReadReceiveTimeoutInMilliseconds : BOOL;
   bTcpIpWriteReceiveTimeoutInMilliseconds : BOOL;
   TcpIpReceiveTimeoutInMilliseconds  : DINT;
   hrTcpIpReceiveTimeoutInMilliseconds  : HRESULT;

   fbTcpIp  : FB_TcpIp;
END_VAR

hrTcpIpReceiveTimeoutInMilliseconds := fbTcpIp.ReadReceiveTimeoutInMilliseconds(
        bExecute    := bTcpIpReadReceiveTimeoutInMilliseconds,
        ConnectionHandle  := depragSmartConnection.ConnectionHandle,
        ClientId   := '0',
        Output    => TcpIpReceiveTimeoutInMilliseconds);
IF hrTcpIpReceiveTimeoutInMilliseconds <> S_FALSE THEN 
   bTcpIpReadReceiveTimeoutInMilliseconds := FALSE;
END_IF 
 
hrTcpIpReceiveTimeoutInMilliseconds := fbTcpIp.WriteReceiveTimeoutInMilliseconds(
        bExecute    := bTcpIpWriteReceiveTimeoutInMilliseconds,
        ConnectionHandle  := depragSmartConnection.ConnectionHandle,
        ClientId   := '0',
        PointerToNodeValue  := ADR(TcpIpReceiveTimeoutInMilliseconds),
        SizeOfNodeValue  := SIZEOF(TcpIpReceiveTimeoutInMilliseconds));
IF hrTcpIpReceiveTimeoutInMilliseconds <> S_FALSE THEN 
   bTcpIpWriteReceiveTimeoutInMilliseconds := 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".