MC_CamIn_BkPlcMc (from V3.0)
The function block starts and monitors a cam plate coupling between two axes. To release the coupling, an MC_CamOut_BkPlcMc function block should be used.
Inputs
VAR_INPUT
Execute: BOOL;
MasterOffset: LREAL:=0.0;
SlaveOffset: LREAL:=0.0;
MasterScaling: LREAL:=0.0;
SlaveScaling: LREAL:=0.0;
StartMode: MC_StartMode_BkPlcMc:=MC_StartMode_Absolute;
CamTableId: MC_CAM_ID_BkPlcMc;
BufferMode: MC_BufferMode_BkPlcMc:=Aborting_BkPlcMc; (ab/from V3.0.8)
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | A rising edge at this input starts the coupling. |
MasterOffset | LREAL | [mm, 1] This value is offset against with the actual position of the master, before the resulting value is looked up in the master column of the table. |
SlaveOffset | LREAL | [mm, 1] This value is offset against the slave position from the table. |
MasterScaling | LREAL | [mm, 1] This value is offset against with the actual position of the master, before the resulting value is looked up in the master column of the table. |
SlaveScaling | LREAL | [mm, 1] This value is offset against the slave position from the table. |
StartMode | MC_StartMode_BkPlcMc | A value from MC_StartMode_BkPlcMc, which specifies the behavior of the slave axis when the coupling is activated. |
CamTableId | MC_CAM_ID_BkPlcMc | Here, a variable of type MC_CAM_ID_BkPlcMc should be transferred, which was initialized by a function block of type MC_CamTableSelect_BkPlcMc. |
BufferMode | MC_BufferMode_BkPlcMc | reserved. This input is provided in preparation for a future build. It should currently either not be assigned or assigned the constant Aborting_BkPlcMc. (from V3.0.8) |
Inputs/outputs
VAR_INOUT
Master: Axis_Ref_BkPlcMc;
Slave: Axis_Ref_BkPlcMc;
END_VAR
Name | Type | Description |
---|---|---|
Master | Axis_Ref_BkPlcMc | Here, the address of a variable of type Axis_Ref_BkPlcMc should be transferred. |
Slave | Axis_Ref_BkPlcMc | Here, the address of a variable of type Axis_Ref_BkPlcMc should be transferred. |
Outputs
VAR_OUTPUT
Busy: BOOL;
InSync: BOOL;
CommandAborted: BOOL;
Error: BOOL;
ErrorID: UDINT;
EndOfProfile: BOOL;
END_VAR
Name | Type | Description |
---|---|---|
Busy | BOOL | Indicates that a command is being processed. |
InSync | BOOL | This indicates the first successful synchronization of the axes. The signal the remains active, even if the synchronization subsequently fails temporarily or permanently. |
CommandAborted | BOOL | This indicates abortion of the coupling. |
Error | BOOL | The occurrence of an error is indicated here. |
ErrorID | UDINT | An encoded indication of the cause of the error is provided here. |
EndOfProfile | BOOL | This is indicates whether the master has reached the end of the defined range. |
Behavior of the function block
On a rising edge at Execute the function block checks the transferred axis interface. A number of problems can be detected and reported during this process:
- If CamTableId.bValidated was not set by a function block of type MC_CamTableSelect_BkPlcMc, the system responds with Error and ErrorID:=dwTcHydErrCdTblNoInit.
- If either the master or the slave are not in idle state, the system responds with Error and ErrorID:=dwTcHydErrCdNotStartable.
- If the value MC_StartMode_RampIn is specified as StartMode, the function block responds with Error and ErrorID:=dwTcHydErrCdNotSupport.
If these checks could be performed without problem, the coupling is initiated. Depending on StartMode, the reference position for Slave is either set to 0.0 or to the current actual position of Slave. The axis is now in state McState_Synchronizedmotion, and the function block starts calculating and monitoring the coupling.
The set position and set velocity of Slave are calculated depending on the actual position and the set velocity of the master and the table.
When the velocity required by the coupling is reached for the first time while the slave axis coupling is active, this is indicated at output InGear. Since the coupling can currently only be activated at standstill, this is the case immediately. If the slave axis is unable to follow the specifications for some reason while the coupling is active, InGear remains unchanged.
If an error code occurs in the motion generator while the coupling is active, the system responds with Error and ErrorID:=motion algorithm error code.
A falling edge at Execute neither aborts the calculation nor the monitoring of the coupling. This is only brought about if the coupling is activated through an MC_CamOut_BkPlcMc function block or if an error occurs. Only then are all pending output signals cleared.
This function block temporarily deals with setpoint generation. To indicate this, Busy is not only TRUE up to the transition to synchronicity, but remains TRUE until the coupling is released. |
Function block call It is mandatory to call this function block cyclically when Busy is TRUE. Subsequently, the function block should be called at least once with Execute:=FALSE. |