*-----------------------------------------------------------------------------
*  Air blast
*-----------------------------------------------------------------------------
*  Module Description
*
*-----------------------------------------------------------------------------

#define /s    KL_runtime_from_MP                       K -1

#define /s    ML_key_tool_unclamping                   M
#define /s    ML_coolant_M07_on                        M
#define /s    ML_coolant_M07_off                       M
#define /s    ML_coolant_M08_on                        M
#define /s    ML_coolant_M08_off                       M
#define /s    ML_coolant_annular_on                    M
#define /s    ML_coolant_annular_off                   M
#define /s    ML_tool_unclamping_timer                 M
#define /s    ML_tool_unclamping_air_blast             M
#define /s    ML_air_blast_pause                       M
#define /s    ML_air_blast_by_M_code                   M
#define /s    ML_air_blast_annular_by_M_code           M
#define /s    ML_oil_mist_by_M_code                    M

GLOBAL Air

;----------------------------
LBL Air
;----------------------------

;  LN     MG_TC_help                    ;20120726
;  AN     MG_TC_automatic
;  AN     I_S1_tool_clamped
;  A      O_S1_tool_unclamping
  L      O_S1_tool_unclamping
;  AN     ML_tool_unclamping_timer
  AN     ML_key_tool_unclamping
  IFT
    PS     K&TR_TC_manual_unclamping_air_blast   ;MP4111.219
    PS     KL_runtime_from_MP
    CM     9006

;    L      MG_marker_one
;    S      ML_tool_unclamping_timer
  ENDI

;  L      ML_tool_unclamping_timer
;  A      TR_TC_manual_unclamping_air_blast
;  S      ML_tool_unclamping_air_blast

;  L      ML_tool_unclamping_air_blast
;  AN     TR_TC_manual_unclamping_air_blast
;  R      ML_tool_unclamping_air_blast

;  L      MG_key_tool_unclamping
;  AN     ML_key_tool_unclamping
;  A      ML_tool_unclamping_timer
;  R      ML_tool_unclamping_timer
;  R      ML_tool_unclamping_air_blast

;  L      MG_key_tool_unclamping
  L      O_S1_tool_unclamping
  =      ML_key_tool_unclamping

;  L      ML_tool_unclamping_air_blast
;  O      O_air_through_spindle
  L      TR_TC_manual_unclamping_air_blast
  =      O_spindle_blow_clean
;----------------------------
  L      MG_M22_air_blast_on
  O      MG_M26_air_inside_on
  O      MG_M27_air_blast_annular_on
  O      MG_M28_air_off
  O      MG_M39_oil_mist_on
  O      MG_M40_oil_mist_off
  S      PN_M4092_quit_M_function

  L      MG_air_side_with_annular
  IFT
    L      MG_M22_air_blast_on
    S      MG_SK_air_blast_side
    S      MG_SK_air_blast_annular
    S      ML_air_blast_by_M_code
  ELSE
    L      MG_M22_air_blast_on
    S      MG_SK_air_blast_side
    S      ML_air_blast_by_M_code
  ENDI

  L      MG_M26_air_inside_on
  S      MG_SK_ATS

  L      MG_M27_air_blast_annular_on
  S      MG_SK_air_blast_annular
  S      ML_air_blast_annular_by_M_code

  L      MG_M39_oil_mist_on
  S      MG_SK_oil_mist
  S      ML_oil_mist_by_M_code

  L      MG_guard_open
  IFT
    LN     NP_M4153_mode_program_run_single_block
    AN     NP_M4154_mode_program_run_full_sequence
    R      ML_air_blast_by_M_code
    R      ML_air_blast_annular_by_M_code
    R      ML_oil_mist_by_M_code
  ELSE
    L      MG_air_side_with_annular
    IFT
      L      ML_air_blast_by_M_code
      A      MG_key_NC_start_p_pulse
      S      MG_SK_air_blast_side
      S      MG_SK_air_blast_annular
    ELSE
      L      ML_air_blast_by_M_code
      A      MG_key_NC_start_p_pulse
      S      MG_SK_air_blast_side
    ENDI

    L      ML_air_blast_annular_by_M_code
    A      MG_key_NC_start_p_pulse
    S      MG_SK_air_blast_annular

    L      ML_oil_mist_by_M_code
    A      MG_key_NC_start_p_pulse
    S      MG_SK_oil_mist
  ENDI

  L      MG_guard_close_open_pulse
  O      MG_pulse_internal_stop
  R      MG_SK_ATS
  R      MG_SK_air_blast_side
  R      MG_SK_air_blast_annular

  L      MG_M28_air_off
  O      MG_pulse_END_PGM_M02_M30
  O      MG_auto_manu_mode_change
  ON     MG_control_operational
  R      MG_SK_ATS
  R      MG_SK_air_blast_side
  R      MG_SK_air_blast_annular
  R      ML_air_blast_by_M_code
  R      ML_air_blast_annular_by_M_code

  L      MG_M40_oil_mist_off
  O      MG_pulse_END_PGM_M02_M30
  O      MG_auto_manu_mode_change
  ON     MG_control_operational
  R      MG_SK_oil_mist
  R      ML_oil_mist_by_M_code

  L      MG_TC_automatic
  =      ML_air_blast_pause
;----------------------------
  L      PN_M4041_M07_MK_status
  A      O_coolant_M07_on
  S      ML_coolant_M07_on
  R      ML_coolant_M07_off

  L      ML_coolant_M07_on
  AN     O_coolant_M07_on
  AN     ML_coolant_M07_off
  IFT
    PS     K&TR_M07_off_air_blast
    PS     KL_runtime_from_MP
    CM     9006

    L      MG_marker_one
    S      ML_coolant_M07_off
  ENDI

  L      ML_coolant_M07_off
  R      ML_coolant_M07_on

  L      ML_coolant_M07_off
  AN     TR_M07_off_air_blast
  R      ML_coolant_M07_off

  L      ML_coolant_M07_off
  A      TR_M07_off_air_blast
  O      MG_SK_ATS
  AN     O_coolant_M07_on
  AN     ML_air_blast_pause
;  O      O_spindle_blow_clean          ;20120726
  =      O_air_through_spindle
;----------------------------
  L      PN_M4042_M08_MK_status
  A      O_coolant_M08_on
  S      ML_coolant_M08_on
  R      ML_coolant_M08_off

  L      ML_coolant_M08_on
  AN     O_coolant_M08_on
  AN     ML_coolant_M08_off
  IFT
    PS     K&TR_M08_off_air_blast
    PS     KL_runtime_from_MP
    CM     9006

    L      MG_marker_one
    S      ML_coolant_M08_off
  ENDI

  L      ML_coolant_M08_off
  R      ML_coolant_M08_on

  L      ML_coolant_M08_off
  AN     TR_M08_off_air_blast
  R      ML_coolant_M08_off

  L      ML_coolant_M08_off
  A      TR_M08_off_air_blast
  AN     O_coolant_M08_on
  AN     ML_air_blast_pause
  =      O_air_blast_coolant_side
;----------------------------
  L      MG_SK_air_blast_side
  O      O_oil_mist_unit
  AN     ML_air_blast_pause
  =      O_air_blast_side
;----------------------------
  L      MG_SK_coolant_annular
  A      O_coolant_annular_on
  S      ML_coolant_annular_on
  R      ML_coolant_annular_off

  L      ML_coolant_annular_on
  AN     O_coolant_annular_on
  AN     ML_coolant_annular_off
  IFT
    PS     K&TR_coolant_annular_off_air_blast    ;MP4111.214
    PS     KL_runtime_from_MP
    CM     9006

    L      MG_marker_one
    S      ML_coolant_annular_off
  ENDI

  L      ML_coolant_annular_off
  R      ML_coolant_annular_on

  L      ML_coolant_annular_off
  AN     TR_coolant_annular_off_air_blast
  R      ML_coolant_annular_off

  L      ML_coolant_annular_off
  A      TR_coolant_annular_off_air_blast
  O      MG_SK_air_blast_annular
  AN     O_coolant_annular_on
  AN     ML_air_blast_pause
  =      O_air_blast_annular
;----------------------------
  L      MG_SK_oil_mist
  AN     ML_air_blast_pause
  =      O_oil_mist_unit

EM
