//開放對外的function
exports.Initialization = function(){
  var obj = new Object();
  var Class = new ArmAngstromInstructionSet();
  obj["GetFlashVersionInformation"] = function(Parameter){return Class.GetFlashVersionInformation(Parameter)};
  obj["MQTTCertificateList"] = function(Parameter){return Class.MQTTCertificateList(Parameter)};
  obj["KillCount"] = function(Parameter){return Class.KillCount(Parameter)};
  obj["InputSimCardPassword"] = function(Parameter){return Class.InputSimCardPassword(Parameter)};
  obj["ShowSDFilePath"] = function(Parameter){return Class.ShowSDFilePath(Parameter)};
  obj["SaveEipDri"] = function(Parameter){return Class.SaveEipDri(Parameter)};
  obj["SaveEipIndex"] = function(Parameter){return Class.SaveEipIndex(Parameter)};
  obj["SaveEipModule"] = function(Parameter){return Class.SaveEipModule(Parameter)};
  obj["SaveEipSetting"] = function(Parameter){return Class.SaveEipSetting(Parameter)};
  obj["SaveEipVariable"] = function(Parameter){return Class.SaveEipVariable(Parameter)};
  obj["SaveEipToOpcuaVariable"] = function(Parameter){return Class.SaveEipToOpcuaVariable(Parameter)};
  obj["SaveEipToMqttVariable"] = function(Parameter){return Class.SaveEipToMqttVariable(Parameter)};
  obj["SaveEipToMqttSetting"] = function(Parameter){return Class.SaveEipToMqttSetting(Parameter)};
  obj["GenerateLoginCredentials"]  = function(Parameter){return Class.GenerateLoginCredentials(Parameter)};
  obj["CheckLoginCredentials"]     = function(Parameter){return Class.CheckLoginCredentials(Parameter)};
  obj["GenerateSignInCredentials"]  = function(Parameter){return Class.GenerateSignInCredentials(Parameter)};
  obj["CheckSignInCredentials"]     = function(Parameter){return Class.CheckSignInCredentials(Parameter)};
  obj["DeleteSignInCredentials"]    = function(Parameter){return Class.DeleteSignInCredentials(Parameter)};
  obj["SaveLanguage"]              = function(Parameter){return Class.SaveLanguage(Parameter)};
  obj["DeviceReboot"]              = function(Parameter){return Class.DeviceReboot(Parameter)};
  obj["SaveBootAllData"]           = function(Parameter){return Class.SaveBootAllData(Parameter)};
  obj["SaveAccountSettingAllData"] = function(Parameter){return Class.SaveAccountSettingAllData(Parameter)};
  obj["CheckAccountPassword"]      = function(Parameter){return Class.CheckAccountPassword(Parameter)};
  obj["GetMainSystemStatus"]       = function(Parameter){return Class.GetMainSystemStatus(Parameter)};
  obj["StartMainSystem"]           = function(Parameter){return Class.StartMainSystem(Parameter)};
  obj["StopMainSystem"]            = function(Parameter){return Class.StopMainSystem(Parameter)};

  obj["GetMqttBrokerStatus"]       = function(Parameter){return Class.GetMqttBrokerStatus(Parameter)};
  obj["StartMqttBroker"]           = function(Parameter){return Class.StartMqttBroker(Parameter)};
  obj["StopMqttBroker"]            = function(Parameter){return Class.StopMqttBroker(Parameter)};

  obj["GetDdnsStatus"]             = function(Parameter){return Class.GetDdnsStatus(Parameter)};
  obj["StartDdns"]                 = function(Parameter){return Class.StartDdns(Parameter)};
  obj["StopDdns"]                  = function(Parameter){return Class.StopDdns(Parameter)};

  obj["StartBackstageService"] = function(Parameter){return Class.StartBackstageService(Parameter)};

  obj["DetectionModel"]       = function(Parameter){return Class.DetectionModel(Parameter)};
  obj["Lan1_GetIpv4Ip"]       = function(Parameter){return Class.Lan1_GetIpv4Ip(Parameter)};
  obj["Lan1_SetIpv4StaticIp"] = function(Parameter){return Class.Lan1_SetIpv4StaticIp(Parameter)};
  obj["Lan1_SetDhcp"]         = function(Parameter){return Class.Lan1_SetDhcp(Parameter)};
  obj["Lan2_GetIpv4Ip"]       = function(Parameter){return Class.Lan2_GetIpv4Ip(Parameter)};
  obj["Lan2_SetIpv4StaticIp"] = function(Parameter){return Class.Lan2_SetIpv4StaticIp(Parameter)};
  obj["Lan2_SetDhcp"]         = function(Parameter){return Class.Lan2_SetDhcp(Parameter)};

  obj["GetHostname"] = function(Parameter){return Class.GetHostname(Parameter)};
  obj["SetHostname"] = function(Parameter){return Class.SetHostname(Parameter)};

  obj["GetDdns"] = function(Parameter){return Class.GetDdns(Parameter)};
  obj["SetDdns"] = function(Parameter){return Class.SetDdns(Parameter)};
  
  obj["SaveComPortSetting"] = function(Parameter){return Class.SaveComPortSetting(Parameter)};
  
  obj["SaveRtuIndex"] = function(Parameter){return Class.SaveRtuIndex(Parameter)};
  obj["SaveRtuModule"] = function(Parameter){return Class.SaveRtuModule(Parameter)};
  obj["SaveRtuSetting"] = function(Parameter){return Class.SaveRtuSetting(Parameter)};
  obj["SaveRtuVariable"] = function(Parameter){return Class.SaveRtuVariable(Parameter)};
  obj["SaveRtuScalingVariable"] = function(Parameter){return Class.SaveRtuScalingVariable(Parameter)};
  obj["SaveRtuBitwiseVariable"] = function(Parameter){return Class.SaveRtuBitwiseVariable(Parameter)};
  obj["UpdateRtuIcpdasModule"] = function(Parameter){return Class.UpdateRtuIcpdasModule(Parameter)};

  obj["SaveAsciiIndex"] = function(Parameter){return Class.SaveAsciiIndex(Parameter)};
  obj["SaveAsciiModule"] = function(Parameter){return Class.SaveAsciiModule(Parameter)};
  obj["SaveAsciiSetting"] = function(Parameter){return Class.SaveAsciiSetting(Parameter)};
  obj["SaveAsciiVariable"] = function(Parameter){return Class.SaveAsciiVariable(Parameter)};

  obj["SaveTcpIndex"] = function(Parameter){return Class.SaveTcpIndex(Parameter)};
  obj["SaveTcpModule"] = function(Parameter){return Class.SaveTcpModule(Parameter)};
  obj["SaveTcpSetting"] = function(Parameter){return Class.SaveTcpSetting(Parameter)};
  obj["SaveTcpVariable"] = function(Parameter){return Class.SaveTcpVariable(Parameter)};
  obj["SaveTcpScalingVariable"] = function(Parameter){return Class.SaveTcpScalingVariable(Parameter)};
  obj["SaveTcpBitwiseVariable"] = function(Parameter){return Class.SaveTcpBitwiseVariable(Parameter)};
  obj["UpdateTcpIcpdasModule"] = function(Parameter){return Class.UpdateTcpIcpdasModule(Parameter)};

  obj["SaveRegisterIndex"] = function(Parameter){return Class.SaveRegisterIndex(Parameter)};
  obj["SaveRegisterModule"] = function(Parameter){return Class.SaveRegisterModule(Parameter)};
  obj["SaveRegisterSetting"] = function(Parameter){return Class.SaveRegisterSetting(Parameter)};
  obj["SaveRegisterVariable"] = function(Parameter){return Class.SaveRegisterVariable(Parameter)};

  obj["SaveRemoteMqttGroup"] = function(Parameter){return Class.SaveRemoteMqttGroup(Parameter)};
  obj["SaveMqttGroupCloudIndex"] = function(Parameter){return Class.SaveMqttGroupCloudIndex(Parameter)};

  obj["SaveMqttIndex"] = function(Parameter){return Class.SaveMqttIndex(Parameter)};
  obj["SaveMqttModule"] = function(Parameter){return Class.SaveMqttModule(Parameter)};
  obj["SaveMqttSetting"] = function(Parameter){return Class.SaveMqttSetting(Parameter)};
  obj["SaveMqttVariable"] = function(Parameter){return Class.SaveMqttVariable(Parameter)};
  obj["UpdateMqttIcpdasModule"] = function(Parameter){return Class.UpdateMqttIcpdasModule(Parameter)};
  
  obj["SaveRtuToOpcuaVariable"] = function(Parameter){return Class.SaveRtuToOpcuaVariable(Parameter)};
  obj["SaveRtuScalingToOpcuaVariable"] = function(Parameter){return Class.SaveRtuScalingToOpcuaVariable(Parameter)};
  obj["SaveRtuBitwiseToOpcuaVariable"] = function(Parameter){return Class.SaveRtuBitwiseToOpcuaVariable(Parameter)};
  obj["SaveTcpToOpcuaVariable"] = function(Parameter){return Class.SaveTcpToOpcuaVariable(Parameter)};
  obj["SaveTcpScalingToOpcuaVariable"] = function(Parameter){return Class.SaveTcpScalingToOpcuaVariable(Parameter)};
  obj["SaveTcpBitwiseToOpcuaVariable"] = function(Parameter){return Class.SaveTcpBitwiseToOpcuaVariable(Parameter)};
  obj["SaveAsciiToOpcuaVariable"] = function(Parameter){return Class.SaveAsciiToOpcuaVariable(Parameter)};
  obj["SaveMqttToOpcuaVariable"] = function(Parameter){return Class.SaveMqttToOpcuaVariable(Parameter)};
  obj["SaveRegisterToOpcuaVariable"] = function(Parameter){return Class.SaveRegisterToOpcuaVariable(Parameter)};

  obj["SaveVariableTableXml"] = function(Parameter){return Class.SaveVariableTableXml(Parameter)};
  obj["SaveModbusDri"] = function(Parameter){return Class.SaveModbusDri(Parameter)};
  obj["SaveMqttDri"] = function(Parameter){return Class.SaveMqttDri(Parameter)};
  obj["SaveUAServerDataXml"] = function(Parameter){return Class.SaveUAServerDataXml(Parameter)};
  obj["SaveMQTTServiceXml"] = function(Parameter){return Class.SaveMQTTServiceXml(Parameter)};
  obj["SavePidDriverDri"] = function(Parameter){return Class.SavePidDriverDri(Parameter)};
  obj["SaveMethodTableXml"] = function(Parameter){return Class.SaveMethodTableXml(Parameter)};
  obj["SaveScaleVariableTableXml"] = function(Parameter){return Class.SaveScaleVariableTableXml(Parameter)};
  obj["SaveBitwiseVariableTableXml"] = function(Parameter){return Class.SaveBitwiseVariableTableXml(Parameter)};
  
  obj["SaveLocalBrokerSetting"] = function(Parameter){return Class.SaveLocalBrokerSetting(Parameter)};
  obj["GetLocalBrokerSetting"] = function(Parameter){return Class.GetLocalBrokerSetting(Parameter)};
  obj["SaveRemoteBrokerSetting"] = function(Parameter){return Class.SaveRemoteBrokerSetting(Parameter)};
  obj["SaveMqttJsonGroup"] = function(Parameter){return Class.SaveMqttJsonGroup(Parameter)};
  obj["SaveAzurePlatformSetting"] = function(Parameter){return Class.SaveAzurePlatformSetting(Parameter)};
  obj["SaveOpcUaLocalServer"] = function(Parameter){return Class.SaveOpcUaLocalServer(Parameter)};

  obj["SaveRtuToMqttSetting"] = function(Parameter){return Class.SaveRtuToMqttSetting(Parameter)};
  obj["SaveRtuToMqttVariable"] = function(Parameter){return Class.SaveRtuToMqttVariable(Parameter)};

  obj["SaveTcpToMqttSetting"] = function(Parameter){return Class.SaveTcpToMqttSetting(Parameter)};
  obj["SaveTcpToMqttVariable"] = function(Parameter){return Class.SaveTcpToMqttVariable(Parameter)};
  
  obj["SaveAsciiToMqttSetting"] = function(Parameter){return Class.SaveAsciiToMqttSetting(Parameter)};
  obj["SaveAsciiToMqttVariable"] = function(Parameter){return Class.SaveAsciiToMqttVariable(Parameter)};

  obj["SaveRtuToMqttJsonVariable"] = function(Parameter){return Class.SaveRtuToMqttJsonVariable(Parameter)};
  obj["SaveTcpToMqttJsonVariable"] = function(Parameter){return Class.SaveTcpToMqttJsonVariable(Parameter)};
  obj["SaveAsciiToMqttJsonVariable"] = function(Parameter){return Class.SaveAsciiToMqttJsonVariable(Parameter)};
  
  obj["RemoveProjectFile"] = function(Parameter){return Class.RemoveProjectFile(Parameter)};
  obj["RemoveOpcuaTrustedCertificate"] = function(Parameter){return Class.RemoveOpcuaTrustedCertificate(Parameter)};
  obj["RemoveOpcuaServerCertificate"] = function(Parameter){return Class.RemoveOpcuaServerCertificate(Parameter)};
  obj["RemoveMqttTrustedCertificate"] = function(Parameter){return Class.RemoveMqttTrustedCertificate(Parameter)};
  obj["RemoveMqttCertificate"] = function(Parameter){return Class.RemoveMqttCertificate(Parameter)};
  obj["RemoveMqttPrivateKey"] = function(Parameter){return Class.RemoveMqttPrivateKey(Parameter)};

  obj["DownloadProjectFile"] = function(Parameter){return Class.DownloadProjectFile(Parameter)};
  obj["DownloadOpcuaServerCertificate"] = function(Parameter){return Class.DownloadOpcuaServerCertificate(Parameter)};
  obj["UpdateProjectFile"] = function(Parameter){return Class.UpdateProjectFile(Parameter)};
  obj["UpdateFirmwareFile"] = function(Parameter){return Class.UpdateFirmwareFile(Parameter)};
  obj["UpdateOpcuaTrustedCertificate"] = function(Parameter){return Class.UpdateOpcuaTrustedCertificate(Parameter)};
  obj["UpdateMqttTrustedCertificate"] = function(Parameter){return Class.UpdateMqttTrustedCertificate(Parameter)};
  obj["UpdateMqttCertificate"] = function(Parameter){return Class.UpdateMqttCertificate(Parameter)};
  obj["UpdateMqttPrivateKey"] = function(Parameter){return Class.UpdateMqttPrivateKey(Parameter)};
  obj["DeleteTarFile"] = function(Parameter){return Class.DeleteTarFile(Parameter)};

  obj["GetDate"] = function(Parameter){return Class.GetDate(Parameter)};
  obj["GetTime"] = function(Parameter){return Class.GetTime(Parameter)};
  obj["GetDateTime"] = function(Parameter){return Class.GetDateTime(Parameter)};
  obj["SaveManuallySetTime"] = function(Parameter){return Class.SaveManuallySetTime(Parameter)};
  obj["SaveNtpSet"] = function(Parameter){return Class.SaveNtpSet(Parameter)};
  obj["GetNtpData"] = function(Parameter){return Class.GetNtpData(Parameter)};
  obj["GetSystemInformation"] = function(Parameter){return Class.GetSystemInformation(Parameter)};
  
  obj["GetVersion"] = function(Parameter){return Class.GetVersion(Parameter)};

  obj["SavePidOperationVariable"] = function(Parameter){return Class.SavePidOperationVariable(Parameter)};

  obj["SaveIftttConditionTriggerSetting"] = function(Parameter){return Class.SaveIftttConditionTriggerSetting(Parameter)};
  obj["SaveIftttConditionTriggerVariable"] = function(Parameter){return Class.SaveIftttConditionTriggerVariable(Parameter)};

  obj["IsExistWirelessDevice"] = function(Parameter){return Class.IsExistWirelessDevice(Parameter)};
  obj["WirelessConnection"] = function(Parameter){return Class.WirelessConnection(Parameter)};
  obj["WirelessDisconnect"] = function(Parameter){return Class.WirelessDisconnect(Parameter)};
  obj["GetWirelessData"] = function(Parameter){return Class.GetWirelessData(Parameter)};
  obj["SaveWirelessData"] = function(Parameter){return Class.SaveWirelessData(Parameter)};
  obj["GetWirelessInformation"] = function(Parameter){return Class.GetWirelessInformation(Parameter)};
  
  obj["SaveMsSqlConnection"] = function(Parameter){return Class.SaveMsSqlConnection(Parameter)};
  obj["MsSqlConnectionTest"] = function(Parameter){return Class.MsSqlConnectionTest(Parameter)};
  obj["SaveTcpToMsSqlVariable"] = function(Parameter){return Class.SaveTcpToMsSqlVariable(Parameter)};
  obj["SaveRtuToMsSqlVariable"] = function(Parameter){return Class.SaveRtuToMsSqlVariable(Parameter)};
  obj["SaveMqttToMsSqlVariable"] = function(Parameter){return Class.SaveMqttToMsSqlVariable(Parameter)};
  obj["SaveMysqlConnection"] = function(Parameter){return Class.SaveMysqlConnection(Parameter)};
  obj["MysqlConnectionTest"] = function(Parameter){return Class.MysqlConnectionTest(Parameter)};
  obj["SaveTcpToMysqlConnectionVariable"] = function(Parameter){return Class.SaveTcpToMysqlConnectionVariable(Parameter)};
  obj["SaveRtuToMysqlConnectionVariable"] = function(Parameter){return Class.SaveRtuToMysqlConnectionVariable(Parameter)};
  obj["SaveMqttToMysqlVariable"] = function(Parameter){return Class.SaveMqttToMysqlVariable(Parameter)};

  obj["GetWebAllLink"] = function(Parameter){return Class.GetWebAllLink(Parameter)};
  obj["WebShell"] = function(Parameter){return Class.WebShell(Parameter)};
  obj["GetSdCardUsageRate"] = function(Parameter){return Class.GetSdCardUsageRate(Parameter)};
  obj["GetSdCardFreeRate"] = function(Parameter){return Class.GetSdCardFreeRate(Parameter)};
  obj["MkdirUpdateFolder"] = function(Parameter){return Class.MkdirUpdateFolder(Parameter)};
  obj["GetWebLogMessage"] = function(Parameter){return Class.GetWebLogMessage(Parameter)};
  obj["MountSdCard"] = function(Parameter){return Class.MountSdCard(Parameter)};
  obj["UnMountSdCard"] = function(Parameter){return Class.UnMountSdCard(Parameter)};

  obj["SaveLocalDataLogger"] = function(Parameter){return Class.SaveLocalDataLogger(Parameter)};
  obj["SaveRtuToLocalDataLoggerVariable"] = function(Parameter){return Class.SaveRtuToLocalDataLoggerVariable(Parameter)};
  obj["SaveTcpToLocalDataLoggerVariable"] = function(Parameter){return Class.SaveTcpToLocalDataLoggerVariable(Parameter)};
  obj["SaveDataLogServiceXml"] = function(Parameter){return Class.SaveDataLogServiceXml(Parameter)};

  obj["SaveIoTstarSetting"] = function(Parameter){return Class.SaveIoTstarSetting(Parameter)};
  obj["StartIoTstar"] = function(Parameter){return Class.StartIoTstar(Parameter)};
  obj["StopIoTstar"] = function(Parameter){return Class.StopIoTstar(Parameter)};
  obj["GetIoTstarStatus"] = function(Parameter){return Class.GetIoTstarStatus(Parameter)};
  return obj;
};

//.h.js
function ArmAngstromInstructionSet()
{
  this.GetFlashVersionInformation    = function(Parameter){return ArmAngstromInstructionSet.prototype._GetFlashVersionInformation_(Parameter);};
  var ComPortUpdate = function(){return ArmAngstromInstructionSet.prototype._ComPortUpdate_();};
  this.MQTTCertificateList    = function(Parameter){return ArmAngstromInstructionSet.prototype._MQTTCertificateList_(Parameter);};
	this.KillCount    = function(Parameter){return ArmAngstromInstructionSet.prototype._KillCount_(Parameter);};
	this.InputSimCardPassword    = function(Parameter){return ArmAngstromInstructionSet.prototype._InputSimCardPassword_(Parameter);};
	this.ShowSDFilePath    = function(Parameter){return ArmAngstromInstructionSet.prototype._ShowSDFilePath_(Parameter);};
	this.SaveEipDri    = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveEipDri_(Parameter);};
	this.SaveEipIndex    = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveEipIndex_(Parameter);};
	this.SaveEipModule   = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveEipModule_(Parameter);};
	this.SaveEipSetting  = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveEipSetting_(Parameter);};
	this.SaveEipVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveEipVariable_(Parameter);};
	this.SaveEipToOpcuaVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveEipToOpcuaVariable_(Parameter);};
	this.SaveEipToMqttVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveEipToMqttVariable_(Parameter);};
	this.SaveEipToMqttSetting = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveEipToMqttSetting_(Parameter);};
	this.GenerateLoginCredentials        = function(Parameter){return ArmAngstromInstructionSet.prototype._GenerateLoginCredentials_(Parameter);};
	this.CheckLoginCredentials           = function(Parameter){return ArmAngstromInstructionSet.prototype._CheckLoginCredentials_(Parameter);};
	this.GenerateSignInCredentials        = function(Parameter){return ArmAngstromInstructionSet.prototype._GenerateSignInCredentials_(Parameter);};
	this.CheckSignInCredentials           = function(Parameter){return ArmAngstromInstructionSet.prototype._CheckSignInCredentials_(Parameter);};
	this.DeleteSignInCredentials          = function(Parameter){return ArmAngstromInstructionSet.prototype._DeleteSignInCredentials_(Parameter);};

	this.SaveLanguage                    = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveLanguage_(Parameter);};
	this.DeviceReboot                    = function(Parameter){return ArmAngstromInstructionSet.prototype._DeviceReboot_(Parameter);};
	this.SaveBootAllData                 = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveBootAllData_(Parameter);};
	this.SaveAccountSettingAllData       = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveAccountSettingAllData_(Parameter);};
	this.CheckAccountPassword            = function(Parameter){return ArmAngstromInstructionSet.prototype._CheckAccountPassword_(Parameter);};
	
	this.GetMainSystemStatus   = function(Parameter){return ArmAngstromInstructionSet.prototype._GetMainSystemStatus_(Parameter);};
	this.StartMainSystem       = function(Parameter){return ArmAngstromInstructionSet.prototype._StartMainSystem_(Parameter);};
	this.StopMainSystem        = function(Parameter){return ArmAngstromInstructionSet.prototype._StopMainSystem_(Parameter);};

	this.GetMqttBrokerStatus   = function(Parameter){return ArmAngstromInstructionSet.prototype._GetMqttBrokerStatus_(Parameter);};
	this.StartMqttBroker       = function(Parameter){return ArmAngstromInstructionSet.prototype._StartMqttBroker_(Parameter);};
	this.StopMqttBroker        = function(Parameter){return ArmAngstromInstructionSet.prototype._StopMqttBroker_(Parameter);};
	
	this.GetDdnsStatus   = function(Parameter){return ArmAngstromInstructionSet.prototype._GetDdnsStatus_(Parameter);};
	this.StartDdns       = function(Parameter){return ArmAngstromInstructionSet.prototype._StartDdns_(Parameter);};
	this.StopDdns        = function(Parameter){return ArmAngstromInstructionSet.prototype._StopDdns_(Parameter);};
	
	this.StartBackstageService = function(Parameter){return ArmAngstromInstructionSet.prototype._StartBackstageService_(Parameter);};

  this.DetectionModel       = function(Parameter){return ArmAngstromInstructionSet.prototype._DetectionModel_(Parameter);};
	this.Lan1_GetIpv4Ip       = function(Parameter){return ArmAngstromInstructionSet.prototype._Lan1_GetIpv4Ip_(Parameter);};
	this.Lan1_SetIpv4StaticIp = function(Parameter){return ArmAngstromInstructionSet.prototype._Lan1_SetIpv4StaticIp_(Parameter);};
	this.Lan1_SetDhcp = function(Parameter){return ArmAngstromInstructionSet.prototype._Lan1_SetDhcp_(Parameter);};
  this.Lan2_GetIpv4Ip       = function(Parameter){return ArmAngstromInstructionSet.prototype._Lan2_GetIpv4Ip_(Parameter);};
  this.Lan2_SetIpv4StaticIp = function(Parameter){return ArmAngstromInstructionSet.prototype._Lan2_SetIpv4StaticIp_(Parameter);};
  this.Lan2_SetDhcp = function(Parameter){return ArmAngstromInstructionSet.prototype._Lan2_SetDhcp_(Parameter);};

	this.GetHostname     = function(Parameter){return ArmAngstromInstructionSet.prototype._GetHostname_(Parameter);};
	this.SetHostname     = function(Parameter){return ArmAngstromInstructionSet.prototype._SetHostname_(Parameter);};
	
	this.GetDdns = function(Parameter){return ArmAngstromInstructionSet.prototype._GetDdns_(Parameter);};
	this.SetDdns = function(Parameter){return ArmAngstromInstructionSet.prototype._SetDdns_(Parameter);};
	
	this.SaveComPortSetting = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveComPortSetting_(Parameter);};

	this.SaveRtuIndex    = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRtuIndex_(Parameter);};
	this.SaveRtuModule   = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRtuModule_(Parameter);};
	this.SaveRtuSetting  = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRtuSetting_(Parameter);};
	this.SaveRtuVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRtuVariable_(Parameter);};
  this.SaveRtuScalingVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRtuScalingVariable_(Parameter);};
  this.SaveRtuBitwiseVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRtuBitwiseVariable_(Parameter);};
  this.UpdateRtuIcpdasModule = function(Parameter){return ArmAngstromInstructionSet.prototype._UpdateRtuIcpdasModule_(Parameter);};

	this.SaveAsciiIndex    = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveAsciiIndex_(Parameter);};
	this.SaveAsciiModule   = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveAsciiModule_(Parameter);};
	this.SaveAsciiSetting  = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveAsciiSetting_(Parameter);};
	this.SaveAsciiVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveAsciiVariable_(Parameter);};

	this.SaveTcpIndex    = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveTcpIndex_(Parameter);};
	this.SaveTcpModule   = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveTcpModule_(Parameter);};
	this.SaveTcpSetting  = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveTcpSetting_(Parameter);};
	this.SaveTcpVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveTcpVariable_(Parameter);};
  this.SaveTcpScalingVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveTcpScalingVariable_(Parameter);};
  this.SaveTcpBitwiseVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveTcpBitwiseVariable_(Parameter);};
  this.UpdateTcpIcpdasModule = function(Parameter){return ArmAngstromInstructionSet.prototype._UpdateTcpIcpdasModule_(Parameter);};
	
  this.SaveRegisterIndex    = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRegisterIndex_(Parameter);};
  this.SaveRegisterModule   = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRegisterModule_(Parameter);};
  this.SaveRegisterSetting  = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRegisterSetting_(Parameter);};
  this.SaveRegisterVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRegisterVariable_(Parameter);};

  this.SaveRemoteMqttGroup    = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRemoteMqttGroup_(Parameter);};
  this.SaveMqttGroupCloudIndex    = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveMqttGroupCloudIndex_(Parameter);};


	this.SaveMqttIndex    = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveMqttIndex_(Parameter);};
	this.SaveMqttModule   = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveMqttModule_(Parameter);};
	this.SaveMqttSetting  = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveMqttSetting_(Parameter);};
	this.SaveMqttVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveMqttVariable_(Parameter);};
  this.UpdateMqttIcpdasModule = function(Parameter){return ArmAngstromInstructionSet.prototype._UpdateMqttIcpdasModule_(Parameter);};

	this.SaveRtuToOpcuaVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRtuToOpcuaVariable_(Parameter);};
  this.SaveRtuScalingToOpcuaVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRtuScalingToOpcuaVariable_(Parameter);};
  this.SaveRtuBitwiseToOpcuaVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRtuBitwiseToOpcuaVariable_(Parameter);};
	this.SaveTcpToOpcuaVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveTcpToOpcuaVariable_(Parameter);};
  this.SaveTcpScalingToOpcuaVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveTcpScalingToOpcuaVariable_(Parameter);};
  this.SaveTcpBitwiseToOpcuaVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveTcpBitwiseToOpcuaVariable_(Parameter);};
	this.SaveAsciiToOpcuaVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveAsciiToOpcuaVariable_(Parameter);};
	this.SaveMqttToOpcuaVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveMqttToOpcuaVariable_(Parameter);};
  this.SaveRegisterToOpcuaVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRegisterToOpcuaVariable_(Parameter);};


	this.SaveVariableTableXml = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveVariableTableXml_(Parameter);};
	this.SaveModbusDri = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveModbusDri_(Parameter);};
	this.SaveMqttDri = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveMqttDri_(Parameter);};
	this.SaveUAServerDataXml = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveUAServerDataXml_(Parameter);};
	this.SaveMQTTServiceXml = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveMQTTServiceXml_(Parameter);};
	this.SavePidDriverDri = function(Parameter){return ArmAngstromInstructionSet.prototype._SavePidDriverDri_(Parameter);};
	this.SaveMethodTableXml = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveMethodTableXml_(Parameter);};
  this.SaveScaleVariableTableXml = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveScaleVariableTableXml_(Parameter);};
  this.SaveBitwiseVariableTableXml = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveBitwiseVariableTableXml_(Parameter);};

	this.SaveLocalBrokerSetting = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveLocalBrokerSetting_(Parameter);};
	this.GetLocalBrokerSetting = function(Parameter){return ArmAngstromInstructionSet.prototype._GetLocalBrokerSetting_(Parameter);};
	this.SaveRemoteBrokerSetting = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRemoteBrokerSetting_(Parameter);};
	this.SaveMqttJsonGroup = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveMqttJsonGroup_(Parameter);};
	this.SaveAzurePlatformSetting = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveAzurePlatformSetting_(Parameter);};
	this.SaveOpcUaLocalServer = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveOpcUaLocalServer_(Parameter);};

	this.SaveRtuToMqttSetting = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRtuToMqttSetting_(Parameter);};
	this.SaveRtuToMqttVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRtuToMqttVariable_(Parameter);};
	
	this.SaveTcpToMqttSetting = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveTcpToMqttSetting_(Parameter);};
	this.SaveTcpToMqttVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveTcpToMqttVariable_(Parameter);};
	
	this.SaveAsciiToMqttSetting = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveAsciiToMqttSetting_(Parameter);};
	this.SaveAsciiToMqttVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveAsciiToMqttVariable_(Parameter);};
	
	this.SaveRtuToMqttJsonVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRtuToMqttJsonVariable_(Parameter);};
	this.SaveTcpToMqttJsonVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveTcpToMqttJsonVariable_(Parameter);};
	this.SaveAsciiToMqttJsonVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveAsciiToMqttJsonVariable_(Parameter);};

	this.RemoveProjectFile = function(Parameter){return ArmAngstromInstructionSet.prototype._RemoveProjectFile_(Parameter);};
	this.RemoveOpcuaTrustedCertificate = function(Parameter){return ArmAngstromInstructionSet.prototype._RemoveOpcuaTrustedCertificate_(Parameter);};
  this.RemoveOpcuaServerCertificate = function(Parameter){return ArmAngstromInstructionSet.prototype._RemoveOpcuaServerCertificate_(Parameter);};
  this.RemoveMqttTrustedCertificate = function(Parameter){return ArmAngstromInstructionSet.prototype._RemoveMqttTrustedCertificate_(Parameter);};
  this.RemoveMqttCertificate = function(Parameter){return ArmAngstromInstructionSet.prototype._RemoveMqttCertificate_(Parameter);};
  this.RemoveMqttPrivateKey = function(Parameter){return ArmAngstromInstructionSet.prototype._RemoveMqttPrivateKey_(Parameter);};

	this.DownloadProjectFile = function(Parameter){return ArmAngstromInstructionSet.prototype._DownloadProjectFile_(Parameter);};
	this.DownloadOpcuaServerCertificate = function(Parameter){return ArmAngstromInstructionSet.prototype._DownloadOpcuaServerCertificate_(Parameter);};
	this.UpdateProjectFile = function(Parameter){return ArmAngstromInstructionSet.prototype._UpdateProjectFile_(Parameter);};
  this.UpdateFirmwareFile = function(Parameter){return ArmAngstromInstructionSet.prototype._UpdateFirmwareFile_(Parameter);};
	this.UpdateOpcuaTrustedCertificate = function(Parameter){return ArmAngstromInstructionSet.prototype._UpdateOpcuaTrustedCertificate_(Parameter);};
  this.UpdateMqttTrustedCertificate = function(Parameter){return ArmAngstromInstructionSet.prototype._UpdateMqttTrustedCertificate_(Parameter);};
  this.UpdateMqttCertificate = function(Parameter){return ArmAngstromInstructionSet.prototype._UpdateMqttCertificate_(Parameter);};
  this.UpdateMqttPrivateKey = function(Parameter){return ArmAngstromInstructionSet.prototype._UpdateMqttPrivateKey_(Parameter);};

	this.DeleteTarFile = function(Parameter){return ArmAngstromInstructionSet.prototype._DeleteTarFile_(Parameter);};

	this.GetDate = function(Parameter){return ArmAngstromInstructionSet.prototype._GetDate_(Parameter);};
	this.GetTime = function(Parameter){return ArmAngstromInstructionSet.prototype._GetTime_(Parameter);};
	this.SaveManuallySetTime = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveManuallySetTime_(Parameter);};
	this.GetDateTime = function(Parameter){return ArmAngstromInstructionSet.prototype._GetDateTime_(Parameter);};
	this.SaveNtpSet = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveNtpSet_(Parameter);};
	this.GetNtpData = function(Parameter){return ArmAngstromInstructionSet.prototype._GetNtpData_(Parameter);};
  this.GetSystemInformation = function(Parameter){return ArmAngstromInstructionSet.prototype._GetSystemInformation_(Parameter);};
	
	this.GetVersion = function(Parameter){return ArmAngstromInstructionSet.prototype._GetVersion_(Parameter);};
	
	this.SavePidOperationVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SavePidOperationVariable_(Parameter);};
	
	this.SaveIftttConditionTriggerSetting = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveIftttConditionTriggerSetting_(Parameter);};
	this.SaveIftttConditionTriggerVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveIftttConditionTriggerVariable_(Parameter);};
	
	this.IsExistWirelessDevice = function(Parameter){return ArmAngstromInstructionSet.prototype._IsExistWirelessDevice_(Parameter);};
	this.WirelessConnection = function(Parameter){return ArmAngstromInstructionSet.prototype._WirelessConnection_(Parameter);};
	this.WirelessDisconnect = function(Parameter){return ArmAngstromInstructionSet.prototype._WirelessDisconnect_(Parameter);};
	this.GetWirelessData = function(Parameter){return ArmAngstromInstructionSet.prototype._GetWirelessData_(Parameter);};
	this.SaveWirelessData = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveWirelessData_(Parameter);};
	this.GetWirelessInformation = function(Parameter){return ArmAngstromInstructionSet.prototype._GetWirelessInformation_(Parameter);};

	this.SaveMsSqlConnection = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveMsSqlConnection_(Parameter);};
	this.MsSqlConnectionTest = function(Parameter){return ArmAngstromInstructionSet.prototype._MsSqlConnectionTest_(Parameter);};
	this.SaveTcpToMsSqlVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveTcpToMsSqlVariable_(Parameter);};
	this.SaveRtuToMsSqlVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRtuToMsSqlVariable_(Parameter);};
  this.SaveMqttToMsSqlVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveMqttToMsSqlVariable_(Parameter);};
    this.SaveMysqlConnection = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveMysqlConnection_(Parameter);};
    this.MysqlConnectionTest = function(Parameter){return ArmAngstromInstructionSet.prototype._MysqlConnectionTest_(Parameter);};
    this.SaveTcpToMysqlConnectionVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveTcpToMysqlConnectionVariable_(Parameter);};
    this.SaveRtuToMysqlConnectionVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRtuToMysqlConnectionVariable_(Parameter);};
    this.SaveMqttToMysqlVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveMqttToMysqlVariable_(Parameter);};

	this.GetWebAllLink = function(Parameter){return ArmAngstromInstructionSet.prototype._GetWebAllLink_(Parameter);};
	this.WebShell = function(Parameter){return ArmAngstromInstructionSet.prototype._WebShell_(Parameter);};
	this.GetSdCardUsageRate = function(Parameter){return ArmAngstromInstructionSet.prototype._GetSdCardUsageRate_(Parameter);};
  this.GetSdCardFreeRate = function(Parameter){return ArmAngstromInstructionSet.prototype._GetSdCardFreeRate_(Parameter);};
	this.GetWebLogMessage = function(Parameter){return ArmAngstromInstructionSet.prototype._GetWebLogMessage_(Parameter);};
  this.MkdirUpdateFolder = function(Parameter){return ArmAngstromInstructionSet.prototype._MkdirUpdateFolder_(Parameter);};
  this.MountSdCard = function(Parameter){return ArmAngstromInstructionSet.prototype._MountSdCard_(Parameter);};
	this.UnMountSdCard = function(Parameter){return ArmAngstromInstructionSet.prototype._UnMountSdCard_(Parameter);};
	this.SaveLocalDataLogger = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveLocalDataLogger_(Parameter);};
	this.SaveRtuToLocalDataLoggerVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveRtuToLocalDataLoggerVariable_(Parameter);};
	this.SaveTcpToLocalDataLoggerVariable = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveTcpToLocalDataLoggerVariable_(Parameter);};
	this.SaveDataLogServiceXml = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveDataLogServiceXml_(Parameter);};

	this.SaveIoTstarSetting = function(Parameter){return ArmAngstromInstructionSet.prototype._SaveIoTstarSetting_(Parameter);};
	this.StartIoTstar = function(Parameter){return ArmAngstromInstructionSet.prototype._StartIoTstar_(Parameter);};
	this.StopIoTstar = function(Parameter){return ArmAngstromInstructionSet.prototype._StopIoTstar_(Parameter);};
  this.GetIoTstarStatus = function(Parameter){return ArmAngstromInstructionSet.prototype._GetIoTstarStatus_(Parameter);};
}
//
ArmAngstromInstructionSet.prototype._GetFlashVersionInformation_ = function(Parameter)
{
  var Return = new Array(), execSync = require('child_process').execSync, fs = require("fs");
  try{
    var FlashInformation = execSync("ls /dev");
    if(FlashInformation.toString().indexOf("ubi0_0") > 0)
    {
      Return[0] = "/dev/ubi0_0";
    }
    else
    {
      Return[0] = "/dev/mmcblk1";
    }

  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};


ArmAngstromInstructionSet.prototype._SaveRegisterIndex_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/Register_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"Index.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};
ArmAngstromInstructionSet.prototype._SaveRegisterModule_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/Register_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"Module.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};
ArmAngstromInstructionSet.prototype._SaveRegisterVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/Register_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"RegisterVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};
ArmAngstromInstructionSet.prototype._SaveRegisterSetting_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/Register_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"RegisterSetting.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveRemoteMqttGroup_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/RemoteMQTTGroup/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"RemoteMqttGroup.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveMqttGroupCloudIndex_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/RemoteMQTTGroup/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"Index.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};


//MQTT憑證清單
ArmAngstromInstructionSet.prototype._MQTTCertificateList_ = function(Parameter)
{
  var Return = new Array(), execSync = require('child_process').execSync, fs = require("fs");
  try{
    var TrustedCertificatePath = Parameter[0] + "/trusted";
    var CertificatePath = Parameter[0] + "/client/certs";
    var PrivateKeyPath = Parameter[0] + "/client/private";
    var TrustedCertificate = execSync("ls -lht "+ TrustedCertificatePath +" | awk \'{print $9}\'");
    var Certificate = execSync("ls -lht "+ CertificatePath +" | awk \'{print $9}\'");
    var PrivateKey = execSync("ls -lht "+ PrivateKeyPath +" | awk \'{print $9}\'");
    TrustedCertificate = TrustedCertificate.toString();
    TrustedCertificate = TrustedCertificate.toString().split("\n");
    Certificate = Certificate.toString();
    Certificate = Certificate.toString().split("\n");
    PrivateKey = PrivateKey.toString();
    PrivateKey = PrivateKey.toString().split("\n");
    Return[0] = TrustedCertificate;
    Return[1] = Certificate;
    Return[2] = PrivateKey;
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

//PIN 死亡次數
ArmAngstromInstructionSet.prototype._KillCount_ = function(Parameter)
{
  var KillCountCmd= "AT+QPINC?";
  var Return = new Array(), execSync = require('child_process').execSync, fs = require("fs");
  try{
    Return = execSync("/app/Wireless/AT_Command " + KillCountCmd + " | grep \'SC\'").toString().replace("\n", "");
  }
  catch(err){
    Return = "Error";
  }
  execSync('sync; sync; sync;');
  return Return;
};

//Sim密碼確認回傳
ArmAngstromInstructionSet.prototype._InputSimCardPassword_ = function(Parameter)
{

  var PasswordCmd = Parameter[0];
  var PasswordCmd = "AT+CPIN="+ PasswordCmd;
  var ReleasePassword = 'AT+CLCK=\\\"SC\\\",0,\\\"'+ Parameter[0] + '\\\"';
  var Return = new Array(), execSync = require('child_process').execSync, fs = require("fs");
  try{
    execSync("/app/Wireless/AT_Command " + "\'AT+CFUN=0\'");
    execSync("/app/Wireless/AT_Command " + "\'AT+CFUN=1\'");
    execSync("usleep 200000");
    if(execSync("/app/Wireless/AT_Command " + PasswordCmd).toString().indexOf("OK") > 0)
      {
        Return[0]="Pass";
        execSync("/app/Wireless/AT_Command " + ReleasePassword).toString();

      }
      else
      {
        Return[0]="Fail";
      }
  }
  catch(err){
    Return[0] = "Pass";
  }
  execSync('sync; sync; sync;');
  return Return;
};



ArmAngstromInstructionSet.prototype._ShowSDFilePath_ = function(Parameter)
{
  var Return = new Array(), execSync = require('child_process').execSync, fs = require("fs");
  try{
    var FilePath = "/mnt" + Parameter[0];
    var FileName = execSync("ls -lht "+ FilePath +" | awk \'{print $9}\'");
    var FileType = execSync("ls -lht "+ FilePath +" | awk \'{print $1}\'");
    var FileSize = execSync("ls -lht "+ FilePath +" | awk \'{print $5}\'");
    FileName = FileName.toString();
    FileName = FileName.toString().split("\n");
    FileType = FileType.toString();
    FileType = FileType.toString().split("\n");
    FileSize = FileSize.toString();
    FileSize = FileSize.toString().split("\n");
    Return[0] = FileName;
    Return[1] = FileType;
    Return[2] = FileSize;
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

//.jpp.js
//EIP模組
//OK
ArmAngstromInstructionSet.prototype._SaveEipDri_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/runtime/project/plugin/driver/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"ICPDAS_EIP.dri", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveEipIndex_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/EIP_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"Index.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};
ArmAngstromInstructionSet.prototype._SaveEipModule_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/EIP_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"Module.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveEipSetting_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/EIP_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"EipSetting.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveEipVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/EIP_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"EipVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};
ArmAngstromInstructionSet.prototype._SaveEipToOpcuaVariable_ = function(Parameter)
{
  var Return = false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/EIP_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"EipToOpcuaVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveEipToMqttVariable_ = function(Parameter)
{
  var Return = false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/EIP_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"EipToMqttVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveEipToMqttSetting_ = function(Parameter)
{
  var Return = false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/EIP_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"EipToMqttSetting.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._GenerateLoginCredentials_ = function(Parameter)
{
	var Return, execSync = require('child_process').execSync;
	try{
		execSync('ifconfig | grep "HWaddr" | awk \'{print $5}\' > /app/Web/public/File/Temporary/LoginCredentials');
		execSync('sync; sync; sync;');
		Return=true;
	}
	catch(err){
		Return=err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._CheckLoginCredentials_ = function(Parameter)
{
	var Return, HWaddr, execSync = require('child_process').execSync;
	try{
		Return = execSync('cat /app/Web/public/File/Temporary/LoginCredentials');
		HWaddr = execSync('ifconfig | grep "HWaddr" | awk \'{print $5}\'');
		if(Return.toString() == HWaddr.toString())	{Return = true;}
		else										{Return = false;}
		execSync('rm -rf /app/Web/public/File/Temporary/LoginCredentials');
		execSync('sync; sync; sync;');
	}
	catch(err){
		if(err.toString().indexOf("No such file or directory") > 0 &&
		   err.toString().indexOf("/app/Web/public/File/Temporary/LoginCredentials") > 0)	{Return = false;}
		else																		{Return = err.toString();}
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._GenerateSignInCredentials_ = function(Parameter)
{
  var Return, execSync = require('child_process').execSync, fs = require("fs");
  try{
    fs.accessSync('/dev/shm/SignInCredentials', fs.constants.R_OK | fs.constants.W_OK);
    return true;
  }
  catch (err){}
  try{
    execSync('ifconfig | grep "HWaddr" | awk \'{print $5}\' > /dev/shm/SignInCredentials');
    execSync('sync; sync; sync;');
    Return=true;
  }
  catch(err){
    Return=err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._CheckSignInCredentials_ = function(Parameter)
{
  var Return, HWaddr, execSync = require('child_process').execSync;
  try{
    Return = execSync('cat /dev/shm/SignInCredentials');
    HWaddr = execSync('ifconfig | grep "HWaddr" | awk \'{print $5}\'');
    if(Return.toString() == HWaddr.toString())  {Return = true;}
    else                                        {Return = false;}
  }
  catch(err)
  {
      execSync('rm -rf /dev/shm/SignInCredentials');
      Return = false;
  }
  return Return;
};

ArmAngstromInstructionSet.prototype._DeleteSignInCredentials_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  
  try{
    execSync('rm -rf /dev/shm/SignInCredentials');
  }
  catch(err){
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveLanguage_ = function(Parameter)
{	
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	try{
		fs.writeFileSync("/app/Web/public/Language/SaveLanguage.txt", Parameter[0].toString(), "utf-8");
		Return = true;
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._DeviceReboot_ = function(Parameter)
{
	var Return, execSync = require('child_process').execSync;
	try{
		execSync("reboot");
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveBootAllData_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync;
	var fs = require("fs");
	var object = new Object();
	object["Main System Run at startup"] = Parameter[0];
	object["MQTT Broker Run at startup"] = Parameter[1];
	object["DDNS Run at startup"]        = Parameter[2];
	try{
		if(Parameter[0] == true)		{execSync("systemctl enable OPC-5231-Runtime.service");}
		else if(Parameter[0] == false)	{execSync("systemctl disable OPC-5231-Runtime.service");}
		if(Parameter[1] == true)		{execSync("systemctl enable OPC-5231-Broker.service");}
		else if(Parameter[1] == false)	{execSync("systemctl disable OPC-5231-Broker.service");}
		if(Parameter[2] == true)		{execSync("systemctl enable OPC-5231-DDNS.service");}
		else if(Parameter[2] == false)	{execSync("systemctl disable OPC-5231-DDNS.service");}
		fs.writeFileSync("/app/Web/public/File/Boot.json", JSON.stringify(object), "utf-8");
		Return = true;
	}
	catch(err){
		Return = err;
	}
	execSync("sync; sync; sync;");
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveAccountSettingAllData_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync;
	var fs = require("fs");
	var object = new Object();
	object["Manager"] = new Object();
	object["Manager"]["Account"] = Parameter[0];
	object["Manager"]["Password"] = Parameter[1];
	try{
		fs.writeFileSync("/app/Web/public/File/AccountSetting.json", JSON.stringify(object), "utf-8");
		fs.writeFileSync("/app/Web/cgi-bin/SystemManagement.xml", Parameter[2], "utf-8");
		Return = true;
	}
	catch(err){
		Return = err;
	}
	execSync("sync; sync; sync;");
	return Return;
};

ArmAngstromInstructionSet.prototype._CheckAccountPassword_ = function(Parameter)
{
	var Return, execSync = require('child_process').execSync;
	var fs = require("fs");
  var Key = "";

  var Account = Parameter[0];
  var Password = Parameter[1];

  // 將字串轉換為陣列
  Account = JSON.parse("["+Account+"]");
  Password = JSON.parse("["+Password+"]");

  Account = ArmAngstromInstructionSet.prototype._PacketDecryption_(Account, Key);
  Password = ArmAngstromInstructionSet.prototype._PacketDecryption_(Password, Key);
	try{
		var object = JSON.parse(fs.readFileSync("/app/Web/public/File/AccountSetting.json", 'utf-8'));
		if(Account == object["Manager"]["Account"] && 
		   Password == object["Manager"]["Password"]){
			Return = true;
		}
		else{
			Return = false;
		}
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._GetMainSystemStatus_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync;
	try{
		var PID = execSync('ps | grep "MainProgram" | grep -v "sh" | grep -v "grep" | awk \'{print $1}\'');
		if(PID.toString() !="")		{Return = true;}
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._StartMainSystem_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, exec = require('child_process').exec;
	try{
    execSync('systemctl stop OPC-5231-Runtime.service');
    execSync('systemctl start OPC-5231-Runtime.service');
	}
	catch(err){}
	execSync('sync; sync; sync;');
	Return = true;
	return Return;
};

ArmAngstromInstructionSet.prototype._StopMainSystem_ = function(Parameter)
{
	var Return=false, PID, execSync = require('child_process').execSync;
	try{
    execSync('systemctl stop OPC-5231-Runtime.service');
	}
	catch(err){}
	Return = true;
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._GetMqttBrokerStatus_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync;
	try{
		var PID = execSync('ps | grep "mosquitto" | grep -v "sh" | grep -v "grep" | awk \'{print $1}\'');
		if(PID.toString() !="")		{Return = true;}
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._StartMqttBroker_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, exec = require('child_process').exec;
	try{
    execSync('systemctl stop OPC-5231-Broker.service');
    execSync('systemctl start OPC-5231-Broker.service');
	}
	catch(err){}
  execSync('sync; sync; sync;');
  Return = true;
	return Return;
};

ArmAngstromInstructionSet.prototype._StopMqttBroker_ = function(Parameter)
{
	var Return=false, PID, execSync = require('child_process').execSync;
	var Index=0;
	try{
	   execSync('systemctl stop OPC-5231-Broker.service');
	}
	catch(err){}
	execSync('sync; sync; sync;');
  Return = true;
	return Return;
};

ArmAngstromInstructionSet.prototype._GetDdnsStatus_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync;
	try{
		var PID = execSync('ps | grep "inadyn" | grep -v "sh" | grep -v "grep" | awk \'{print $1}\'');
		if(PID.toString() !="")		{Return = true;}
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._StartDdns_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, exec = require('child_process').exec;
	try{
    execSync("rm -rf /var/cache/inadyn");
    execSync('systemctl stop OPC-5231-DDNS.service');
    execSync('systemctl start OPC-5231-DDNS.service');
	}
	catch(err){}

	execSync('sync; sync; sync;');
  Return = true;
	return Return;
};

ArmAngstromInstructionSet.prototype._StopDdns_ = function(Parameter)
{
	var Index=0, Return=false, PID, execSync = require('child_process').execSync;
	try{
    execSync("rm -rf /var/cache/inadyn");
    execSync('systemctl stop OPC-5231-DDNS.service');
	}
	catch(err){}
	execSync('sync; sync; sync;');
  Return = true;
	return Return;
};

ArmAngstromInstructionSet.prototype._StartBackstageService_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, exec = require('child_process').exec;
  try
  {
    execSync('systemctl stop BackstageService.service');
    execSync('systemctl start BackstageService.service');
  }
  catch(err){}
  execSync('sync; sync; sync;');
  Return = true;
  return Return;
};

ArmAngstromInstructionSet.prototype._DetectionModel_ = function(Parameter)
{
  var execSync = require('child_process').execSync, DetectionModel;
  try{
    DetectionModel = execSync("DetectionModel");
    DetectionModel = DetectionModel.toString().replace("\r", "").replace("\n", "").replace("[", "").replace("]", "");
  }
  catch(err){
    DetectionModel = "UA-5231";
  }
  execSync('sync; sync; sync;');
  return DetectionModel;
}

ArmAngstromInstructionSet.prototype._Lan1_GetIpv4Ip_ = function(Parameter)
{
	var Return = new Array(), IPv4, Mask, Gateway, os=require('os'), execSync=require('child_process').execSync;
	try{
		var NetworkInterfaceName = os.networkInterfaces().eth0;
		for(var i=0; i<NetworkInterfaceName.length; i++)
		{
			if(NetworkInterfaceName[i].family=='IPv4')
			{
				IPv4 = NetworkInterfaceName[i].address;
				Mask = NetworkInterfaceName[i].netmask;
			}
		}
    Gateway = execSync("/usr/lib/connman/test/get-services | grep \"IPv4.Configuration\" | grep \"" + IPv4 + "\" | awk '{print $5}' | sed -e 's/Gateway=//'");
    Gateway = Gateway.toString();
    if(Gateway == ""){
      Gateway = execSync('route -n | grep "UG" | grep "eth0" | awk \'{print $2}\'');
      Gateway = Gateway.toString().split("\n");
      Gateway = Gateway[0];
    }
		Return[0] = IPv4; Return[1] = Mask; Return[2] = Gateway;
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._Lan1_SetIpv4StaticIp_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, DetectionModel;
  try{
    DetectionModel = execSync("DetectionModel");
    DetectionModel = DetectionModel.toString().replace("\r", "").replace("\n", "");
  }
  catch(err){
    DetectionModel = "";
  }
  try{
    if(DetectionModel.toString() == "[UA-2241]")
    {
      execSync("ipv4 eth0 "+Parameter[0]+" "+Parameter[1]+" "+Parameter[2]);
    }
    else if(DetectionModel.toString() == "[UA-5231]" || DetectionModel == "")
    {
      execSync("ipv4set static "+Parameter[0]+" "+Parameter[1]+" "+Parameter[2]);
    }
    Return = true;
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._Lan1_SetDhcp_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync;
	try{
		execSync('ipv4set dhcp');
		Return = true;
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._Lan2_GetIpv4Ip_ = function(Parameter)
{
  var Return = new Array(), IPv4, Mask, Gateway, os=require('os'), execSync=require('child_process').execSync;
  try{
    var NetworkInterfaceName = os.networkInterfaces().eth1;
    for(var i=0; i<NetworkInterfaceName.length; i++)
    {
      if(NetworkInterfaceName[i].family=='IPv4')
      {
        IPv4 = NetworkInterfaceName[i].address;
        Mask = NetworkInterfaceName[i].netmask;
      }
    }
    Gateway = execSync("/usr/lib/connman/test/get-services | grep \"IPv4.Configuration\" | grep \"" + IPv4 + "\" | awk '{print $5}' | sed -e 's/Gateway=//'");
    Gateway = Gateway.toString();
    Return[0] = IPv4; Return[1] = Mask; Return[2] = Gateway;
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._Lan2_SetIpv4StaticIp_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync;
  try
  {
    execSync("ipv4 eth1 "+Parameter[0]+" "+Parameter[1]+" "+Parameter[2]);
    Return = true;
  }
  catch(err)
  {
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._Lan2_SetDhcp_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync;
  try{
    execSync('ipv4set dhcp');
    Return = true;
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._GetHostname_ = function(Parameter)
{
	var Return = new Array(), HostName, os=require('os'), execSync = require('child_process').execSync;
	try{
		var HostName = os.hostname();
		Return[0] = HostName;
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SetHostname_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	try{
		fs.writeFileSync("/etc/hostname", Parameter[0], "utf-8");
		execSync('hostname '+Parameter[0]);
		Return = true;
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._GetDdns_ = function(Parameter)
{
	var Return, execSync = require('child_process').execSync, fs = require("fs"), FilePath="/app/DDNS/inadyn.conf";
	try{
		var ServiceProvider = execSync('cat '+FilePath+' | grep "provider" | awk \'{print $2}\' | awk -F\'@\' \'{print $2}\'');
		var Username = execSync('cat '+FilePath+' | grep "username" | awk \'{print $3}\'');
		var Password = execSync('cat '+FilePath+' | grep "password" | awk \'{print $3}\'');
		var DomainName = execSync('cat '+FilePath+' | grep "hostname" | awk \'{print $3}\'');
		ServiceProvider = ServiceProvider.toString().replace("\n", "");
		Username = Username.toString().replace("\n", "");
		Password = Password.toString().replace("\n", "");
		DomainName = DomainName.toString().replace("\n", "");
		Return=new Array(ServiceProvider, Username, Password, DomainName);
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};
	
ArmAngstromInstructionSet.prototype._SetDdns_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, exec = require('child_process').exec, fs = require("fs");
	try{
		var InadynConf = 
		"# Inadyn v2.0 configuration file format\n"+
		"period          = 300 \n"+
		"provider default@"+Parameter[0]+" {\n"+
		"ssl            = false\n"+
		"checkip-ssl    = false\n"+
		"username       = "+Parameter[1]+"\n"+
		"password       = "+Parameter[2]+"\n"+
		"hostname       = "+Parameter[3]+"\n"+
		"checkip-server = api.ipify.org"+"\n"+
		"}";
		fs.writeFileSync("/app/DDNS/inadyn.conf", InadynConf, "utf-8");
		Return = true;
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveComPortSetting_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"ComPortInterfaceSetting.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveRtuIndex_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/RTU_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"Index.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveRtuModule_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/RTU_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"Module.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveRtuSetting_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/RTU_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"RtuSetting.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveRtuVariable_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/RTU_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"RtuVariable.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveRtuScalingVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/RTU_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"RtuScalingVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveRtuBitwiseVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/RTU_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"RtuBitwiseVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._UpdateRtuIcpdasModule_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync;
  try
  {
    execSync("cp -rf /app/Web/Temporary/RtuIcpdasModule.json /app/Web/public/File/RTU_Module/.");
    execSync("rm -rf /app/Web/Temporary/*");
    Return = true;
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveRtuToOpcuaVariable_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/RTU_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"RtuToOpcuaVariable.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveRtuScalingToOpcuaVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/RTU_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"RtuScalingToOpcuaVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveRtuBitwiseToOpcuaVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/RTU_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"RtuBitwiseToOpcuaVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveTcpToOpcuaVariable_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/TCP_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"TcpToOpcuaVariable.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveTcpScalingToOpcuaVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/TCP_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"TcpScalingToOpcuaVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveTcpBitwiseToOpcuaVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/TCP_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"TcpBitwiseToOpcuaVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveAsciiToOpcuaVariable_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/ASCII_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"AsciiToOpcuaVariable.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveMqttToOpcuaVariable_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/MQTT_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"MqttToOpcuaVariable.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};
ArmAngstromInstructionSet.prototype._SaveRegisterToOpcuaVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/Register_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"RegisterToOpcuaVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveAsciiIndex_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/ASCII_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"Index.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveAsciiModule_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/ASCII_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"Module.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveAsciiSetting_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/ASCII_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"AsciiSetting.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveAsciiVariable_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/ASCII_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"AsciiVariable.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveTcpIndex_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/TCP_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"Index.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveTcpModule_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/TCP_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"Module.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveTcpSetting_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/TCP_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"TcpSetting.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveTcpVariable_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/TCP_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"TcpVariable.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveTcpScalingVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/TCP_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"TcpScalingVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveTcpBitwiseVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/TCP_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"TcpBitwiseVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._UpdateTcpIcpdasModule_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync;
  try
  {
    execSync("cp -rf /app/Web/Temporary/TcpIcpdasModule.json /app/Web/public/File/TCP_Module/.");
    execSync("rm -rf /app/Web/Temporary/*");
    Return = true;
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveMqttIndex_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/MQTT_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"Index.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveMqttModule_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/MQTT_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"Module.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveMqttSetting_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/MQTT_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"MqttSetting.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveMqttVariable_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/MQTT_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"MqttVariable.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._UpdateMqttIcpdasModule_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync;
  try
  {
    execSync("cp -rf /app/Web/Temporary/MqttIcpdasModule.json /app/Web/public/File/MQTT_Module/.");
    execSync("rm -rf /app/Web/Temporary/*");
    Return = true;
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveVariableTableXml_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/runtime/project/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"VariableTable.xml", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};
//OK
ArmAngstromInstructionSet.prototype._SaveModbusDri_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/runtime/project/plugin/driver/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"Modbus.dri", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};
//OK
ArmAngstromInstructionSet.prototype._SaveMqttDri_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/runtime/project/plugin/driver/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"MQTT.dri", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};
//OK
ArmAngstromInstructionSet.prototype._SaveUAServerDataXml_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/runtime/project/plugin/server/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"UAServerData.xml", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};
//OK
ArmAngstromInstructionSet.prototype._SaveMQTTServiceXml_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/runtime/project/plugin/server/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")	{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"MQTTService.xml", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};
//OK
ArmAngstromInstructionSet.prototype._SavePidDriverDri_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/runtime/project/plugin/driver/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")	{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"PIDDriver.dri", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};
//OK
ArmAngstromInstructionSet.prototype._SaveScaleVariableTableXml_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/runtime/project/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"ScaleVariableTable.xml", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};
ArmAngstromInstructionSet.prototype._SaveBitwiseVariableTableXml_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/runtime/project/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"BitwiseVariableTable.xml", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};
//OK
ArmAngstromInstructionSet.prototype._SaveMethodTableXml_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/runtime/project/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")	{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"MethodTable.xml", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveLocalBrokerSetting_ = function(Parameter)
{
	var Command, Return=false, execSync = require('child_process').execSync, fs = require("fs");  var Obj = {encoding:"utf8",flag:"w"};
	try{
		var conf = "user root\n"+"port "+Parameter[0]+"\n"+"max_connections 20480\n"+"max_inflight_messages 0\n"+"max_queued_messages 3000\n";
		if(Parameter[1] == false || Parameter[1] == "false"){
			conf = conf + "allow_anonymous false\n"+"password_file /app/MQTT/Broker/passwd\n"+"acl_file /app/MQTT/Broker/acl";
			Command = "/app/MQTT/Broker/mosquitto_passwd -c /app/MQTT/Broker/passwd "+Parameter[2]+" << EOF\n"+Parameter[3]+"\n"+Parameter[3]+"\n"+"EOF";
			execSync(Command);
		}
		else if(Parameter[1] == true || Parameter[1] == "true"){
			conf = conf + "allow_anonymous true";
		}
		var Path="/app/Web/public/File/IoT_Platform/";
		fs.writeFileSync(Path+"mosquitto.conf", conf, Obj);							execSync('sync; sync; sync;');
		fs.writeFileSync(Path+"LocalBroker.txt", "Password "+Parameter[3], Obj);	execSync('sync; sync; sync;');
		var Acl = "user "+Parameter[2]+"\n"+"topic write #\n"+"topic read #\n";
		fs.writeFileSync(Path+"acl", Acl, Obj);										execSync('sync; sync; sync;');
		Command='cp -rf '+Path+"mosquitto.conf "+"/app/MQTT/Broker/";	execSync(Command);
		Command='cp -rf '+Path+"acl "+"/app/MQTT/Broker/";				execSync(Command);
		Return = true;
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._GetLocalBrokerSetting_ = function(Parameter)
{
	var Return, execSync = require('child_process').execSync;
	try{
		var Path="/app/Web/public/File/IoT_Platform/";
		var mosquittoConf = Path+"mosquitto.conf";
		var Port = execSync('cat '+mosquittoConf+' | grep "port" | awk \'{print $2}\'');
		var Allow_anonymous = execSync('cat '+mosquittoConf+' | grep "allow_anonymous" | awk \'{print $2}\'');
		var Acl = Path+"acl";
		var Account = execSync('cat '+Acl+' | grep "user" | awk \'{print $2}\'');
		var LocalBroker = Path+"LocalBroker.txt";
		var Password = execSync('cat '+LocalBroker+' | grep "Password" | awk \'{print $2}\'');
		Port = parseInt(Port);
		Allow_anonymous = JSON.parse(Allow_anonymous.toString().replace(/\r\n|\n/g,""));
		Account = Account.toString().replace(/\r\n|\n/g,"");
		Password = Password.toString().replace(/\r\n|\n/g,"");
		Return = new Array(Port, Allow_anonymous, Account, Password);
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveRemoteBrokerSetting_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/IoT_Platform/";  var SaveString="";
	try{
    if(typeof(Parameter[0]) != "string")    {SaveString = JSON.stringify(Parameter[0]);}
    else                                    {SaveString = Parameter[0];}
		fs.writeFileSync(Path+"RemoteBroker.json", SaveString, {encoding:"utf8",flag:"w"});
		Return = true;
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveAzurePlatformSetting_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/IoT_Platform/";  var SaveString="";
	try{
    if(typeof(Parameter[0]) != "string")    {SaveString = JSON.stringify(Parameter[0]);}
    else                                    {SaveString = Parameter[0];}
		fs.writeFileSync(Path+"Microsoft_Azure_Platform.json", SaveString, {encoding:"utf8",flag:"w"});
		Return = true;
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveOpcUaLocalServer_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var RuntimePath="/app/runtime/project/plugin/server/";
	var WebUiPath="/app/Web/public/File/IoT_Platform/";
	try{
		fs.writeFileSync(RuntimePath+"UAServerConfig.xml", Parameter[0], {encoding:"utf8",flag:"w"});
		fs.writeFileSync(WebUiPath+"UAServerConfig.xml", Parameter[0], {encoding:"utf8",flag:"w"});
		Return = true;
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveRtuToMqttSetting_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/RTU_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"RtuToMqttSetting.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveRtuToMqttVariable_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/RTU_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"RtuToMqttVariable.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveTcpToMqttSetting_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/TCP_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"TcpToMqttSetting.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveTcpToMqttVariable_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/TCP_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"TcpToMqttVariable.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveAsciiToMqttSetting_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/ASCII_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"AsciiToMqttSetting.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveAsciiToMqttVariable_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/ASCII_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"AsciiToMqttVariable.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveMqttJsonGroup_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/IoT_Platform/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"MqttJsonGroup.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveRtuToMqttJsonVariable_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/RTU_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"RtuToMqttJsonVariable.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveTcpToMqttJsonVariable_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/TCP_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"TcpToMqttJsonVariable.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveAsciiToMqttJsonVariable_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/ASCII_Module/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"AsciiToMqttJsonVariable.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._RemoveProjectFile_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync;
	try{
		execSync("rm -rf /app/Web/public/File/*_Module");
		execSync("rm -rf /app/Web/public/File/PID_Operation");
		execSync("rm -rf /app/Web/public/File/IoT_Platform");
    execSync("rm -rf /app/Web/public/File/RemoteMQTTGroup");
		execSync("cp -rf /app/Web/public/File/Factory/*_Module /app/Web/public/File");
		execSync("cp -rf /app/Web/public/File/Factory/PID_Operation /app/Web/public/File");
		execSync("cp -rf /app/Web/public/File/Factory/IoT_Platform /app/Web/public/File");
    execSync("cp -rf /app/Web/public/File/Factory/IFTTT_Notify /app/Web/public/File");
    execSync("cp -rf /app/Web/public/File/Factory/RemoteMQTTGroup /app/Web/public/File");

		execSync("cp -rf /app/Web/public/File/IoT_Platform/acl /app/MQTT/Broker/acl");
		execSync("cp -rf /app/Web/public/File/IoT_Platform/mosquitto.conf /app/MQTT/Broker/mosquitto.conf");
		execSync("rm -rf /app/runtime/project/VariableTable.xml");
    execSync("rm -rf /app/runtime/project/ScaleVariableTable.xml");
    execSync("rm -rf /app/runtime/project/BitwiseVariableTable.xml");
		execSync("rm -rf /app/runtime/project/MethodTable.xml");
		execSync("rm -rf /app/runtime/project/plugin/server/*.xml");
		execSync("rm -rf /app/runtime/project/plugin/driver/*.dri");
		execSync("cp -rf /app/Web/public/File/IoT_Platform/UAServerConfig.xml /app/runtime/project/plugin/server");
		Return=true;
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._RemoveOpcuaTrustedCertificate_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync;
	try{
    execSync("rm -rf /app/Certificates/OPCUA/trusted/*");
		Return=true;
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._RemoveOpcuaServerCertificate_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync;
  try{
    execSync("rm -rf /app/Certificates/OPCUA/pkiserver");
    Return=true;
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._RemoveMqttTrustedCertificate_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync;
  try{
    execSync("rm -rf /app/Certificates/MQTT/trusted/*");
    Return=true;
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._RemoveMqttCertificate_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync;
  try{
    execSync("rm -rf /app/Certificates/MQTT/client/certs/*");
    Return=true;
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._RemoveMqttPrivateKey_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync;
  try{
    execSync("rm -rf /app/Certificates/MQTT/client/private/*");
    Return=true;
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._DownloadProjectFile_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, os=require('os');
	try{
		execSync("rm -rf /dev/shm/Project*.tar");
		execSync("cp -rf /app/Web/public/File /dev/shm");
		execSync("cp -rf /app/Web/cgi-bin /dev/shm");
		execSync("cp -rf /app/runtime/project /dev/shm");
    execSync("rm -rf /dev/shm/File/AccountSetting.json");
    execSync("rm -rf /dev/shm/File/Version.txt");
		var NetworkInterfaceName = os.networkInterfaces().eth0;
		var IPv4 = NetworkInterfaceName[0].address;
		var TarFile = "Project_"+IPv4+"_.tar";
		execSync("cd /dev/shm; tar -c -f /dev/shm/"+TarFile+" File project cgi-bin");
		execSync("cd /dev/shm; rm -rf File cgi-bin project");
		Return=true;
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._DownloadOpcuaServerCertificate_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, os=require('os');
	try{
		var NetworkInterfaceName = os.networkInterfaces().eth0;
		var IPv4 = NetworkInterfaceName[0].address;
		var TarFile = "Certificate_"+IPv4+"_.tar";
		execSync("cd /app/Certificates/OPCUA/pkiserver/own/certs; tar -c -f /dev/shm/"+TarFile+" icpdasuaserver.der");
		Return=true;
	}
	catch(err){
    execSync("rm -rf /dev/shm/*.tar");
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._ComPortUpdate_ = function()
{
  var fs = require('fs');
  var ComPortSourceFile = JSON.parse(fs.readFileSync("/app/Web/public/File/ComPortInterfaceSetting.json", 'utf-8'));
  var SourceObject = new Object();
  SourceObject = ComPortSourceFile;
  var SourceComPort = Object.keys(SourceObject);
  var ComPortUpdateFile = JSON.parse(fs.readFileSync("/app/Web/Temporary/File/ComPortInterfaceSetting.json", 'utf-8'));
  var UpdateObject = new Object();
  UpdateObject = ComPortUpdateFile;
  var UpdateComPort = Object.keys(UpdateObject);
  if(UpdateComPort.length < SourceComPort.length)
  {
    for(var i=0;i<UpdateComPort.length;i++)
    {
      SourceObject[SourceComPort[i]]["DevicePath"] = UpdateObject[UpdateComPort[i]]["DevicePath"];
      SourceObject[SourceComPort[i]]["BaudRate"] = UpdateObject[UpdateComPort[i]]["BaudRate"];
      SourceObject[SourceComPort[i]]["DataBits"] = UpdateObject[UpdateComPort[i]]["DataBits"];
      SourceObject[SourceComPort[i]]["Parity"] = UpdateObject[UpdateComPort[i]]["Parity"];
      SourceObject[SourceComPort[i]]["StopBits"] = UpdateObject[UpdateComPort[i]]["StopBits"];
      SourceObject[SourceComPort[i]]["PollingRate"] = UpdateObject[UpdateComPort[i]]["PollingRate"];
    }
    fs.writeFileSync("/app/Web/public/File/ComPortInterfaceSetting.json", JSON.stringify(SourceObject), "utf-8");
  }
  else
  {
    fs.writeFileSync("/app/Web/public/File/ComPortInterfaceSetting.json", JSON.stringify(UpdateObject), "utf-8");
  }
}

ArmAngstromInstructionSet.prototype._UpdateProjectFile_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync;
	try{
		execSync("cd /app/Web/Temporary; tar -x -f *.tar");
    ArmAngstromInstructionSet.prototype._ComPortUpdate_();
    execSync("rm -rf /app/runtime/project/*");
    execSync("cp -rf /app/Web/Temporary/project /app/runtime");
    
    execSync("cp -rf /app/Web/public/File/AccountSetting.json /app/Web/Temporary/File/AccountSetting.json");
    execSync("cp -rf /app/Web/public/File/Version.txt /app/Web/Temporary/File/Version.txt");
    execSync("cp -rf /app/Web/public/File/ComPortInterfaceSetting.json /app/Web/Temporary/File/ComPortInterfaceSetting.json");
		execSync("cp -rf /app/Web/public/File/Factory/* /app/Web/public/File/.");
    execSync("cp -rf /app/Web/Temporary/File/* /app/Web/public/File/.");
		execSync("cp -rf /app/Web/public/File/IoT_Platform/acl /app/MQTT/Broker/acl");
		execSync("cp -rf /app/Web/public/File/IoT_Platform/mosquitto.conf /app/MQTT/Broker/mosquitto.conf");
		
    execSync("rm -rf /app/Web/Temporary/*");
		Return=true;
	}
	catch(err){
		execSync("rm -rf /app/Web/Temporary/*");
		Return=false;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._UpdateFirmwareFile_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, exec = require('child_process').exec;
  try{
    execSync("rm -rf /tmp/WebUpdate.log");
    execSync("cd /mnt/update/; tar xf " + Parameter[0]);
    var Command = execSync("ls /mnt/update/command_WebUpdate.sh").toString().replace("\r", "").replace("\n", "");
    if(Command != '')
    {
      exec("cd /mnt/update/; ./command_WebUpdate.sh");
      Return = true;
    }
    else
    {
      Return = false;
    } 
  }
  catch(err){
    execSync("rm -rf /app/Web/Temporary/*");
    Return=false;
  }
  return Return;
};

ArmAngstromInstructionSet.prototype._UpdateOpcuaTrustedCertificate_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync;
	try{
		execSync("cp -rf /app/Web/Temporary/* /app/Certificates/OPCUA/trusted");
		execSync("rm -rf /app/Web/Temporary/*");
		Return=true;
	}
	catch(err){
		execSync("rm -rf /app/Web/Temporary/*");
		Return=false;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._UpdateMqttTrustedCertificate_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync;
  try{
    execSync("cp -rf /app/Web/Temporary/* /app/Certificates/MQTT/trusted");
    execSync("rm -rf /app/Web/Temporary/*");
    Return=true;
  }
  catch(err){
    execSync("rm -rf /app/Web/Temporary/*");
    Return=false;
  }
  execSync('sync; sync; sync;');
  return Return;
};
ArmAngstromInstructionSet.prototype._UpdateMqttCertificate_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync;
  try{
    execSync("cp -rf /app/Web/Temporary/* /app/Certificates/MQTT/client/certs");
    execSync("rm -rf /app/Web/Temporary/*");
    Return=true;
  }
  catch(err){
    execSync("rm -rf /app/Web/Temporary/*");
    Return=false;
  }
  execSync('sync; sync; sync;');
  return Return;
};
ArmAngstromInstructionSet.prototype._UpdateMqttPrivateKey_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync;
  try{
    execSync("cp -rf /app/Web/Temporary/* /app/Certificates/MQTT/client/private");
    execSync("rm -rf /app/Web/Temporary/*");
    Return=true;
  }
  catch(err){
    execSync("rm -rf /app/Web/Temporary/*");
    Return=false;
  }
  execSync('sync; sync; sync;');
  return Return;
};













ArmAngstromInstructionSet.prototype._DeleteTarFile_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync;
	try
	{
		var SetInterval = setInterval(function()
		{
			execSync("rm -rf /dev/shm/*.tar");
			execSync('sync; sync; sync;');
			clearInterval(SetInterval);
		}, Parameter[0]*1000);
		Return=true;
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._GetDate_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync;
	try
	{
		var Today=new Date();
		var Year=Today.getFullYear();
		var Month=Today.getMonth()+1;
		var Day=Today.getDate();
		Return=Month+"/"+Day+"/"+Year;
	}
	catch(err)
	{
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._GetTime_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync;
	try
	{
		var Time=execSync("date +%H:%M:%S");
		Time=Time.toString().replace("\n", "");
		Time=Time.toString().replace("\r", "");
		Return=Time;
	}
	catch(err)
	{
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};
ArmAngstromInstructionSet.prototype._GetDateTime_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync;
  try
  {
    var DateTime=execSync("date +%s");

    DateTime=DateTime.toString().replace("\n", "");
    DateTime=DateTime.toString().replace("\r", "");
    Return=DateTime;
  }
  catch(err)
  {
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};


ArmAngstromInstructionSet.prototype._SaveManuallySetTime_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync;
	try
	{
		execSync("timedatectl set-timezone "+Parameter[0]);
		execSync("timedatectl set-ntp false");
		execSync("timedatectl set-time "+"\'"+Parameter[1]+"\'");
    execSync("hwclock -u -w");
		Return=true;
	}
	catch(err)
	{
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveNtpSet_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	try
	{
		fs.writeFileSync("/etc/systemd/timesyncd.conf", '[Time]\nNTP='+Parameter[0]+'\nFallbackNTP='+Parameter[0], "utf-8");
		execSync('sync; sync; sync;');
		execSync('timedatectl set-ntp true');
		execSync('timedatectl set-timezone "'+Parameter[1]+'"');
    execSync('systemctl restart systemd-timesyncd.service');
		Return=true;
	}
	catch(err)
	{
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._GetNtpData_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync;
	try
	{
		var NtpStatus=execSync('timedatectl status | grep "NTP enabled" | awk \'{print $3}\'');
		NtpStatus=NtpStatus.toString().replace("\n", "");
		NtpStatus=NtpStatus.toString().replace("\r", "");
		var NtpServer=execSync('cat /etc/systemd/timesyncd.conf | grep "FallbackNTP" | awk -F\'=\' \'{print $2}\'');
		NtpServer=NtpServer.toString().replace("\n", "");
		NtpServer=NtpServer.toString().replace("\r", "");
		var TimeZone=execSync('timedatectl status | grep "Time zone" |  awk -F\':\' \'{print $2}\' | awk \'{print $1}\'');
		TimeZone=TimeZone.toString().replace("\n", "");
		TimeZone=TimeZone.toString().replace("\r", "");
		Return=new Array(NtpStatus, NtpServer, TimeZone);
	}
	catch(err)
	{
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._GetSystemInformation_ = function(Parameter)
{
 var Return=new Array(), execSync = require('child_process').execSync, fs = require("fs");;
  try
  {
    var CPUUsage = execSync('top -b -d1 -n1 | grep usr | head -n 1 | awk \'{print $8}\'').toString().replace("\n", "").replace("%", "");
    var MEMUsage = execSync('free | grep Mem | awk \'{print $3/$2 * 100.0}\'');
    var SdCardUsageRate = execSync("df -h | grep mnt | awk \'{print $5}\'");
    CPUUsage = 100 - parseInt(CPUUsage);
    CPUUsage = CPUUsage.toString().replace("\n", "");
    MEMUsage = MEMUsage.toString().replace("\n", "");
    SdCardUsageRate = SdCardUsageRate.toString().replace("\r", "").replace("\n", "");
    Return=new Array(CPUUsage, MEMUsage, SdCardUsageRate);
  }
  catch(err)
  {
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._GetVersion_ = function(Parameter)
{
  var Return=false, execSync=require('child_process').execSync, fs=require("fs"); var TarFileVersion, RuntimeVersion, WebUiVersion, EEPROM;
  try{
    TarFileVersion=fs.readFileSync("/app/Version.txt", 'utf-8');
    TarFileVersion=TarFileVersion.toString().replace("\n", "");
    TarFileVersion=TarFileVersion.toString().replace("\r", "");
  }
  catch(err){}
  try{
    RuntimeVersion=fs.readFileSync("/app/runtime/runtimever.txt", 'utf-8');
    RuntimeVersion=RuntimeVersion.toString().replace("\n", "");
    RuntimeVersion=RuntimeVersion.toString().replace("\r", "");
  }
  catch(err){}
  try{
    WebUiVersion=fs.readFileSync("/app/Web/public/File/Version.txt", 'utf-8');
    WebUiVersion=WebUiVersion.toString();
  }
  catch(err){}
  try{
    EEPROM=execSync("/app/Eeprom/eeprom_read");
    EEPROM=EEPROM.toString();
  }
  catch(err){}
  Return=new Array(TarFileVersion, RuntimeVersion, WebUiVersion, EEPROM);
	return Return;
};

ArmAngstromInstructionSet.prototype._SavePidOperationVariable_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/PID_Operation/"; var Obj;
	
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"PidOperation.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveIftttConditionTriggerSetting_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/IFTTT_Notify/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"Setting.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveIftttConditionTriggerVariable_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	var Path="/app/Web/public/File/IFTTT_Notify/"; var Obj;
	try{
		if(Parameter[0] == "Start")			{Obj = {encoding:"utf8",flag:"w"};}
		else if(Parameter[0] == "Send")		{Obj = {encoding:"utf8",flag:"a+"};}
		else if(Parameter[0] == "End")		{Obj = {encoding:"utf8",flag:"a+"};}
		fs.writeFileSync(Path+"Variable.json", Parameter[1], Obj);
		Return = Parameter[0];
	}
	catch(err){
		Return = err;
	}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._IsExistWirelessDevice_ = function(Parameter)
{
    var Return=false, execSync = require('child_process').execSync;
    try
    {
        var WirelessDevice_3G = execSync('lsusb -d 05c6:');
        if(WirelessDevice_3G.toString() != "")
        {
            Return = true;
        }
    }
    catch(err) {}
    try
    {
        var WirelessDevice_4G = execSync('lsusb -d 2c7c:');
        if(WirelessDevice_4G.toString() != "")
        {
            Return = true;
        }
    }
    catch(err) {}
	  return Return;
};

ArmAngstromInstructionSet.prototype._WirelessConnection_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, exec = require('child_process').exec;
	try
  {
    execSync("systemctl stop UA-Wireless.service");
    execSync("systemctl start UA-Wireless.service");
	}
	catch(err){}

  Return=true;
	return Return;
};

ArmAngstromInstructionSet.prototype._WirelessDisconnect_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync;
	try{
		execSync("systemctl stop UA-Wireless.service");
	}
	catch(err){}
	
	Return=true;
	return Return;
};

ArmAngstromInstructionSet.prototype._GetWirelessData_ = function(Parameter)
{
	var Return=new Array(), execSync = require('child_process').execSync;
	try{
		var object = require('/app/Web/public/File/Boot.json');
		var AutomaticConnection=object["Wireless Run at startup"];
		var DialUpNumber=execSync('cat /app/Wireless/wvdial.conf | grep "Phone = " | awk -F\' \' \'{print $3}\'').toString().replace("\n", "");
		var APN         =execSync('cat /app/Wireless/wvdial.conf | grep "Init4 = AT+CGDCONT=1" | awk -F\',\' \'{print $3}\' | awk -F\'"\' \'{print $2}\'').toString().replace("\n", "");
		var Username    =execSync('cat /app/Wireless/wvdial.conf | grep "Username = " | awk -F\' \' \'{print $3}\'').toString().replace("\n", "");
		var Password    =execSync('cat /app/Wireless/wvdial.conf | grep "Password = " | awk -F\' \' \'{print $3}\'').toString().replace("\n", "");
		var MCC=execSync('cat /app/Wireless/wvdial.conf | grep "Init5 = AT+COPS=1,2," | awk -F\'"\' \'{print $2}\'').toString().substr(0,3);
		var MNC=execSync('cat /app/Wireless/wvdial.conf | grep "Init5 = AT+COPS=1,2," | awk -F\'"\' \'{print $2}\'').toString().substr(3,6).replace("\n", "");
		var MobileCodeEnable=execSync('cat /app/Wireless/wvdial.conf | grep "Init5 = "').toString();
		if(MobileCodeEnable.indexOf(";Init5 = ") != -1){var MobileCodeEnable=false;}
		else                                           {var MobileCodeEnable=true;}
		Return=new Array(AutomaticConnection, DialUpNumber, APN, Username, Password, MobileCodeEnable, MCC, MNC);
	}
	catch(err){}
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveWirelessData_ = function(Parameter)
{	var Data=
	'[Dialer Defaults]'+'\r\n'+'Stupid Mode = 1'+'\r\n'+'Init1 = ATZ'+'\r\n'+'Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0'+'\r\n'+
	'Init4 = AT+CGDCONT=1,"IP","'+Parameter[2]+'"'+'\r\n'+
	'Init5 = AT+COPS=1,2,"'+Parameter[6]+Parameter[7]+'"'+'\r\n'+
	'Modem Type = USB Modem'+'\r\n'+
	'ISDN = 0'+'\r\n'+
	'New PPPD = yes'+'\r\n'+
	'Phone = '+Parameter[1]+'\r\n'+
	'Modem = /dev/ttyUSB3'+'\r\n'+
	'Username = '+Parameter[3]+'\r\n'+
	'Password = '+Parameter[4]+'\r\n'+'Baud = 460800';
	var Return=false, execSync = require('child_process').execSync, fs = require("fs");
	try{
		if(Parameter[0] == true)      {execSync('systemctl enable UA-Wireless.service');}
		else if(Parameter[0] == false){execSync('systemctl disable UA-Wireless.service');}
		if(Parameter[5] == false)     {Data=Data.replace("Init5 = ", ";Init5 = ");}
		var object = require('/app/Web/public/File/Boot.json');
		object["Wireless Run at startup"]=Parameter[0];
		fs.writeFileSync("/app/Web/public/File/Boot.json", JSON.stringify(object), "utf-8");
		fs.writeFileSync("/app/Wireless/wvdial.conf", Data, "utf-8");
		Return=true;
	}
	catch(err){}
	execSync('sync; sync; sync;');
	return Return;
};

ArmAngstromInstructionSet.prototype._GetWirelessInformation_ = function(Parameter)
{
	var Return=new Array(), execSync = require('child_process').execSync;
	var Signal=execSync("/app/Wireless/AT_Command \'AT+CSQ\'").toString().replace("+CSQ:", "[").replace("OK", "]");
	Signal=Signal.substring(Signal.indexOf("[")+1,Signal.indexOf("]")).replace(" ", "").split(",")[0];
	Signal=parseInt(Signal);
	try{
		var ConnectionStatus=execSync('ifconfig ppp0 | grep "inet addr:"').toString().replace("\n", "");
		var IP=execSync('ifconfig ppp0 | grep "inet addr:" | awk -F\' \' \'{print $2}\' | awk -F\':\' \'{print $2}\'').toString().replace("\n", "");
		Return[0]=Signal;
		Return[1]="Connected";
		Return[2]=IP;
	}
	catch(err)
	{
		Return[0]=Signal;
		Return[1]="Disconnected";
		Return[2]="";
	}

  try{
    var SimCardStatus = execSync("/app/Wireless/AT_Command \'AT+CPIN?\'").toString().indexOf("OK");
    SimCardStatus = parseInt(SimCardStatus);
    if(SimCardStatus > 0)
    {

      if(execSync("/app/Wireless/AT_Command \'AT+CPIN?\'").toString().indexOf("READY") > 0)
      {
        ;
      }
      else if(execSync("/app/Wireless/AT_Command \'AT+CPIN?\'").toString().indexOf("+CPIN: SIM PIN") > 0)
      {
        Return[3]="PIN";
      }
      else
      {
        Return[3]="Kill";
      }
    }
    else
    {
      Return[1]="SimDisconnected";
    }
  }
  catch(err){
    Return = err;
  }
	return Return;
};

ArmAngstromInstructionSet.prototype._SaveMsSqlConnection_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/IoT_Platform/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"MsSqlConnection.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._MsSqlConnectionTest_ = function(Parameter)
{
  var Return, execSync = require('child_process').execSync;
  var Run="/app/MsSqlConnectionTest/bin/run.sh";
  var ParameterString = "\"Driver={" + Parameter[0] + "};Server=" + Parameter[1] + ";Port=" + Parameter[2] + ";Uid=" + Parameter[3] + ";Pwd=" + Parameter[4] + "\"";
  try
  {
    var Command = Run + " " + ParameterString;
    Return = execSync(Command);
    Return = Return.toString();
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveTcpToMsSqlVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/TCP_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"TcpToMsSqlVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveRtuToMsSqlVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/RTU_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"RtuToMsSqlVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveMqttToMsSqlVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/MQTT_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"MqttToMsSqlVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveMysqlConnection_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/IoT_Platform/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"MysqlConnection.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._MysqlConnectionTest_ = function(Parameter)
{
  var Return, execSync = require('child_process').execSync;
  var Run="/app/MysqlConnectionTest/bin/run.sh";
  var ParameterString = Parameter[0] + " " + Parameter[1] + " " + Parameter[2] + " " + Parameter[3];
  try
  {
    var Command = Run + " " + ParameterString;
    Return = execSync(Command);
    Return = Return.toString();
    if(Return.toString() == "false")      {Return = false;}
    else if(Return.toString() == "true")  {Return = true;}
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};
ArmAngstromInstructionSet.prototype._SaveTcpToMysqlConnectionVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/TCP_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"TcpToMysqlConnectionVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveRtuToMysqlConnectionVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/RTU_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"RtuToMysqlConnectionVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveMqttToMysqlVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/MQTT_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"MqttToMysqlVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._GetWebAllLink_ = function(Parameter)
{
  var Return=new Array(), execSync = require('child_process').execSync;
  try
  {
    var Command = "";
    if(typeof(Parameter[1]) == "undefined")
    {
      Command = "/app/Web/GetWebAllLink.sh " + Parameter[0];
    }
    else if(typeof(Parameter[1]) != "undefined")
    {
      Command = "/app/Web/GetWebAllLink.sh " + Parameter[0] + " " + Parameter[1];
    }
    var Return = execSync(Command);
    Return = Return.toString().split("\n");
    Return.pop();
  }
  catch(err)
  {
    Return = err;
  }
  return Return;
};

ArmAngstromInstructionSet.prototype._WebShell_ = function(Parameter)
{
  var Return=true, execSync = require('child_process').execSync;
  var File="/app/Web/WebShell.sh"; var Obj;
  try
  {
    execSync(File+" \""+Parameter[0]+"\"");
  }
  catch(err)
  {
    Return = false;
  }
  return Return;
};

ArmAngstromInstructionSet.prototype._GetSdCardUsageRate_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  try
  {
    Return = execSync("df -h | grep mnt | awk \'{print $5}\'").toString().replace("\r", "").replace("\n", "");
  }
  catch(err){
    Return = err;
  }
  return Return;
}
ArmAngstromInstructionSet.prototype._GetWebLogMessage_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  try
  {
    var Tmp = execSync("ls /tmp/WebUpdate.log").toString().replace("\r", "").replace("\n", "");
    if(Tmp == '')
    {
      Return = "NoFile";
    }
    else
    {
      Return = execSync("cat /tmp/WebUpdate.log").toString().replace("\r", "").replace("\n", "");
    }
  }
  catch(err){
    Return = err;
  }
  return Return;
}

ArmAngstromInstructionSet.prototype._GetSdCardFreeRate_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  try
  {
    SDFreeUsage = execSync("df | grep mnt | awk \'{print $4}\'").toString().replace("\r", "").replace("\n", "");
    FlashFreeUsage = execSync("df | grep ubi | awk \'{print $4}\'").toString().replace("\r", "").replace("\n", "");
    if(FlashFreeUsage == "")
    {
      FlashFreeUsage = execSync("df | grep root | awk \'{print $4}\'").toString().replace("\r", "").replace("\n", "");
    }
    if(SDFreeUsage > 512*1000 && FlashFreeUsage > 120*1000)
    {
      Return = true;
    }
    else
    {
      Return = false;
    }
  }
  catch(err){
    Return = err;
  }
  return Return;
}
ArmAngstromInstructionSet.prototype._MkdirUpdateFolder_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  try
  {
    Return = execSync("rm -rf /mnt/update; mkdir /mnt/update").toString().replace("\r", "").replace("\n", "");
  }
  catch(err){
    Return = err;
  }
  return Return;
}

ArmAngstromInstructionSet.prototype._MountSdCard_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  try
  {
    var FlashInformation = execSync("ls /dev");
    if(FlashInformation.toString().indexOf("ubi0_0") > 0)
    {
      SD_Path = "/dev/mmcblk0p1";
    }
    else
    {
      SD_Path = "/dev/mmcblk1p1";
    }
    Return = execSync("umount /mnt; mount " + SD_Path + " /mnt").toString().replace("\r", "").replace("\n", "");
  }
  catch(err){
    Return = err;
  }
  return Return;
}


ArmAngstromInstructionSet.prototype._UnMountSdCard_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  try
  {
    Return = execSync("umount /mnt;").toString().replace("\r", "").replace("\n", "");
  }
  catch(err){
    Return = err;
  }
  return Return;
}

ArmAngstromInstructionSet.prototype._SaveLocalDataLogger_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  try{
    fs.writeFileSync("/app/Web/public/File/IoT_Platform/LocalDataLogger.json", Parameter[0], "utf-8");
    Return = true;
  }
  catch(err){
    Return = err;
  }
  execSync("sync; sync; sync;");
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveRtuToLocalDataLoggerVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/RTU_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"RtuToLocalDataLoggerVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveTcpToLocalDataLoggerVariable_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/TCP_Module/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"TcpToLocalDataLoggerVariable.json", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};
//OK
ArmAngstromInstructionSet.prototype._SaveDataLogServiceXml_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/runtime/project/plugin/server/"; var Obj;
  try{
    if(Parameter[0] == "Start")     {Obj = {encoding:"utf8",flag:"w"};}
    else if(Parameter[0] == "Send")   {Obj = {encoding:"utf8",flag:"a+"};}
    else if(Parameter[0] == "End")    {Obj = {encoding:"utf8",flag:"a+"};}
    fs.writeFileSync(Path+"DataLogService.xml", Parameter[1], Obj);
    Return = Parameter[0];
  }
  catch(err){
    Return = err;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._SaveIoTstarSetting_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync, fs = require("fs");
  var Path="/app/Web/public/File/IoT_Platform/";
  try
  {
    var Xml = "<ServerIP>" + Parameter[0] + "</ServerIP>\r\n" + 
              "<Port>" + Parameter[1] + "</Port>\r\n" + 
              "<Account>" + Parameter[2] + "</Account>\r\n" + 
              "<Password>" + Parameter[3] + "</Password>\r\n" + 
              "<Nickname>" + Parameter[4] + "</Nickname>\r\n" + 
              "<DeviceName>" + Parameter[5] + "</DeviceName>";
    fs.writeFileSync(Path+"IoTstarConfigure", Xml, {encoding:"utf8",flag:"w"});
    Return = true;
  }
  catch(err)
  {
    Return = false;
  }
  execSync('sync; sync; sync;');
  return Return;
};

ArmAngstromInstructionSet.prototype._StartIoTstar_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, exec = require('child_process').exec;
	try{
		execSync('killall "IoTstar"');
	}
	catch(err){}
	exec('/app/IoTstar/bin/run.sh');
	Return = true;
	return Return;
};

ArmAngstromInstructionSet.prototype._StopIoTstar_ = function(Parameter)
{
	var Return=false, execSync = require('child_process').execSync, exec = require('child_process').exec;
	try{
		execSync('killall "IoTstar"');
	}
	catch(err){}
	Return = true;
	return Return;
};

ArmAngstromInstructionSet.prototype._GetIoTstarStatus_ = function(Parameter)
{
  var Return=false, execSync = require('child_process').execSync;
  try
  {
    var PID = execSync('ps | grep "IoTstar" | grep -v "sh" | grep -v "grep" | awk \'{print $1}\'');
    if(PID.toString() !="")   {Return = true;}
  }
  catch(err){}
  return Return;
};

ArmAngstromInstructionSet.prototype._PacketDecryption_ = function(Packet, AesKey)
{
  var aesjs = require('aes-js');
  var key = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
               16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
               29, 30, 31];
  var aesCtr = new aesjs.ModeOfOperation.ctr(key, new aesjs.Counter(5));
  var decryptedBytes = aesCtr.decrypt(Packet);
  var decryptedText = aesjs.utils.utf8.fromBytes(decryptedBytes);
  try{
      decryptedText = JSON.parse(decryptedText);
  }
  catch(error){
  }
  return decryptedText;
};

ArmAngstromInstructionSet.prototype._PacketEncryption_ = function(Packet, AesKey)
{
  var aesjs = require('aes-js');
  var key = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
               16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
               29, 30, 31];
  var textBytes = aesjs.utils.utf8.toBytes(Packet);
  var aesCtr = new aesjs.ModeOfOperation.ctr(key, new aesjs.Counter(5));
  var encryptedBytes = aesCtr.encrypt(textBytes);
  var encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes);
  var encryptedBytes = aesjs.utils.hex.toBytes(encryptedHex);
  return encryptedBytes;
};