User guide
93
VTB USER GUIDE
PP_GETPOS – READING OF ACTUAL POSITION NGPP-NGMEVO
This function reads the actual position of a step/dir channel. The value will correspond to the DOUBLE of the real
position. This function isn't present in NGM13,NGQ where to read the actual positions there are 4 system variables.
Hardware NG35+NG-PP,NGMEVO
Syntax
PP_GETPOS(Char Chan) as long
Parameters
Chan Number of the STEP/DIR channel (See PP_STEP for channels reference)
Return value
Long Actual position x 2
READING OF ACTUAL POSITION NGM13-NGQ
There are 4 system variables containing the actual position of the first 4 step/dir channels. The value will correspond
to the DOUBLE of the real position.
Hardware NGM13,NGQ
_SYSTEM_PXC as long Actual position channel 0
_SYSTEM_PYC as long Actual position channel 1
_SYSTEM_PZC as long Actual position channel 2
_SYSTEM_PAC as long Actual position channel 3
EXAMPLE OF USING WITH THE OBJECT MONOAX
The object MONOAX is a SINGLE AXIS POSITIONER very sophisticated able to generate ACCELERATION and DECELERATION
ramps, to control the axis position and velocity, etc.
To make the object independent of the using hardware it acts on a generic VARIABLE which finally will contain the axis
position.
It will be required to write some row of code to interface the object to the hardware we want use redirecting the above
variable to a PID filter to works with analog axis, a PDO to manage CANOPEN axis, or to function pp_step to interface a
STEP/DIR axis.
Step to execute:
1) In the object NGM13_INIT enable the interpolation mode on the step/dir channel used
2) Load an object MONOAX from MOTORCONTROL → CINTERPPOS in the MAIN PAGE
3) Name it for example AxisX
4) Declare the following GLOBAL VARIABLES:
PosAxis Long – position of the axis
RappX Float – ratio between generated steps and effective movement
5) Initialize in the section INIT of the MAIN task the variable RAPPX at the desired value (however not
equal to 0). A negative value will be able to change the direction of the axis.
6) Set the following PROPERTY of the OBJECT MONAX (example):