Promotic

InitFromFile - method of the AtouchX object

Description:
Initializes the connection to the DbNet network according to the specified HW and database description.
The method performs the initialization of the object. Until the initialization is successful, the other methods of the object cannot be used, because they will end with the error "not initialized". The exceptions are the version checking, information checking, and time conversion methods, which can be used without initialization.
 
If it is necessary to change the value of the DirectEvents property then this change must be made before the initialization methods are executed.
 
It is highly recommended to test the return value of the initialization methods and to treat the application for the possibility of initialization failure. Some errors (for example "wrong WID") are the result of errors in parameterizing and using the object, and can be eliminated relatively early. However, initialization can always result in the unavailability of the HW connection resource (COM, DOCK), which leads to subsequent application failure.
 
If the initialization method is called on the object then the de-initialization method Done must always be called before the object is cancelled. regardless, whether the initialization succeeds or fails!
Syntax:
Integer InitFromFile(Object objekt, String HWFile, String DBFile)
Parameters:
objekt(Object) Object expression whose result is an object of the AtouchApp type.
HWFile(String) The name of the file that describes the HW connection of the computer to the DbNet network.
DBFile(String) The name of the file that describes the database (list of variables) of the DbNet network.
Example:
JavaScriptVBScriptSelect and copy to clipboard

var sHwIni = "Cfg/sHWfile.ini";
var sDbIni = "Cfg/sDBfile.ini";
var oATC = pMe.Pm("/AtouchApp").Acx;
var nState = oATC.InitFromFile(sHwIni, sDbIni);

if (nState== 0 || nState== 258)
{
oATC.VariantOnly = true;
}
PROMOTIC 9.0.21 SCADA system documentation - MICROSYS, spol. s r.o.

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