Skip to content

Brake

The brake sample provides an easy interface to control the brake parameters and function.

Also see Automation Studio help

  • (00ef9572-f1d5-43b5-9815-90e510eaeb7f) for a description of MC_BR_BrakeTest_AcpAx

Here is the link to the repository.

Interface structure

The sample uses a variable structure to communicate with the outside world that can also be used to interact with other tasks. The structure looks as follows:

Parameter Function
CmdClose Close brake
CmdOpen Open brake
CmdSetPar Set brake parameter
MpLink The axis reference establishes the connection between the function block and an axis
ParBrake Configuration parameters
StaBrake Configuration parameters
ErrId Error ID

Program structure

The program consists of a state machine where the commands are executed. When a brake open or close command is executed the status of the brake is checked in an additional step.

Sample code

Here is a sample snippet that can be used as a starting point.

Program init
PROGRAM _INIT
    // --------------------------------------------------------------------------
    // Set brake parameters, disable brake restrictions
    AxisBrake.MpLink := ADR(gAxis_1);                           // MpLink reference for axis                    
    AxisBrake.ParBrake.RestrictedBrakeControl := mcSWITCH_OFF;  // Allow brake to be turned off
    AxisBrake.CmdSetPar := TRUE;                                // Call parameter set command

END_PROGRAM
Program cyclic
PROGRAM _CYCLIC
    // --------------------------------------------------------------------------
    // Call axis actions used for this drive
    BrakeAction;

END_PROGRAM

Revision

Version 3

  • Renamed action

Version 2

  • Renamed action

Version 1

  • First release