The following example of a Control Expert program supports learning and the use of 16 dimensions.
In the use part we will have first declared an AXIS_0 variable of the T_STEPPER_STD_ type
This chart supports the programming of learning 16 dimensions.
STEP 50 ACTION ON ACTIVATION
<stores %MW99 with a view to use it as a limit
! %MW98 := %MW99;
<Initializes the index during the learning phase
! %MW99 := -1;
TRANSITION: X50 -> X51
! RE AXIS_0.NEXT
STEP 51 ACTION ON ACTIVATION
<updates the index
! %MW99 :=%MW99+1;
<learning of the positions
! %MD200[%MW99] := AXIS_0.POS;
TRANSITION: X51 -> X52
! %MW99 <= 16
TRANSITION: X51 -> X53
! %MW99 > 16
TRANSITION: X53 -> X50
! RE AXIS_0.DONE
TRANSITION: X52 -> X51
! RE AXIS_0.NEXT
TRANSITION: X52 -> X50
! RE AXIS_0.DONE
This chart supports the programming of using dimensions
STEP 42 ACTION ON ACTIVATION
<initializes %MW97 as execution index
! %MW97 := -1;
TRANSITION: X42 -> X43
! RE AXIS_0.AX_FLT
STEP 43 ACTION ON ACTIVATION
<increments execution index
! %MW97 := %MW97+1;
<executes the next segment
! SMOVE (AXIS_0,%MW97,%KW8,%KW1,%MD200[%MW97],150000,0);
%KW8 : 90 movement to absolute value
%KW1 : 09 go to breakpoint
TRANSITION: X43 -> X46
! AXIS80.NEXT AND %MW97 < %MW98) AND NOT AXIS_0.AX_FLT
TRANSITION: X43 -> X42
! AXIS_0.DONE AND (%MW97 >= %MW98) OR AXIS_0.AX_FLT
TRANSITION: X46 -> X43
! TRUE