FB_ALY_StorageProvider

FB_ALY_StorageProvider 1:

The FB_ALY_StorageProvider is a client FB for communication with a Storage Provider instance. The FB provides methods to trigger historical data or start/stop recordings.

Syntax

Definition:

FUNCTION_BLOCK FB_ALY_StorageProvider
VAR_INPUT
    stConfig : ST_ALY_SP_Config;
END_VAR
VAR_OUTPUT
    bBusy  : BOOL;
    bError : BOOL;
    ipResultMessage  : I_TcMessage;
    eConnectionState : ETcIotMqttClientState;
END_VAR

FB_ALY_StorageProvider 2: Inputs

Name

Type

Description

stConfig

ST_ALY_SP_Config

Structure for the configuration of the FB.

FB_ALY_StorageProvider 3: Outputs

Name

Type

Description

bBusy

BOOL

TRUE as soon as a method of the function block is active.

bError

BOOL

Becomes TRUE when an error situation occurs.

ipResultMessage

I_TcMessage

Message interface of the TwinCAT 3 EventLogger, which provides further information about the return value.

eConnectionState

ETcIotMqttClientState

Specifies the state of the connection between client and broker as an enumeration ETcIotMqttClientState.

FB_ALY_StorageProvider 4: Methods

Name

Definition location

Description

Call

Local

Method for background communication with the TwinCAT driver. The method must be called cyclically.

Cancel

Local

Method for aborting activities of the TwinCAT Analytics Storage Provider.

GetHistoricalData

Local

Method for requesting historical data.

ReadHistoricalStreams

Local

Method for reading all historical streams.

ReadStreamRecords

Local

Method for reading all records of a historical stream

ResetCommunication

Local

Method to reset the MQTT connection to the broker.

SendCommand

Local

Generic method for sending various commands.

SetHistoricalDataState

Local

Method for setting various parameters of a historical stream

StartRecord

Local

Starts recording a live MQTT binary stream.

StopRecord

Local

Stops the selected recording.

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4022.25

PC or CX (x64, x86, ARM)

Tc3_AnalyticsStorageProvider