*-----------------------------------------------------------------------------
*  Machine Parameter reading
*-----------------------------------------------------------------------------
*    To read one machine parameter (MP) it is necessary to put in 4 lines
*    in the constant field "KFIELD MP_definition":
*
*    KFIELD MP_definition
*      K+10                    --> number MP
*      KL_index_0              --> index MP
*      KL_type_word            --> typ destination operand (B,W,D)
*      K&WG_MP10_active_axis   --> destination address MP value
*      ...
*      K-1                     --> end constant field
*    ENDK
*-----------------------------------------------------------------------------

#define /s    KL_index_0                               K +0
#define /s    KL_index_1                               K +1
#define /s    KL_index_2                               K +2
#define /s    KL_index_3                               K +3
#define /s    KL_index_4                               K +4
#define /s    KL_index_5                               K +5
#define /s    KL_index_6                               K +6
#define /s    KL_index_7                               K +7
#define /s    KL_index_8                               K +8
#define /s    KL_index_9                               K +9
#define /s    KL_index_10                              K +10
#define /s    KL_index_11                              K +11
#define /s    KL_index_12                              K +12
#define /s    KL_index_13                              K +13
#define /s    KL_index_14                              K +14
#define /s    KL_index_15                              K +15
#define /s    KL_index_16                              K +16
#define /s    KL_index_17                              K +17
#define /s    KL_index_18                              K +18
#define /s    KL_index_19                              K +19
#define /s    KL_index_20                              K +20
#define /s    KL_index_21                              K +21
#define /s    KL_index_22                              K +22
#define /s    KL_index_23                              K +23
#define /s    KL_index_24                              K +24
#define /s    KL_index_25                              K +25
#define /s    KL_index_26                              K +26
#define /s    KL_index_27                              K +27
#define /s    KL_index_28                              K +28
#define /s    KL_index_29                              K +29
#define /s    KL_index_30                              K +30
#define /s    KL_index_31                              K +31

#define /s    KL_type_Byte                             K +0
#define /s    KL_type_Word                             K +1
#define /s    KL_type_DWord                            K +2
#define /s    KL_spindle_inactive                      K +0
#define /s    KL_spindle_with_ROD                      K +6
#define /s    KL_spindle_without_rpm_ROD               K +0
#define /s    KL_without_gear                          K +5
#define /s    KL_without_gear_and_ROD                  K +8
#define /s    KL_spindle_ref_without_ext_sensor        K +0
#define /s    KL_TC_without_P_code                     K +2
#define /s    KL_TC_table_inactive                     K +0
#define /s    KL_T_pocket_table_inactive               K +0
#define /s    KL_PLC_axis                              K +1
#define /s    KL_axis_with_ROD                         K +0
#define /s    KL_controlled_axis                       K +2
#define /s    KL_slave_axis                            K +9
#define /s    KL_drive_temperature_max                 K +3
#define /s    KL_hirth_axis                            K +4
#define /s    KL_hirth_increment                       K +5
#define /s    KL_modulo_value_axis                     K +6
#define /s    KL_digital_axis                          K +8
#define /s    KL_function_keys_to_PLC                  K +0
#define /s    KL_bit_2_PGM_stop_M_strobe               K +2
#define /s    KL_evaluation_by_NC                      K %10111
#define /s    KL_encoder_distance_coded                K +0
#define /s    KL_encoder_one_reference_mark            K +1
#define /s    KL_reference_dog_short_distance_coded    K +3
#define /s    KL_2_reference_mark_distance_coded       K +4
#define /s    KL_programming_station_with_PLC          K +1
#define /s    KL_programming_station                   K +2
#define /s    KL_control_type                          K +21
#define /s    KL_iTNC530_PC_programming_station        K +7
#define /s    KL_supported_hand_wheel_types            K +13
#define /s    KL_auto_start_active                     K +5
#define /s    KL_bit_5_2_spindle_mode                  K +5
#define /s    KL_mode_read_string_from_MP_memory       K %11
#define /s    KL_file_name_not_used                    K +0
#define /s    KL_MP100_axis_identifier                 K +100
#define /s    KL_line_1                                K +1
#define /s    KL_mode_0                                K +0
#define /s    KL_all_axes                              K -1
#define /s    KL_factor_nonlinear_curve                K +100
#define /s    KL_field_angle_via_soft_key              K +2
#define /s    KL_Bit_5_TE_with_Fmax_override           K +5
#define /s    KL_Bit_9_TE_with_Fmax_override           K +9
#define /s    KL_TC_mag_axis_inactive                  K -1
#define /s    KL_axes_group_max_number                 K +6
#define /s    KL_max_limit_range                       K +3
#define /s    KL_brake_test_inactive                   K +0
#define /s    KL_bit_14_extended_interface             K +14

#define /s    ML_TNC_programming_station_active        M
#define /s    ML_commissioning_active                  M
#define /s    ML_kinematic_01_selected                 M
#define /s    ML_debug                                 M

#define /s    BL_MP_read_identfier                     B
#define /s    BL_type_operand                          B
#define /s    BL_MP113_0_spindle_S1_speed_encoder      B
#define /s    BL_MP113_1_spindle_S2_speed_encoder      B
#define /s    BL_MP1340_reference_axis_identifier      B
#define /s    BL_MP3010_spindle_mode                   B
#define /s    BL_MP3143_reference_spindle              B
#define /s    BL_MP7210_programming_station            B
#define /s    BL_MP7440_output_of_M_functions          B
#define /s    BL_MP7480_Tool_change_type               B
#define /s    BL_MP7645_handwheel_keyboard             B
#define /s    BL_MP7681_MSTQ_strobe_block_scan         B
#define /s    BL_MP7683_NC_PGM_and_pallet_execute      B
#define /s    BL_MP13010_spindle_mode                  B
#define /s    BL_MP13143_referenze_spindle             B
#define /s    BL_stack_synchronize                     B
#define /s    BL_no_limit                              B
#define /s    BL_WZ_mag_index                          B
#define /s    BL_TC_mag_axis_index                     B
#define /s    BL_axes_group_index                      B

#define /s    WL_index                                 W
#define /s    WL_MP4020_PLC_function                   W
#define /s    WL_MP7260_tool_number_in_table           W
#define /s    WL_MP7620_TE_with_Fmax_override          W

#define /s    DL_controlled_axes_before                D
#define /s    DL_MP3420_pos_window_S                   D
#define /s    DL_MP13420_pos_window_S                  D

#define /s /c BL_address_0                             B0
#define /s /c WL_address_0                             W0
#define /s /c DL_address_0                             D0

#include Mac_Lib.inc

EXTERN MP_data_tab_reading
EXTERN MP_config_tab_reading
EXTERN Identifier_axis_x

GLOBAL MP_read

;----------------------------
LBL MP_read
;----------------------------

  L      PN_error_check_machine_parameter
  O      PN_error_check_MP_data
  O      PN_error_MP_config_table_check
  EMT

  RPLY   BL_MP_read_identfier
  <>     K+0
  EMT
  SUBM   MP_read_submit
  =      BL_MP_read_identfier
  ==     K+0
  S      PN_error_submit_spawn_queue_full

EM

;----------------------------
LBL MP_read_submit

  L      MG_marker_one
  R      MG_TNC_digital
  R      PN_error_check_machine_parameter

  CM     MP_config_tab_reading
  CM     MP_data_tab_reading

  L      I_additional_axes_mounted
  AN     ML_kinematic_01_selected
  IFT
    S      ML_kinematic_01_selected

    PS     KL_line_1
    PS     KL_mode_0
    CM     9097
    PL     BL_stack_synchronize

     M_display_module_error
  ENDI

  L      K+0
  =X

  REPEAT

    PS     KF MP_definition[X]
    INCX
    PS     KF MP_definition[X]
    CM     9310

    INCX

    L      KF MP_definition[X]
    =      BL_type_operand

    INCX

    LX
    =      WL_index

    CASE   BL_type_operand
      CM     PL_Byte_index
      CM     PL_Word_index
      CM     PL_DWord_index
    ENDC

    M_display_module_error

    L      WL_index
    =X
    INCX

    L      KF MP_definition[X]
    <      K+0
  UNTILT

  PS     KL_all_axes
  PS     KL_controlled_axis
  CM     9038
  PL     DG_controlled_axes
  M_display_module_error

  L      DL_controlled_axes_before
  AN     DG_controlled_axes
  =      DG_reset_axes

  L      DG_controlled_axes
  BC     KG_spindle
  =      DL_controlled_axes_before

  L      K+0
  =      DG_drives_digital
  =      DG_slave_axes
  =      DG_hirth_axes
  =      DG_PLC_axes
  =      DG_modulo_axis
  =      DG_traverse_reverence_active
  =      DG_axis_encoder_distance_coded
  =      DG_axis_encoder_one_reference_mark
  =      DG_axis_encoder_distance_coded
  =      DG_MP2230_brake_test_active
  =      DG_MP2254_fieldangle_axis_on_PLC
  =X

  REPEAT

    L      DG_controlled_axes
    BTX
    IFT

      PSX
      PS     KL_digital_axis
      CM     9038
      PLW
      >      K+0
      IFT
        L      DG_drives_digital
        BSX
        =      DG_drives_digital
      ENDI

     M_display_module_error

      PSX
      PS     KL_slave_axis
      CM     9038
      PLW
      >      K+0
      IFT
        L      DG_slave_axes
        BSX
        =      DG_slave_axes
      ENDI
     M_display_module_error

      PSX
      PS     KL_hirth_axis
      CM     9038
      PLW
      >      K+0
      IFT
        L      DG_hirth_axes
        BSX
        A      DG_controlled_axes
        =      DG_hirth_axes
      ENDI
    M_display_module_error

      PSX
      PS     KL_PLC_axis
      CM     9038
      PLW
      >      K+0
      IFT
        L      DG_PLC_axes
        BSX
        =      DG_PLC_axes
      ENDI
    M_display_module_error

      PSX
      PS     KL_hirth_increment
      CM     9038
      PL     DG_MP430_hirth_increm_X[X]
    M_display_module_error

      PSX
      PS     KL_modulo_value_axis
      CM     9038
      PL     DG_MP810_modulo_value_X[X]

      L      DG_MP810_modulo_value_X[X]
      >      K+0
      IFT
        L      DG_modulo_axis
        BSX
        =      DG_modulo_axis
      ENDI
    M_display_module_error

      PSX
      PS     KL_drive_temperature_max
      CM     9038
      PL     WG_drive_temp_max_X[X]
    M_display_module_error

      PS     K+960
      PSX
      CM     9310
      PL     DG_MP960_ref_preset_X[X]
    M_display_module_error

      PS     K+1030
      PSX
      CM     9310
      PL     DG_MP1030_pos_window_X[X]
    M_display_module_error

      PS     K+1330
      PSX
      CM     9310
      PL     WG_MP1330_feed_X_ref[X]
    M_display_module_error

      PS     K+1340
      PSX
      CM     9310
      PLW
      =      BL_MP1340_reference_axis_identifier
      >=     K+1
      IFT
        L      BL_MP1340_reference_axis_identifier
        DECW
        =      BL_MP1340_reference_axis_identifier

        L      DG_traverse_reverence_active
        BS     BL_MP1340_reference_axis_identifier
        =      DG_traverse_reverence_active
      ENDI
    M_display_module_error

      PS     K+1350
      PSX
      CM     9310
      PLW
      PSW
      ==     KL_encoder_distance_coded
      IFT
        L      DG_axis_encoder_distance_coded
        BSX
        =      DG_axis_encoder_distance_coded
      ENDI
    M_display_module_error

      PLW
      PSW
      ==     KL_encoder_one_reference_mark
      IFT
        L      DG_axis_encoder_one_reference_mark
        BSX
        =      DG_axis_encoder_one_reference_mark
      ENDI

      PLW
      PSW
      ==     KL_reference_dog_short_distance_coded
      IFT
        L      DG_axis_encoder_distance_coded
        BSX
        =      DG_axis_encoder_distance_coded
      ENDI

      PLW
      ==     KL_2_reference_mark_distance_coded
      IFT
        L      DG_axis_encoder_distance_coded
        BSX
        =      DG_axis_encoder_distance_coded
      ENDI

      PS     K+2230
      PSX
      CM     9310
      PLW
      <>     KL_brake_test_inactive
      IFT
        L      DG_MP2230_brake_test_active
        BSX
        =      DG_MP2230_brake_test_active
      ENDI
      M_display_module_error

      PS     K+2254
      PSX
      CM     9310
      PLW
      ==     KL_field_angle_via_soft_key
      IFT
        L      DG_MP2254_fieldangle_axis_on_PLC
        BSX
        =      DG_MP2254_fieldangle_axis_on_PLC
      ENDI
      M_display_module_error

    ENDI

    INCX

    LX
    >=     KG_max_number_axes
  UNTILT

  L      DG_controlled_axes
  AN     DG_PLC_axes
  =      DG_controlled_NC_axes

  PS     KG_spindle
  PS     KL_drive_temperature_max
  CM     9038
  PL     WG_drive_temp_max_S
  M_display_module_error

  PS     KG_spindle
  PS     KL_digital_axis
  CM     9038
  PLW
  >      K+0
  =      MG_spindle_digital
  IFT
    L      DG_drives_digital
    BS     KG_spindle
    =      DG_drives_digital
  ENDI
    M_display_module_error

  L      K +0
  =      BL_no_limit

  REPEAT
    PS     KL_mode_read_string_from_MP_memory
    PS     KL_file_name_not_used
    PS     KL_MP100_axis_identifier
    PS     BL_no_limit
    L      K &SG_ident_axes_limit_1
    +      BL_no_limit
    PSW
    CM     9313
    PL     BL_stack_synchronize
    M_display_module_error

    INC    BL_no_limit

    L      BL_no_limit
    >=     KL_max_limit_range
  UNTILT

  CM     Identifier_axis_x

  L      DG_drives_digital
  <>     K+0
  S      MG_TNC_digital

  L      WL_MP4020_PLC_function
  BT     KL_bit_5_2_spindle_mode
  =      MG_2_spindle_mode_active
  SN     MG_spindle_1_active
  RN     MG_spindle_2_active

  LN     MG_spindle_1_active
  AN     MG_spindle_2_active
  S      MG_spindle_1_active

  L      MG_spindle_wye_delta_switchover
  R      MG_spindle_wye_delta_switchover

  LN     MG_spindle_2_active
#if CFG_spindle_S1_with_wye_delta_switchover = "active"
  S      MG_spindle_wye_delta_switchover
#endif
  IFT
    L      BL_MP113_0_spindle_S1_speed_encoder
    ==     KL_spindle_without_rpm_ROD
    A      MG_spindle_digital
    =      MG_spindle_in_Uf_control_mode

    L      BL_MP3010_spindle_mode
    <>     KL_spindle_inactive
    =      MG_spindle_active

    L      BL_MP3010_spindle_mode
    <>     KL_without_gear
    A[
      L      BL_MP3010_spindle_mode
      <>     KL_without_gear_and_ROD
    ]
    =      MG_spindle_with_gear

    L      BL_MP3010_spindle_mode
    >=     KL_spindle_with_ROD
    =      MG_spindle_with_ROD

    L      BL_MP3143_reference_spindle
    <>     KL_spindle_ref_without_ext_sensor
    =      MG_spindle_reference_using_sensor

    L      DL_MP3420_pos_window_S
    +      K+100                       ;S offset controlled to posit window
    =      DG_pos_window_S

    L      WG_MP3310_0_S_override_max
    X      KL_factor_nonlinear_curve
    =      WG_MP3310_0_S_override_max

    L      WG_MP3310_1_S_override_min
    X      KL_factor_nonlinear_curve
    =      WG_MP3310_1_S_override_min
  ELSE
#if CFG_spindle_S2_with_wye_delta_switchover = "active"
    LN     MG_spindle_wye_delta_switchover
    S      MG_spindle_wye_delta_switchover
#endif

    L      BL_MP113_1_spindle_S2_speed_encoder
    ==     KL_spindle_without_rpm_ROD
    A      MG_spindle_digital
    =      MG_spindle_in_Uf_control_mode

    L      BL_MP13010_spindle_mode
    <>     KL_spindle_inactive
    =      MG_spindle_active

    L      BL_MP13010_spindle_mode
    <>     KL_without_gear
    A[
      L      BL_MP13010_spindle_mode
      <>     KL_without_gear_and_ROD
    ]
    =      MG_spindle_with_gear

    L      BL_MP13010_spindle_mode
    >=     KL_spindle_with_ROD
    =      MG_spindle_with_ROD

    L      BL_MP13143_referenze_spindle
    <>     KL_spindle_ref_without_ext_sensor
    =      MG_spindle_reference_using_sensor

    L      DL_MP13420_pos_window_S
    +      K+100                       ;S offset controlled to posit window
    =      DG_pos_window_S

    L      WG_MP13310_0_S_override_max
    X      KL_factor_nonlinear_curve
    =      WG_MP13310_0_S_override_max

    L      WG_MP13310_1_S_override_min
    X      KL_factor_nonlinear_curve
    =      WG_MP13310_1_S_override_min
  ENDI

  L      MG_marker_one
  R      MG_servo_drive_release_axis_groups_active

  L      K +0
  =      BL_axes_group_index
  =      BG_active_axes_groups

  REPEAT
    L      DG_MP2040_0_axis_group_1[BL_axes_group_index]
    <>     K+0
    S      MG_servo_drive_release_axis_groups_active
    IFT
      L      BG_active_axes_groups
      BS     BL_axes_group_index
      =      BG_active_axes_groups
    ENDI

    INC    BL_axes_group_index

    L      BL_axes_group_index
    >=     KL_axes_group_max_number
  UNTILT

  L      MG_servo_drive_release_axis_groups_active
  IFT
    L      MG_spindle_active
    A      MG_spindle_digital
    IFT
      L      DG_controlled_axes
      BS     KG_spindle
      AN     DG_MP2040_0_axis_group_1
      AN     DG_MP2040_1_axis_group_2
      AN     DG_MP2040_2_axis_group_3
      AN     DG_MP2040_3_axis_group_4
      AN     DG_MP2040_4_axis_group_5
      AN     DG_MP2040_5_axis_group_6
      AN     DG_MP2040_6_axis_group_7
      AN     DG_MP2040_7_axis_group_8
      <>     K+0
      S      PN_error_check_machine_parameter
      =      MG_win_axes_MP10_n
    ELSE
      L      DG_controlled_axes
      AN     DG_MP2040_0_axis_group_1
      AN     DG_MP2040_1_axis_group_2
      AN     DG_MP2040_2_axis_group_3
      AN     DG_MP2040_3_axis_group_4
      AN     DG_MP2040_4_axis_group_5
      AN     DG_MP2040_5_axis_group_6
      AN     DG_MP2040_6_axis_group_7
      AN     DG_MP2040_7_axis_group_8
      <>     K+0
      S      PN_error_check_machine_parameter
      =      MG_win_axes_MP10_n
    ENDI
  ENDI

  L      BL_MP7210_programming_station
  ==     KL_programming_station_with_PLC
  =      MG_TNC_programming_station_with_PLC

  L      BL_MP7210_programming_station
  ==     KL_programming_station
  O      MG_TNC_programming_station_with_PLC
  AN     ML_TNC_programming_station_active
  S      ML_TNC_programming_station_active
  S      PN_error_TNC_programming_station_active

  L      MG_commissioning
  AN     ML_commissioning_active
  S      ML_commissioning_active
  S      PN_error_commissioning_active

  PS     KL_control_type
  CM     9035
  PLW
  ==     KL_iTNC530_PC_programming_station
  =      MG_iTNC530_PC_programming_station
  M_display_module_error

  L      WL_MP7260_tool_number_in_table
  >      KL_TC_table_inactive
  =      MG_tool_table_active

  L      MG_marker_one
  R      MG_TC_auto_active

  L      K+0
  =      BL_WZ_mag_index
  =      DG_TC_magazine_axes
  =      WG_TC_magazine_number
  REPEAT
    L      BL_WZ_mag_index
    =X

    L      KF TC_mag_axis_index[X]
    =      STG_TC_mag[BL_WZ_mag_index].BG_TC_magazine_axis_index

    PS     K+7261
    PS     BL_WZ_mag_index
    CM     9310
    PL     STG_TC_mag[BL_WZ_mag_index].WG_MP7261_TC_magazine_max_pocket
      M_display_module_error

    L      BL_MP7480_Tool_change_type
    >      KL_TC_without_P_code
#if (CFG_Tool_magazine_system = "Mag_type_09") or (CFG_Tool_magazine_system = "Mag_type_10")
    A[
      L      STG_TC_mag[BL_WZ_mag_index].BG_TC_magazine_axis_index
      >      KL_TC_mag_axis_inactive
    ]
#endif
    IFT
      L      STG_TC_mag[BL_WZ_mag_index].WG_MP7261_TC_magazine_max_pocket
      >      KL_T_pocket_table_inactive
      S      MG_TC_auto_active
      IFT
        INC    WG_TC_magazine_number
      ENDI
    ENDI

#if (CFG_Tool_magazine_system = "Mag_type_09") or (CFG_Tool_magazine_system = "Mag_type_10")
    L      DG_controlled_axes
    BT     STG_TC_mag[BL_WZ_mag_index].BG_TC_magazine_axis_index
    A[
      L      STG_TC_mag[BL_WZ_mag_index].BG_TC_magazine_axis_index
      >      KL_TC_mag_axis_inactive
    ]
    IFT
      LN     DG_PLC_axes
      BT     STG_TC_mag[BL_WZ_mag_index].BG_TC_magazine_axis_index
      A      MG_TC_auto_active
      AN     MG_commissioning
      S      PN_error_check_machine_parameter
      S      MG_win_TC_magazine_PLC_axis
      R      MG_TC_auto_active
      IFF
        L      DG_TC_magazine_axes
        BS     STG_TC_mag[BL_WZ_mag_index].BG_TC_magazine_axis_index
        =      DG_TC_magazine_axes
      ENDI
    ENDI

    L      STG_TC_mag[BL_WZ_mag_index].BG_TC_magazine_axis_index
    =      BL_TC_mag_axis_index
    >      KL_TC_mag_axis_inactive
    IFT
      L      DG_MP810_modulo_value_X[BL_TC_mag_axis_index]
      =      STG_TC_mag[BL_WZ_mag_index].DG_MP810_modulo_value
      /      STG_TC_mag[BL_WZ_mag_index].WG_MP7261_TC_magazine_max_pocket
      =      STG_TC_mag[BL_WZ_mag_index].DG_TC_magazine_pocket_distance
    ENDI
#endif

    INC    BL_WZ_mag_index

    L      BL_WZ_mag_index
    >=     KG_TC_magazine_max_count
    O      ML_debug
  UNTILT

  LN     WL_MP4020_PLC_function
  BT     KL_bit_14_extended_interface
  S      PN_error_check_machine_parameter
  =      MG_win_extended_axes_interface

  L      BL_MP7440_output_of_M_functions
  BT     KL_bit_2_PGM_stop_M_strobe
  S      PN_error_check_machine_parameter
  =      MG_win_PGM_stop_M_strobe

#if CFG_HSCI = "active"
  L      WL_MP7620_TE_with_Fmax_override
  BT     KL_Bit_9_TE_with_Fmax_override
  =      MG_MP7620_TE_with_Fmax_override
#else
  L      WL_MP7620_TE_with_Fmax_override
  BT     KL_Bit_5_TE_with_Fmax_override
  =      MG_MP7620_TE_with_Fmax_override
#endif

  L      BG_MP7640_handwheel_type
  >      KL_supported_hand_wheel_types
  S      PN_error_check_machine_parameter
  =      MG_win_MP7640_HR_type_not_supported
  IFT
    L      K+0
    =      BG_MP7640_handwheel_type
  ENDI

  L      BL_MP7645_handwheel_keyboard
  <>     KL_function_keys_to_PLC
  S      PN_error_check_machine_parameter
  =      MG_win_HR410_MP7645

  L      BL_MP7681_MSTQ_strobe_block_scan
  <>     KL_evaluation_by_NC
  S      PN_error_check_machine_parameter
  =      MG_win_MSTG_strobe_block_scan

  L      BL_MP7683_NC_PGM_and_pallet_execute
  BT     KL_auto_start_active
  =      PN_M4586_auto_start_release

  L      NP_M4203_error_module_9xxx
  S      PN_error_check_machine_parameter

  LN     PN_error_check_machine_parameter
  AN     PN_error_check_MP_data
  AN     PN_error_MP_config_table_check
  R      MG_TNC_initialized
  S      MG_machine_parameter_are_read

  LN     MG_tool_status_reading
  S      MG_tool_status_reading

  LN     MG_commissioning
  EMT

  CM     9019
  PL     BG_bytes_on_stack
  M_display_module_error

  L      BG_bytes_on_stack
  >      K+0
  S      PN_error_stack_not_empty

EM

;----------------------------
LBL PL_Byte_index

  L      KF MP_definition[X]
  =X
  PL     BL_address_0[X]

EM

;----------------------------
LBL PL_Word_index

  L      KF MP_definition[X]
  /      K+2
  =X
  PL     WL_address_0[X]

EM

;----------------------------
LBL PL_DWord_index

  L      KF MP_definition[X]
  /      K+4
  =X
  PL     DL_address_0[X]

EM

;----------------------------
KFIELD MP_definition

  K+12
  KL_index_0
  KL_type_DWord
  K&DG_MP12_simulated_axes

  K+113
  KL_index_0
  KL_type_Byte
  K&BL_MP113_0_spindle_S1_speed_encoder

  K+113
  KL_index_1
  KL_type_Byte
  K&BL_MP113_1_spindle_S2_speed_encoder

  K+1010
  KG_turning_rotary_axis_index
  KL_type_DWord
  K&DG_MP1010_rapid_feed_turning_axis

  K+1054
  KG_turning_rotary_axis_index
  KL_type_DWord
  K&DG_MP1054_distance_per_revolution_turning_axis

  K+1320
  KL_index_0
  KL_type_DWord
  K&DG_MP1320_direction_traverse_ref_negative

  K+1350
  KL_index_0
  KL_type_Byte
  K&BG_MP1350_reference_mode_X

  K+2040
  KL_index_0
  KL_type_DWord
  K&DG_MP2040_0_axis_group_1

  K+2040
  KL_index_1
  KL_type_DWord
  K&DG_MP2040_1_axis_group_2

  K+2040
  KL_index_2
  KL_type_DWord
  K&DG_MP2040_2_axis_group_3

  K+2040
  KL_index_3
  KL_type_DWord
  K&DG_MP2040_3_axis_group_4

  K+2040
  KL_index_4
  KL_type_DWord
  K&DG_MP2040_4_axis_group_5

  K+2040
  KL_index_5
  KL_type_DWord
  K&DG_MP2040_5_axis_group_6

  K+2040
  KL_index_6
  KL_type_DWord
  K&DG_MP2040_6_axis_group_7

  K+2040
  KL_index_7
  KL_type_DWord
  K&DG_MP2040_7_axis_group_8

  K+3010
  KL_index_0
  KL_type_Byte
  K&BL_MP3010_spindle_mode

  K+3143
  KL_index_0
  KL_type_Byte
  K&BL_MP3143_reference_spindle

  K+3310
  KL_index_0
  KL_type_Word
  K&WG_MP3310_0_S_override_max

  K+3310
  KL_index_1
  KL_type_Word
  K&WG_MP3310_1_S_override_min

  K+3420
  KL_index_0
  KL_type_DWord
  K&DL_MP3420_pos_window_S

  K+3520
  KL_index_1
  KL_type_DWord
  K&DG_MP3520_1_rpm_S_orientate

  K+4020
  KL_index_0
  KL_type_Word
  K&WL_MP4020_PLC_function

  K+4030
  KL_index_0
  KL_type_Byte
  K&BG_MP4030_0_assignment_logical_PL_1

  K+4030
  KL_index_1
  KL_type_Byte
  K&BG_MP4030_1_assignment_logical_PL_2

  K+4030
  KL_index_2
  KL_type_Byte
  K&BG_MP4030_2_assignment_logical_PL_3

  K+4031
  KL_index_0
  KL_type_Byte
  K&BG_MP4031_number_connected_PL

  K+4030
  KL_index_3
  KL_type_Byte
  K&BG_MP4030_3_assignment_logical_PL_4

  K+4130
  KL_index_0
  KL_type_Word
  K&WG_MP4130_Ixx_monitoring_functions_off

  K+6010
  KL_index_0
  KL_type_Byte
  K&BG_MP6010_touch_probe_type

  K+7210
  KL_index_0
  KL_type_Byte
  K&BL_MP7210_programming_station

  K+7260
  KL_index_0
  KL_type_Word
  K&WL_MP7260_tool_number_in_table

  K+7440
  KL_index_0
  KL_type_Byte
  K&BL_MP7440_output_of_M_functions

  K+7480
  KL_index_0
  KL_type_Byte
  K&BL_MP7480_Tool_change_type

  K+7620
  KL_index_0
  KL_type_Word
  K&WL_MP7620_TE_with_Fmax_override

  K+7640
  KL_index_0
  KL_type_Byte
  K&BG_MP7640_handwheel_type

  K+7645
  KL_index_0
  KL_type_Byte
  K&BL_MP7645_handwheel_keyboard

  K+7681
  KL_index_0
  KL_type_Byte
  K&BL_MP7681_MSTQ_strobe_block_scan

  K+7683
  KL_index_0
  KL_type_Byte
  K&BL_MP7683_NC_PGM_and_pallet_execute

  K+13010
  KL_index_0
  KL_type_Byte
  K&BL_MP13010_spindle_mode

  K+13143
  KL_index_0
  KL_type_Byte
  K&BL_MP13143_referenze_spindle

  K+13310
  KL_index_0
  KL_type_Word
  K&WG_MP13310_0_S_override_max

  K+13310
  KL_index_1
  KL_type_Word
  K&WG_MP13310_1_S_override_min

  K+13420
  KL_index_0
  KL_type_DWord
  K&DL_MP13420_pos_window_S

  K+13520
  KL_index_1
  KL_type_DWord
  K&DG_MP13520_1_rpm_S_orientate

  K-1
ENDK

;----------------------------
KFIELD TC_mag_axis_index
  KG_TC_magazine_1_axis_index
  KG_TC_magazine_2_axis_index
  KG_TC_magazine_3_axis_index
  KG_TC_magazine_4_axis_index
  KG_TC_magazine_5_axis_index
  KG_TC_magazine_6_axis_index
  KG_TC_magazine_7_axis_index
  KG_TC_magazine_8_axis_index
ENDK
