MC_PowerStepper
The enables for an axis are set with the function block MC_PowerStepper. An MC_Power block is used internally for this purpose. The MC_PowerStepper also detects the stall situations that occur in stepper motors if they are overloaded, and offers suitable counter measures. The status bits of a KL2531 or KL2541 terminal are monitored, and the errors indicated there are reported to the NC.
There is more detailed explanation in the Appendix.
VAR_INPUT
VAR_INPUT
Enable : BOOL;
Enable_Positive : BOOL;
Enable_Negative : BOOL;
Override : LREAL;
DestallParams : ST_PowerStepperStruct;
KL_Status : USINT;
KL_Status2 : UINT;
END_VAR
Enable: NC controller enable for the axis.
Enable_Positive: NC advance movement enable in positive direction.
Enable_Negative: NC advance movement enable in negative direction.
Override: Override value in percent (e.g. 68.123%)
DestallParams: The functions of the block are enabled here, and their working rules are specified.
KL_Status: The status byte of a terminal of type KL2531 or KL2541.
KL_Status2: The status word of a terminal of type KL2531 or KL2541.
VAR_OUTPUT
VAR_OUTPUT
Status : BOOL;
Error : BOOL;
ErrorID : UDINT;
END_VAR
Status: Becomes TRUE once all enables were set successfully.
Error: Becomes TRUE, as soon as an error occurs.
ErrorID: If the error output is set, this parameter supplies the error number.
VAR_IN_OUT
VAR_IN_OUT
AxisRefIn : NCTOPLC_AXLESTRUCT;
AxisRefOut : PLCTONC_AXLESTRUCT;
END_VAR
AxisRefIn: The axis structure provided by the NC.
AxisRefOut: The axis structure provided by the PLC.
Requirements
Development environment | Target system type | PLC libraries to be linked |
---|---|---|
TwinCAT v2.9, build 1026 onwards | PC (i386) | TcMC.Lib |