FB_CTRL_STEPPING_MOTOR_OUT

FB_CTRL_STEPPING_MOTOR_OUT 1:

This function block generates a control value for a stepper motor.

Behavior of the output

FB_CTRL_STEPPING_MOTOR_OUT 2:

FB_CTRL_STEPPING_MOTOR_OUT 3: VAR_INPUT

VAR_INPUT
    fIn                : FLOAT;
    bUpperLimitSwitch  : BOOL;
    bLowerLimitSwitch  : BOOL;
    fManSyncValue      : FLOAT;
    bSync           
   : BOOL;
    eMode              : E_CTRL_MODE;
END_VAR

Name

Type

Description

fIn

FLOAT

Controller's control value (controller output)

bUpperLimit
Switch

BOOL

Limit switch, becomes TRUE when the upper stop is reached.

bLowerLimit
Switch

BOOL

Limit switch, becomes TRUE when the lower stop is reached.

fManSyncValue

FLOAT

Input with which the internal state of the motor setting can be adjusted, or whose value is adopted in manual mode.

bSync

BOOL

With a rising edge at this input the internal step counter is set to the step that corresponds to the value "fManSyncValue".

eMode

E_CTRL_MODE

Input that specifies the operation mode of the function block.

FB_CTRL_STEPPING_MOTOR_OUT 4:

For synchronization with the current valve position, this function block has the mode eCTRL_MODE_SYNC_MOVEMENT. In this mode, pulses for closing the valve are output until the valve is safely closed. The function block is then synchronized with this valve position.

Once the synchronization process is completed, eCTRL_STATE_ACTIVE mode is automatically activated.

FB_CTRL_STEPPING_MOTOR_OUT 5: VAR_OUTPUT

VAR_OUTPUT
    bOutBitPos   : BOOL;
    bOutBitNeg   : BOOL;
    nActualStep  : DINT;
    eState       : E_CTRL_STATE;
    eErrorId     : E_CTRL_ERRORCODES;
    bError       : BOOL;
END_VAR

Name

Type

Description

bOutBitPos

BOOL

Output required to drive the motor in a positive direction.

bOutBitNeg

BOOL

Output required to drive the motor in a negative direction.

nActualStep

DINT

Actual step at which the motor is positioned.

eState

E_CTRL_STATE

State of the function block

eErrorId

E_CTRL_ERRORCODES

Supplies the error number when the output bError is set.

bError

BOOL

Becomes TRUE, as soon as an error occurs.

VAR_IN_OUT

VAR_IN_OUT
    stParams    : ST_CTRL_STEPPING_MOTOR_OUT_PARAMS;
END_VAR

Name

Type

Description

stParams

ST_CTRL_STEPPING_MOTOR_
OUT_PARAMS

Parameter structure of the function block

stParams consists of the following elements:

TYPE
ST_CTRL_STEPPING_MOTOR_OUT_PARAMS:
STRUCT
    tCtrlCycleTime             : TIME := T#0ms;
    tTaskCycleTime             : TIME := T#0ms;
    tOnTime                    : TIME;
    tOffTime                   : TIME;
    nMaxMovingPulses           : DINT;
    nMinMovingPulses           : UINT := 0;
    bHoldWithOutputOn          : BOOL;
    nAdditionalPulsesAtLimits  : DINT;
    bMoveOnLimitSwitch         : BOOL;
    fCtrlOutMax   
             : FLOAT := 100.0;
    fCtrlOutMin                : FLOAT := 0.0;
END_STRUCT
END_TYPE

Name

Type

Description

tCtrlCycleTime

TIME

Cycle time with which the control loop is processed. This must be greater than or equal to the TaskCycleTime. The function block uses this input value to calculate internally whether the state and the output values have to be updated in the current cycle.

tTaskCycleTime

TIME

Cycle time with which the function block is called. If the function block is called in every cycle this corresponds to the task cycle time of the calling task.

tOnTime

TIME

Pulse length

tOffTime

TIME

Pause length

nMaxMoving
Pulses

DINT

Max. number of pulses required to move from one limit to another.

nMinMoving
Pulses

UINT

Min. number of pulses required to move from one limit to another.

bHoldWith
OutputOn

BOOL

If this parameter is set to TRUE, then an output remains set when the drive is stationary. This will result in braking.

nAdditionalPulsesAtLimits

DINT

Number of supplementary pulses that are output to reliably ensure that limits are reached.

bMoveOnLimit
Switch

BOOL

If this is TRUE, then pulses are output when the control value is either 0% or 100% until the limit switch is reached.

fCtrlOutMax

FLOAT

Control value for which the valve will be driven to 100%.

fCtrlOutMin

FLOAT

Control value for which the valve will be driven to 0%.