
VARIABLE CountOfHRData
{
	LABEL "";
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE INTEGER(2);
	DEFAULT_VALUE 0;
	VALIDITY TRUE;
}

VARIABLE Eventlog_Message_1
{
	LABEL "";
	VALIDITY IF (CountOfHRData >= 1) { TRUE; } ELSE { FALSE; } 
	HANDLING READ & WRITE;
	CLASS LOCAL;
	TYPE ASCII(14);
}
Eventlog_Message_2 LIKE VARIABLE Eventlog_Message_1{ REDEFINE VALIDITY IF (CountOfHRData >= 2) { TRUE; } ELSE { FALSE; } }
Eventlog_Message_3 LIKE VARIABLE Eventlog_Message_1{ REDEFINE VALIDITY IF (CountOfHRData >= 3) { TRUE; } ELSE { FALSE; } }
Eventlog_Message_4 LIKE VARIABLE Eventlog_Message_1{ REDEFINE VALIDITY IF (CountOfHRData >= 4) { TRUE; } ELSE { FALSE; } }
Eventlog_Message_5 LIKE VARIABLE Eventlog_Message_1{ REDEFINE VALIDITY IF (CountOfHRData >= 5) { TRUE; } ELSE { FALSE; } }
Eventlog_Message_6 LIKE VARIABLE Eventlog_Message_1{ REDEFINE VALIDITY IF (CountOfHRData >= 6) { TRUE; } ELSE { FALSE; } }
Eventlog_Message_7 LIKE VARIABLE Eventlog_Message_1{ REDEFINE VALIDITY IF (CountOfHRData >= 7) { TRUE; } ELSE { FALSE; } }
Eventlog_Message_8 LIKE VARIABLE Eventlog_Message_1{ REDEFINE VALIDITY IF (CountOfHRData >= 8) { TRUE; } ELSE { FALSE; } }
Eventlog_Message_9 LIKE VARIABLE Eventlog_Message_1{ REDEFINE VALIDITY IF (CountOfHRData >= 9) { TRUE; } ELSE { FALSE; } }
Eventlog_Message_10 LIKE VARIABLE Eventlog_Message_1{ REDEFINE VALIDITY IF (CountOfHRData >= 10) { TRUE; } ELSE { FALSE; } }

VARIABLE HelpByte_1
{
	LABEL "";
	CLASS LOCAL;
	VALIDITY TRUE;
	TYPE UNSIGNED_INTEGER(1);
}
HelpByte_2 LIKE VARIABLE HelpByte_1
{
	REDEFINE LABEL "";
}
HelpByte_3 LIKE VARIABLE HelpByte_1
{
	REDEFINE LABEL "";
}
HelpByte_4 LIKE VARIABLE HelpByte_1
{
	REDEFINE LABEL "";
}
HelpByte_5 LIKE VARIABLE HelpByte_1
{
	REDEFINE LABEL "";
}
HelpByte_6 LIKE VARIABLE HelpByte_1
{
	REDEFINE LABEL "";
}
HelpByte_7 LIKE VARIABLE HelpByte_1
{
	REDEFINE LABEL "";
}
HelpByte_8 LIKE VARIABLE HelpByte_1
{
	REDEFINE LABEL "";
}
HelpByte_9 LIKE VARIABLE HelpByte_1
{
	REDEFINE LABEL "";
}
HelpByte_10 LIKE VARIABLE HelpByte_1
{
	REDEFINE LABEL "";
}

ARRAY OF VARIABLE block_data_evl_union_array
{
	ELEMENTS
	{
		0, HelpDWORD_1;
		1, HelpDWORD_2;
		2, HelpDWORD_3;
		3, HelpDWORD_4;
		4, HelpDWORD_5;
		5, HelpDWORD_6;
		6, HelpDWORD_7;
		7, HelpDWORD_8;
		8, HelpDWORD_9;
		9, HelpDWORD_10;
	}
}

ARRAY OF VARIABLE block_data_evl_class_array
{
	ELEMENTS
	{
		0, HelpByte_1;
		1, HelpByte_2;
		2, HelpByte_3;
		3, HelpByte_4;
		4, HelpByte_5;
	}
}

cur_device_byte_count LIKE VARIABLE device_byte_count { REDEFINE LABEL ""; }

#define STATUS_OUT_OK         0x00
#define STATUS_IN_OK          0x80
#define STATUS_OUT_MAINTENANCE    0x04
#define STATUS_IN_MAINTENANCE     0x84
#define STATUS_OUT_FAILURE    0x01
#define STATUS_IN_FAILURE     0x81
#define STATUS_OUT_OUTOFRANGE 0x08
#define STATUS_IN_OUTOFRANGE  0x88
#define STATUS_OUT_CHECK  0x02
#define STATUS_IN_CHECK   0x82
#define STATUS_INFO	          0x10

VARIABLE Eventlog_Status_1
{
	LABEL "";
	VALIDITY IF (CountOfHRData >= 1) { TRUE; } ELSE { FALSE; }
	HANDLING READ;
	CLASS LOCAL;
	TYPE 
	ENUMERATED (4)
	{
		ENUMLIST_DeviceStates_ENUM32,\
		ENUMLIST_DeviceStates2_ENUM32,\
		ENUMLIST_DeviceStates3_ENUM32
	}
}

Eventlog_Status_2 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 2) { TRUE; } ELSE { FALSE; } }
Eventlog_Status_3 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 3) { TRUE; } ELSE { FALSE; } }
Eventlog_Status_4 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 4) { TRUE; } ELSE { FALSE; } }
Eventlog_Status_5 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 5) { TRUE; } ELSE { FALSE; } }
Eventlog_Status_6 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 6) { TRUE; } ELSE { FALSE; } }
Eventlog_Status_7 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 7) { TRUE; } ELSE { FALSE; } }
Eventlog_Status_8 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 8) { TRUE; } ELSE { FALSE; } }
Eventlog_Status_9 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 9) { TRUE; } ELSE { FALSE; } }
Eventlog_Status_10 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 10) { TRUE; } ELSE { FALSE; } }

Eventlog_Image_Status_1 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 1) { TRUE; } ELSE { FALSE; } }
Eventlog_Image_Status_2 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 2) { TRUE; } ELSE { FALSE; } }
Eventlog_Image_Status_3 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 3) { TRUE; } ELSE { FALSE; } }
Eventlog_Image_Status_4 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 4) { TRUE; } ELSE { FALSE; } }
Eventlog_Image_Status_5 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 5) { TRUE; } ELSE { FALSE; } }
Eventlog_Image_Status_6 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 6) { TRUE; } ELSE { FALSE; } }
Eventlog_Image_Status_7 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 7) { TRUE; } ELSE { FALSE; } }
Eventlog_Image_Status_8 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 8) { TRUE; } ELSE { FALSE; } }
Eventlog_Image_Status_9 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 9) { TRUE; } ELSE { FALSE; } }
Eventlog_Image_Status_10 LIKE VARIABLE Eventlog_Status_1{ REDEFINE VALIDITY IF (CountOfHRData >= 10) { TRUE; } ELSE { FALSE; } }

IMAGE Image_Eventlog_Status_1
{
	LINK Method_GetMI_Eventlog_Status_1;

	PATH  SELECT((Eventlog_Image_Status_1 >> 24) & 0xff)
	{
		CASE STATUS_OUT_OK: "11670501_FMCS_ok_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OK: "11670501_FMCS_ok_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_MAINTENANCE: "11670501_FMCS_maintenance_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_MAINTENANCE: "11670501_FMCS_maintenance_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_FAILURE: "11670501_FMCS_failure_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_FAILURE: "11670501_FMCS_failure_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_OUTOFRANGE: "11670501_EH_outofspec_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OUTOFRANGE: "11670501_EH_outofspec_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_CHECK: "11670501_FMCS_check_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_CHECK: "11670501_FMCS_check_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_INFO: "11670501_Info.gif|en zz|11670501_nopicture.gif";
	}

	VALIDITY IF (CountOfHRData >= 1) { TRUE; } ELSE { FALSE; }
}

IMAGE Image_Eventlog_Status_2
{
	LINK Method_GetMI_Eventlog_Status_2;

	PATH  SELECT((Eventlog_Image_Status_2 >> 24) & 0xff)
	{
		CASE STATUS_OUT_OK: "11670501_FMCS_ok_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OK: "11670501_FMCS_ok_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_MAINTENANCE: "11670501_FMCS_maintenance_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_MAINTENANCE: "11670501_FMCS_maintenance_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_FAILURE: "11670501_FMCS_failure_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_FAILURE: "11670501_FMCS_failure_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_OUTOFRANGE: "11670501_EH_outofspec_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OUTOFRANGE: "11670501_EH_outofspec_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_CHECK: "11670501_FMCS_check_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_CHECK: "11670501_FMCS_check_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_INFO: "11670501_Info.gif|en zz|11670501_nopicture.gif";
	}

	VALIDITY IF (CountOfHRData >= 2) { TRUE; } ELSE { FALSE; }
}

IMAGE Image_Eventlog_Status_3
{
	LINK Method_GetMI_Eventlog_Status_3;

	PATH  SELECT((Eventlog_Image_Status_3 >> 24) & 0xff)
	{
		CASE STATUS_OUT_OK: "11670501_FMCS_ok_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OK: "11670501_FMCS_ok_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_MAINTENANCE: "11670501_FMCS_maintenance_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_MAINTENANCE: "11670501_FMCS_maintenance_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_FAILURE: "11670501_FMCS_failure_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_FAILURE: "11670501_FMCS_failure_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_OUTOFRANGE: "11670501_EH_outofspec_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OUTOFRANGE: "11670501_EH_outofspec_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_CHECK: "11670501_FMCS_check_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_CHECK: "11670501_FMCS_check_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_INFO: "11670501_Info.gif|en zz|11670501_nopicture.gif";
	}

	VALIDITY IF (CountOfHRData >= 3) { TRUE; } ELSE { FALSE; }
}

IMAGE Image_Eventlog_Status_4
{
	LINK Method_GetMI_Eventlog_Status_4;

	PATH  SELECT((Eventlog_Image_Status_4 >> 24) & 0xff)
	{
		CASE STATUS_OUT_OK: "11670501_FMCS_ok_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OK: "11670501_FMCS_ok_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_MAINTENANCE: "11670501_FMCS_maintenance_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_MAINTENANCE: "11670501_FMCS_maintenance_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_FAILURE: "11670501_FMCS_failure_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_FAILURE: "11670501_FMCS_failure_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_OUTOFRANGE: "11670501_EH_outofspec_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OUTOFRANGE: "11670501_EH_outofspec_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_CHECK: "11670501_FMCS_check_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_CHECK: "11670501_FMCS_check_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_INFO: "11670501_Info.gif|en zz|11670501_nopicture.gif";
	}

	VALIDITY IF (CountOfHRData >= 4) { TRUE; } ELSE { FALSE; }
}

IMAGE Image_Eventlog_Status_5
{
	LINK Method_GetMI_Eventlog_Status_5;

	PATH  SELECT((Eventlog_Image_Status_5 >> 24) & 0xff)
	{
		CASE STATUS_OUT_OK: "11670501_FMCS_ok_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OK: "11670501_FMCS_ok_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_MAINTENANCE: "11670501_FMCS_maintenance_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_MAINTENANCE: "11670501_FMCS_maintenance_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_FAILURE: "11670501_FMCS_failure_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_FAILURE: "11670501_FMCS_failure_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_OUTOFRANGE: "11670501_EH_outofspec_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OUTOFRANGE: "11670501_EH_outofspec_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_CHECK: "11670501_FMCS_check_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_CHECK: "11670501_FMCS_check_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_INFO: "11670501_Info.gif|en zz|11670501_nopicture.gif";
	}

	VALIDITY IF (CountOfHRData >= 5) { TRUE; } ELSE { FALSE; }
}

IMAGE Image_Eventlog_Status_6
{
	LINK Method_GetMI_Eventlog_Status_6;

	PATH  SELECT((Eventlog_Image_Status_6 >> 24) & 0xff)
	{
		CASE STATUS_OUT_OK: "11670501_FMCS_ok_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OK: "11670501_FMCS_ok_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_MAINTENANCE: "11670501_FMCS_maintenance_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_MAINTENANCE: "11670501_FMCS_maintenance_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_FAILURE: "11670501_FMCS_failure_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_FAILURE: "11670501_FMCS_failure_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_OUTOFRANGE: "11670501_EH_outofspec_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OUTOFRANGE: "11670501_EH_outofspec_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_CHECK: "11670501_FMCS_check_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_CHECK: "11670501_FMCS_check_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_INFO: "11670501_Info.gif|en zz|11670501_nopicture.gif";
	}

	VALIDITY IF (CountOfHRData >= 6) { TRUE; } ELSE { FALSE; }
}

IMAGE Image_Eventlog_Status_7
{
	LINK Method_GetMI_Eventlog_Status_7;

	PATH  SELECT((Eventlog_Image_Status_7 >> 24) & 0xff)
	{
		CASE STATUS_OUT_OK: "11670501_FMCS_ok_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OK: "11670501_FMCS_ok_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_MAINTENANCE: "11670501_FMCS_maintenance_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_MAINTENANCE: "11670501_FMCS_maintenance_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_FAILURE: "11670501_FMCS_failure_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_FAILURE: "11670501_FMCS_failure_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_OUTOFRANGE: "11670501_EH_outofspec_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OUTOFRANGE: "11670501_EH_outofspec_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_CHECK: "11670501_FMCS_check_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_CHECK: "11670501_FMCS_check_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_INFO: "11670501_Info.gif|en zz|11670501_nopicture.gif";
	}

	VALIDITY IF (CountOfHRData >= 7) { TRUE; } ELSE { FALSE; }
}

IMAGE Image_Eventlog_Status_8
{
	LINK Method_GetMI_Eventlog_Status_8;

	PATH  SELECT((Eventlog_Image_Status_8 >> 24) & 0xff)
	{
		CASE STATUS_OUT_OK: "11670501_FMCS_ok_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OK: "11670501_FMCS_ok_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_MAINTENANCE: "11670501_FMCS_maintenance_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_MAINTENANCE: "11670501_FMCS_maintenance_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_FAILURE: "11670501_FMCS_failure_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_FAILURE: "11670501_FMCS_failure_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_OUTOFRANGE: "11670501_EH_outofspec_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OUTOFRANGE: "11670501_EH_outofspec_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_CHECK: "11670501_FMCS_check_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_CHECK: "11670501_FMCS_check_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_INFO: "11670501_Info.gif|en zz|11670501_nopicture.gif";
	}

	VALIDITY IF (CountOfHRData >= 8) { TRUE; } ELSE { FALSE; }
}

IMAGE Image_Eventlog_Status_9
{
	LINK Method_GetMI_Eventlog_Status_9;

	PATH  SELECT((Eventlog_Image_Status_9 >> 24) & 0xff)
	{
		CASE STATUS_OUT_OK: "11670501_FMCS_ok_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OK: "11670501_FMCS_ok_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_MAINTENANCE: "11670501_FMCS_maintenance_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_MAINTENANCE: "11670501_FMCS_maintenance_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_FAILURE: "11670501_FMCS_failure_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_FAILURE: "11670501_FMCS_failure_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_OUTOFRANGE: "11670501_EH_outofspec_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OUTOFRANGE: "11670501_EH_outofspec_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_CHECK: "11670501_FMCS_check_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_CHECK: "11670501_FMCS_check_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_INFO: "11670501_Info.gif|en zz|11670501_nopicture.gif";
	}

	VALIDITY IF (CountOfHRData >= 9) { TRUE; } ELSE { FALSE; }
}

IMAGE Image_Eventlog_Status_10
{
	LINK Method_GetMI_Eventlog_Status_10;

	PATH  SELECT((Eventlog_Image_Status_10 >> 24) & 0xff)
	{
		CASE STATUS_OUT_OK: "11670501_FMCS_ok_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OK: "11670501_FMCS_ok_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_MAINTENANCE: "11670501_FMCS_maintenance_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_MAINTENANCE: "11670501_FMCS_maintenance_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_FAILURE: "11670501_FMCS_failure_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_FAILURE: "11670501_FMCS_failure_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_OUTOFRANGE: "11670501_EH_outofspec_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_OUTOFRANGE: "11670501_EH_outofspec_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_OUT_CHECK: "11670501_FMCS_check_Go.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_IN_CHECK: "11670501_FMCS_check_Come.gif|en zz|11670501_nopicture.gif";
		CASE STATUS_INFO: "11670501_Info.gif|en zz|11670501_nopicture.gif";
	}

	VALIDITY IF (CountOfHRData >= 10) { TRUE; } ELSE { FALSE; }
}

VARIABLE HRDataSelection
{
	LABEL T_EventBufferSelection;
	CLASS   LOCAL;
	HANDLING READ & WRITE;
	DEFAULT_VALUE 0;

	TYPE ENUMERATED(1)
	{
		IF(SPV_NumEntriesEventList_1>=1)
		{
			{ 0, T_NumEntriesList" : 1-10" }
		}

		IF(SPV_NumEntriesEventList_1>=11)
		{
			{ 10, T_NumEntriesList" : 11-20" }
		}

		IF ((((STD_SWOptionActiveOverview_1&e_SWOptionEnabledOverview_ExtendedHistoROMAndTrend_LONG)== e_SWOptionEnabledOverview_ExtendedHistoROMAndTrend_LONG))){
		IF(SPV_NumEntriesEventList_1>=21)
		{
			{ 20, T_NumEntriesList" : 21-30" }
		}

		IF(SPV_NumEntriesEventList_1>=31)
		{
			{ 30, T_NumEntriesList" : 31-40" }
		}

		IF(SPV_NumEntriesEventList_1>=41)
		{
			{ 40, T_NumEntriesList" : 41-50" }
		}

		IF(SPV_NumEntriesEventList_1>=51)
		{
			{ 50, T_NumEntriesList" : 51-60" }
		}

		IF(SPV_NumEntriesEventList_1>=61)
		{
			{ 60, T_NumEntriesList" : 61-70" }
		}

		IF(SPV_NumEntriesEventList_1>=71)
		{
			{ 70, T_NumEntriesList" : 71-80" }
		}

		IF(SPV_NumEntriesEventList_1>=81)
		{
			{ 80, T_NumEntriesList" : 81-90" }
		}

		IF(SPV_NumEntriesEventList_1>=91)
		{
			{ 90, T_NumEntriesList" : 91-100" }
		}
		}
	}
    	POST_EDIT_ACTIONS
	{
		PE_method_read_event
	}
}
    

ARRAY OF VARIABLE historom_status_array
{
	ELEMENTS
	{
		0,  Eventlog_Status_1;
		1,  Eventlog_Status_2;
		2,  Eventlog_Status_3;
		3,  Eventlog_Status_4;
		4,  Eventlog_Status_5;
		5,  Eventlog_Status_6;
		6,  Eventlog_Status_7;
		7,  Eventlog_Status_8;
		8,  Eventlog_Status_9;
 		9,  Eventlog_Status_10;
	}
}


ARRAY OF VARIABLE historom_class_array
{
	ELEMENTS
	{
		0,  Eventlog_Image_Status_1;
		1,  Eventlog_Image_Status_2;
		2,  Eventlog_Image_Status_3;
		3,  Eventlog_Image_Status_4;
		4,  Eventlog_Image_Status_5;
		5,  Eventlog_Image_Status_6;
		6,  Eventlog_Image_Status_7;
		7,  Eventlog_Image_Status_8;
		8,  Eventlog_Image_Status_9;
 		9,  Eventlog_Image_Status_10;
	}
}

METHOD method_read_eventlogbook
{
	LABEL T_ReadEvents;
	CLASS COMPUTATION;
	
	DEFINITION
	{
		int  nState,count_retries;
		int nTransaction, nMasterLength, nMaxLoops;
		long nFilter, nMaxBCT, nBCT;
		long i,j,nCurrent,jMaxLoops;
		unsigned int byte0, byte1, byte2, byte3, byte4, dwData;
		long varid[2]; 
		int tabnState[2];
		unsigned int compareDW[29], compareVal;
		iassign(CountOfHRData, 0);
		iassign(HRDataSelection, 0);
		save_values();
		nState=0;
		save_values();
		iassign(progress, 0);
		varid[0] = VARID(progress);
		save_values();
    
        DETECT_MAX_FRAME_LENGTH

        if (((i == 0) && (nMaxBCT != 110)) || (i == 25))
        { // full support
        nTransaction = 60;
        nMaxLoops = 5;
        jMaxLoops = 2;
        nMasterLength = 38;
        iassign(BCT_request, 38);
        }
        else
        { // minimal support
        nTransaction = 50;
        nMaxLoops = 10;
        jMaxLoops = 1;
        nMasterLength = 18;
        iassign(BCT_request, 18);
        }
      send_command_trans(173,48); // read STD_UserLevel_1
send_command_trans(173,44); // read STD_SWOptionActiveOverview_1
		iassign(port, ReadHistoryLog); // read history log
		i = ivar_value(SPV_FilterOptions_1); 
    
      save_values();
      		add_abort_method(finish_transfer_log);
			count_retries = 1;
        send_command_trans(146, 1);
      
      tabnState[0] = VARID(SPV_EventListStatus_1);
      nState = ivar_value(SPV_EventListStatus_1);

      while ((count_retries < 30) && (nState != 100))
      {
      DELAY(2,T_DisplayPreparationInProgress);

      iassign(port, ReadHistoryLog);
      i = ivar_value(SPV_FilterOptions_1);
      save_values();
      
        send_command_trans(146, 1);
      
      count_retries = count_retries + 1;
      nState = ivar_value(SPV_EventListStatus_1);
      tabnState[0] = VARID(SPV_EventListStatus_1);
      }

      if ( nState != 100)
      {
      ACKNOWLEDGE(T_PrepareBusy);
      iassign(CountOfHRData, 0);
      save_values();
      }

      // read hk preparation state
      if ( nState == 100)
      {
      count_retries = 1;
      iassign(port, ReadHistoryLog);
      i = ivar_value(SPV_FilterOptions_1);
      save_values();
      
        send_command_trans(147, 1);
      
      tabnState[0] = VARID(SPV_EventListStatus_1);
      nState = ivar_value(SPV_EventListStatus_1);
      save_values();

      while ((count_retries < 15) && (nState != 100))
      {
      DELAY(2,T_DisplayPreparationInProgress);
      
        send_command_trans(147, 1);
      
      count_retries = count_retries + 1;
      //nState = ivar_value(SPV_EventListStatus_1) & 0x7f;
      nState = ivar_value(SPV_EventListStatus_1);
      tabnState[0] = VARID(SPV_EventListStatus_1);
      }

      if ( nState != 100)
      {
      ACKNOWLEDGE(T_PrepareBusy);
      iassign(CountOfHRData, 0);
      save_values();
      }
      }
      
      if (ivar_value(SPV_NumEntriesEventList_1) == 0 && nState == 100)
      {
      ACKNOWLEDGE("%{SPV_FilterOptions_1} : " + T_NoEvent);
      }

      if (ivar_value(SPV_NumEntriesEventList_1) != 0)
      {
      GET_DEV_VAR_VALUE(T_EventBufferSelection,HRDataSelection);
      save_values();

      if (ivar_value(SPV_NumEntriesEventList_1) - ivar_value(HRDataSelection) >= 10)
      {
          iassign(CountOfHRData, 10);
      }
      else
      {
          iassign(CountOfHRData, ivar_value(SPV_NumEntriesEventList_1) - ivar_value(HRDataSelection));
          if (nMasterLength == 18)
          {
              nMaxLoops = CountOfHRData;
          }
          else
          {
              nMaxLoops = CountOfHRData / 2;

              if (CountOfHRData % 2 == 1)
                  ++nMaxLoops;
          }
      }

      save_values();
        }
      
      // start with opening port
      iassign(port, ReadHistoryLog);
      iassign(function_code, PORT_OPEN);
      iassign(master_byte_count, 0);
		iassign(device_byte_count, 0);
		
		// abort method to close port in case of failure
		remove_abort_method(finish_transfer_log);
		add_abort_method(close_port);
		add_abort_method(finish_transfer_log);
		send_command_trans(211,0);
		
    if (ivar_value(Device_BCT) != nMasterLength)
		{ // minimal support
			nTransaction = 50;
			nMaxLoops = 10;
			nMasterLength = 18;
			iassign(BCT_request, 18);
		}
		device_byte_count=19 * ivar_value(HRDataSelection);
		save_values();
    
        if (ivar_value(SPV_NumEntriesEventList_1) != 0)
        {
        for (i=1;i<=nMaxLoops;i++)
        {
        iassign(progress, i*100/nMaxLoops);
				iassign(function_code, PORT_TRANSFER);
				iassign(number_bytes_message, 0);
				
				// start transaction
				if(nTransaction>=60)
				{
					if ((((ivar_value(CountOfHRData))-((i-1)*2)) == 1))
					{
						nMasterLength = 18;
						iassign(BCT_request, 18);
						nTransaction= 50 + CountOfHRData;
						send_command_trans(212, nTransaction);
					}
					else
					{
						nMasterLength = 38;
						iassign(BCT_request, 38);
						nTransaction=nTransaction+1;
						send_command_trans(212, nTransaction);
					}
				}
				else
				{
					nTransaction=nTransaction+1;
					send_command_trans(212, nTransaction);
				}
 
      // retrieve data
      
        for (j=0;j<jMaxLoops;j++)
      
      {
      
        nCurrent = (((i-1)*jMaxLoops)+j);
        save_values();

        // swap byte order
        dwData = block_data_evl_union_array[nCurrent];
        byte0 = dwData & 0xff;
        byte1 = dwData & 0x7f;
        byte2 = ( dwData >> 8 ) & 0xff;
        byte3 = ( dwData >> 16 ) & 0xff;
        byte4 = ( dwData >> 24 ) & 0xff;
        dwData = (byte3 + (byte4 * 256)  + (65536 * byte2) + (65536 * 256 * byte1));
        historom_status_array[nCurrent]=dwData;
        dwData = ((byte0 * 256 * 256 * 256) + (byte2 * 256 * 256 ) + (byte3 * 256) + byte4);
        historom_class_array[nCurrent]=dwData;
        save_values();
        }

        if (nMasterLength != 18)
        {
        device_byte_count = 19 * ivar_value(HRDataSelection) + (38 * i);
        //iassign(device_byte_count, (38*i));
        save_values();
        }

        else
        {
        device_byte_count = 19 * ivar_value(HRDataSelection) + (19 * i);
        save_values();
      

      }
      }
      
        }
      
      iassign(port, ReadHistoryLog);
      iassign(function_code, PORT_CLOSE);
      
        send_command_trans(211,0);
      
      save_values();
      
          if (ivar_value(SPV_NumEntriesEventList_1) != 0 && nState == 100)
          {
          DELAY(2,T_DisplayPreparationInProgress);
          }
        

      }
      }
    
MENU EventListPage
{
	LABEL T_EventList;
	STYLE GROUP;
	VALIDITY IF(CountOfHRData!=0){ TRUE;} ELSE {FALSE;}

	ITEMS
	{
		T_OperatingTime,
		COLUMNBREAK,
		T_EventClassAndRI,
		COLUMNBREAK,
		T_Event,
		ROWBREAK,
		Eventlog_Message_1(READ_ONLY),
		COLUMNBREAK,
		Image_Eventlog_Status_1(INLINE),
		COLUMNBREAK,

			Eventlog_Status_1(NO_LABEL),
		ROWBREAK,
		Eventlog_Message_2(READ_ONLY),
		COLUMNBREAK,
		Image_Eventlog_Status_2(INLINE),
		COLUMNBREAK,

			Eventlog_Status_2(NO_LABEL),
		ROWBREAK,
		Eventlog_Message_3(READ_ONLY),
		COLUMNBREAK,
		Image_Eventlog_Status_3(INLINE),
		COLUMNBREAK,

			Eventlog_Status_3(NO_LABEL),
		ROWBREAK,
		Eventlog_Message_4(READ_ONLY),
		COLUMNBREAK,
		Image_Eventlog_Status_4(INLINE),
		COLUMNBREAK,

			Eventlog_Status_4(NO_LABEL),
		ROWBREAK,
		Eventlog_Message_5(READ_ONLY),
		COLUMNBREAK,
		Image_Eventlog_Status_5(INLINE),
		COLUMNBREAK,

			Eventlog_Status_5(NO_LABEL),
		ROWBREAK,
		Eventlog_Message_6(READ_ONLY),
		COLUMNBREAK,
		Image_Eventlog_Status_6(INLINE),
		COLUMNBREAK,

			Eventlog_Status_6(NO_LABEL),
		ROWBREAK,
		Eventlog_Message_7(READ_ONLY),
		COLUMNBREAK,
		Image_Eventlog_Status_7(INLINE),
		COLUMNBREAK,

			Eventlog_Status_7(NO_LABEL),
		ROWBREAK,
		Eventlog_Message_8(READ_ONLY),
		COLUMNBREAK,
		Image_Eventlog_Status_8(INLINE),
		COLUMNBREAK,

			Eventlog_Status_8(NO_LABEL),
		ROWBREAK,
		Eventlog_Message_9(READ_ONLY),
		COLUMNBREAK,
		Image_Eventlog_Status_9(INLINE),
		COLUMNBREAK,

			Eventlog_Status_9(NO_LABEL),
		ROWBREAK,
		Eventlog_Message_10(READ_ONLY),
		COLUMNBREAK,
		Image_Eventlog_Status_10(INLINE),
		COLUMNBREAK,

			Eventlog_Status_10(NO_LABEL)
	}
}

METHOD Method_GetMI_Eventlog_Status_1
{
	LABEL T_RemedyInformation;
	CLASS COMPUTATION;
	VALIDITY IF ((CountOfHRData >= 1) && (((Eventlog_Image_Status_1 >> 24) & 0xff) != STATUS_INFO)) { TRUE; } ELSE { FALSE; }

	DEFINITION
	{
		IGNORE_ALL_RESPONSE_CODES();
		IGNORE_ALL_DEVICE_STATUS();

		switch(Eventlog_Status_1)
		{
			MaintenanceInstruction\
			MaintenanceInstruction2
		}
	}
}

METHOD Method_GetMI_Eventlog_Status_2
{
	LABEL T_RemedyInformation;
	CLASS COMPUTATION;
	VALIDITY IF ((CountOfHRData >= 2) && (((Eventlog_Image_Status_2 >> 24) & 0xff) != STATUS_INFO)) { TRUE; } ELSE { FALSE; }

	DEFINITION
	{
		IGNORE_ALL_RESPONSE_CODES();
		IGNORE_ALL_DEVICE_STATUS();

		switch(Eventlog_Status_2)
		{
			MaintenanceInstruction\
			MaintenanceInstruction2
		}
	}
}

METHOD Method_GetMI_Eventlog_Status_3
{
	LABEL T_RemedyInformation;
	CLASS COMPUTATION;
	VALIDITY IF ((CountOfHRData >= 3) && (((Eventlog_Image_Status_3 >> 24) & 0xff) != STATUS_INFO)) { TRUE; } ELSE { FALSE; }

	DEFINITION
	{
		IGNORE_ALL_RESPONSE_CODES();
		IGNORE_ALL_DEVICE_STATUS();

		switch(Eventlog_Status_3)
		{
			MaintenanceInstruction\
			MaintenanceInstruction2
		}
	}
}

METHOD Method_GetMI_Eventlog_Status_4
{
	LABEL T_RemedyInformation;
	CLASS COMPUTATION;
	VALIDITY IF ((CountOfHRData >= 4) && (((Eventlog_Image_Status_4 >> 24) & 0xff) != STATUS_INFO)) { TRUE; } ELSE { FALSE; }

	DEFINITION
	{
		IGNORE_ALL_RESPONSE_CODES();
		IGNORE_ALL_DEVICE_STATUS();

		switch(Eventlog_Status_4)
		{
			MaintenanceInstruction\
			MaintenanceInstruction2
		}
	}
}

METHOD Method_GetMI_Eventlog_Status_5
{
	LABEL T_RemedyInformation;
	CLASS COMPUTATION;
	VALIDITY IF ((CountOfHRData >= 5) && (((Eventlog_Image_Status_5 >> 24) & 0xff) != STATUS_INFO)) { TRUE; } ELSE { FALSE; }

	DEFINITION
	{
		IGNORE_ALL_RESPONSE_CODES();
		IGNORE_ALL_DEVICE_STATUS();

		switch(Eventlog_Status_5)
		{
			MaintenanceInstruction\
			MaintenanceInstruction2
		}
	}
}

METHOD Method_GetMI_Eventlog_Status_6
{
	LABEL T_RemedyInformation;
	CLASS COMPUTATION;
	VALIDITY IF ((CountOfHRData >= 6) && (((Eventlog_Image_Status_6 >> 24) & 0xff) != STATUS_INFO)) { TRUE; } ELSE { FALSE; }

	DEFINITION
	{
		IGNORE_ALL_RESPONSE_CODES();
		IGNORE_ALL_DEVICE_STATUS();

		switch(Eventlog_Status_6)
		{
			MaintenanceInstruction\
			MaintenanceInstruction2
		}
	}
}

METHOD Method_GetMI_Eventlog_Status_7
{
	LABEL T_RemedyInformation;
	CLASS COMPUTATION;
	VALIDITY IF ((CountOfHRData >= 7) && (((Eventlog_Image_Status_7 >> 24) & 0xff) != STATUS_INFO)) { TRUE; } ELSE { FALSE; }

	DEFINITION
	{
		IGNORE_ALL_RESPONSE_CODES();
		IGNORE_ALL_DEVICE_STATUS();

		switch(Eventlog_Status_7)
		{
			MaintenanceInstruction\
			MaintenanceInstruction2
		}
	}
}

METHOD Method_GetMI_Eventlog_Status_8
{
	LABEL T_RemedyInformation;
	CLASS COMPUTATION;
	VALIDITY IF ((CountOfHRData >= 8) && (((Eventlog_Image_Status_8 >> 24) & 0xff) != STATUS_INFO)) { TRUE; } ELSE { FALSE; }

	DEFINITION
	{
		IGNORE_ALL_RESPONSE_CODES();
		IGNORE_ALL_DEVICE_STATUS();

		switch(Eventlog_Status_8)
		{
			MaintenanceInstruction\
			MaintenanceInstruction2
		}
	}
}

METHOD Method_GetMI_Eventlog_Status_9
{
	LABEL T_RemedyInformation;
	CLASS COMPUTATION;
	VALIDITY IF ((CountOfHRData >= 9) && (((Eventlog_Image_Status_9 >> 24) & 0xff) != STATUS_INFO)) { TRUE; } ELSE { FALSE; }

	DEFINITION
	{
		IGNORE_ALL_RESPONSE_CODES();
		IGNORE_ALL_DEVICE_STATUS();

		switch(Eventlog_Status_9)
		{
			MaintenanceInstruction\
			MaintenanceInstruction2
		}
	}
}

METHOD Method_GetMI_Eventlog_Status_10
{
	LABEL T_RemedyInformation;
	CLASS COMPUTATION;
	VALIDITY IF ((CountOfHRData >= 10) && (((Eventlog_Image_Status_10 >> 24) & 0xff) != STATUS_INFO)) { TRUE; } ELSE { FALSE; }

	DEFINITION
	{
		IGNORE_ALL_RESPONSE_CODES();
		IGNORE_ALL_DEVICE_STATUS();

		switch(Eventlog_Status_10)
		{
			MaintenanceInstruction\
			MaintenanceInstruction2
		}
	}
}
    METHOD Method_Read_Trend_All
    {
    LABEL T_ReadTrendCurves;
    CLASS COMPUTATION;
    
VALIDITY IF ( /*IsHistoROMTrendAvailable */ (((STD_SWOptionActiveOverview_1 & e_SWOptionEnabledOverview_ExtendedHistoROMAndTrend_LONG)== e_SWOptionEnabledOverview_ExtendedHistoROMAndTrend_LONG )&&(HB_InputSelector1_1 != e_HistoRomInputSelector_Off_LONG || HB_InputSelector2_1 != e_HistoRomInputSelector_Off_LONG || HB_InputSelector3_1 != e_HistoRomInputSelector_Off_LONG || HB_InputSelector4_1 != e_HistoRomInputSelector_Off_LONG))){ TRUE;} ELSE {FALSE;}
    DEFINITION
    {
    int nDataReadCount,select, count_retries, tabnState[2], nState, x1, nb_trend, position,nb_points,sel_1,sel_2,sel_3,sel_4,MasterLength,nTransaction;
    long intput_tmp,intput_tmp_2,i;
  
    long varid[2];
    long nMaxBCT, nBCT;
    unsigned int compareDW[29], compareVal;
  
    float max_y, min_y, max_y_2, min_y_2, max_y_3, min_y_3, max_y_4, min_y_4,flt_y;
    nb_trend=0;
    position=0;
    x1=0;
    sel_1=0;
    sel_2=0;
    sel_3=0;
    sel_4=0;
    max_y=-1000000;
    min_y=100000;
    max_y_2=-1000000;
    min_y_2=100000;
    max_y_3=-1000000;
    min_y_3=100000;
    max_y_4=-1000000;
    min_y_4=100000;
    
    DETECT_MAX_FRAME_LENGTH

    if (((i == 0) && (nMaxBCT != 110)) || (i == 25))
      { // full support
      iassign(BCT_request, 60);
      nTransaction = 70;
      MasterLength = 60;
      }
      else
      {
      iassign(BCT_request, 16);
      nTransaction = 71;
      MasterLength = 16;
      }
    

    intput_tmp = ivar_value(HB_InputSelector1_1);
    if (intput_tmp != e_HistoRomInputSelector_Off_LONG)
    {
    nb_trend = nb_trend+1;
    sel_1 =1;
    save_values();
    }
    intput_tmp = ivar_value(HB_InputSelector2_1);
    if (intput_tmp != e_HistoRomInputSelector_Off_LONG)
    {
    nb_trend = nb_trend+1;
    sel_2 =1;
    save_values();
    }
    intput_tmp = ivar_value(HB_InputSelector3_1);
    if (intput_tmp != e_HistoRomInputSelector_Off_LONG)
    {
    nb_trend = nb_trend+1;
    sel_3 =1;
    save_values();
    }
    intput_tmp = ivar_value(HB_InputSelector4_1);
    if (intput_tmp != e_HistoRomInputSelector_Off_LONG)
    {
    nb_trend = nb_trend+1;
    sel_4 =1;
    save_values();
    }

    if (nb_trend != 0)
    {
    
      assign_int(HB_ValueCount_1,500);
      
				send_command_trans(178,1394); /* write HB_ValueCount_1 */
		send_command_trans(173,154); /* read HB_ValueCount_1 */

    iassign(device_byte_count, 0);
    iassign(nb_trend_local, nb_trend);
    iassign(port, ReadTrend);
    
    iassign(function_code, PORT_OPEN);
    i = ivar_value(HB_Version_1);
    assign_int(HB_FilterOption_1,5);
    
				send_command_trans(178,1393); /* write HB_FilterOption_1 */

    send_command_trans(146, 2);
  
  count_retries = 1;
  while ((count_retries <= 15) && (nState != 100))
  {
  DELAY(2,T_DisplayPreparationInProgress);
  count_retries = count_retries + 1;
  
    send_command_trans(147, 2);
    tabnState[0] = VARID(HB_TrendListStatus_1);
  
    nState = ivar_value(HB_TrendListStatus_1);
    }
    if ( nState != 100)
    {
    ACKNOWLEDGE(T_PrepareBusy);
    abort();
    }
    nDataReadCount=0;
    if (nb_trend == 1)
    {
    nb_points=500;
    }
    if (nb_trend == 2)
    {
    nb_points=250;
    }
    if (nb_trend == 3)
    {
    nb_points=166;
    }
    if (nb_trend == 4)
    {
    nb_points=125;
    }
    iassign(XMinAxis, -HB_TrendInterval_1 * nb_points);
   
    iassign(port, ReadTrend);
    iassign(function_code, PORT_OPEN);
    send_command_trans(211,0);
  
    while (nDataReadCount <= 499)
    {
    
      iassign(progress, (nDataReadCount+MasterLength)*100/500);
      varid[0] = VARID(progress);
      
      iassign(function_code, PORT_TRANSFER);
      iassign(number_bytes_message, 0);
      send_command_trans(212,nTransaction);
    
  array_Display_Trend_500[499-nDataReadCount]=HelpFloat_1;

  array_Display_Trend_500[499-nDataReadCount-1]=HelpFloat_2;
  array_Display_Trend_500[499-nDataReadCount-2]=HelpFloat_3;
  array_Display_Trend_500[499-nDataReadCount-3]=HelpFloat_4;
    if (MasterLength == 60)
    {
    array_Display_Trend_500[499-nDataReadCount-4]=HelpFloat_5;
  if (nDataReadCount != 495)
  {
  array_Display_Trend_500[499-nDataReadCount-5]=HelpFloat_6;
  array_Display_Trend_500[499-nDataReadCount-6]=HelpFloat_7;
  array_Display_Trend_500[499-nDataReadCount-7]=HelpFloat_8;
  array_Display_Trend_500[499-nDataReadCount-8]=HelpFloat_9;
  array_Display_Trend_500[499-nDataReadCount-9]=HelpFloat_10;
  array_Display_Trend_500[499-nDataReadCount-10]=HelpFloat_11;
  array_Display_Trend_500[499-nDataReadCount-11]=HelpFloat_12;
  array_Display_Trend_500[499-nDataReadCount-12]=HelpFloat_13;
  array_Display_Trend_500[499-nDataReadCount-13]=HelpFloat_14;
  array_Display_Trend_500[499-nDataReadCount-14]=HelpFloat_15;
    }
    }

    nDataReadCount = nDataReadCount + MasterLength/4;
    iassign(device_byte_count, ivar_value(device_byte_count) + MasterLength);
    }

    }
    
      iassign(port, ReadTrend);
      iassign(function_code, PORT_CLOSE);

      send_command_trans(211,0);
    


  if (nb_trend == 1)

  {
  for (x1 = 499; x1 >= 0; x1--)
  {
  flt_y = array_Display_Trend_500[x1];
  if (max_y < flt_y){max_y = flt_y;}if (min_y > flt_y){min_y = flt_y;}
}
}

if (nb_trend == 2)

{
for (x1 = 499; x1 > 499-nb_points; x1--)  
{array_Display_Trend_1_250[x1-250] = array_Display_Trend_500[x1];
	flt_y = array_Display_Trend_500[x1];
	if (max_y < flt_y){max_y = flt_y;}if (min_y > flt_y){min_y = flt_y;}
}
for  (x1 = nb_points-1; x1 >= 0; x1--)  
{
	array_Display_Trend_2_250[x1] = array_Display_Trend_500[x1];
	flt_y = array_Display_Trend_500[x1];
	if (max_y_2 < flt_y){max_y_2 = flt_y;}if (min_y_2 > flt_y){min_y_2 = flt_y;}
	
}
}

if (nb_trend == 3)
{
for (x1 = 499; x1 > 499-nb_points; x1--)   
{
	array_Display_Trend_1_166[x1-334] = array_Display_Trend_500[x1];
	flt_y = array_Display_Trend_500[x1];
	if (max_y < flt_y){max_y = flt_y;}if (min_y > flt_y){min_y = flt_y;}
	
}
for (x1 = 333; x1 > 333-nb_points; x1--)  
{
	array_Display_Trend_2_166[x1-168] = array_Display_Trend_500[x1];
	flt_y = array_Display_Trend_500[x1];
	if (max_y_2 < flt_y){max_y_2 = flt_y;}if (min_y_2 > flt_y){min_y_2 = flt_y;}
}
for  (x1 = 167;x1 > 167-nb_points; x1--)  
{
	array_Display_Trend_3_166[x1-2] = array_Display_Trend_500[x1];
	flt_y = array_Display_Trend_500[x1];
	if (max_y_3 < flt_y){max_y_3 = flt_y;}if (min_y_3 > flt_y){min_y_3 = flt_y;}
}
}

if (nb_trend == 4)
{
for (x1 = 499; x1 > 499-nb_points; x1--)   
{
	array_Display_Trend_1_125[x1-375] = array_Display_Trend_500[x1];
	flt_y = array_Display_Trend_500[x1];
		if (max_y < flt_y){max_y = flt_y;}if (min_y > flt_y){min_y = flt_y;}
	
}
for (x1 = 374; x1 > 374-nb_points; x1--)  
{
	array_Display_Trend_2_125[x1-250] = array_Display_Trend_500[x1];
	flt_y = array_Display_Trend_500[x1];
	if (max_y_2 < flt_y){max_y_2 = flt_y;}if (min_y_2 > flt_y){min_y_2 = flt_y;}
}
for (x1 = 249; x1 > 249-nb_points; x1--)  
{
	array_Display_Trend_3_125[x1-125] = array_Display_Trend_500[x1];
	flt_y = array_Display_Trend_500[x1];
	if (max_y_3 < flt_y){max_y_3 = flt_y;}if (min_y_3 > flt_y){min_y_3 = flt_y;}
}

for  (x1 = nb_points-1; x1 >= 0; x1--)  
{
	array_Display_Trend_4_125[x1] = array_Display_Trend_500[x1];
	flt_y = array_Display_Trend_500[x1];
	if (max_y_4 < flt_y){max_y_4 = flt_y;}if (min_y_4 > flt_y){min_y_4 = flt_y;}
}
}

intput_tmp = ivar_value(HB_InputSelector1_1);
if (intput_tmp != e_HistoRomInputSelector_Off_LONG)
{

}

intput_tmp = ivar_value(HB_InputSelector2_1);
if (intput_tmp != e_HistoRomInputSelector_Off_LONG)
{

}

intput_tmp = ivar_value(HB_InputSelector3_1);
if (intput_tmp != e_HistoRomInputSelector_Off_LONG)
{

}

intput_tmp = ivar_value(HB_InputSelector4_1);

if (intput_tmp != e_HistoRomInputSelector_Off_LONG)
{

}
    if (nb_trend == 1)
    {
    if (sel_1 == 1)
    {
    fassign(mrkMaxValue_1, max_y);
    fassign(mrkMinValue_1, min_y);
    fassign(YMaxValue_1, max_y);
    save_values();
    fassign(YMinValue_1, min_y);
    save_values();
    }
    if (sel_2 == 1)
    {
    fassign(mrkMaxValue_2, max_y);
    fassign(mrkMinValue_2, min_y);
    fassign(YMaxValue_2, max_y);
    save_values();
    fassign(YMinValue_2, min_y);
    save_values();
    }
    if (sel_3 == 1)
    {
    fassign(mrkMaxValue_3, max_y);
    fassign(mrkMinValue_3, min_y);
    fassign(YMaxValue_3, max_y);
    save_values();
    fassign(YMinValue_3, min_y);
    save_values();
    }
    if (sel_4 == 1)
    {
    fassign(mrkMaxValue_4, max_y);
    fassign(mrkMinValue_4, min_y);
    fassign(YMaxValue_4, max_y);
    save_values();
    fassign(YMinValue_4, min_y);
    save_values();
    }
    }

    if (nb_trend == 2)
    {
    if (sel_1 == 1)
    {
    fassign(mrkMaxValue_1, max_y);
    fassign(mrkMinValue_1, min_y);
    fassign(YMaxValue_1, max_y);
    save_values();
    fassign(YMinValue_1, min_y);
    save_values();
    if (sel_2 == 1)
    {
    fassign(mrkMaxValue_2, max_y_2);
    fassign(mrkMinValue_2, min_y_2);
    fassign(YMaxValue_2, max_y_2);
    save_values();
    fassign(YMinValue_2, min_y_2);
    save_values();
    }
    if (sel_3 == 1)
    {
    fassign(mrkMaxValue_3, max_y_2);
    fassign(mrkMinValue_3, min_y_2);
    fassign(YMaxValue_3, max_y_2);
    save_values();
    fassign(YMinValue_3, min_y_2);
    save_values();
    }
    if (sel_4 == 1)
    {
    fassign(mrkMaxValue_4, max_y_2);
    fassign(mrkMinValue_4, min_y_2);
    fassign(YMaxValue_4, max_y_2);
    save_values();
    fassign(YMinValue_4, min_y_2);
    save_values();
    }
    }
    else if  (sel_2 == 1)
    {
    fassign(mrkMaxValue_2, max_y);
    fassign(mrkMinValue_2, min_y);
    fassign(YMaxValue_2, max_y);
    save_values();
    fassign(YMinValue_2, min_y);
    save_values();
    if (sel_3 == 1)
    {
    fassign(mrkMaxValue_3, max_y_2);
    fassign(mrkMinValue_3, min_y_2);
    fassign(YMaxValue_3, max_y_2);
    save_values();
    fassign(YMinValue_3, min_y_2);
    save_values();
    }
    if (sel_4 == 1)
    {
    fassign(mrkMaxValue_4, max_y_2);
    fassign(mrkMinValue_4, min_y_2);
    fassign(YMaxValue_4, max_y_2);
    save_values();
    fassign(YMinValue_4, min_y_2);
    save_values();
    }
    }
    else if  (sel_3 == 1)
    {
    fassign(mrkMaxValue_3, max_y);
    fassign(mrkMinValue_3, min_y);
    fassign(YMaxValue_3, max_y);
    save_values();
    fassign(YMinValue_3, min_y);
    save_values();
    fassign(mrkMaxValue_4, max_y_2);
    fassign(mrkMinValue_4, min_y_2);
    fassign(YMaxValue_4, max_y_2);
    save_values();
    fassign(YMinValue_4, min_y_2);
    save_values();
    }
    }

    if (nb_trend == 3)
    {
    if (sel_1 == 1)
    {
    fassign(mrkMaxValue_1, max_y);
    fassign(mrkMinValue_1, min_y);
    fassign(YMaxValue_1, max_y);
    save_values();
    fassign(YMinValue_1, min_y);
    save_values();
    if (sel_2 == 1)
    {
    fassign(mrkMaxValue_2, max_y_2);
    fassign(mrkMinValue_2, min_y_2);
    fassign(YMaxValue_2, max_y_2);
    save_values();
    fassign(YMinValue_2, min_y_2);
    save_values();
    if (sel_3 == 1)
    {
    fassign(mrkMaxValue_3, max_y_3);
    fassign(mrkMinValue_3, min_y_3);
    fassign(YMaxValue_3, max_y_3);
    save_values();
    fassign(YMinValue_3, min_y_3);
    save_values();
    }
    else if (sel_4 == 1)
    {
    fassign(mrkMaxValue_4, max_y_3);
    fassign(mrkMinValue_4, min_y_3);
    fassign(YMaxValue_4, max_y_3);
    save_values();
    fassign(YMinValue_4, min_y_3);
    save_values();
    }
    }
    else if (sel_3 == 1)
    {
    fassign(mrkMaxValue_3, max_y_2);
    fassign(mrkMinValue_3, min_y_2);
    fassign(YMaxValue_3, max_y_2);
    save_values();
    fassign(YMinValue_3, min_y_2);
    save_values();
    fassign(mrkMaxValue_4, max_y_3);
    fassign(mrkMinValue_4, min_y_3);
    fassign(YMaxValue_4, max_y_3);
    save_values();
    fassign(YMinValue_4, min_y_3);
    save_values();
    }
    }
    else if  (sel_2 == 1)
    {
    fassign(mrkMaxValue_2, max_y);
    fassign(mrkMinValue_2, min_y);
    fassign(mrkMaxValue_3, max_y_2);
    fassign(mrkMinValue_3, min_y_2);
    fassign(mrkMaxValue_4, max_y_3);
    fassign(mrkMinValue_4, min_y_3);
    fassign(YMaxValue_2, max_y);
    save_values();
    fassign(YMinValue_2, min_y);
    save_values();
    fassign(YMaxValue_3, max_y_2);
    save_values();
    fassign(YMinValue_3, min_y_2);
    save_values();
    fassign(YMaxValue_4, max_y_3);
    save_values();
    fassign(YMinValue_4, min_y_3);
    save_values();
    }

    }

    if (nb_trend == 4)
    {
    fassign(mrkMaxValue_1, max_y);
    fassign(mrkMinValue_1, min_y);
    fassign(mrkMaxValue_2, max_y_2);
    fassign(mrkMinValue_2, min_y_2);
    fassign(mrkMaxValue_3, max_y_3);
    fassign(mrkMinValue_3, min_y_3);
    fassign(mrkMaxValue_4, max_y_4);
    fassign(mrkMinValue_4, min_y_4);
    fassign(YMaxValue_1, max_y);
    save_values();
    fassign(YMinValue_1, min_y);
    save_values();
    fassign(YMaxValue_2, max_y_2);
    save_values();
    fassign(YMinValue_2, min_y_2);
    save_values();
    fassign(YMaxValue_3, max_y_3);
    save_values();
    fassign(YMinValue_3, min_y_3);
    save_values();
    fassign(YMaxValue_4, max_y_4);
    save_values();
    fassign(YMinValue_4, min_y_4);
    save_values();
    }

    MenuDisplay(Trend_DIALOG_ALL,T_Closed, select);
    }
    }

     ARRAY array_Display_Trend_500
          {
          NUMBER_OF_ELEMENTS  500;
          TYPE HelpFloat_1;
          }
	  
	   ARRAY array_Display_Trend_1_250
          {
          NUMBER_OF_ELEMENTS  250;
          TYPE HelpFloat_1;
          }
	  
	   ARRAY array_Display_Trend_2_250
          {
          NUMBER_OF_ELEMENTS  250;
          TYPE HelpFloat_1;
          }
	  
	  
	     ARRAY array_Display_Trend_1_166
          {
          NUMBER_OF_ELEMENTS  166;
          TYPE HelpFloat_1;
          }
	  
	     ARRAY array_Display_Trend_2_166
          {
          NUMBER_OF_ELEMENTS  166;
          TYPE HelpFloat_1;
          }
	  
	     ARRAY array_Display_Trend_3_166
          {
          NUMBER_OF_ELEMENTS  166;
          TYPE HelpFloat_1;
          }
	  
	     ARRAY array_Display_Trend_1_125
          {
          NUMBER_OF_ELEMENTS  125;
          TYPE HelpFloat_1;
          }
  
  
	   ARRAY array_Display_Trend_2_125
          {
          NUMBER_OF_ELEMENTS  125;
          TYPE HelpFloat_1;
          }
	  
	   ARRAY array_Display_Trend_3_125
          {
          NUMBER_OF_ELEMENTS  125;
          TYPE HelpFloat_1;
          }
	  
	   ARRAY array_Display_Trend_4_125
          {
          NUMBER_OF_ELEMENTS  125;
          TYPE HelpFloat_1;
    }
    
	  WAVEFORM WAVEFORM_Trend_1_500
{
Y_AXIS YaxisTrend_1; 		
LINE_COLOR 0xC600C6;
      
	LABEL T_AssignChannelX_1;
  
TYPE YT
{
NUMBER_OF_POINTS 500;
X_INITIAL 0;
X_INCREMENT -HB_TrendInterval_1;

Y_VALUES
{
array_Display_Trend_500
	
}
}}

  WAVEFORM WAVEFORM_Trend_2_500
{
Y_AXIS YaxisTrend_2; 
  LINE_COLOR 0x0000FF;

	LABEL T_AssignChannelX_2;
  
TYPE YT
{
NUMBER_OF_POINTS 500;
X_INITIAL 0;
X_INCREMENT -HB_TrendInterval_1;

Y_VALUES
{
array_Display_Trend_500
	
}
}}

  WAVEFORM WAVEFORM_Trend_3_500
{
Y_AXIS YaxisTrend_3; 
  LINE_COLOR 0xFF0000;

	LABEL T_AssignChannelX_3;
      
TYPE YT
{
NUMBER_OF_POINTS 500;
X_INITIAL 0;
X_INCREMENT -HB_TrendInterval_1;

Y_VALUES
{
array_Display_Trend_500
	
}
}}

  WAVEFORM WAVEFORM_Trend_4_500
{
Y_AXIS YaxisTrend_4; 
  LINE_COLOR 0x00C6C6;

	LABEL T_AssignChannelX_4;
      
TYPE YT
{
NUMBER_OF_POINTS 500;
X_INITIAL 0;
X_INCREMENT -HB_TrendInterval_1;

Y_VALUES
{
array_Display_Trend_500
	
}
}}


	  WAVEFORM WAVEFORM_Trend_1_250
{
Y_AXIS YaxisTrend_1;
  LINE_COLOR 0xC600C6;

	LABEL T_AssignChannelX_1;
      
TYPE YT
{

NUMBER_OF_POINTS 250;
X_INITIAL 0;
X_INCREMENT -HB_TrendInterval_1;

Y_VALUES
{
array_Display_Trend_1_250
	
}
}}

	  WAVEFORM WAVEFORM_Trend_2_250
{
Y_AXIS YaxisTrend_2;
  LINE_COLOR 0x0000FF;

	LABEL T_AssignChannelX_2;
      
TYPE YT
{

NUMBER_OF_POINTS 250;
X_INITIAL 0;
X_INCREMENT -HB_TrendInterval_1;

Y_VALUES
{
     IF (HB_InputSelector1_1 != e_HistoRomInputSelector_Off_LONG )
     {
         array_Display_Trend_2_250
     }
     ELSE
     {
 array_Display_Trend_1_250
     }
}
}}

	  WAVEFORM WAVEFORM_Trend_3_250
{
Y_AXIS YaxisTrend_3;
  LINE_COLOR 0xFF0000;

	LABEL T_AssignChannelX_3;
      
TYPE YT
{

NUMBER_OF_POINTS 250;
X_INITIAL 0;
X_INCREMENT -HB_TrendInterval_1;

Y_VALUES
{
IF ((HB_InputSelector1_1 != e_HistoRomInputSelector_Off_LONG )||(HB_InputSelector2_1 != e_HistoRomInputSelector_Off_LONG ))
     {
         array_Display_Trend_2_250
     }
     ELSE
     {
 array_Display_Trend_1_250
     }
}
}}

	  WAVEFORM WAVEFORM_Trend_4_250
{
Y_AXIS YaxisTrend_4;
  LINE_COLOR 0x00C6C6;

	LABEL T_AssignChannelX_4;
      
TYPE YT
{

NUMBER_OF_POINTS 250;
X_INITIAL 0;
X_INCREMENT -HB_TrendInterval_1;

Y_VALUES
{
array_Display_Trend_2_250
	
}
}}

	  WAVEFORM WAVEFORM_Trend_1_166
{
Y_AXIS YaxisTrend_1;
  LINE_COLOR 0xC600C6;

	LABEL T_AssignChannelX_1;
      
TYPE YT
{

NUMBER_OF_POINTS 166;
X_INITIAL 0;
X_INCREMENT -HB_TrendInterval_1;

Y_VALUES
{
array_Display_Trend_1_166
	
}
}}

	  WAVEFORM WAVEFORM_Trend_2_166
{
Y_AXIS YaxisTrend_2;
  LINE_COLOR 0x0000FF;

	LABEL T_AssignChannelX_2;
      
TYPE YT
{

NUMBER_OF_POINTS 166;
X_INITIAL 0;
X_INCREMENT -HB_TrendInterval_1;

Y_VALUES
{
IF (HB_InputSelector1_1 != e_HistoRomInputSelector_Off_LONG )
     {
         array_Display_Trend_1_166
     }
     ELSE
     {
 array_Display_Trend_2_166
     }
	
}
}}

	  WAVEFORM WAVEFORM_Trend_3_166
{
Y_AXIS YaxisTrend_3;
  LINE_COLOR 0xFF0000;

	LABEL T_AssignChannelX_3;
      
TYPE YT
{

NUMBER_OF_POINTS 166;
X_INITIAL 0;
X_INCREMENT -HB_TrendInterval_1;

Y_VALUES
{
IF ((HB_InputSelector1_1 != e_HistoRomInputSelector_Off_LONG )||(HB_InputSelector2_1 != e_HistoRomInputSelector_Off_LONG ))
     {
         array_Display_Trend_2_166
     }
IF ((HB_InputSelector1_1 != e_HistoRomInputSelector_Off_LONG )&&(HB_InputSelector2_1 != e_HistoRomInputSelector_Off_LONG ))
     {
         array_Display_Trend_3_166
     }
     ELSE
     {
 array_Display_Trend_1_166
     }
	
}
}}

	  WAVEFORM WAVEFORM_Trend_4_166
{
Y_AXIS YaxisTrend_4;
  LINE_COLOR 0x00C6C6;

	LABEL T_AssignChannelX_4;
      
TYPE YT
{

NUMBER_OF_POINTS 166;
X_INITIAL 0;
X_INCREMENT -HB_TrendInterval_1;

Y_VALUES
{
array_Display_Trend_3_166
	
}
}}

WAVEFORM WAVEFORM_Trend_1_125
{
Y_AXIS YaxisTrend_1;
  LINE_COLOR 0xC600C6;

	LABEL T_AssignChannelX_1;
      
TYPE YT
{

NUMBER_OF_POINTS 125;
X_INITIAL 0;
X_INCREMENT -HB_TrendInterval_1;

Y_VALUES
{
array_Display_Trend_1_125
	
}
}}

WAVEFORM WAVEFORM_Trend_2_125
{
Y_AXIS YaxisTrend_2;
  LINE_COLOR 0x0000FF;

	LABEL T_AssignChannelX_2;
      
TYPE YT
{

NUMBER_OF_POINTS 125;
X_INITIAL 0;
X_INCREMENT -HB_TrendInterval_1;

Y_VALUES
{
array_Display_Trend_2_125
	
}
}}

WAVEFORM WAVEFORM_Trend_3_125
{
Y_AXIS YaxisTrend_3;
  LINE_COLOR 0xFF0000;

	LABEL T_AssignChannelX_3;
      
TYPE YT
{

NUMBER_OF_POINTS 125;
X_INITIAL 0;
X_INCREMENT -HB_TrendInterval_1;

Y_VALUES
{
array_Display_Trend_3_125
	
}
}}

WAVEFORM WAVEFORM_Trend_4_125
{
Y_AXIS YaxisTrend_4;
  LINE_COLOR 0x00C6C6;

	LABEL T_AssignChannelX_4;
      
TYPE YT
{

NUMBER_OF_POINTS 125;
X_INITIAL 0;
X_INCREMENT -HB_TrendInterval_1;

Y_VALUES
{
array_Display_Trend_4_125
	
}
}}

AXIS YaxisTrend_1
{
LABEL "";
MIN_VALUE YMinValue_1;
MAX_VALUE YMaxValue_1; 

SCALING LINEAR;
}

AXIS YaxisTrend_2
{
LABEL "";
MIN_VALUE YMinValue_2;
MAX_VALUE YMaxValue_2; 

SCALING LINEAR;
}

AXIS YaxisTrend_3
{
LABEL "";
MIN_VALUE YMinValue_3;
MAX_VALUE YMaxValue_3; 

SCALING LINEAR;
}

AXIS YaxisTrend_4
{
LABEL "";
MIN_VALUE YMinValue_4;
MAX_VALUE YMaxValue_4; 

SCALING LINEAR;
}

GRAPH TREND_GRAPH_1
{
LABEL "";
HEIGHT LARGE;
WIDTH MEDIUM;
X_AXIS XaxisTrend;

MEMBERS
{
	IF (nb_trend_local ==  1)
    {HK_TABLE1, WAVEFORM_Trend_1_500;
    }
	   IF (nb_trend_local ==  2)
    {
HK_TABLE1, WAVEFORM_Trend_1_250;
    }
    IF (nb_trend_local ==  3)
    {
HK_TABLE1, WAVEFORM_Trend_1_166;
    }
    IF (nb_trend_local ==  4)
    {
HK_TABLE1, WAVEFORM_Trend_1_125;
    }
}
}

GRAPH TREND_GRAPH_2
{
LABEL "";
HEIGHT LARGE;
WIDTH MEDIUM;
X_AXIS XaxisTrend;

MEMBERS
{
	IF (nb_trend_local ==  1)
    {HK_TABLE1, WAVEFORM_Trend_1_500;
    }
	   IF (nb_trend_local ==  2)
    {
HK_TABLE1, WAVEFORM_Trend_2_250;
    }
    IF (nb_trend_local ==  3)
    {
HK_TABLE1, WAVEFORM_Trend_2_166;
    }
    IF (nb_trend_local ==  4)
    {
HK_TABLE1, WAVEFORM_Trend_2_125;
    }
}
}

GRAPH TREND_GRAPH_3
{
LABEL "";
HEIGHT LARGE;
WIDTH MEDIUM;
X_AXIS XaxisTrend;

MEMBERS
{
	IF (nb_trend_local ==  1)
    {HK_TABLE1, WAVEFORM_Trend_1_500;
    }
	   IF (nb_trend_local ==  2)
    {
HK_TABLE1, WAVEFORM_Trend_3_250;
    }
    IF (nb_trend_local ==  3)
    {
HK_TABLE1, WAVEFORM_Trend_3_166;
    }
    IF (nb_trend_local ==  4)
    {
HK_TABLE1, WAVEFORM_Trend_3_125;
    }
}
}

GRAPH TREND_GRAPH_4
{
LABEL "";
HEIGHT LARGE;
WIDTH MEDIUM;
X_AXIS XaxisTrend;

MEMBERS
{
	IF (nb_trend_local ==  1)
    {HK_TABLE1, WAVEFORM_Trend_1_500;
    }
	   IF (nb_trend_local ==  2)
    {
HK_TABLE1, WAVEFORM_Trend_4_250;
    }
    IF (nb_trend_local ==  3)
    {
HK_TABLE1, WAVEFORM_Trend_4_166;
    }
    IF (nb_trend_local ==  4)
    {
HK_TABLE1, WAVEFORM_Trend_4_125;
    }
}
}
GRAPH TREND_GRAPH_ALL
{
LABEL "";
HEIGHT LARGE;
WIDTH MEDIUM;
X_AXIS XaxisTrend;

MEMBERS
{

 IF (nb_trend_local ==  1)
    {
        IF (HB_InputSelector1_1 != e_HistoRomInputSelector_Off_LONG )
        {
             HK_TABLE1, WAVEFORM_Trend_1_500;
        }
         IF (HB_InputSelector2_1 != e_HistoRomInputSelector_Off_LONG )
        {
             HK_TABLE1, WAVEFORM_Trend_2_500;
        }
          IF (HB_InputSelector3_1 != e_HistoRomInputSelector_Off_LONG )
        {
             HK_TABLE1, WAVEFORM_Trend_3_500;
        }
           IF (HB_InputSelector4_1 != e_HistoRomInputSelector_Off_LONG )
        {
             HK_TABLE1, WAVEFORM_Trend_4_500;
        }
       

    }
    IF (nb_trend_local ==  2)
    {

IF (HB_InputSelector1_1 != e_HistoRomInputSelector_Off_LONG )
        {
             HK_TABLE1, WAVEFORM_Trend_1_250;
        }
         IF (HB_InputSelector2_1 != e_HistoRomInputSelector_Off_LONG )
        {
             HK_TABLE1, WAVEFORM_Trend_2_250;
        }
          IF (HB_InputSelector3_1 != e_HistoRomInputSelector_Off_LONG )
        {
             HK_TABLE1, WAVEFORM_Trend_3_250;
        }
           IF (HB_InputSelector4_1 != e_HistoRomInputSelector_Off_LONG )
        {
             HK_TABLE1, WAVEFORM_Trend_4_250;
        }
    }
      IF (nb_trend_local ==  3)
    {	      
IF (HB_InputSelector1_1 != e_HistoRomInputSelector_Off_LONG )
        {
             HK_TABLE1, WAVEFORM_Trend_1_166;
        }
         IF (HB_InputSelector2_1 != e_HistoRomInputSelector_Off_LONG )
        {
             HK_TABLE1, WAVEFORM_Trend_2_166;
        }
          IF (HB_InputSelector3_1 != e_HistoRomInputSelector_Off_LONG )
        {
             HK_TABLE1, WAVEFORM_Trend_3_166;
        }
           IF (HB_InputSelector4_1 != e_HistoRomInputSelector_Off_LONG )
        {
             HK_TABLE1, WAVEFORM_Trend_4_166;
        } 
	     }
      IF (nb_trend_local ==  4)
    {
	  
IF (HB_InputSelector1_1 != e_HistoRomInputSelector_Off_LONG )
        {
             HK_TABLE1, WAVEFORM_Trend_1_125;
        }
         IF (HB_InputSelector2_1 != e_HistoRomInputSelector_Off_LONG )
        {
             HK_TABLE1, WAVEFORM_Trend_2_125;
        }
          IF (HB_InputSelector3_1 != e_HistoRomInputSelector_Off_LONG )
        {
             HK_TABLE1, WAVEFORM_Trend_3_125;
        }
           IF (HB_InputSelector4_1 != e_HistoRomInputSelector_Off_LONG )
        {
             HK_TABLE1, WAVEFORM_Trend_4_125;
        }
	     }		        
}
}

AXIS XaxisTrend
{
  MAX_VALUE 0;
  MIN_VALUE XMinAxis;
  SCALING LINEAR;
  CONSTANT_UNIT T_Unit_Second;
}

MENU Trend_DIALOG_GRAPH_1_GROUP
{
	LABEL "";
	STYLE GROUP;
	ITEMS
	{
		 HB_InputSelector1_1(READ_ONLY),
		COLUMNBREAK,
		mrkMinValue_1(READ_ONLY),
		COLUMNBREAK,
		YMinValue_1,
		ROWBREAK
        
		COLUMNBREAK
		mrkMaxValue_1(READ_ONLY),
		COLUMNBREAK,
		YMaxValue_1
	}

VALIDITY IF ( /*IsHistoROMTrendAvailable */ (((STD_SWOptionActiveOverview_1 & e_SWOptionEnabledOverview_ExtendedHistoROMAndTrend_LONG)== e_SWOptionEnabledOverview_ExtendedHistoROMAndTrend_LONG )&&(HB_InputSelector1_1 != e_HistoRomInputSelector_Off_LONG ))){ TRUE;} ELSE {FALSE;}
}

MENU Trend_DIALOG_GRAPH_2_GROUP
{
	LABEL "";
	STYLE GROUP;
	ITEMS
	{
		 HB_InputSelector2_1(READ_ONLY),
		COLUMNBREAK,
		mrkMinValue_2(READ_ONLY),
		COLUMNBREAK,
		YMinValue_2,
		ROWBREAK
        
		COLUMNBREAK
		mrkMaxValue_2(READ_ONLY),
		COLUMNBREAK,
		YMaxValue_2
	}

VALIDITY IF ( /*IsHistoROMTrendAvailable */ (((STD_SWOptionActiveOverview_1 & e_SWOptionEnabledOverview_ExtendedHistoROMAndTrend_LONG)== e_SWOptionEnabledOverview_ExtendedHistoROMAndTrend_LONG )&&(HB_InputSelector2_1 != e_HistoRomInputSelector_Off_LONG ))){ TRUE;} ELSE {FALSE;}
}

MENU Trend_DIALOG_GRAPH_3_GROUP
{
	LABEL "";
	STYLE GROUP;
	ITEMS
	{
		 HB_InputSelector3_1(READ_ONLY),
		COLUMNBREAK,
		mrkMinValue_3(READ_ONLY),
		COLUMNBREAK,
		YMinValue_3,
		ROWBREAK
        
		COLUMNBREAK
		mrkMaxValue_3(READ_ONLY),
		COLUMNBREAK,
		YMaxValue_3
	}

        VALIDITY IF ( /*IsHistoROMTrendAvailable */ (((STD_SWOptionActiveOverview_1 & e_SWOptionEnabledOverview_ExtendedHistoROMAndTrend_LONG)== e_SWOptionEnabledOverview_ExtendedHistoROMAndTrend_LONG )&&(HB_InputSelector3_1 != e_HistoRomInputSelector_Off_LONG ))){ TRUE;} ELSE {FALSE;}
      }
    
MENU Trend_DIALOG_GRAPH_4_GROUP
{
	LABEL "";
	STYLE GROUP;
	ITEMS
	{
		 HB_InputSelector4_1(READ_ONLY),
		COLUMNBREAK,
		mrkMinValue_4(READ_ONLY),
		COLUMNBREAK,
		YMinValue_4,
		ROWBREAK
        
		COLUMNBREAK
		mrkMaxValue_4(READ_ONLY),
		COLUMNBREAK,
		YMaxValue_4
	}

          VALIDITY IF ( /*IsHistoROMTrendAvailable */ (((STD_SWOptionActiveOverview_1 & e_SWOptionEnabledOverview_ExtendedHistoROMAndTrend_LONG)== e_SWOptionEnabledOverview_ExtendedHistoROMAndTrend_LONG )&&(HB_InputSelector4_1 != e_HistoRomInputSelector_Off_LONG ))){ TRUE;} ELSE {FALSE;}
}
      

MENU Trend_DIALOG_ALL
{
	LABEL T_DisplayCurves;
	STYLE DIALOG;
	ITEMS
	{
		Header,
		TREND_GRAPH_ALL,
		ROWBREAK,
		Trend_DIALOG_GRAPH_1_GROUP,
		Trend_DIALOG_GRAPH_2_GROUP,
		Trend_DIALOG_GRAPH_3_GROUP,
		Trend_DIALOG_GRAPH_4_GROUP
	}
	VALIDITY TRUE;
}

MENU Trend_DIALOG
{
	LABEL T_DisplayCurves;
	STYLE DIALOG;
	ITEMS
	{
	Header
	IF (Trend_channel == 1 )
	{
		TREND_GRAPH_1,
		ROWBREAK,
		Trend_DIALOG_GRAPH_1_GROUP
	}
	IF (Trend_channel == 2 )
	{
		TREND_GRAPH_2,
		ROWBREAK,
		Trend_DIALOG_GRAPH_2_GROUP
	}
	IF (Trend_channel == 3 )
	{
		TREND_GRAPH_3,
		ROWBREAK,
		Trend_DIALOG_GRAPH_3_GROUP
	}
	IF (Trend_channel == 4 )
		{
		TREND_GRAPH_4,
		ROWBREAK,
		Trend_DIALOG_GRAPH_4_GROUP
		}
	}
	VALIDITY TRUE;
}

VARIABLE mrkMaxValue_1
{
	LABEL T_Maximum;
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE  FLOAT
	{
		DISPLAY_FORMAT ".4f";
	}

}

VARIABLE mrkMinValue_1
{
	LABEL T_Minimum;
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE  FLOAT
	{
		DISPLAY_FORMAT ".4f";
	}

}

VARIABLE mrkMaxValue_2
{
	LABEL T_Maximum;
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE  FLOAT
	{
		DISPLAY_FORMAT ".4f";
	}

}

VARIABLE mrkMinValue_2
{
	LABEL T_Minimum;
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE  FLOAT
	{
		DISPLAY_FORMAT ".4f";
	}

}

VARIABLE mrkMaxValue_3
{
	LABEL T_Maximum;
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE  FLOAT
	{
		DISPLAY_FORMAT ".4f";
	}

}

VARIABLE mrkMinValue_3
{
	LABEL T_Minimum;
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE  FLOAT
	{
		DISPLAY_FORMAT ".4f";
	}

}

VARIABLE mrkMaxValue_4
{
	LABEL T_Maximum;
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE  FLOAT
	{
		DISPLAY_FORMAT ".4f";
	}

}

VARIABLE mrkMinValue_4
{
	LABEL T_Minimum;
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE  FLOAT
	{
		DISPLAY_FORMAT ".4f";
	}

}


VARIABLE YMaxValue_1
{
	LABEL T_UpperYLabel;
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE  FLOAT
	{
		DISPLAY_FORMAT ".4f";
	}

}

VARIABLE YMinValue_1
{
	LABEL T_LowerYLabel;
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE  FLOAT
	{
		DISPLAY_FORMAT ".4f";
	}

}

VARIABLE YMaxValue_2
{
	LABEL T_UpperYLabel;
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE  FLOAT
	{
		DISPLAY_FORMAT ".4f";
	}

}

VARIABLE YMinValue_2
{
	LABEL T_LowerYLabel;
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE  FLOAT
	{
		DISPLAY_FORMAT ".4f";
	}

}

VARIABLE YMaxValue_3
{
	LABEL T_UpperYLabel;
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE  FLOAT
	{
		DISPLAY_FORMAT ".4f";
	}

}

VARIABLE YMinValue_3
{
	LABEL T_LowerYLabel;
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE  FLOAT
	{
		DISPLAY_FORMAT ".4f";
	}

}

VARIABLE YMaxValue_4
{
	LABEL T_UpperYLabel;
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE  FLOAT
	{
		DISPLAY_FORMAT ".4f";
	}

}

VARIABLE YMinValue_4
{
	LABEL T_LowerYLabel;
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE  FLOAT
	{
		DISPLAY_FORMAT ".4f";
	}

}


VARIABLE XMinAxis
{
	LABEL "";
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE  FLOAT;
}

VARIABLE nb_trend_local
{
	LABEL "";
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE UNSIGNED_INTEGER(1);
	DEFAULT_VALUE 0;
}

VARIABLE Trend_channel
{
	LABEL "";
	CLASS LOCAL;
	HANDLING READ & WRITE;
	TYPE UNSIGNED_INTEGER(1);
	DEFAULT_VALUE 0;
}
