MC_ReadMotionFunction

MC_ReadMotionFunction 1:

The MC_ReadMotionFunction function block can be used to read the data of a motion function. Either the complete function with all interpolation points or only a part can be read. The data are stored within the PLC in the structure described by CamTable.

MC_ReadMotionFunction 2: Inputs

VAR_INPUT
   Execute    : BOOL;
   CamTableID : MC_CAM_ID;
   PointID    : MC_MotionFunctionPoint_ID;
   NumPoints  : UDINT; (* 0 = fill MFsize *)
END_VAR

Name

Type

Description

Execute

BOOL

The command is executed with a rising edge at Execute input.

CamTableID

MC_CAM_ID

ID of the loaded table.

PointID

MC_MotionFunctionPoint_ID

Point ID of the first point of the motion function to be read.

NumPoints

UDINT

Number of motion function points to be read. For reading all points, 0 can be specified here, in which case the number that is actually read is returned in the output variable NumPointsRead.

MC_ReadMotionFunction 3: Inputs/outputs

VAR_IN_OUT
   CamTable : MC_CAM_REF;
END_VAR

Name

Type

Description

CamTable

MC_CAM_REF

Reference to the table (structure).

MC_ReadMotionFunction 4: Outputs

VAR_OUTPUT
   Done          : BOOL;
   Busy          : BOOL;
   Error         : BOOL;
   ErrorID       : UDINT;
   NumPointsRead : UDINT; (* return value <= NumPoints *)
END_VAR

Name

Type

Description

Done

BOOL

Becomes TRUE if the data have been read successfully.

Busy

BOOL

The Busy output becomes TRUE when the command is started with Execute and remains TRUE for as long as the command is processed. If Busy becomes FALSE again, the function block is ready for a new order. At the same time one of the outputs, Done or Error, is set.

Error

BOOL

Becomes TRUE as soon as an error occurs.

ErrorID

UDINT

If the error output is set, this parameter supplies the error number.

NumPointsRead

UDINT

The number of points that were actually read. The number can be less than or equal to NumPoints.