
/***********************************************************************/
/*    AO Function Block 1                                              */
/***********************************************************************/

BLOCK func3_AO_1_block
{
    TYPE    FUNCTION;
    NUMBER    5;
}

func3_AO_1_blk_reserve                           LIKE VARIABLE    phys_blk_reserve
{
}

VARIABLE func3_AO_1_blk_object
{
    LABEL       [blk_block_object];
    HELP        [blk_block_object_help];
    CLASS       CONTAINED;
    TYPE        ENUMERATED(1)
    {
        {    2,    [blk_block_object_FUNCTION]        }
    }
    HANDLING    READ;
}

VARIABLE func3_AO_1_blk_parent_class
{
    LABEL       [blk_parent_class];
    HELP        [func_blk_parent_class_help];
    CLASS       CONTAINED;
    TYPE        ENUMERATED(1)
    {
        {    2,    [func_blk_parent_class_OUTPUT]    }
    }
    HANDLING    READ;
}

VARIABLE func3_AO_1_blk_class
{
    LABEL       [blk_class];
    HELP        [func_blk_class_help];
    CLASS       CONTAINED;
    TYPE        ENUMERATED(1)
    {
        {    1,    [func_blk_class_AO]        }
    }
    HANDLING    READ;
}

func3_AO_1_blk_dd_reference                      LIKE VARIABLE    phys_blk_dd_reference
{
}

func3_AO_1_blk_dd_rev                            LIKE VARIABLE    phys_blk_dd_rev
{
}

func3_AO_1_blk_profile                           LIKE VARIABLE    phys_blk_profile
{
}

func3_AO_1_blk_profile_rev                       LIKE VARIABLE    phys_blk_profile_rev
{
}

func3_AO_1_blk_execution_time                    LIKE VARIABLE    phys_blk_execution_time
{
}

func3_AO_1_blk_num_parameters                    LIKE VARIABLE    phys_blk_num_parameters
{
}

func3_AO_1_blk_index_view_1                      LIKE VARIABLE    phys_blk_index_view_1
{
}

func3_AO_1_blk_num_view_lists                    LIKE VARIABLE    phys_blk_num_view_lists
{
}

func3_AO_1_st_rev                                LIKE VARIABLE    phys_st_rev
{
}

func3_AO_1_tag_desc                              LIKE VARIABLE    phys_tag_desc
{
    REDEFINE LABEL       [MT_AO_1_tag_desc];
}

func3_AO_1_strategy                              LIKE VARIABLE    phys_strategy
{
}

func3_AO_1_alert_key                             LIKE VARIABLE    phys_alert_key
{
}

func3_AO_1_target_mode                           LIKE VARIABLE    phys_target_mode
{
    REDEFINE TYPE        ENUMERATED (1)
    {
        DEFAULT_VALUE    BLOCK_MODE_AUTO;
        {    0x02,    [mode_RCAS]              },
        {    0x08,    [mode_AUTO]              },
        {    0x10,    [mode_MAN]               },
        {    0x20,    [mode_LO]                },
        {    0x80,    [mode_OUT_OF_SERVICE]    }
    }
}

func3_AO_1_actual_mode                           LIKE VARIABLE    phys_actual_mode
{
    REDEFINE TYPE        ENUMERATED (1)
    {
        {    0x02,    [mode_RCAS]              },
        {    0x08,    [mode_AUTO]              },
        {    0x10,    [mode_MAN]               },
        {    0x20,    [mode_LO]                },
        {    0x80,    [mode_OUT_OF_SERVICE]    }
    }
}

func3_AO_1_permitted_mode                        LIKE VARIABLE    phys_permitted_mode
{
    REDEFINE TYPE        BIT_ENUMERATED (1)
    {
        {    0x02,    [mode_RCAS]              },
        {    0x08,    [mode_AUTO]              },
        {    0x10,    [mode_MAN]               },
        {    0x20,    [mode_LO]                },
        {    0x80,    [mode_OUT_OF_SERVICE]    }
    }
}

func3_AO_1_normal_mode                           LIKE VARIABLE    phys_normal_mode
{
    REDEFINE TYPE        ENUMERATED (1)
    {
        {    0x02,    [mode_RCAS]              },
        {    0x08,    [mode_AUTO]              },
        {    0x10,    [mode_MAN]               },
        {    0x20,    [mode_LO]                },
        {    0x80,    [mode_OUT_OF_SERVICE]    }
    }
}

func3_AO_1_current_state_alarm_sum               LIKE VARIABLE    phys_current_state_alarm_sum
{
    REDEFINE TYPE        BIT_ENUMERATED (2)
    {
        {    0x0000,    [limit_state_NO_ALARM]  },
        {    0x0200,    [limit_state_HI_HI]     },
        {    0x0400,    [limit_state_HI]        },
        {    0x0800,    [limit_state_LO_LO]     },
        {    0x1000,    [limit_state_LO]        }
    }
    REDEFINE STYLE      "MULTILINE 16 5" ;
}

func3_AO_1_unacknowledged_state_alarm_sum        LIKE VARIABLE    phys_unacknowledged_state_alarm_sum
{
    REDEFINE TYPE        BIT_ENUMERATED (2)
    {
        {    0x0000,    [limit_state_NO_ALARM]  },
        {    0x0200,    [limit_state_HI_HI]     },
        {    0x0400,    [limit_state_HI]        },
        {    0x0800,    [limit_state_LO_LO]     },
        {    0x1000,    [limit_state_LO]        }
    }
    REDEFINE STYLE      "MULTILINE 16 5" ;
}

func3_AO_1_unreported_state_alarm_sum            LIKE VARIABLE    phys_unreported_state_alarm_sum
{
    REDEFINE TYPE        BIT_ENUMERATED (2)
    {
        {    0x0000,    [limit_state_NO_ALARM]  },
        {    0x0200,    [limit_state_HI_HI]     },
        {    0x0400,    [limit_state_HI]        },
        {    0x0800,    [limit_state_LO_LO]     },
        {    0x1000,    [limit_state_LO]        }
    }
    REDEFINE STYLE      "MULTILINE 16 5" ;
}

func3_AO_1_disabled_state_alarm_sum              LIKE VARIABLE    phys_disabled_state_alarm_sum
{
    REDEFINE TYPE        BIT_ENUMERATED (2)
    {
        {    0x0000,    [limit_state_NO_ALARM]  },
        {    0x0200,    [limit_state_HI_HI]     },
        {    0x0400,    [limit_state_HI]        },
        {    0x0800,    [limit_state_LO_LO]     },
        {    0x1000,    [limit_state_LO]        }
    }
    REDEFINE STYLE      "MULTILINE 16 5" ;
}

VARIABLE func3_AO_1_batch_id
{
    LABEL       [func_batch_id];
    HELP        [func_batch_id_help];
    CLASS       CONTAINED;
    TYPE        UNSIGNED_INTEGER (4)
    {
        DEFAULT_VALUE    0;
    }
    HANDLING    READ & WRITE;
}

VARIABLE func3_AO_1_batch_unit
{
    LABEL       [func_batch_unit];
    HELP        [func_batch_unit_help];
    CLASS       CONTAINED;
    TYPE        UNSIGNED_INTEGER (2)
    {
        DEFAULT_VALUE    0;
    }
    HANDLING    READ & WRITE;
}

VARIABLE func3_AO_1_batch_operation
{
    LABEL       [func_batch_operation];
    HELP        [func_batch_operation_help];
    CLASS       CONTAINED;
    TYPE        UNSIGNED_INTEGER (2)
    {
        DEFAULT_VALUE    0;
    }
    HANDLING    READ & WRITE;
}

VARIABLE func3_AO_1_batch_phase
{
    LABEL       [func_batch_phase];
    HELP        [func_batch_phase_help];
    CLASS       CONTAINED;
    TYPE        UNSIGNED_INTEGER (2)
    {
        DEFAULT_VALUE    0;
    }
    HANDLING    READ & WRITE;
}

/*---------------------------------------------------------------------*/
/*    AO-1 : Additional Parameter                                      */
/*---------------------------------------------------------------------*/

VARIABLE func3_AO_1_setpoint_value
{
    LABEL       [func_ao_setpoint_value];
    HELP        [func_ao_setpoint_value_help];
    CLASS       CONTAINED & DYNAMIC;
    TYPE        FLOAT
    {
        DEFAULT_VALUE    9999.0;
    }
    HANDLING
        IF (func3_AO_1_target_mode == BLOCK_MODE_AUTO)
        {
            READ & WRITE;
        }
        ELSE {
            READ;
        }
}

VARIABLE func3_AO_1_setpoint_status_quality
{
    LABEL       [status_quality];
    HELP        [func_ao_setpoint_status_help];
    CLASS       CONTAINED & DYNAMIC;
    TYPE        ENUMERATED (1)
    {
        DEFAULT_VALUE    0;
        STATUS_INPUT_NO_RCAS
    }
    POST_EDIT_ACTIONS
    {
        method_set_status_limit_func3_AO_1
    }
      HANDLING
        IF (func3_AO_1_target_mode == BLOCK_MODE_AUTO)
        {
            READ & WRITE;
        }
        ELSE {
            READ;
        }

}

func3_AO_1_setpoint_status_limit                 LIKE VARIABLE    func3_AO_1_setpoint_status_quality
{
    REDEFINE LABEL       [status_limit];
    REDEFINE TYPE        ENUMERATED (1)
    {
        STATUS_INPUT_LIMIT (func3_AO_1_setpoint_status_quality)
    }
}

VARIABLE func3_AO_1_pv_upper_range_value
{
    LABEL       [func_pv_scale_upper_value];
    HELP        [func_pv_scale_upper_value_help];
    CLASS       CONTAINED;
    TYPE        FLOAT
    {
        DEFAULT_VALUE    9999.0;
        DISPLAY_FORMAT	DEF_DISPLAY_FORMAT(func3_AO_1_out_decimal_point)
    }
    HANDLING    READ & WRITE;
}

VARIABLE func3_AO_1_pv_lower_range_value
{
    LABEL       [func_pv_scale_lower_value];
    HELP        [func_pv_scale_lower_value_help];
    CLASS       CONTAINED;
    TYPE        FLOAT
    {
        DEFAULT_VALUE    0.0;
        DISPLAY_FORMAT	DEF_DISPLAY_FORMAT(func3_AO_1_out_decimal_point)
    }
    HANDLING    READ & WRITE;
}

VARIABLE func3_AO_1_pv_unit
{
    LABEL       [func_pv_scale_unit];
    HELP        [func_pv_scale_unit_help];
    CLASS       CONTAINED;
    TYPE        ENUMERATED (2)
    {
        DEFAULT_VALUE 1138;
        AO_UNIT
    }
    HANDLING    READ & WRITE;
}

VARIABLE func3_AO_1_pv_decimal_point
{
    LABEL       [decimal_point];
    HELP        [decimal_point_help];
    CLASS       CONTAINED;
    TYPE        ENUMERATED (1)
    {
        DEFAULT_VALUE    2;
        {    0,   "0"        },
        {    1,   "1"        },
        {    2,   "2"        },
        {    3,   "3"        },
        {    4,   "4"        },
        {    5,   "5"        },
        {    6,   "6"        }
    }
    HANDLING    READ & WRITE;
}

VARIABLE func3_AO_1_readback_value
{
    LABEL       [func_ao_readback_value];
    HELP        [func_ao_readback_value_help];
    CLASS       CONTAINED & DYNAMIC;
    TYPE        FLOAT
    {
        DEFAULT_VALUE    0.0;
    }
    HANDLING    READ;
}


VARIABLE func3_AO_1_readback_status_quality
{
    LABEL       [status_quality];
    HELP        [func_ao_readback_status_help];
    CLASS       CONTAINED & DYNAMIC;
    TYPE        ENUMERATED (1)
    {
        DEFAULT_VALUE    0;
        STATUS_OUTPUT_NO_RCAS
    }
    HANDLING    READ;
}

func3_AO_1_readback_status_limit                 LIKE VARIABLE    func3_AO_1_readback_status_quality
{
    REDEFINE LABEL       [status_limit];
    REDEFINE TYPE        ENUMERATED (1)
    {
        STATUS_OUTPUT_LIMIT
    }
}

VARIABLE func3_AO_1_rcas_in_value
{
    LABEL       [func_rcas_in_value];
    HELP        [func_rcas_in_value_help];
    CLASS       CONTAINED & DYNAMIC;
    TYPE        FLOAT
    {
        DEFAULT_VALUE    0.0;
    }
    HANDLING
        IF (func3_AO_1_target_mode == BLOCK_MODE_RCAS)
        {
            READ & WRITE;
        }
        ELSE {
            READ;
        }
}

VARIABLE func3_AO_1_rcas_in_status_quality
{
    LABEL       [status_quality];
    HELP        [func_rcas_in_status_help];
    CLASS       CONTAINED & DYNAMIC;
    TYPE        ENUMERATED (1)
    {
        DEFAULT_VALUE    0;
        STATUS_INPUT_RCAS
    }
    POST_EDIT_ACTIONS
    {
        method_set_status_limit_func3_AO_1
    }
    HANDLING
        IF (func3_AO_1_target_mode == BLOCK_MODE_RCAS)
        {
            READ & WRITE;
        }
        ELSE {
            READ;
        }
}

func3_AO_1_rcas_in_status_limit                  LIKE VARIABLE    func3_AO_1_rcas_in_status_quality
{
    REDEFINE LABEL       [status_limit];
    REDEFINE TYPE        ENUMERATED (1)
    {
        STATUS_INPUT_LIMIT (func3_AO_1_rcas_in_status_quality)
    }
}

VARIABLE func3_AO_1_in_channel
{
    LABEL       [MT_channel];
    HELP        [func_channel_help];
    CLASS       CONTAINED;
    TYPE        ENUMERATED(2)
    {
        DEFAULT_VALUE   1;
        _FB_AO_CHANNEL
    }
    HANDLING    READ & WRITE;
}

VARIABLE func3_AO_1_out_channel
{
    LABEL       [MT_channel];
    HELP        [func_channel_help];
    CLASS       CONTAINED;
    TYPE        ENUMERATED(2)
    {
        DEFAULT_VALUE   1;
        _FB_AO_CHANNEL
    }
    HANDLING    READ & WRITE;
}

VARIABLE func3_AO_1_fsafe_time
{
    LABEL       [func_ao_fsafe_time];
    HELP        [func_ao_fsafe_time_help];
    CLASS       CONTAINED;
    TYPE        FLOAT
    {
        DEFAULT_VALUE    0;
    }
    CONSTANT_UNIT    [sec];
    HANDLING    READ & WRITE;
}

VARIABLE func3_AO_1_fsafe_type
{
    LABEL       [func_ao_fsafe_type];
    HELP        [func_ao_fsafe_type_help];
    CLASS       CONTAINED;
    TYPE        ENUMERATED (1)
    {
        DEFAULT_VALUE    0;
        {    0,    [func_ao_fsafe_type_FAIL_SAFE_VALUE]         },
        {    1,    [func_ao_fsafe_type_STORING_LAST_SETPOINT]   },
        {    2,    [func_ao_fsafe_type_FAIL_SAFE_POSITION]      }
    }
    HANDLING    READ & WRITE;
}

VARIABLE func3_AO_1_fsafe_value
{
    LABEL       [func_ao_fsafe_value];
    HELP        [func_ao_fsafe_value_help];
    CLASS       CONTAINED;
    TYPE        FLOAT
    {
        DEFAULT_VALUE    0.0;
    }
    HANDLING    READ & WRITE;
}

VARIABLE func3_AO_1_rcas_out_value
{
    LABEL       [func_rcas_out_value];
    HELP        [func_rcas_out_value_help];
    CLASS       CONTAINED & DYNAMIC;
    TYPE        FLOAT;
    HANDLING    READ;
}

VARIABLE func3_AO_1_rcas_out_status_quality
{
    LABEL       [status_quality];
    HELP        [func_rcas_out_status_help];
    CLASS       CONTAINED & DYNAMIC;
    TYPE        ENUMERATED (1)
    {
        DEFAULT_VALUE    0;
        STATUS_OUTPUT_RCAS
    }
    HANDLING    READ;
}

func3_AO_1_rcas_out_status_limit                 LIKE VARIABLE    func3_AO_1_rcas_out_status_quality
{
    REDEFINE LABEL       [status_limit];
    REDEFINE TYPE        ENUMERATED (1)
    {
        STATUS_OUTPUT_LIMIT
    }
}

VARIABLE func3_AO_1_position_discrete_value
{
    LABEL       [func_ao_position_discrete_value];
    HELP        [func_ao_position_discrete_value_help];
    CLASS       CONTAINED & DYNAMIC;
    TYPE        ENUMERATED (1)
    {
        {    0,    [func_ao_position_discrete_status_NOT_INIT]          },
        {    1,    [func_ao_position_discrete_status_CLOSED]            },
        {    2,    [func_ao_position_discrete_status_OPENED]            },
        {    3,    [func_ao_position_discrete_status_INTERMEDIATE]      }
    }
    HANDLING    READ;
}

VARIABLE func3_AO_1_position_discrete_status_quality
{
    LABEL       [status_quality];
    HELP        [func_ao_position_discrete_status_help];
    CLASS       CONTAINED & DYNAMIC;
    TYPE        ENUMERATED (1)
    {
        DEFAULT_VALUE    0;
        STATUS_OUTPUT_NO_RCAS
    }
    HANDLING READ;
}

func3_AO_1_position_discrete_status_limit        LIKE VARIABLE    func3_AO_1_position_discrete_status_quality
{
    REDEFINE LABEL       [status_limit];
    REDEFINE TYPE        ENUMERATED (1)
    {
        STATUS_OUTPUT_LIMIT
    }
}

VARIABLE func3_AO_1_check_back
{
    LABEL       [func_check_back];
    HELP        [func_check_back_help];
    CLASS       CONTAINED & DYNAMIC;
    TYPE        BIT_ENUMERATED (3)
    {
        {    0,                   [dia_OK],               [dia_OK_help]               },
        {    CB_FAIL_SAFE,        [cb_FAIL_SAFE],         [cb_FAIL_SAFE_help]         },
        {    CB_REQ_LOC_OP,       [cb_REQ_LOC_OP],        [cb_REQ_LOC_OP_help]        },
        {    CB_LOCAL_OP,         [cb_LOCAL_OP],          [cb_LOCAL_OP_help]          },
        {    CB_OVERRIDE,         [cb_OVERRIDE],          [cb_OVERRIDE_help]          },
        {    CB_DISC_DIR,         [cb_DISC_DIR],          [cb_DISC_DIR_help]          },
        {    CB_TORQUE_D_OP,      [cb_TORQUE_D_OP],       [cb_TORQUE_D_OP_help]       },
        {    CB_TORQUE_D_CL,      [cb_TORQUE_D_CL],       [cb_TORQUE_D_CL_help]       },
        {    CB_TRAV_TIME,        [cb_TRAV_TIME],         [cb_TRAV_TIME_help]         },
        {    CB_ACT_OPEN,         [cb_ACT_OPEN],          [cb_ACT_OPEN_help]          },
        {    CB_ACT_CLOSE,        [cb_ACT_CLOSE],         [cb_ACT_CLOSE_help]         },
        {    CB_UPDATE_EVT,       [cb_UPDATE_EVT],        [cb_UPDATE_EVT_help]        },
        {    CB_SIMULATE,         [cb_SIMULATE],          [cb_SIMULATE_help]          },
        {    CB_DISTURBANCE,      [cb_DISTURBANCE],       [cb_DISTURBANCE_help]       },
        {    CB_CONTR_ERR,        [cb_CONTR_ERR],         [cb_CONTR_ERR_help]         },
        {    CB_CONTR_INACT,      [cb_CONTR_INACT],       [cb_CONTR_INACT_help]       },
        {    CB_SELFTEST,         [cb_SELFTEST],          [cb_SELFTEST_help]          },
        {    CB_TOT_VALVE_TRAV,   [cb_TOT_VALVE_TRAV],    [cb_TOT_VALVE_TRAV_help]    }
    }
    HANDLING    READ;
    STYLE      "MULTILINE 10 8" ;
}

VARIABLE func3_AO_1_check_back_mask
{
    LABEL       [func_check_back_mask];
    HELP        [func_check_back_mask_help];
    CLASS       CONTAINED;
    TYPE        BIT_ENUMERATED (3)
    {
        {    CB_FAIL_SAFE,        [cb_FAIL_SAFE],         [cb_FAIL_SAFE_help]         },
        {    CB_REQ_LOC_OP,       [cb_REQ_LOC_OP],        [cb_REQ_LOC_OP_help]        },
        {    CB_LOCAL_OP,         [cb_LOCAL_OP],          [cb_LOCAL_OP_help]          },
        {    CB_OVERRIDE,         [cb_OVERRIDE],          [cb_OVERRIDE_help]          },
        {    CB_DISC_DIR,         [cb_DISC_DIR],          [cb_DISC_DIR_help]          },
        {    CB_TORQUE_D_OP,      [cb_TORQUE_D_OP],       [cb_TORQUE_D_OP_help]       },
        {    CB_TORQUE_D_CL,      [cb_TORQUE_D_CL],       [cb_TORQUE_D_CL_help]       },
        {    CB_TRAV_TIME,        [cb_TRAV_TIME],         [cb_TRAV_TIME_help]         },
        {    CB_ACT_OPEN,         [cb_ACT_OPEN],          [cb_ACT_OPEN_help]          },
        {    CB_ACT_CLOSE,        [cb_ACT_CLOSE],         [cb_ACT_CLOSE_help]         },
        {    CB_UPDATE_EVT,       [cb_UPDATE_EVT],        [cb_UPDATE_EVT_help]        },
        {    CB_SIMULATE,         [cb_SIMULATE],          [cb_SIMULATE_help]          },
        {    CB_DISTURBANCE,      [cb_DISTURBANCE],       [cb_DISTURBANCE_help]       },
        {    CB_CONTR_ERR,        [cb_CONTR_ERR],         [cb_CONTR_ERR_help]         },
        {    CB_CONTR_INACT,      [cb_CONTR_INACT],       [cb_CONTR_INACT_help]       },
        {    CB_SELFTEST,         [cb_SELFTEST],          [cb_SELFTEST_help]          },
        {    CB_TOT_VALVE_TRAV,   [cb_TOT_VALVE_TRAV],    [cb_TOT_VALVE_TRAV_help]    }
    }
    HANDLING    READ;
    STYLE      "MULTILINE 10 8" ;
}

VARIABLE func3_AO_1_simulate_value
{
    LABEL       [func_simulate_value];
    HELP        [func_ao_simulate_value_help];
    CLASS       CONTAINED;
    TYPE        FLOAT
    {
        DEFAULT_VALUE    0.0;
    }
    HANDLING    READ & WRITE;
}

VARIABLE func3_AO_1_simulate_status_quality
{
    LABEL       [status_quality];
    HELP        [func_simulate_status_help];
    CLASS       CONTAINED & DYNAMIC;
    TYPE        ENUMERATED (1)
    {
        DEFAULT_VALUE    0;
        STATUS_INPUT_NO_RCAS
    }
    POST_EDIT_ACTIONS
    {
        method_set_status_limit_func3_AO_1
    }
    HANDLING READ & WRITE;
}

func3_AO_1_simulate_status_limit                 LIKE VARIABLE    func3_AO_1_simulate_status_quality
{
    REDEFINE LABEL       [status_limit];
    REDEFINE TYPE        ENUMERATED (1)
    {
        STATUS_INPUT_LIMIT (func3_AO_1_simulate_status_quality)
    }
}

VARIABLE func3_AO_1_simulation_enabled
{
    LABEL       [func_simulation_enabled];
    HELP        [func_simulation_enabled_help];
    CLASS       CONTAINED;
    TYPE        ENUMERATED (1)
    {
        DEFAULT_VALUE    0;
        {    0,    [disabled]       },
        {    1,    [enabled]        }
    }
    HANDLING    READ & WRITE;
}

VARIABLE func3_AO_1_increase_close
{
    LABEL       [func_ao_increase_close];
    HELP        [func_ao_increase_close_help];
    CLASS       CONTAINED;
    TYPE        ENUMERATED (1)
    {
        DEFAULT_VALUE    0;
        {    0,    [func_ao_increase_close_RISING]      },
        {    1,    [func_ao_increase_close_FALLING]     }
    }
    HANDLING    READ & WRITE;
}

VARIABLE func3_AO_1_out_value
{
    LABEL       [func_out_value];
    HELP        [func_ao_out_value_help];
    CLASS       CONTAINED & DYNAMIC;
    TYPE        FLOAT
    {
        DEFAULT_VALUE    0.0;
        DISPLAY_FORMAT	DEF_DISPLAY_FORMAT(func3_AO_1_out_decimal_point)
    }
    HANDLING
        IF ((func3_AO_1_actual_mode == BLOCK_MODE_MAN) || (func3_AO_1_actual_mode == BLOCK_MODE_LO))
        {
            READ & WRITE;
        }
        ELSE {
            READ;
        }
}

VARIABLE func3_AO_1_out_status_quality
{
    LABEL       [status_quality];
    HELP        [func_out_status_help];
    CLASS       CONTAINED & DYNAMIC;
    TYPE        ENUMERATED (1)
    {
        DEFAULT_VALUE    0;
        IF ((func3_AO_1_actual_mode == BLOCK_MODE_MAN) || (func3_AO_1_actual_mode == BLOCK_MODE_LO))
        {
            STATUS_INPUT_NO_RCAS
        }
        ELSE {
            STATUS_OUTPUT_NO_RCAS
        }
    }
    POST_EDIT_ACTIONS
    {
        IF ((func3_AO_1_actual_mode == BLOCK_MODE_MAN) || (func3_AO_1_actual_mode == BLOCK_MODE_LO))
        {
            method_set_status_limit_func3_AO_1
        }
    }
    HANDLING
        IF ((func3_AO_1_actual_mode == BLOCK_MODE_MAN) || (func3_AO_1_actual_mode == BLOCK_MODE_LO))
        {
            READ & WRITE;
        }
        ELSE {
            READ;
        }
}

func3_AO_1_out_status_limit                      LIKE VARIABLE    func3_AO_1_out_status_quality
{
    REDEFINE LABEL       [status_limit];
    REDEFINE TYPE        ENUMERATED (1)
    {
        STATUS_OUTPUT_LIMIT
    }
}

VARIABLE func3_AO_1_out_upper_range_value
{
    LABEL       [func_out_scale_upper_value];
    HELP        [func_out_scale_upper_value_help];
    CLASS       CONTAINED;
    TYPE        FLOAT
    {
        DEFAULT_VALUE    9999.0;
        DISPLAY_FORMAT	DEF_DISPLAY_FORMAT(func3_AO_1_out_decimal_point)
    }
    HANDLING    READ & WRITE;
}

VARIABLE func3_AO_1_out_lower_range_value
{
    LABEL       [func_out_scale_lower_value];
    HELP        [func_out_scale_lower_value_help];
    CLASS       CONTAINED;
    TYPE        FLOAT
    {
        DEFAULT_VALUE    0.0;
        DISPLAY_FORMAT	DEF_DISPLAY_FORMAT(func3_AO_1_out_decimal_point)
    }
    HANDLING    READ & WRITE;
}

VARIABLE func3_AO_1_out_unit
{
    LABEL       [func_out_scale_unit];
    HELP        [func_out_scale_unit_help];
    CLASS       CONTAINED;
    TYPE        ENUMERATED (2)
    {
        DEFAULT_VALUE 1138;
        AO_UNIT
    }
    HANDLING    READ & WRITE;
}

func3_AO_1_out_decimal_point                     LIKE VARIABLE    func3_AO_1_pv_decimal_point
{
}

UNIT AO_1_PV_SCALE_UNIT
{
    func3_AO_1_pv_unit:

    func3_AO_1_pv_upper_range_value,
    func3_AO_1_pv_lower_range_value,
    func3_AO_1_readback_value,
    func3_AO_1_setpoint_value,
    func3_AO_1_rcas_in_value,
    func3_AO_1_rcas_out_value,
    func3_AO_1_fsafe_value
}

UNIT AO_1_OUT_SCALE_UNIT
{
    func3_AO_1_out_unit:

    func3_AO_1_out_value,
    func3_AO_1_out_upper_range_value,
    func3_AO_1_out_lower_range_value,
    func3_AO_1_simulate_value
}

/***********************************************************************/
/*    AO-1 : COMMAND                                                   */
/***********************************************************************/

COMMAND read_func3_AO_1_blk
{
    BLOCK func3_AO_1_block;
    INDEX 0;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_blk_reserve, func3_AO_1_blk_object, func3_AO_1_blk_parent_class, func3_AO_1_blk_class,
            func3_AO_1_blk_dd_reference, func3_AO_1_blk_dd_rev, func3_AO_1_blk_profile, func3_AO_1_blk_profile_rev,
            func3_AO_1_blk_execution_time, func3_AO_1_blk_num_parameters, func3_AO_1_blk_index_view_1,
            func3_AO_1_blk_num_view_lists
        }
    }
}

COMMAND read_func3_AO_1_st_rev
{
    BLOCK func3_AO_1_block;
    INDEX 1;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_st_rev
        }
    }
}

COMMAND read_func3_AO_1_tag_desc
{
    BLOCK func3_AO_1_block;
    INDEX 2;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_tag_desc
        }
    }
}

COMMAND write_func3_AO_1_tag_desc
{
    BLOCK func3_AO_1_block;
    INDEX 2;
    OPERATION WRITE;
    TRANSACTION
    {
        REQUEST
        {
            func3_AO_1_tag_desc
        }
        REPLY
        {
        }
    }
}

COMMAND read_func3_AO_1_strategy
{
    BLOCK func3_AO_1_block;
    INDEX 3;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_strategy
        }
    }
}

COMMAND write_func3_AO_1_strategy
{
    BLOCK func3_AO_1_block;
    INDEX 3;
    OPERATION WRITE;
    TRANSACTION
    {
        REQUEST
        {
            func3_AO_1_strategy
        }
        REPLY
        {
        }
    }
}

COMMAND read_func3_AO_1_alert_key
{
    BLOCK func3_AO_1_block;
    INDEX 4;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_alert_key
        }
    }
}

COMMAND write_func3_AO_1_alert_key
{
    BLOCK func3_AO_1_block;
    INDEX 4;
    OPERATION WRITE;
    TRANSACTION
    {
        REQUEST
        {
            func3_AO_1_alert_key
        }
        REPLY
        {
        }
    }
}

COMMAND read_func3_AO_1_target_mode
{
    BLOCK func3_AO_1_block;
    INDEX 5;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_target_mode
        }
    }
}

COMMAND write_func3_AO_1_target_mode
{
    BLOCK func3_AO_1_block;
    INDEX 5;
    OPERATION WRITE;
    TRANSACTION
    {
        REQUEST
        {
            func3_AO_1_target_mode
        }
        REPLY
        {
        }
    }
}

COMMAND read_func3_AO_1_mode
{
    BLOCK func3_AO_1_block;
    INDEX 6;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
             func3_AO_1_actual_mode, func3_AO_1_permitted_mode, func3_AO_1_normal_mode
        }
    }
}

COMMAND read_func3_AO_1_alarm
{
    BLOCK func3_AO_1_block;
    INDEX 7;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_current_state_alarm_sum, func3_AO_1_unacknowledged_state_alarm_sum,
            func3_AO_1_unreported_state_alarm_sum, func3_AO_1_disabled_state_alarm_sum
        }
    }
}

COMMAND read_func3_AO_1_batch_information
{
    BLOCK func3_AO_1_block;
    INDEX 8;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_batch_id, func3_AO_1_batch_unit, func3_AO_1_batch_operation, func3_AO_1_batch_phase
        }
    }
}

COMMAND write_func3_AO_1_batch_information
{
    BLOCK func3_AO_1_block;
    INDEX 8;
    OPERATION WRITE;
    TRANSACTION
    {
        REQUEST
        {
            func3_AO_1_batch_id, func3_AO_1_batch_unit, func3_AO_1_batch_operation, func3_AO_1_batch_phase
        }
        REPLY
        {
        }
    }
}

COMMAND read_func3_AO_1_setpoint
{
    BLOCK func3_AO_1_block;
    INDEX 9;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_setpoint_value,
            func3_AO_1_setpoint_status_quality <0xFC>,
            func3_AO_1_setpoint_status_limit   <0x03>
        }
    }
}

COMMAND write_func3_AO_1_setpoint
{
    BLOCK func3_AO_1_block;
    INDEX 9;
    OPERATION WRITE;
    TRANSACTION
    {
        REQUEST
        {
            func3_AO_1_setpoint_value,
            func3_AO_1_setpoint_status_quality <0xFC>,
            func3_AO_1_setpoint_status_limit   <0x03>
        }
        REPLY
        {
        }
    }
}

COMMAND read_func3_AO_1_pv
{
    BLOCK func3_AO_1_block;
    INDEX 11;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_pv_upper_range_value, func3_AO_1_pv_lower_range_value,
            func3_AO_1_pv_unit, func3_AO_1_pv_decimal_point
        }
    }
}

COMMAND write_func3_AO_1_pv
{
    BLOCK func3_AO_1_block;
    INDEX 11;
    OPERATION WRITE;
    TRANSACTION
    {
        REQUEST
        {
            func3_AO_1_pv_upper_range_value, func3_AO_1_pv_lower_range_value,
            func3_AO_1_pv_unit, func3_AO_1_pv_decimal_point
        }
        REPLY
        {
        }
    }
}

COMMAND read_func3_AO_1_readback
{
    BLOCK func3_AO_1_block;
    INDEX 12;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_readback_value,
            func3_AO_1_readback_status_quality <0xFC>,
            func3_AO_1_readback_status_limit   <0x03>
        }
    }
}

COMMAND read_func3_AO_1_rcas_in
{
    BLOCK func3_AO_1_block;
    INDEX 14;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_rcas_in_value,
            func3_AO_1_rcas_in_status_quality <0xFC>,
            func3_AO_1_rcas_in_status_limit   <0x03>
        }
    }
}

COMMAND write_func3_AO_1_rcas_in
{
    BLOCK func3_AO_1_block;
    INDEX 14;
    OPERATION WRITE;
    TRANSACTION
    {
        REQUEST
        {
            func3_AO_1_rcas_in_value,
            func3_AO_1_rcas_in_status_quality <0xFC>,
            func3_AO_1_rcas_in_status_limit   <0x03>
        }
        REPLY
        {
        }
    }
}

COMMAND read_func3_AO_1_in_channel
{
    BLOCK func3_AO_1_block;
    INDEX 21;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_in_channel
        }
    }
}

COMMAND write_func3_AO_1_in_channel
{
    BLOCK func3_AO_1_block;
    INDEX 21;
    OPERATION WRITE;
    TRANSACTION
    {
        REQUEST
        {
            func3_AO_1_in_channel
        }
        REPLY
        {
        }
    }
}

COMMAND read_func3_AO_1_out_channel
{
    BLOCK func3_AO_1_block;
    INDEX 22;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_out_channel
        }
    }
}

COMMAND write_func3_AO_1_out_channel
{
    BLOCK func3_AO_1_block;
    INDEX 22;
    OPERATION WRITE;
    TRANSACTION
    {
        REQUEST
        {
            func3_AO_1_out_channel
        }
        REPLY
        {
        }
    }
}

COMMAND read_func3_AO_1_fsafe_time
{
    BLOCK func3_AO_1_block;
    INDEX 23;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_fsafe_time
        }
    }
}

COMMAND write_func3_AO_1_fsafe_time
{
    BLOCK func3_AO_1_block;
    INDEX 23;
    OPERATION WRITE;
    TRANSACTION
    {
        REQUEST
        {
            func3_AO_1_fsafe_time
        }
        REPLY
        {
        }
    }
}

COMMAND read_func3_AO_1_fsafe_type
{
    BLOCK func3_AO_1_block;
    INDEX 24;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_fsafe_type
        }
    }
}

COMMAND write_func3_AO_1_fsafe_type
{
    BLOCK func3_AO_1_block;
    INDEX 24;
    OPERATION WRITE;
    TRANSACTION
    {
        REQUEST
        {
            func3_AO_1_fsafe_type
        }
        REPLY
        {
        }
    }
}

COMMAND read_func3_AO_1_fsafe_value
{
    BLOCK func3_AO_1_block;
    INDEX 25;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_fsafe_value
        }
    }
}

COMMAND write_func3_AO_1_fsafe_value
{
    BLOCK func3_AO_1_block;
    INDEX 25;
    OPERATION WRITE;
    TRANSACTION
    {
        REQUEST
        {
            func3_AO_1_fsafe_value
        }
        REPLY
        {
        }
    }
}

COMMAND read_func3_AO_1_rcas_out
{
    BLOCK func3_AO_1_block;
    INDEX 27;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_rcas_out_value,
            func3_AO_1_rcas_out_status_quality <0xFC>,
            func3_AO_1_rcas_out_status_limit   <0x03>
        }
    }
}

COMMAND read_func3_AO_1_current_position
{
    BLOCK func3_AO_1_block;
    INDEX 31;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_position_discrete_value,
            func3_AO_1_position_discrete_status_quality <0xFC>,
            func3_AO_1_position_discrete_status_limit   <0x03>
        }
    }
}

COMMAND read_func3_AO_1_check_back
{
    BLOCK func3_AO_1_block;
    INDEX 33;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_check_back
        }
    }
}

COMMAND read_func3_AO_1_check_back_mask
{
    BLOCK func3_AO_1_block;
    INDEX 34;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_check_back_mask
        }
    }
}

COMMAND read_func3_AO_1_simulate
{
    BLOCK func3_AO_1_block;
    INDEX 35;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_simulate_status_quality <0xFC>,
            func3_AO_1_simulate_status_limit   <0x03>,
            func3_AO_1_simulate_value,
            func3_AO_1_simulation_enabled
        }
    }
}

COMMAND write_func3_AO_1_simulate
{
    BLOCK func3_AO_1_block;
    INDEX 35;
    OPERATION WRITE;
    TRANSACTION
    {
        REQUEST
        {
            func3_AO_1_simulate_status_quality <0xFC>,
            func3_AO_1_simulate_status_limit   <0x03>,
            func3_AO_1_simulate_value,
            func3_AO_1_simulation_enabled
        }
        REPLY
        {
        }
    }
}

COMMAND read_func3_AO_1_increase_close
{
    BLOCK func3_AO_1_block;
    INDEX 36;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_increase_close
        }
    }
}

COMMAND write_func3_AO_1_increase_close
{
    BLOCK func3_AO_1_block;
    INDEX 36;
    OPERATION WRITE;
    TRANSACTION
    {
        REQUEST
        {
            func3_AO_1_increase_close
        }
        REPLY
        {
        }
    }
}

COMMAND read_func3_AO_1_out
{
    BLOCK func3_AO_1_block;
    INDEX 37;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_out_value,
            func3_AO_1_out_status_quality <0xFC>,
            func3_AO_1_out_status_limit   <0x03>
        }
    }
}

COMMAND write_func3_AO_1_out
{
    BLOCK func3_AO_1_block;
    INDEX 37;
    OPERATION WRITE;
    TRANSACTION
    {
        REQUEST
        {
            func3_AO_1_out_value,
            func3_AO_1_out_status_quality <0xFC>,
            func3_AO_1_out_status_limit   <0x03>
        }
        REPLY
        {
        }
    }
}

COMMAND read_func3_AO_1_out_scale
{
    BLOCK func3_AO_1_block;
    INDEX 38;
    OPERATION READ;
    TRANSACTION
    {
        REQUEST
        {
        }
        REPLY
        {
            func3_AO_1_out_upper_range_value, func3_AO_1_out_lower_range_value,
            func3_AO_1_out_unit, func3_AO_1_out_decimal_point
        }
    }
}

COMMAND write_func3_AO_1_out_scale
{
    BLOCK func3_AO_1_block;
    INDEX 38;
    OPERATION WRITE;
    TRANSACTION
    {
        REQUEST
        {
            func3_AO_1_out_upper_range_value, func3_AO_1_out_lower_range_value,
            func3_AO_1_out_unit, func3_AO_1_out_decimal_point
        }
        REPLY
        {
        }
    }
}

/***********************************************************************/
/*    AO-1 : MENUs                                                     */
/***********************************************************************/

MENU Tab_s_AO_1
{
    LABEL       [MT_AO_1];
    ITEMS
    {
        Tab_s_basic_AO_1,
        Tab_s_advanced_AO_1
    }
}

MENU Tab_s_basic_AO_1
{
    LABEL       [MT_Tab_basic];
    ITEMS
    {
        //Tab_s_target_mode_AO_1,
        //Tab_s_channel_in_AO_1,
        //Tab_s_channel_out_AO_1,
        Tab_s_direction_AO_1,
        Tab_s_scale_pv_AO_1,
        Tab_s_scale_out_AO_1
    }
}

MENU Tab_s_advanced_AO_1
{
    LABEL       [MT_Tab_advanced];
    ITEMS
    {
        Tab_s_fault_set_AO_1,
        Tab_s_batch_AO_1
    }
}

MENU Tab_s_target_mode_AO_1
{
    LABEL       [MT_Select_Block_Mode];
    ITEMS
    {
        func3_AO_1_target_mode
    }
}

MENU Tab_s_channel_in_AO_1
{
    LABEL       [MT_Tab_channel_in];
    ITEMS
    {
        func3_AO_1_in_channel
    }
}

MENU Tab_s_channel_out_AO_1
{
    LABEL       [MT_Tab_channel_out];
    ITEMS
    {
        func3_AO_1_out_channel
    }
}


MENU Tab_s_scale_pv_AO_1
{
    LABEL       [MT_Set_Scale_of_Input_Value];
    ITEMS
    {
        func3_AO_1_pv_upper_range_value,
        func3_AO_1_pv_lower_range_value,
        func3_AO_1_pv_unit,
        func3_AO_1_pv_decimal_point
    }
}

MENU Tab_s_scale_out_AO_1
{
    LABEL       [MT_Set_Scale_of_Output_Value];
    ITEMS
    {
        func3_AO_1_out_upper_range_value,
        func3_AO_1_out_lower_range_value,
        func3_AO_1_out_unit,
        func3_AO_1_out_decimal_point
    }
}

MENU Tab_s_direction_AO_1
{
    LABEL       [MT_Select_pos_act_action];
    ITEMS
    {
        func3_AO_1_increase_close
    }
}

MENU Tab_s_fault_set_AO_1
{
    LABEL       [MT_Set_Fail_Safe_Values];
    ITEMS
    {
        func3_AO_1_fsafe_type,
        func3_AO_1_fsafe_time,
        func3_AO_1_fsafe_value
    }
}

MENU Tab_s_batch_AO_1
{
    LABEL       [MT_Define_Batch_Info];
    ITEMS
    {
        func3_AO_1_batch_id,
        func3_AO_1_batch_unit,
        func3_AO_1_batch_operation,
        func3_AO_1_batch_phase
    }
}


MENU Tab_m_AO_1
{
    LABEL       [MT_AO_1];
    ITEMS
    {
        Tab_m_basic_AO_1,
        Tab_m_advanced_AO_1
    }
}

MENU Tab_m_basic_AO_1
{
    LABEL       [MT_Tab_basic];
    ITEMS
    {
        Tab_m_target_mode_AO_1,
        //Tab_m_channel_in_AO_1,
        //Tab_m_channel_out_AO_1,
        Tab_m_direction_AO_1,
        Tab_m_scale_pv_AO_1,
        Tab_m_scale_out_AO_1
    }
}

MENU Tab_m_advanced_AO_1
{
    LABEL       [MT_Tab_advanced];
    ITEMS
    {
        Tab_m_fault_set_AO_1,
        Tab_m_batch_AO_1
    }
}

MENU Tab_m_target_mode_AO_1
{
    LABEL       [MT_Select_Block_Mode];
    ITEMS
    {
        func3_AO_1_target_mode  (READ_ONLY)
    }
}

MENU Tab_m_channel_in_AO_1
{
    LABEL       [MT_Tab_channel_in];
    ITEMS
    {
        func3_AO_1_in_channel  (READ_ONLY)
    }
}

MENU Tab_m_channel_out_AO_1
{
    LABEL       [MT_Tab_channel_out];
    ITEMS
    {
        func3_AO_1_out_channel  (READ_ONLY)
    }
}


MENU Tab_m_scale_pv_AO_1
{
    LABEL       [MT_Set_Scale_of_Input_Value];
    ITEMS
    {
        func3_AO_1_pv_upper_range_value  (READ_ONLY),
        func3_AO_1_pv_lower_range_value  (READ_ONLY),
        func3_AO_1_pv_unit  (READ_ONLY),
        func3_AO_1_pv_decimal_point  (READ_ONLY)
    }
}

MENU Tab_m_scale_out_AO_1
{
    LABEL       [MT_Set_Scale_of_Output_Value];
    ITEMS
    {
        func3_AO_1_out_upper_range_value  (READ_ONLY),
        func3_AO_1_out_lower_range_value  (READ_ONLY),
        func3_AO_1_out_unit  (READ_ONLY),
        func3_AO_1_out_decimal_point  (READ_ONLY)
    }
}

MENU Tab_m_direction_AO_1
{
    LABEL       [MT_Select_pos_act_action];
    ITEMS
    {
        func3_AO_1_increase_close  (READ_ONLY)
    }
}

MENU Tab_m_fault_set_AO_1
{
    LABEL       [MT_Set_Fail_Safe_Values];
    ITEMS
    {
        func3_AO_1_fsafe_type  (READ_ONLY),
        func3_AO_1_fsafe_time  (READ_ONLY),
        func3_AO_1_fsafe_value  (READ_ONLY)
    }
}

MENU Tab_m_batch_AO_1
{
    LABEL       [MT_Define_Batch_Info];
    ITEMS
    {
        func3_AO_1_batch_id,
        func3_AO_1_batch_unit,
        func3_AO_1_batch_operation,
        func3_AO_1_batch_phase
    }
}

/*---------------------------------------------------------------------*/
/*    AO-1 : Online-Windows                                            */
/*---------------------------------------------------------------------*/

MENU Page_display_AO_1
{
    LABEL       [MT_AO_1];
    ITEMS
    {
        BarVal_display_readback_AO_1,
        Group_display_readback_AO_1
        Group_display_setpoint_AO_1,
        func3_AO_1_position_discrete_value,
        func3_AO_1_check_back,
        Group_display_out_AO_1
    }
}


#if _PDM_ < 800
MENU BarVal_display_readback_AO_1
{
    LABEL       [MT_readback];
    ITEMS
    {
        func3_AO_1_readback_value,
        func3_AO_1_pv_lower_range_value        (READ_ONLY),
        func3_AO_1_pv_upper_range_value        (READ_ONLY)
    }
}

#else
CHART BarVal_display_readback_AO_1
{
     LABEL [MT_readback];
#ifdef _DTM_
     TYPE          STRIP;
     WIDTH         LARGE;
     HEIGHT        XX_LARGE;
#else
     TYPE HORIZONTAL_BAR;
#endif
     MEMBERS
     {
          SOURCE1, sourceHorBarGraph5;
     }
}

SOURCE sourceHorBarGraph5
{
	LABEL [func_ao_readback_value];
	Y_AXIS axisHorBarGraph5;
	MEMBERS
	{
		VALUE1, func3_AO_1_readback_value;
	}
}

AXIS axisHorBarGraph5
{
	LABEL [MT_readback];
	MIN_VALUE	func3_AO_1_pv_lower_range_value;
	MAX_VALUE	func3_AO_1_pv_upper_range_value;
}
#endif


MENU Group_display_readback_AO_1
{
    LABEL       [MT_readback];
    ITEMS
    {
        func3_AO_1_readback_value,
        COLUMNBREAK,
        func3_AO_1_readback_status_quality,
        func3_AO_1_readback_status_limit
    }
}

MENU Group_display_setpoint_AO_1
{
    LABEL       [func_ao_setpoint_value];
    ITEMS
    {
        func3_AO_1_setpoint_value          (READ_ONLY),
        COLUMNBREAK,
        func3_AO_1_setpoint_status_quality (READ_ONLY),
        func3_AO_1_setpoint_status_limit   (READ_ONLY)
    }
}

MENU Group_display_out_AO_1
{
    LABEL       [menu_dialog_display_output];
    ITEMS
    {
        func3_AO_1_out_value          (READ_ONLY),
        COLUMNBREAK,
        func3_AO_1_out_status_quality (READ_ONLY),
        func3_AO_1_out_status_limit   (READ_ONLY)
    }
}

MENU Page_diagnosis_func3_AO_1
{
    LABEL       [MT_AO_1];
    ITEMS
    {
        func3_AO_1_blk_object,
        func3_AO_1_blk_parent_class,
        func3_AO_1_blk_class,
        func3_AO_1_blk_dd_reference,
        func3_AO_1_blk_dd_rev,
        func3_AO_1_blk_profile,
        func3_AO_1_blk_profile_rev,
        func3_AO_1_st_rev,
        func3_AO_1_actual_mode,
        func3_AO_1_simulation_enabled (READ_ONLY)
    }
}

/*---------------------------------------------------------------------*/
/*    AO-1 : Online-Dialogs                                            */
/*---------------------------------------------------------------------*/

MENU OnlineDialog_AO_1_setting
{
    LABEL       [MT_Block_Mode_AO_1];
    ITEMS
    {
        Page_mode_AO_1,
        Page_actuator_AO_1
    }
}

MENU Page_mode_AO_1
{
    LABEL       [MT_Config_Block_Mode];
    ITEMS
    {
        Group_mode_AO_1,
        Group_output_AO_1,
        Group_setpoint_AO_1,
        Group_rcas_in_AO_1,
        Group_rcas_out_AO_1,
/*        Group_readback_AO_1,*/
        method_set
    }
}


MENU Group_mode_AO_1
{
    LABEL       [MT_Config_Block_Mode];
    ITEMS
    {
        func3_AO_1_target_mode,
        COLUMNBREAK,
        func3_AO_1_actual_mode
    }
}

MENU Group_output_AO_1
{
    LABEL       [MT_output_online];
    ITEMS
    {
        func3_AO_1_out_value,
        COLUMNBREAK,
        func3_AO_1_out_status_quality,
        func3_AO_1_out_status_limit
    }
}

MENU Group_setpoint_AO_1
{
    LABEL       [MT_setpoint_online];
    ITEMS
    {
        func3_AO_1_setpoint_value,
        COLUMNBREAK,
        func3_AO_1_setpoint_status_quality,
        func3_AO_1_setpoint_status_limit
    }
}

MENU Group_rcas_in_AO_1
{
    LABEL       [MT_rcas_in_online];
    ITEMS
    {
        func3_AO_1_rcas_in_value,
        COLUMNBREAK,
        func3_AO_1_rcas_in_status_quality,
        func3_AO_1_rcas_in_status_limit
    }
}

MENU Group_rcas_out_AO_1
{
    LABEL       [MT_rcas_out_online];
    ITEMS
    {
        func3_AO_1_rcas_out_value,
        COLUMNBREAK,
        func3_AO_1_rcas_out_status_quality,
        func3_AO_1_rcas_out_status_limit
    }
}

MENU Page_actuator_AO_1
{
    LABEL       [MT_feedback];
    ITEMS
    {
        Group_readback_AO_1,
        Group_pos_d_AO_1,
        func3_AO_1_check_back,
        func3_AO_1_current_state_alarm_sum
    }
}

MENU Group_pos_d_AO_1
{
    LABEL       [MT_pos_d];
    ITEMS
    {
        func3_AO_1_position_discrete_value,
        COLUMNBREAK,
        func3_AO_1_position_discrete_status_quality,
        func3_AO_1_position_discrete_status_limit
    }
}

MENU Group_readback_AO_1
{
    LABEL       [MT_readback];
    ITEMS
    {
        func3_AO_1_readback_value,
        COLUMNBREAK,
        func3_AO_1_readback_status_quality,
        func3_AO_1_readback_status_limit
    }
}

MENU OnlineDialog_simulation_AO_1
{
    LABEL       [MT_Simulate_AO_1];
    ITEMS
    {
        Page_simulation_AO_1,
        Page_simulation_out_AO_1
    }
}

MENU Page_simulation_AO_1
{
    LABEL       [menu_dialog_simulation_input];
    ITEMS
    {
        func3_AO_1_simulation_enabled,
        Group_simulate_value_AO_1,
        Group_readback_AO_1,
        method_set
    }
}

MENU Group_simulate_value_AO_1
{
    LABEL     [func_simulate_value];
    ITEMS
    {
        func3_AO_1_simulate_value,
        COLUMNBREAK,
        func3_AO_1_simulate_status_quality,
        func3_AO_1_simulate_status_limit
    }
}

MENU Page_simulation_out_AO_1
{
    LABEL       [menu_dialog_simulation_output];
    ITEMS
    {
        Group_mode_AO_1,
        Group_output_AO_1,
        method_set
    }
}

/*---------------------------------------------------------------------*/
/*    AO-1 : Offline-Windows                                           */
/*---------------------------------------------------------------------*/

MENU OfflineWindow_AO_1_geral
{
    LABEL       [MT_AO_1];
    ITEMS
    {
        Page_basic_AO_1,
        Page_scale_AO_1,
        Page_advanced_AO_1
    }
}

MENU Page_basic_AO_1
{
    LABEL       [MT_Tab_basic];
    ITEMS
    {
        Group_target_mode_AO_1,
        Group_channel_in_out_AO_1,
        Group_direction_AO_1
    }
}

MENU Page_scale_AO_1
{
    LABEL       [MT_scales_units];
    ITEMS
    {
        Group_scale_pv_AO_1,
        Group_scale_out_AO_1
    }
}

MENU Page_advanced_AO_1
{
    LABEL       [MT_Tab_advanced];
    ITEMS
    {
        Group_fault_set_AO_1,
        Group_batch_AO_1
    }
}

MENU Page_batch_AO_1
{
    LABEL       [MT_Batch_Info];
    ITEMS
    {
        Group_batch_AO_1
    }
}


MENU Group_target_mode_AO_1
{
    LABEL       [MT_Config_Block_Mode];
    ITEMS
    {
        func3_AO_1_target_mode,
        COLUMNBREAK,
        method_write_target_mode_AO_1
    }
}

MENU Group_channel_in_out_AO_1
{
    LABEL       [MT_group_channel_in_out];
    ITEMS
    {
        func3_AO_1_in_channel,
        func3_AO_1_out_channel,
        COLUMNBREAK,
        method_write_channel_in_AO_1
        method_write_channel_out_AO_1
    }
}

MENU Group_scale_pv_AO_1
{
    LABEL     [MT_Set_Scale_of_Input_Value];
    ITEMS
    {
        func3_AO_1_pv_upper_range_value,
        func3_AO_1_pv_lower_range_value,
        func3_AO_1_pv_unit,
        COLUMNBREAK,
        method_write_scale_in_AO_1
    }
}

MENU Group_scale_out_AO_1
{
    LABEL     [MT_Set_Scale_of_Output_Value];
    ITEMS
    {
        func3_AO_1_out_upper_range_value,
        func3_AO_1_out_lower_range_value,
        func3_AO_1_out_unit (READ_ONLY),
        COLUMNBREAK,
        method_write_scale_out_AO_1
    }
}

MENU Group_direction_AO_1
{
    LABEL       [MT_Select_pos_act_action];
    ITEMS
    {
        func3_AO_1_increase_close,
        COLUMNBREAK,
        method_write_direction_AO_1
    }
}


MENU Group_fault_set_AO_1
{
    LABEL     [MT_Set_Fail_Safe_Values];
    ITEMS
    {
        func3_AO_1_fsafe_type,
        func3_AO_1_fsafe_value,
        func3_AO_1_fsafe_time,
        COLUMNBREAK,
        method_write_fail_AO_1
    }
}

MENU Group_batch_AO_1
{
    LABEL       [MT_Define_Batch_Info];
    ITEMS
    {
        func3_AO_1_batch_id,
        func3_AO_1_batch_unit,
        func3_AO_1_batch_operation,
        func3_AO_1_batch_phase,
        COLUMNBREAK,
        method_write_batch_AO_1
    }
}

/*---------------------------------------------------------------------*/
/*    AO-1 : Methods                                                   */
/*---------------------------------------------------------------------*/

METHOD method_set_status_limit_func3_AO_1
{
    CLASS       INPUT;
    LABEL       "set status limit";
    DEFINITION
    {
        int    quality;
        int block_mode;

        quality = ivar_value(func3_AO_1_setpoint_status_quality);
        if ((quality == 0x20) || (quality == 0x30))
            iassign(func3_AO_1_setpoint_status_limit, 0);

        quality = ivar_value(func3_AO_1_rcas_in_status_quality);
        if ((quality == 0x20) || (quality == 0x30))
            iassign(func3_AO_1_rcas_in_status_limit, 0);

        quality = ivar_value(func3_AO_1_simulate_status_quality);
        if ((quality == 0x20) || (quality == 0x30))
            iassign(func3_AO_1_simulate_status_limit, 0);

        block_mode    = ivar_value(func3_AO_1_target_mode);
        quality        = ivar_value(func3_AO_1_out_status_quality);
        if (((block_mode == BLOCK_MODE_MAN) || (block_mode == BLOCK_MODE_LO)) && ((quality == 0x20) || (quality == 0x30)))
            iassign(func3_AO_1_out_status_limit, 0);
    }
}

METHOD method_write_target_mode_AO_1
{
    LABEL       [MT_Write];
    DEFINITION
    {
        WriteCommand(write_func3_AO_1_target_mode);
        ReadCommand(read_func3_AO_1_target_mode);
    }
}

METHOD method_write_channel_in_AO_1
{
    LABEL       [MT_Write];
    DEFINITION
    {
        WriteCommand(write_func3_AO_1_in_channel);
        ReadCommand(read_func3_AO_1_in_channel);
    }
}

METHOD method_write_channel_out_AO_1
{
    LABEL       [MT_Write];
    DEFINITION
    {
        WriteCommand(write_func3_AO_1_out_channel);
        ReadCommand(read_func3_AO_1_out_channel);
    }
}

METHOD method_write_direction_AO_1
{
    LABEL       [MT_Write];
    DEFINITION
    {
        WriteCommand(write_func3_AO_1_increase_close);
        ReadCommand(read_func3_AO_1_increase_close);
    }
}


METHOD method_write_scale_in_AO_1
{
    LABEL       [MT_Write];
    DEFINITION
    {
        WriteCommand(write_func3_AO_1_pv);
        ReadCommand(read_func3_AO_1_pv);
    }
}

METHOD method_write_scale_out_AO_1
{
    LABEL       [MT_Write];
    DEFINITION
    {
        WriteCommand(write_func3_AO_1_out_scale);
        ReadCommand(read_func3_AO_1_out_scale);
    }
}

METHOD method_write_fail_AO_1
{
    LABEL       [MT_Write];
    DEFINITION
    {
        WriteCommand(write_func3_AO_1_fsafe_type);
        WriteCommand(write_func3_AO_1_fsafe_time);
        WriteCommand(write_func3_AO_1_fsafe_value);
        ReadCommand(read_func3_AO_1_fsafe_type);
        ReadCommand(read_func3_AO_1_fsafe_time);
        ReadCommand(read_func3_AO_1_fsafe_value);
    }
}

METHOD method_write_batch_AO_1
{
    LABEL       [MT_Write];
    DEFINITION
    {
        WriteCommand(write_func3_AO_1_batch_information);
    }
}

/***********************************************************************/
/*    ALL AO Function Block : MENUs                                    */
/***********************************************************************/

MENU Menu_AO_off
{
    LABEL       [menu_output_AO];
    ITEMS
    {
        OfflineWindow_AO_1_geral
    }
}

MENU Menu_AO_on
{
    LABEL       [menu_output_AO];
    ITEMS
    {
        OnlineDialog_AO_1_setting
    }
}

MENU Menu_simulate_AO
{
    LABEL       [MT_Simulate_AO];
    ITEMS
    {
        OnlineDialog_simulation_AO_1
    }
}
