IsConnected

Read TwinCAT TIA
Network TCP/IP client ActiveClients One client

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

Indicates whether the TCP/IP client is connected to the server.

Examples:

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

Beckhoff parameter:

    bTcpIpIsConnected
    A boolean variable that can be used to trigger the execution of the IsConnected command.
    TcpIpIsConnected
    A boolean variable that indicates whether the TCP/IP client is connected to the server.
    hrTcpIpIsConnected
    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.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
   bTcpIpIsConnected : BOOL;
   TcpIpIsConnected : BOOL;
   hrTcpIpIsConnected : HRESULT;

   fbTcpIp  : FB_TcpIp;
END_VAR

hrTcpIpIsConnected := fbTcpIp.IsConnected(
        bExecute    := bTcpIpIsConnected,
        ConnectionHandle  := depragSmartConnection.ConnectionHandle,
        ClientId   := '0',
        Output    => TcpIpIsConnected);
IF hrTcpIpIsConnected <> S_FALSE THEN 
   bTcpIpIsConnected := 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".