MC_Home_BkPlcMc (from V3.0)

MC_Home_BkPlcMc (from V3.0) 1:

This function block starts and monitors the homing of an axis.

MC_Home_BkPlcMc (from V3.0) 2: Inputs

VAR_INPUT
    Execute:        BOOL;
    Position:       LREAL;
    HomingMode:     MC_HomingMode_BkPlcMc;
    CalibrationCam: BOOL;
    BufferMode:     MC_BufferMode_BkPlcMc:=Aborting_BkPlcMc;    (ab/from V3.0.8)
END_VAR

Name

Type

Description

Execute

BOOL

The homing is initiated by a rising edge at this input.

Position

LREAL

[mm] The reference position.

HomingMode

MC_HomingMode_BkPlcMc

Specifies the method to be used.

CalibrationCam

BOOL

This can be used for direct transfer of the referencing index (cam).

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)

MC_Home_BkPlcMc (from V3.0) 3: Inputs/outputs

VAR_INOUT
    Axis:           Axis_Ref_BkPlcMc;
END_VAR

Name

Type

Description

Axis

Axis_Ref_BkPlcMc

Here, the address of a variable of type Axis_Ref_BkPlcMc should be transferred.

MC_Home_BkPlcMc (from V3.0) 4: Outputs

VAR_OUTPUT
    Busy:           BOOL;
    Done:           BOOL;
    CommandAborted: BOOL;
    Error:          BOOL;
    ErrorID:        UDINT;
END_VAR

Name

Type

Description

Busy

BOOL

Indicates that a command is being processed.

Done

BOOL

Successful processing of the homing is indicated here.

CommandAborted

BOOL

Abortion of homing is indicated here.

Error

BOOL

The occurrence of an error is indicated here.

ErrorID

UDINT

An encoded indication of the cause of the error is provided here.

Behavior of the function block

On a rising edge at Execute, the function block examines the transferred axis interface. A number of problems can be detected and reported during this process:

Homing begins if these checks are carried out without problems. The exact sequence is specified by HomingMode. If the movement algorithm reports an error code while homing is being executed, the function block responds with Error and ErrorID:=the movement algorithm's error code. If completion of homing is prevented by the activity of another function block, the function block responds with CommandAborted. Successful completion of homing is reported with Done.

A falling edge at Execute clears all the pending output signals. If, while homing is still active, Execute is set to FALSE, execution of homing that had started continues unaffected. The signals provided at the end of the movement (Error, ErrorID, CommandAborted, Done) are made available for one cycle.

Notice fEnc_DefaultHomePosition in pStAxParams is provided for circumstances in which the application does not itself specify a reference position and a value saved with the machine data is to be loaded for use instead. If different values are required, depending on the situation, use should be made of fCustomerData[] in pStAxParams.

If iTcMc_EncoderSim is set as encoder type, the mode MC_Direct_BkPlcMc takes effect, irrespective of HomingMode and Axis_Ref_BkPlcMc.stAxParams.nEnc_HomingType.

MC_DefaultHomingMode_BkPlcMc

The referencing method is not specified by the application, but through Axis_Ref_BkPlcMc.stAxParams.nEnc_HomingType. The following rules apply:

nEnc_HomingType

MC_HomingMode_BkPlcMc

iTcMc_HomingOnBlock

MC_Block_BkPlcMc

iTcMc_HomingOnIndex

MC_AbsSwitch_BkPlcMc

iTcMc_HomingOnSync

MC_RefPulse_BkPlcMc

iTcMc_HomingOnExec

MC_Direct_BkPlcMc

MC_AbsSwitch_BkPlcMc

The axis is moved with Axis_Ref_BkPlcMc.stAxParams.fEnc_RefIndexVelo in the direction specified by bEnc_RefIndexPositive. The axis stops if CalibrationCam becomes TRUE or if the reference cam (bit 5, dwTcHydDcDwRefIndex) is detected in Axis_Ref_BkPlcMc.stAxRtData.nDeCtrlDWord. The axis is then moved with fEnc_RefSyncVelo in the direction specified by bEnc_RefSyncPositive, until the reference cam is exited. The actual value for the axis is set to the value of the reference position.

MC_LimitSwitch_BkPlcMc

Not currently supported.

MC_RefPulse_BkPlcMc

The axis is moved with Axis_Ref_BkPlcMc.stAxParams.fEnc_RefIndexVelo in the direction specified by bEnc_RefIndexPositive. The axis stops if CalibrationCam becomes TRUE or if the reference cam (bit 5, dwTcHydDcDwRefIndex) is detected in Axis_Ref_BkPlcMc.stAxRtData.nDeCtrlDWord. The axis is then moved with fEnc_RefSyncVelo in the direction specified by bEnc_RefSyncPositive, until the reference cam is exited. The encoder's hardware latch is then activated, and the axis is moved on until the latch becomes valid. After the axis has stopped, the actual value for the axis is set to a value that is calculated from the reference position and from the distance covered since the encoder's sync pulse was detected.

MC_Direct_BkPlcMc

The actual value of the axis is immediately set to the value of the reference position.

MC_Absolute_BkPlcMc

Not currently supported.

MC_Block_BkPlcMc

The axis is moved with Axis_Ref_BkPlcMc.stAxParams.fEnc_RefIndexVelo in the direction specified by bEnc_RefIndexPositive. If no movement is detected over a period of 2 seconds, the fixed stop (block) is considered to have been reached. The actual value for the axis is set to the value of the reference position.

From version 3.0.41 of 12 October 2017 it is possible to change the time period for the function block detection. See ST_TcHydAxRtData.fBlockDetectDelay.

MC_FlyingSwitch_BkPlcMc

Not currently supported.

MC_FlyingRefPulse_BkPlcMc

Not currently supported.