SMC_SetControllerMode (FB)

 

FUNCTION_BLOCK SMC_SetControllerMode

This function block, if supported by the drive, can be used to switch to another controller mode. Preconditions:

Behavior when active:

What function blocks have to be called after SMC_SetControllerMode reports bDone?

As soon as byRealControllerMode reflects byControllerMode, the func­tion block sets its Done output and stops any action. This means that the application program is immediately responsible for calculating the correct set values beginning with this cycle. E.g. an axis was torque controlled and shall be switched to position control. The axis was still moving when the function block SMC_SetControllerMode was started. During the switching time, the function block calculates the proper values for the set position. But as soon as it sets Done, no function block continues to provide set values and the axis would stop immediately and report an error. Therefore e.g. a function block MC_Halt, MC_MoveVe­locity or MC_MoveAbsolute could be triggered by the Done output of SMC_ControllerMode and take over the control of the axis.

InOut:

Scope

Name

Type

Initial

Comment

Inout

Axis

AXIS_REF_SM3

Axis

Input

bExecute

BOOL

FALSE

TRUE: Starts changing the controlling mode.

nControllerMode

SMC_CONTROLLER_MODE

SMC_position

Output

bDone

BOOL

TRUE: Mode switching has been done.

bBusy

BOOL

TRUE: FB is not idle.

bError

BOOL

TRUE: Error has occured within function block.

nErrorID

SMC_ERROR

Error identification