MC_WriteMotionFunction
The MC_WriteMotionFunction function block can be used to write the data of a motion function into the NC. Either the complete function with all interpolation points or only a part can be written. First, the data are stored within the PLC in the structure described by CamTable.
The MC_SetCamOnlineChangeMode function block can be used to define when the data is transferred to the cam plate. If activation of the data is to be delayed until the master reaches a certain position, the system will initially queue the written data and activate them at the master position.
The Axis.Status.CamDataQueued (AXIS_REF) status flag can be used to check whether data have been queued, i.e. written but not yet activated.
Inputs
VAR_INPUT
Execute : BOOL;
CamTableID : MC_CAM_ID;
PointID : MC_MotionFunctionPoint_ID;
NumPoints : UDINT;
CamTable : MC_CAM_REF;
Options : ST_WriteMotionFunctionOptions;
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 written. | |
CamTable | MC_CAM_REF | Reference to the table (structure). The start address of the table data structure (CamTable.pArray) indicates the first point to be written. | |
Options | Data structure with additional options: | ||
SynchronousAccess | Writing takes place via synchronous access without a time delay. Should only be used for applications that are extremely time-critical. |
Outputs
VAR_OUTPUT
Done : BOOL;
Busy : BOOL;
Error : BOOL;
ErrorID : UDINT;
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. |