*-----------------------------------------------------------------------------
*  Pallet changer turn
*-----------------------------------------------------------------------------
*  Module Description
*
*-----------------------------------------------------------------------------

#define /s    KL_absolute_with_software_limit_switch   K%010
#define /s    KL_PC_number_pallet_2                    K+2
#define /s    KL_pallet_0                              K+0
#define /s    KL_pallet_1                              K+1
#define /s    KL_pallet_2                              K+2

#define /s    ML_APC_manual_ready                      M
#define /s    ML_X_axis_in_APC_pos                     M
#define /s    ML_Y_axis_in_APC_pos                     M
#define /s    ML_Z_axis_in_APC_pos                     M
#define /s    ML_C_axis_in_APC_pos                     M
#define /s    ML_APC_down_finish                       M
#define /s    ML_key_pressed                           M
#define /s    ML_PC_to_position_1                      M
#define /s    ML_PC_to_position_2                      M
#define /s    ML_cone_air_pressure_test                M     ;20120705
#define /s    ML_PC_coolant                            M     ;20120705
#define /s    ML_PC_coolant_auto                       M     ;20120705
#define /s    ML_PC_coolant_pulse                      M     ;20120705

#define /s    BL_step_alternating_table                B

#include Mac_Lib.inc

EXTERN Absolute

GLOBAL Pal_changer

;----------------------------
LBL Pal_changer
;----------------------------

;  L      NP_pallet_change_alternat_table_inactive
  L      MG_pallet_change_alternat_table_inactive          ;20120705
  R      PN_error_PC_load_door_opened
  R      PN_error_PC_automode_door_open
  IFT
    L      MG_M60_pallet_change
    O      MG_M61_pallet_1_to_machine
    O      MG_M62_pallet_2_to_machine
    S      PN_error_M_function_not_used
    EM
  ENDI

  CM     PC_coolant_clean              ;20120705

;  L      I_PC_position_in_1
;  =      O_lamp_APC_position_1

;  L      I_PC_position_in_2
;  =      O_lamp_APC_position_2

;  LN     I_PC_in_down_position
;  O      I_PC_in_up_position
;  =      O_lamp_APC_up_position

  L      O_PC_to_position_1            ;20120705
  AN     I_PC_position_in_1
  O[
    L      O_PC_to_position_2
    AN     I_PC_position_in_2
  ]
  =      O_lamp_PC_run

  L      MG_new_workpiece_on_pallet
  =      O_lamp_PC_ready

  LN     I_PC_load_door_closed
  ON     I_PC_load_door_closed_locked
;  AN     NP_MG_APC_guard_inactive
  AN     MG_guard_inactive             ;20120705
  IFT
    LN     MG_PC_key_enable_new_WP_inactive
    R      MG_new_workpiece_on_pallet

    L      MG_clock_1_s
    R      O_lamp_PC_ready
  ENDI

  L      MG_M60_pallet_change
  O      MG_M61_pallet_1_to_machine
  O      MG_M62_pallet_2_to_machine
  IFT
    L      MG_clock_500_ms
    R      O_lamp_PC_ready
  ENDI

  L      I_key_PC_load_door_open
  AN     ML_key_pressed
  XO     O_PC_load_door_unlock
  =      O_PC_load_door_unlock

  L      I_key_enable_new_workpiece_on_pallet
  AN     ML_key_pressed
  XO     MG_new_workpiece_on_pallet
  =      MG_new_workpiece_on_pallet

;  L      NP_workpiece_enable_by_pass
  L      MG_PC_key_enable_new_WP_inactive
  S      MG_new_workpiece_on_pallet

  L      I_key_enable_new_workpiece_on_pallet
  O      I_key_PC_load_door_open
  =      ML_key_pressed

  LN     I_PC_load_door_closed         ;20120705
  R      O_PC_load_door_unlock

  LN     I_PC_load_door_closed
  ON     I_PC_load_door_closed_locked
  AN     MG_guard_inactive
;  =      PN_error_PC_load_door_open
  =      PN_error_PC_load_door_opened  ;20120705
  =      MG_PC_guard_open

  L      I_PC_load_door_closed
  IFT
    L      MG_clock_1_s
    AN     I_PC_load_door_closed_locked
    A      O_PC_load_door_unlock
    =      O_lamp_PC_load_door
  ELSE
    L      MG_clock_500_ms
    =      O_lamp_PC_load_door
  ENDI

  LN     I_PC_load_door_closed
  AN     MG_guard_inactive             ;20120705
  A      MG_PC_active
  S      PN_error_PC_automode_door_open

;  LN     I_APC_load_lock_pin_in
;  =      PN_error_APC_load_lock_pin_out

;  LN     I_APC_load_lock_pin_in
;  A      MG_PC_active
;  =      PN_error_APC_stop_load_lock_pin_out

  L      MG_PC_active
  R      TS_PC_timeout
  S      TS_PC_timer_universal
  S      TS_PC_pallet_unclamping
  S      TS_PC_cone_air_blast_pressure

;  L      O_PC_to_position_1
;  O      O_PC_to_position_2
;  IFT
;    R      O_PC_table_slow_motion
;
;    L      I_APC_dec_speed_pos_1
;    A      O_PC_to_position_1
;    S      O_PC_table_slow_motion
;
;    L      I_APC_dec_speed_pos_2
;    A      O_PC_to_position_2
;    S      O_PC_table_slow_motion
;  ENDI

  L      I_PC_dec_speed_pos_1          ;20120705
  A      O_PC_to_position_1
  O[
    L      I_PC_dec_speed_pos_2
    A      O_PC_to_position_2
  ]
  R      TS_delay_slow_motion

  LN     TR_delay_slow_motion
  A      I_PC_in_up_position
  =      O_PC_table_slow_motion

  L      I_PC_position_in_1
  A      O_PC_to_position_1
  O[
    L      I_PC_position_in_2
    A      O_PC_to_position_2
  ]
  R      O_PC_table_slow_motion

  CASE   BG_step_pallet_change
    CM     APC_activate                ;0
    CM     APC_release                 ;1
    CM     Z_start                     ;2
    CM     Z_in_PC_pos                 ;3
;    CM     C_start                     ;4  ;20120704
;    CM     C_in_PC_pos                 ;5  ;20120704
    CM     X_start                     ;6
    CM     Y_start                     ;7
    CM     X_in_PC_pos                 ;8
    CM     Y_in_PC_pos                 ;9
    CM     APC_time                    ;11
    CM     APC_up_to_middle_pos        ;12  ;20120704
    CM     APC_up_in_middle_pos        ;13  ;20120704
    CM     Pal_unclamp                 ;14
    CM     Pal_unclamped               ;15
    CM     APC_to_up_pos               ;16
    CM     APC_in_up_pos               ;17
    CM     Pal_1_2_start               ;18  ;20120704
    CM     Pal_1_2_in_pos              ;19  ;20120704
    CM     APC_time                    ;20
    CM     APC_down_to_middle_pos      ;21  ;20120704
    CM     APC_down_in_middle_pos      ;22  ;20120704
    CM     Pal_clamp                   ;23
    CM     Pal_clamped                 ;24
    CM     APC_to_down_pos             ;25  ;20120704
    CM     APC_in_down_pos             ;26  ;20120704
    CM     PC_cone_air_pressure_test   ;27  ;20120704
    CM     APC_quit                    ;28
    CM     APC_end                     ;29
;    CM     Pal_clamp                   ;15
;    CM     Pal_clamped                 ;16
;    CM     Pal_1_2_start               ;17
;    CM     Pal_1_2_in_pos              ;18
;    CM     APC_time                    ;19
;    CM     Pal_unclamp                 ;20
;    CM     Pal_unclamped               ;21
;    CM     APC_to_down_pos             ;22
;    CM     APC_in_down_pos             ;23
  ENDC

  PLL
;  S      TS_PC_timeout
  S      TS_PC_timeout
  IFT
    INC    BG_step_pallet_change
  ENDI

*  L      MG_PW_diagnosis
*  IFT
*    L      KL_offset_PC_translat_1
*    +      BG_step_PC
*    =X
*
*    L      S#D0[X]
*    =      S1
*    INCX
*
*    L      S#D0[X]
*    =      S2
*    INCX
*
*    L      S#D0[X]
*    =      S3
*  ENDI

  LN     MG_PC_active
  EMT

  L      MG_NC_start_pulse
  R      MG_PC_interruption

  L      MG_key_NC_start
  O      MG_pulse_CE_key
  S      TS_PC_timeout

  LN     TR_PC_timeout
  AN     TS_PC_timeout
  =      PN_error_PC_timeout
  S      MG_PC_interruption

  L      MG_key_NC_stop
  O      MG_pulse_external_stop
  S      MG_PC_interruption

  L      MG_pulse_internal_stop
  O      MG_auto_manu_mode_change
  ON     MG_control_operational
  CMT    APC_reset

EM

;----------------------------
LBL APC_activate                       ;00

  L      MG_M60_pallet_change
  O      MG_M61_pallet_1_to_machine
  O      MG_M62_pallet_2_to_machine
  A      MG_PC_standby_position
  A      MG_TC_standby_position
  S      MG_PC_active
  PSL

EM

;----------------------------
LBL APC_release                        ;01

  L      MG_manual_mode
  S      PN_error_M_function_only_in_auto_mode
  JPT    APC_end

  L      MG_marker_one
  S      TS_PC_timeout

  L      MG_M61_pallet_1_to_machine
  A      I_PC_position_in_1
  S      PN_M4092_quit_M_function
  JPT    APC_end

  L      MG_M62_pallet_2_to_machine
  A      I_PC_position_in_2
  S      PN_M4092_quit_M_function
  JPT    APC_end

  LN     MG_new_workpiece_on_pallet
  =      PN_error_enable_new_workpiece_on_pallet
  IFT
    L      MG_clock_1_s
    =      O_lamp_PC_ready
  ENDI

  L      I_guard_1_closed_locked
  O      MG_guard_inactive
  A[
    LN     PN_error_PC_load_door_open
    O      MG_guard_inactive
  ]
  AN     PN_error_enable_new_workpiece_on_pallet
  A      MG_control_in_operation_on
  AN     NP_M4157_mode_restore_position
  PSL

EM

;----------------------------
LBL Z_start                            ;02

  L      MG_PC_interruption
  IFT
    PS     MG_marker_zero
  ELSE
    PS     KG_axis_Z
    PS     DG_PC_posit_Z
    PS     DG_feed_PLC_Z
    PS     KL_absolute_with_software_limit_switch
    CM     9221
    PLW
    ==     K+0
    PSL
    M_display_module_error(KG_error_module_9221)
  ENDI

EM

;----------------------------
LBL Z_in_PC_pos                        ;03

  L      MG_PC_interruption
  =      MG_win_PC_posit_Z

  L      DG_position_axis_Z_ref
  -      DG_PC_posit_Z
  PSW
  CM     Absolute
  PLW
  <      DG_MP1030_pos_window_Z
  AN     PN_M4122_strobe_PLC_posit_axis_Z
  AN     MG_PC_interruption
  PSL

EM

;----------------------------
LBL X_start                            ;06

  L      MG_PC_interruption
  IFT
    PS     MG_marker_zero
  ELSE
    PS     KG_axis_X
    PS     DG_PC_posit_X
    PS     DG_feed_PLC_X
    PS     KL_absolute_with_software_limit_switch
    CM     9221
    PLW
    ==     K+0
    PSL
    M_display_module_error(KG_error_module_9221)
  ENDI

EM

;----------------------------
LBL X_in_PC_pos                        ;08

  L      MG_PC_interruption
  =      MG_win_PC_posit_X

  L      DG_position_axis_X_ref
  -      DG_PC_posit_X
  PSW
  CM     Absolute
  PLW
  <      DG_MP1030_pos_window_X
  AN     PN_M4120_strobe_PLC_posit_axis_X
  AN     MG_PC_interruption
  PSL

EM

;----------------------------
LBL Y_start                            ;07

  L      MG_PC_interruption
  IFT
    PS     MG_marker_zero
  ELSE
    PS     KG_axis_Y
    PS     DG_PC_posit_Y
    PS     DG_feed_PLC_Y
    PS     KL_absolute_with_software_limit_switch
    CM     9221
    PLW
    ==     K+0
    PSL
    M_display_module_error(KG_error_module_9221)
  ENDI

EM

;----------------------------
LBL Y_in_PC_pos                        ;09

  L      MG_PC_interruption
  =      MG_win_PC_posit_Y

  L      DG_position_axis_Y_ref
  -      DG_PC_posit_Y
  PSW
  CM     Absolute
  PLW
  <      DG_MP1030_pos_window_Y
  AN     PN_M4121_strobe_PLC_posit_axis_Y
  AN     MG_PC_interruption
  PSL


EM

;----------------------------
;LBL C_start                            ;04
;
;  L      MG_PC_interruption
;  IFT
;    PS     MG_marker_zero
;  ELSE
;    PS     KG_axis_4
;    PS     K+0
;    L      NP_D780_feed_PLC_4
;    /      K+10000
;    PSW
;    PS     KL_absolute_with_software_limit_switch
;    CM     9221
;    PLW
;    ==     K+0
;    PSL
;    M_display_module_error(KG_error_module_9221)
;  ENDI
;
;EM

;----------------------------
;LBL C_in_PC_pos                        ;05
;
;  L      MG_PC_interruption
;  =      MG_win_PC_posit_4
;
;  L      DG_position_axis_4_ref
;  <      DG_MP1030_pos_window_4
;  O[
;    L      K+3600000
;    -      DG_position_axis_4_ref
;    <      DG_MP1030_pos_window_4
;  ]
;  AN     PN_M4123_strobe_PLC_posit_axis_4
;  AN     MG_PC_interruption
;  PSL
;
;EM

;----------------------------
LBL Pal_unclamp                        ;14

  L      MG_marker_one                 ;20120709
  S      O_PC_pallet_in_machine_unclamping
  R      O_PC_table_up
  R      O_PC_table_down               ;20120705
  PSL

EM

;----------------------------
LBL Pal_unclamped                      ;15

;  LN     MG_PC_interruption
;  A      I_APC_pallet_in_machine_unclamped
;  S      O_PC_air_blast
;  PSL

  LN     MG_PC_interruption
  S      O_PC_pallet_in_machine_unclamping
  R      TS_PC_pallet_unclamping
  R      O_PC_table_up
  R      O_PC_table_down

  LN     TS_PC_pallet_unclamping
  AN     TR_PC_pallet_unclamping
  AN     I_PC_pallet_in_clamped
  PSL

  L      MG_PC_interruption
  R      O_PC_air_blast
;  =      MG_win_APC_pallet_unclamping_in_machine
  =      MG_win_PC_interrupted_yes     ;20120705

EM

;----------------------------
LBL Pal_clamp                          ;23

  LN     MG_PC_interruption
  AN     I_PC_in_middle_position       ;20120705
  R      O_PC_pallet_in_machine_unclamping
  R      O_PC_air_blast
  PSL

  L      MG_PC_interruption            ;20120705
  R      O_PC_air_blast
;  =      MG_win_PC_pallet_clamping_in_machine
  =      MG_win_PC_interrupted_yes

  LN     MG_PC_interruption            ;20120705
  =      O_PC_table_down

EM

;----------------------------
LBL Pal_clamped                        ;24

  LN     MG_PC_interruption
;  AN     I_APC_pallet_in_machine_unclamped       ;20120705
  A      I_PC_pallet_in_clamped
  PSL

  L      MG_PC_interruption
  R      O_PC_air_blast
;  =      MG_win_APC_pallet_clamping_in_machine   ;20120705
  =      MG_win_PC_interrupted_yes     ;20120705

  LN     MG_PC_interruption            ;20120705
  =      O_PC_table_down

EM

;----------------------------
LBL APC_up_to_middle_pos               ;12 ;20120705

  LN     MG_PC_interruption
  S      O_PC_table_up
  R      O_PC_table_down
  PSL

EM

;----------------------------
LBL APC_up_in_middle_pos               ;13 ;20120705

  LN     MG_PC_interruption
  A      I_PC_in_middle_position
  AN     I_PC_in_up_position
  AN     I_PC_in_down_position
;  A      I_PC_pallet_in_clamped
  R      O_PC_table_up
  R      O_PC_table_down
  PSL

  LN     MG_PC_interruption
  AN     I_PC_in_middle_position
  =      O_PC_table_up

  LN     I_PC_in_middle_position
  O      I_PC_in_up_position
  O      I_PC_in_down_position
  A      MG_PC_interruption
;  =      MG_win_PC_to_up_position
  =      MG_win_PC_interrupted_yes

EM

;----------------------------
LBL APC_to_up_pos                      ;16

  LN     MG_PC_interruption
  S      O_PC_pallet_in_machine_unclamping
  S      O_PC_table_up
  R      O_PC_table_down
  PSL

EM

;----------------------------
LBL APC_in_up_pos                      ;17

  L      MG_marker_one                 ;20120705
  S      O_PC_pallet_in_machine_unclamping

  LN     I_PC_in_middle_position       ;20120705
  A      O_PC_table_up
  S      O_PC_air_blast

  LN     MG_PC_interruption
  A      I_PC_in_up_position
  AN     I_PC_in_middle_position       ;20120705
  AN     I_PC_in_down_position
;  AN     I_APC_pallet_in_clamped_position        ;20120705
  AN     I_PC_pallet_in_clamped        ;20120705
  R      O_PC_air_blast
  PSL

  LN     MG_PC_interruption
  AN     MG_win_pal_in_machine_unclamping
  =      O_PC_table_up

;  LN     I_PC_in_up_position
;  O      I_PC_in_down_position
;  A      MG_PC_interruption
;  =      MG_win_APC_to_up_position

;  L      I_APC_pallet_in_clamped_position
;  A      MG_PC_interruption
;  =      MG_win_APC_pallet_clamping_in_machine

  LN     I_PC_in_up_position
  O      I_PC_in_middle_position
  O      I_PC_in_down_position
  A      MG_PC_interruption
;  =      MG_win_PC_to_up_position
  =      MG_win_PC_interrupted_yes

  L      I_PC_pallet_in_clamped
  =      MG_win_pal_in_machine_unclamping

EM

;----------------------------
LBL APC_down_to_middle_pos             ;21

  LN     MG_PC_interruption
  R      O_PC_table_up
  S      O_PC_table_down
  S      O_PC_pallet_in_machine_unclamping
  PSL

EM

;----------------------------
LBL APC_down_in_middle_pos             ;22

  L      MG_marker_one
  S      O_PC_pallet_in_machine_unclamping

  LN     I_PC_in_up_position
  A      O_PC_table_down
  S      O_PC_air_blast

  LN     MG_PC_interruption
  A      I_PC_in_middle_position
  AN     I_PC_in_up_position
  AN     I_PC_in_down_position
  AN     I_PC_pallet_in_clamped
  R      O_PC_air_blast
  PSL

  LN     I_PC_in_middle_position
  O      I_PC_in_up_position
  O      I_PC_in_down_position
  A      MG_PC_interruption
;  =      MG_win_PC_to_down_position
  =      MG_win_PC_interrupted_yes

  LN     MG_PC_interruption
  AN     MG_win_pal_in_machine_unclamping
  =      O_PC_table_down

  L      I_PC_pallet_in_clamped
  =      MG_win_pal_in_machine_unclamping

EM

;----------------------------
LBL APC_to_down_pos                    ;25

  LN     MG_PC_interruption
  R      O_PC_table_up
  S      O_PC_table_down
  PSL

EM

;----------------------------
LBL APC_in_down_pos                    ;26

  LN     I_PC_in_up_position
  ON     I_PC_in_middle_position
  A      I_PC_in_down_position
;  A      I_APC_pallet_in_clamped_position
  A      I_PC_pallet_in_clamped
  AN     MG_PC_interruption
;  S      O_PC_air_blast
  R      O_PC_air_blast
  PSL

  L      MG_PC_interruption
;  R      O_PC_air_blast
;  =      MG_win_APC_to_down_position
  =      MG_win_PC_interrupted_yes

  L      I_PC_in_up_position
  O      I_PC_in_middle_position
  ON     I_PC_in_down_position
  A      MG_PC_interruption
;  R      O_PC_air_blast
;  =      MG_win_APC_to_up_position
  =      MG_win_PC_interrupted_yes

;  LN     I_APC_pallet_in_clamped_position
;  A      MG_PC_interruption
;  =      MG_win_APC_pallet_clamping_in_machine

EM

;----------------------------
LBL PC_cone_air_pressure_test          ;27

  LN     MG_PC_interruption
  R      TS_PC_cone_air_blast_pressure
  S      O_PC_cone_air_blast

  LN     TS_PC_cone_air_blast_pressure
  AN     TR_PC_cone_air_blast_pressure
  A      I_PC_in_down_position
  A      I_PC_pallet_in_clamped
  A      I_PC_cone_air_pressure_ok
  AN     MG_PC_interruption
  O      PN_error_cone_air_pressure_low
  R      O_PC_cone_air_blast
  PSL

  LN     TS_PC_cone_air_blast_pressure
  AN     TR_PC_cone_air_blast_pressure
  AN     I_PC_cone_air_pressure_ok
  ON     I_PC_in_down_position
  ON     I_PC_pallet_in_clamped
  O      MG_PC_interruption
  S      PN_error_cone_air_pressure_low
  R      O_PC_cone_air_blast

EM

;----------------------------
LBL Pal_1_2_start                      ;18

  L      MG_marker_one                 ;20120705
  S      TS_delay_slow_motion

  L      MG_M60_pallet_change
  A      I_PC_position_in_2
  O      MG_M61_pallet_1_to_machine
  =      ML_PC_to_position_1
  =N     ML_PC_to_position_2
  CMT    Pal_1_start
  CMF    Pal_2_start

EM

;----------------------------
LBL Pal_1_start

  LN     MG_PC_interruption
  A      I_PC_in_up_position
  S      O_PC_to_position_1
  R      O_PC_to_position_2
  PSL

  L      I_PC_in_up_position
  S      O_PC_table_up

  LN     I_PC_in_up_position
  =      MG_win_PC_to_up_position

EM

;----------------------------
LBL Pal_2_start

  LN     MG_PC_interruption
  A      I_PC_in_up_position
  R      O_PC_to_position_1
  S      O_PC_to_position_2
  PSL

  L      I_PC_in_up_position
  S      O_PC_table_up

  LN     I_PC_in_up_position
  =      MG_win_PC_to_up_position

EM

;----------------------------
LBL Pal_1_2_in_pos                     ;19

  L      MG_M60_pallet_change
  A      O_PC_to_position_1
  O      MG_M61_pallet_1_to_machine
  CMT    Pal_in_1_pos
  CMF    Pal_in_2_pos

  L      MG_PC_interruption
  IFT
    R      O_PC_to_position_1
    R      O_PC_to_position_2
  ELSE
    L      ML_PC_to_position_1
    =      O_PC_to_position_1

    L      ML_PC_to_position_2
    =      O_PC_to_position_2
  ENDI

EM

;----------------------------
LBL Pal_in_1_pos

  L      I_PC_position_in_1
  AN     I_PC_position_in_2
  AN     MG_PC_interruption
  PSL

  L      MG_PC_interruption
;  =      MG_win_APC_neither_position_1_nor_position
  =      MG_win_PC_interrupted_yes

EM

;----------------------------
LBL Pal_in_2_pos

  L      I_PC_position_in_2
  AN     I_PC_position_in_1
  AN     MG_PC_interruption
  PSL

  L      MG_PC_interruption
;  =      MG_win_APC_neither_position_1_nor_position
  =      MG_win_PC_interrupted_yes

EM

;----------------------------
LBL APC_quit                           ;28

  LN     PN_M4092_quit_M_function
  AN     MG_PC_interruption
  PSL

  LN     MG_PC_interruption
  S      PN_M4092_quit_M_function

EM


;----------------------------
LBL APC_end                            ;29

  PS     MG_marker_zero


LBL APC_reset

  L      MG_marker_one
  R      MG_PC_active
  R      MG_enable_alternating_table
;  R      MG_new_workpiece_on_pallet
  R      MG_PC_interruption
;  R      O_PC_to_position_1
;  R      O_PC_to_position_2
;  R      O_PC_table_up
;  R      O_PC_table_down
  R      O_PC_pallet_in_machine_unclamping
  R      O_PC_air_blast
  R      O_PC_table_slow_motion
  R      O_lamp_PC_ready
  R      O_PC_cone_air_blast

  L      K+0
  =      BG_step_pallet_change

EM

;----------------------------
LBL APC_time

  LN     TR_PC_timer_universal
  =      TS_PC_timer_universal
  PSL

EM

;----------------------------
LBL PC_coolant_clean

  L      MG_M418_PC_coolant_on
  O      MG_M419_PC_coolant_off
  S      PN_M4092_quit_M_function

  L      NP_M4158_mode_block_scan
  EMT

  L      MG_control_in_operation_on
  A      MG_automatic_mode
  AN     ML_PC_coolant_auto
  =      ML_PC_coolant_pulse

  L      MG_control_in_operation_on
  A      MG_automatic_mode
  =      ML_PC_coolant_auto

  L      MG_M418_PC_coolant_on
  O      ML_PC_coolant_pulse
  S      ML_PC_coolant

  L      MG_M419_PC_coolant_off
  O      MG_pulse_END_PGM_M02_M30
  O      MG_auto_manu_mode_change
  ON     MG_control_operational
  R      ML_PC_coolant

  L      ML_PC_coolant
  AN     MG_PC_active
  AN     MG_TC_automatic
  AN     MG_guard_open
  A      I_circuit_breaker_ok
  =      O_coolant_PC_clean

  L      O_coolant_PC_clean
  A      I_PC_position_in_1
  AN     I_PC_position_in_2
  =      O_coolant_PC_clean_1

  L      O_coolant_PC_clean
  AN     I_PC_position_in_1
  A      I_PC_position_in_2
  =      O_coolant_PC_clean_2

EM
