FB_ALY_AM8xxxSSD_ValueExtractor

The AM8xxxSSD_ValueExtractor enables the analysis of a motor equipped with the Smart System Diagnosis functionality. The built-in encoder records measured values from various internally installed sensors. These include the temperature and humidity in the encoder, as well as the acceleration in the X and Y directions. These measured values are provided as outputs.

Syntax

Definition:

FUNCTION_BLOCK FB_ALY_AM8xxxSSD_ValueExtractor
VAR_OUTPUT
    ipResultMessage : Tc3_EventLogger.I_TcMessage;
    bError : BOOL;
    bNewResult : BOOL;
    bConfigured : BOOL;
    fHumidity : LREAL;
    fTemperature : LREAL;
    fXRmsAcceleration :  LREAL;
    fXKurtosisAcceleration : LREAL;
    fXPeakPeakAcceleration : LREAL;
    fYRmsAcceleration :  LREAL;
    fYKurtosisAcceleration : LREAL;
    fYPeakPeakAcceleration : LREAL;
END_VAR

FB_ALY_AM8xxxSSD_ValueExtractor 1: Outputs

Name

Type

Description

ipResultMessage

I_TcMessage

Contains more detailed information on the current return value. For this special interface pointer, it is ensured internally that it is always valid/assigned.

bError

BOOL

The output is TRUE if an error occurs.

bNewResult

BOOL

When a new result has been calculated, the output is TRUE.

bConfigured

BOOL

Displays TRUE if the function block is successfully configured.

fHumidity

LREAL

Humidity inside the encoder in %.

fTemperature

LREAL

Temperature inside the encoder in °C.

fXRmsAcceleration

LREAL

RMS of the acceleration in the X direction in g.

fXKurtosisAcceleration

LREAL

Kurtosis of the acceleration in the X direction.

fXPeakPeakAcceleration

LREAL

Peak-to-peak value of the acceleration in the X direction in g.

fYRmsAcceleration

LREAL

RMS of the acceleration in the Y direction in g.

fYKurtosisAcceleration

LREAL

Kurtosis of the acceleration in the Y direction.

fPeakPeakAccelerationY

LREAL

Peak-to-peak value of the acceleration in the Y direction in g.

FB_ALY_AM8xxxSSD_ValueExtractor 2: Methods

Name

Definition location

Description

Call()

Local

Method for calculating the outputs for a specific configuration.

Reset()

Local

Resets all internal states or the calculations performed so far.

Example

VAR
    fbAM8SSD : FB_ALY_AM8xxxSSD_ValueExtractor;
    fbSystemTime : FB_ALY_GetSystemTime;

    // Inputs
    nUpdateCounter AT%I* : ULINT;
    dataSensor0 AT%I* : ULINT;
    dataSensor1 AT%I* : ULINT;
    dataSensor2 AT%I* : ULINT;
    dataSensor3 AT%I* : ULINT;
END_VAR
// Get current system time
fbSystemTime.Call();

// Call algorithm
fbAM8SSD.SetChannelValue(1, nUpdateCounter);
fbAM8SSD.SetChannelValue(2, dataSensor0);
fbAM8SSD.SetChannelValue(3, dataSensor1);
fbAM8SSD.SetChannelValue(4, dataSensor2);
fbAM8SSD.SetChannelValue(5, dataSensor3);
fbAM8SSD.Call(tTimestamp := fbSystemTime.tSystemTime);

Sample project

The code used in the example section is implemented in the example project below. The link to the required hardware is also shown here.

Download: TC_BSSD

To ensure that the required outputs are available, the drive must be prepared accordingly. This is described in the Preparation section below.

The following packages are required to run the example project:

Preparation

In order for the sensor values to be available for analysis, they must be added to the process image of the drive. This process is described below.

►Create a TwinCAT project.
►Scan the I/Os of the TwinCAT project.
►Add a Drive Manager project to the solution.
►Select the corresponding channel of the drive to which the motor with the B/SSD-capable encoder is connected.
►Select the Advanced tab.
►Further process data can be added in the Process data subitem.
►Add the following process data:
IntSHub: Update counter
IntSHub: Data Sensor 0
IntSHub: Data Sensor 1
IntSHub: Data Sensor 2
IntSHub: Data Sensor 3
FB_ALY_AM8xxxSSD_ValueExtractor 3:
Once the process data has been added, it is displayed in the I/O node and is available for analysis.
FB_ALY_AM8xxxSSD_ValueExtractor 4:

Requirements

Development environment

Target platform

Plc libraries to include

TwinCAT v3.1.4024.0

PC or CX (x64, x86)

Tc3_Analytics