F_VN_GetClusterCenter

F_VN_GetClusterCenter 1:

Get the center of a cluster.

Syntax

Definition:

FUNCTION F_VN_GetClusterCenter : HRESULT
VAR_INPUT
    ipClusterer : ITcVnMlModel;
    nCluster    : DINT;
    ipCenter    : Reference To ITcVnContainer;
    hrPrev      : HRESULT;
END_VAR

F_VN_GetClusterCenter 2: Inputs

Name

Type

Description

ipClusterer

ITcVnMlModel

Clusterer to be used

nCluster

DINT

Cluster ID of the cluster the center of which is requested

ipCenter

Reference To ITcVnContainer

Returns the cluster center (ContainerType_Vector_REAL or ContainerType_Vector_LREAL depending on the floating point type internally used by the clusterer)

hrPrev

HRESULT

HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.)

F_VN_GetClusterCenter 3: Return value

HRESULT

Further information

The function F_VN_GetClusterCenter returns the center of a cluster.

Parameter

Clusterer model

The cluster whose center is to be calculated must be contained in the previously trained model ipClusterer.

Cluster ID

The ID of the corresponding cluster is transferred to nCluster.

Cluster center

The center of the cluster is returned via the reference ipCenter. The type of container returned is ContainerType_Vector_REAL or ContainerType_Vector_LREAL, depending on the data type used internally in ipClusterer.

Application

The center of the third cluster in a Clusterer model can be determined as follows:

hr := F_VN_GetClusterCenter(
    ipClusterer := ipClusterer,
    nCluster    := 2,
    ipCenter    := ipCenter,
    hrPrev      := hr);

Related functions

Required License

TC3 Vision Machine Learning

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4024.54 or later

PC or CX (x64) with PL50, e.g. Intel 4-core Atom CPU

Tc3_Vision