/* All user scripts should derive from the base "Application" class */ require ("Application"); class ControlOdbc Application { triggerPoint = #$default:Channel1.Device1.Logging; } method ControlOdbc.controlOdbc (enabled) { if (enabled != 0) { princ ("Starting the ODBC Engine due to a point trigger: ", this, " = ", enabled, "\n"); _ODBCEngine_Singleton.Start(); } else if (enabled == 0) { princ ("Stopping the ODBC Engine due to a point trigger: ", this, " = ", enabled, "\n"); _ODBCEngine_Singleton.Stop(); } } method ControlOdbc.constructor () { .OnChange(.triggerPoint, `(@self).controlOdbc(value)); } /* Start the program by instantiating the class. */ ApplicationSingleton (ControlOdbc);