ReadData

ReadData 1:

Reads data points from index StartIndex to StartIndex + NumberOfPoints - 1. The first valid index is 1.
Returns 0 on success or a non-zero error code.

Syntax

Definition:

METHOD ReadData : UDINT
VAR_INPUT
    DestinationAddress : Pointer To MotionFunctionPoint;
    NumberOfPoints     : UDINT;
    StartIndex         : UDINT;
END_VAR
VAR_OUTPUT
    NumberOfPointsRead : UDINT;
END_VAR

ReadData 2: Inputs

Name

Type

Description

DestinationAddress

Pointer To MotionFunctionPoint

Pointer to the destination buffer for the requested data points.

NumberOfPoints

UDINT

Number of points to read.

StartIndex

UDINT

Index of the first point to read.

ReadData 3: Outputs

Name

Type

Description

NumberOfPointsRead

UDINT

The actual number of points read, which can be less than or equal to the specified NumberOfPoints.

ReadData 4: Return value

UDINT

Possible error codes

For this function block, the following values, among others, are possible for the ErrorId output:

Error(Hex)

Error(Dec)

Error type

Description

0x8120

33056

Environment

Invalid configuration for object (e.g., in TwinCAT 3 Engineering (XAE)). The static configuration of the object (parameters, init values, linked symbols) is incomplete or invalid, so the object cannot reach the target state.

0x8198

33176

Parameter

Invalid index. The used index does not exist or is invalid.

An overview of all NC error codes can be found here: