FB_GetState

FB_GetState 1:

This function block queries the state of the RRCS server.

FB_GetState 2: Inputs

VAR_INPUT
    bExecute : BOOL;
END_VAR

Name

Type

Description

bExecute

BOOL

The function block is enabled by a positive edge at this input.

FB_GetState 3: Outputs

VAR_OUTPUT
    eRRCS_ErrorCode : E_RRCS_ErrorCodes
    bBusy           : BOOL;
    bError          : BOOL;
    nStatusCode     : UINT;
    sGatewayState   : STRING(32)
END_VAR

Name

Type

Description

eRRCS_ErrorCode

E_RRCS_ErrorCodes

Error code received from RRCS_Servers.

bBusy

BOOL

Is TRUE as long as the function block is busy with the query and no error occurs.

bError

BOOL

Is TRUE if an error occurred during the query.

nStatusCode

UINT

Servers deliver the status code as a response to every HTTP request.
The server uses this code to inform the client whether the request was successful.
Normally 200 (OK) is returned.
Detailed information on this:
developer.mozilla.org/en/docs/Web/HTTP/Reference/Status

sGatewayState

STRING(32)

Information from the RRCS server, possible states:

  • Working
  • Standby

FB_GetState has an extended FB_init method in which an instance of FB_RRCScom must be referenced using a pointer:

VAR
fbGetState: FB_GetState(pfbRRCscom := ADR(fbRRCScom));
END_VAR