FB_IotFunctions_Message

FB_IotFunctions_Message 1:

The function block provides read/write operations for messages. All message parameters as well as global settings exist as input parameters.

Syntax

FUNCTION_BLOCK FB_IotFunctions_Message
VAR_INPUT
  nChannelId                : UINT;
  nRequestTimeout           : UDINT;
  nMessageRetryInterval     : UDINT;
  nMessageCumulativeTimeout : UDINT;
  iotFunctionsDriverOTCID   : OTCID;
END_VAR
VAR_OUTPUT
  hResult                   : HRESULT;
  pStMessageDetails         : POINTER TO ST_IotFunctionsMessage;
  pStRequestDetails         : POINTER TO ST_IotFunctionsRequest;
  bInitialized              : BOOL;
  fbTcResultEvent           : FB_TcIotFunctionsResultEvent;
END_VAR

FB_IotFunctions_Message 2: Inputs

Designation

Type

Description

nChannelId

UINT

Channel ID of the corresponding IotFunctions channel in the configuration of the target data agent instance.

nRequestTimeout

UDINT

Timeout value in milliseconds.

nMessageRetryInterval

UDINT

Message interval in milliseconds (0 disables retries).

nMessageCumulativeTimeout

UDINT

Cumulative timeout (the successful receipt of message data extends the timeout of the relevant request by this value).

iotFunctionsDriverOTCID

OTCID

OTCID of the target IotFunctions driver instance (see driverOTCID of FB_IotFunctions_Connector)

FB_IotFunctions_Message 3: Outputs

Designation

Type

Description

hResult

HRESULT

Contains the last hresult (is updated when bBusy or bError are accessed or Read/Write is called)

pStMessageDetails

POINTER TO ST_IotFunctionsMessage

Pointer to structure containing detailed information about the underlying message

pStRequestDetails

POINTER TO ST_IotFunctionsRequest

Pointer to structure containing detailed information about the underlying request in which this message is executed

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_Message 4: Methods

Designation

Description

Read

Reads a message from the channel

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.

Write

Writes a message to the channel

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4022.14

IPC or CX (c86, x64, ARM)

Tc3_IotFunctions