FB_AxisNewTargPosAndVelo

FB_AxisNewTargPosAndVelo 1:

The target position and velocity of the axis can be changed during the operation with the function block "FB_AixsNewTartAndVelo". With the Function AxisIsMoving can be determined, if the axis is moving. If it does not move, this command creates an error. Furthermore the command should not be set  very shortly before  the positioning ends, because otherwise the axis could already be locked at the receiving of the command.

 

VAR_INPUT

VAR_INPUT
    iAxisId       : UINT;
    eCmdType      : E_CmdTypeNewTargPosAndVelo;
    fTargPos      : LREAL;
    fSwitchPos    : LREAL;
    eTargPosType  : E_TargPosType;
    fVelo         : LREAL;
    bExecute      : BOOL;
    tTimeout      : TIME;
END_VAR

 

iAxisId: Axis-ID of the axis

eCmdType: The type (E_CmdTypeNewTargPosAndVelo) of the command defines, if target position, velocity or both values are changed during the current operation. Furthermore this parameter defines, if the change operates immediately or at the switch threshold fSwitchPos. 

fTargPos: Target position of the current operation of the axis. 

fSwitchPos: Optional switch threshold. When it is reached, the command acts.

eTargPosType: Type of the target position (E_TargPosType). The relative positioning should not be used in this context. Otherwise, the target position would be dependent of the position that the command is activated at and therefore not exactly.

fVelo: New velocity, with it should be moved to the target position.

bExecute: The command is triggered by a rising edge at this input.

tTimeout: Timeout until the NC acknowledges the command.  

 

VAR_OUTPUT

VAR_OUTPUT
    bBusy           : BOOL;
    bErr            : BOOL;
    iErrId          : UDINT;
END_VAR

bBusy: When the function block is activated this output is set. It remains set until and acknowledgement is received.

bErr: The output bErr is set if an error occurs as the command is being executed.  

iErrId: Supplies the error number if the bErr output is set.

 

Requirements

Development Environment

Target System

PLC Libraries to include

TwinCAT v2.8

PC (i386)

TcNc.Lib