Navigation:  Equipments (Devices) > PLC200 > Program > Motion - Stepper Motor >

MW_PlcStop2

Previous pageReturn to chapter overviewNext page

Block to interrupt the pulse generation when controlling two stepper motors simultaneously.

 

Ladder Representation

 

MW_PlcStop2_G0

 

Block Structure

 

Variable Type

Name

Data Type

Description

VAR_INPUT

EN

BOOL

Block enabling

VAR_OUTPUT

ENO

BOOL

Output enabling

VAR

MW_PlcStopWithRamp2_INST_0

MW_PlcStopWithRamp2

Instance of access to block structure

 

Operation

 

When the EN input changes from FALSE to TRUE (rising edge), the block starts a deceleration ramp for pulse generation for both stepper motors.

 

The deceleration ramp follows the configuration used in the ramp configuration block (MW_PlcChangeRamp1).

 

wpshelp_common_fig_note

NOTE!

The stepper motor control must be enabled for both axes. Look at the user manual and parameter manual.

 

Example in Ladder

 

MW_PlcStop2_example01

 

When the "start" contact is activated, a PWM signal is generated on the pulse output of axis 1 with an initial frequency of 0 Hz and a duty cycle of 50%. The direction output of axis 1 is set to a low level (considering that the direction has not been inverted via parameters), and a synchronized ramp with axis 2 is performed.

 

A PWM signal is also generated on the pulse output of axis 2 with an initial frequency of 0 Hz and a duty cycle of 50%. The direction output of axis 2 is set to a high level (considering that the direction has not been inverted via parameters), and a synchronized ramp with axis 1 is performed.

 

In parallel, the "start" contact starts a 3-second timer which, at the end of the time, will initiate a deceleration ramp for the pulses on both axes, and the move block will be completed, regardless of the number of pulses generated.

 

Example in ST

 

 The example below displays instructions for applying the functional example in ST language.

 

 

VAR

   start : BOOL := 0;

   finished : BOOL;

   stopped : BOOL;

   pos1 : DINT := 1000000;

   pos2 : DINT := 2000000;

   MW_PlcMoveRelative2_INST_0 : FB_MW_PlcMoveRelative2;

   MW_PlcStopWithRamp2_INST_0 : FB_MW_PlcStopWithRamp2;

   TON_INST_0 : FB_TON;

END_VAR

 

MW_PlcMoveRelative2_INST_0.EN := start;

MW_PlcMoveRelative2_INST_0(

  AxisNumber:=1,

   Position:=pos);

finished := MW_PlcMoveRelative2_INST_0.DONE;

 

TON_INST_0.EN := start;

TON_INST_0(PT:=3, TIMEBASE:=1000);

 

MW_PlcStopWithRamp2_INST_0.EN := TON_INST_0.Q;

MW_PlcStopWithRamp2_INST_0(ENO=>stopped);