Promotic

onAppStopEnd - event of the PmaRoot object

Description:
The event is triggered after halting the application (after onAppStopBegin event). Pma objects have already been deleted thus it isn't possible to use their properties and methods in the event algorithm. The algorithm of this event is the last executed algorithm of the application.
Parameters:
pMe(Object) Reference to the PmaRoot object where the event rises.
pEvent(Object) Reference to the object describing detailed information about the specific event.
The pEvent parameter is not used here because this event does not need any additional information.
Note:
Application termination can be disabled by "PmaRoot > Permissions > AppStop" permission.
Example1:
Dump INFO system status into the file.
This functionality is integrated into the preconfiguration for creating new application since version Pm9.0.16.
Created the Application_RtStop.log file can then be viewed in the development environment in the menu " > Open application file > Application_RtStop.log".
JavaScriptVBScriptSelect and copy to clipboard

var sFile = "#app:" + Pm.AppName + "_RtStop.log";
var sInfo = "AppStop: " + Pm.FormatDate(Pm.Time, 1) + "\\n" + "\\n";
sInfo += "-----------------------------------\\n" + "Errors\\n";
Pm.FileTextWrite(sFile, sInfo, "charset:utf-8;");

Pm.InfoWriteToFile("Errors", "$all", sFile, "");

sInfo = "-----------------------------------\\n" + "Debug\\n";
Pm.FileTextWrite(sFile, sInfo, "mode:add;");

Pm.InfoWriteToFile("Debug", "$all", sFile, "");

sInfo = "-----------------------------------\\n" + "AppStopDone";
Pm.FileTextWrite(sFile, sInfo, "mode:add;");
Example2:
Repeated launch of this application by the utility RunLater:
JavaScriptVBScriptSelect and copy to clipboard

Pm.ShellExecute("", "c:/Promotic/Tools/RunLater/RunLater", "/t=10 /f=C:/Promotic/Pm90027/Bin32/PromoticRt32.exe /p=" + Pm.AppFullName + ".pra", "", 1);

History:
Pm9.00.16: The PROMOTIC system now, in this event, preconfigures the saving of the INFO system status (the content of the Errors and Debug items) into the Application_RtStop.log file.
This file can then be viewed in the development environment in the menu " > Open application file".
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.