//This is the destructor macro which executes once, on the application close event

//*****************************  CNC4PC block  *****************************
//*****************  rem Modified Mar/14/2023 by CNC4PC  *******************


//*****************************  Set_point  *****************************
      
	  string Set_Point = AS3.Getfield(20004);
	  exec.Writekey("CNC4PC_THC-3", "Set_Point", Set_Point);
	  
//*****************************  End_Set_point  *****************************

//*****************************  Histeresys  *****************************
      
	  string Histeresys = AS3.Getfield(20007);
	  exec.Writekey("CNC4PC_THC-3", "Histeresys", Histeresys);
	  
//*****************************  End_Histeresys  *****************************

//*****************************  Auto_Set_Point_Button  *****************************

bool Auto_Set_Point_Button = AS3.Getbuttonstate(21001);
if (Auto_Set_Point_Button)
{
exec.Writekey("CNC4PC_THC-3", "Auto_Set_Point_Button", "True");
}
else
{
exec.Writekey("CNC4PC_THC-3", "Auto_Set_Point_Button", "False");
}

//*****************************  End Auto_Set_Point_Button  *****************************

//*****************************  Test_Mode_Button  *****************************

bool Test_Mode_Button = AS3.Getbuttonstate(21002);
if (Test_Mode_Button)
{
exec.Writekey("CNC4PC_THC-3", "Test_Mode_Button", "True");
}
else
{
exec.Writekey("CNC4PC_THC-3", "Test_Mode_Button", "False");
}

//*****************************  End Test_Mode_Button  *****************************

//*****************************  Divider  *****************************
      
	  string Divider = AS3.Getfield(20008);
	  exec.Writekey("CNC4PC_THC-3", "Divider", Divider);
	  
//*****************************  End_Divider  *****************************

//*****************************  Analog_Smoothing  *****************************
      
	  string Analog_Smoothing = AS3.Getfield(20009);
	  exec.Writekey("CNC4PC_THC-3", "Analog_Smoothing", Analog_Smoothing);
	  
//*****************************  End_Analog_Smoothing  *****************************

//*****************************  Anti_dive  *****************************
      
	  string Anti_dive = AS3.Getfield(20011);
	  exec.Writekey("CNC4PC_THC-3", "Anti_dive", Anti_dive);
	  
//*****************************  End_Anti_dive  *****************************

//*****************************  End CNC4PC block  *****************************