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_PlcStop2_INST_0

MW_PlcStop2

Instance of access to block structure

 

Operation

 

When the EN input changes from FALSE to TRUE (rising edge), the block immediately stops generating pulses for the two stepper motors.

 

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 at the pulse output of axis 1 with an initial frequency of 0 Hz and duty cycle of 50%. The direction output of axis 1 is set to a low level (considering that the direction was not reversed via parameters), and a synchronized ramp is made with axis 2.

 

A PWM signal is also generated at 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 refersed via parameters), and a synchronized ramp is made with axis 1.

 

In parallel, the contact of "start" begins a 3-second counter which, at the end of the time, will cause the PWM signal from both axes to be finished immediately and the move block to 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_PlcStop2_INST_0 : FB_MW_PlcStop2;

   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(EN:=3, TIMEBASE:=1000);

 

MW_PlcStop2_INST_0.EN := TON_INST_0.Q;

MW_PlcStop2_INST_0(ENO=>stopped);