FB_IotFunctions_Request

FB_IotFunctions_Request 1:

The function block enables the synchronization of multiple messages (see Synchronizing message operations).

Syntax

FUNCTION_BLOCK FB_IotFunctions_Request
VAR_INPUT
    iotFunctionsDriverOTCID : OTCID;
    nRequestTimeout         : UDINT;
END_VAR
VAR_OUTPUT
    hResult             : HRESULT;
    pStRequestDetails   : POINTER TO ST_IotFunctionsRequest;
    bInitialized        : BOOL;
    fbTcResultEvent     : FB_TcIotFunctionsResultEvent;
END_VAR

FB_IotFunctions_Request 2: Inputs

Designation

Type

Description

iotFunctionsDriverOTCID

OTCID

OTCID of the target IotFunctions driver instance [defaults to the first created object of the FB_IotFunctions_Connector]

nRequestTimeout

UDINT

Timeout value in milliseconds

FB_IotFunctions_Request 3: Outputs

Designation

Type

Description

hResult             

HRESULT

Contains the hresult of the last message (is updated when bBusy or bError is accessed or Create/Execute/EnqueueRead/EnqueueWrite is called)

pStRequestDetails   

POINTER TO ST_IotFunctionsRequest

Pointer to structure containing details information about the underlying request

bInitialized        

BOOL

Indicates whether interface search and initialization was successful

fbTcResultEvent

FB_TcIotFunctionsResultEvent

Instance of a helper function block that contains detailed information about the send or receive process.

FB_IotFunctions_Request 4: Methods

Designation

Description

Create

Creates a new request

EnqueueRead

Adds an instance of FB_IotFunctions_Message for read operation

EnqueueWrite

Adds an instance of FB_IotFunctions_Message for write operations

Execute

Executes the request

Acknowledge

Acknowledges the error/success status and releases the associated message objects. Call this method after status acknowledgement if no new read/write process is started in this cycle to prevent multiple evaluation of the last status.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4022.14

IPC or CX (c86, x64, ARM)

Tc3_IotFunctions