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

MW_PlcGetPosition2

Previous pageReturn to chapter overviewNext page

 

Ladder Representation

 

MW_PlcGetPosition2_G0

 

Block Structure

 

Variable Type

Name

Data Type

Description

VAR_INPUT

EN

BOOL

Block enabling

VAR_OUTPUT

ENO

BOOL

Output enabling

PositionAxis1

DINT

Current position of axis 1

PositionAxis2

DINT

Current position of axis 2

VAR

MW_PlcGetPosition2_INST_0

MW_PlcGetPosition2

Instance of access to block structure

 

Operation

 

When the EN input is TRUE, the block reads the current position of the axes.

 

wpshelp_common_fig_note

NOTE!

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

 

Example in Ladder

 

MW_PlcGetPosition2_example01

In the example above, the "read" contact enables the reading of the position of the axes. While "read" is TRUE, the "pos1" and "pos2" variables will be updated with the value of the current position of the axes.

 

Example in ST

 

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

 

 

VAR

   enable : BOOL := 1;

   done : BOOL;

   pos1 : DINT := 0 ;

   pos2 : DINT := 0 ;

END_VAR

 

done := FB_MW_PlcGetPosition2(

   EN:=enable,

   PositionAxis1=> pos1,

   PositionAxis2=>pos2);