MaxResponseContentBufferSize

Write Read TwinCAT TIA
Network REST Client ActiveClients One client

ns=2;s=DEPRAG Smart/Network/HTTP/REST/ActiveClients/0/MaxResponseContentBufferSize

Maximum number of bytes to cache for calls to the REST API.

Examples:

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

Beckhoff parameter:

    bHttpReadMaxResponseContentBufferSize
    A boolean variable that can be used to trigger the execution of the ReadMaxResponseContentBufferSize command.
    bHttpWriteMaxResponseContentBufferSize
    A boolean variable that can be used to trigger the execution of the WriteMaxResponseContentBufferSize command.
    ReadMaxResponseContentBufferSize
    A LINT variable in which the number of bytes that are buffered is stored.
    WriteMaxResponseContentBufferSize
    A LINT variable in which the number of bytes to be buffered is stored.
    hrHttpMaxResponseContentBufferSize
    This can be used to monitor the execution of the command. Error codes have the type HRESULT.
    fbHttpRest
    An instance of the "FB_HttpRest" function block supplied with the DEPRAG Smart library.
    ClientId
    A String(255) variable that specifies the client that should execute the command.
    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
     bHttpReadMaxResponseContentBufferSize : BOOL;
     bHttpWriteMaxResponseContentBufferSize : BOOL;
     ReadMaxResponseContentBufferSize  : LINT;
     WriteMaxResponseContentBufferSize  : LINT;
     hrHttpMaxResponseContentBufferSize  : HRESULT;

     fbHttpRest   : FB_HttpRest;
END_VAR

 
hrHttpMaxResponseContentBufferSize := fbHttpRest.ReadMaxResponseContentBufferSize(
       bExecute    := bHttpReadMaxResponseContentBufferSize,
       ConnectionHandle  := depragSmartConnection.ConnectionHandle,
       ClientId   := '0',
       Output    => ReadMaxResponseContentBufferSize);
IF hrHttpMaxResponseContentBufferSize <> S_FALSE THEN 
     bHttpReadMaxResponseContentBufferSize := FALSE;
END_IF 
 
hrHttpMaxResponseContentBufferSize := fbHttpRest.WriteMaxResponseContentBufferSize(
       bExecute    := bHttpWriteMaxResponseContentBufferSize,
       ConnectionHandle  := depragSmartConnection.ConnectionHandle,
       ClientId   := '0',
       PointerToNodeValue  := ADR(WriteMaxResponseContentBufferSize),
       SizeOfNodeValue  := SIZEOF(WriteMaxResponseContentBufferSize));
IF hrHttpMaxResponseContentBufferSize <> S_FALSE THEN 
     bHttpWriteMaxResponseContentBufferSize := 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".