OverwriteData

OverwriteData 1:

Overwrites data points from index StartIndex to StartIndex + NumberOfPoints - 1 and recalculates the modified cam table segments. The first valid index is 1.
Returns 0 on success or a non-zero error code.

Syntax

Definition:

METHOD OverwriteData : UDINT
VAR_INPUT
    SourceAddress  : Pointer To MotionFunctionPoint;
    NumberOfPoints : UDINT;
    StartIndex     : UDINT;
END_VAR

OverwriteData 2: Inputs

Name

Type

Description

SourceAddress

Pointer To MotionFunctionPoint

Pointer to the new data points to write.

NumberOfPoints

UDINT

Number of points to overwrite.

StartIndex

UDINT

Index of the first point to overwrite.

OverwriteData 3: Return value

UDINT

Further information

The property allows writing or overwriting a defined data range of the cam plate.

Notice

Property damage due to modifying an active cam plate coupling

This method can also be called while a cam plate is active. Valid changes are applied synchronously to the cam plate and may result in setpoint jumps. To switch cam plates at a specific time or position, the following steps are recommended:

  • Create a copy of the active cam plate (using the CopyFrom() method).
  • Make the changes to the copy (using the OverwriteData() method).
  • Switch between the cam plates (MC_CamExchange).

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: