NetLogic templates
You must use the NetLogic templates to make the code operational.
-
Logic related to the lifecycle of an object, using the
Start
andStop
methods -
New methods
-
Other C# logics
using
directives
#region
in the first row. FactoryTalk Optix Studio automatically writes a directive using
each FTOptix module in the project. Every directive supplies the C# classes expected by the module.
Runtime NetLogic template
The NetLogic template includes the Start()
and Stop()
methods used to insert the code to run automatically at runtime.
Start()
method-
The method runs when the object where the method was created starts to exist.
-
NetLogic in non-UI Type (for example, in a NetLogic folder): The
Start
method runs when the runtime starts. -
NetLogic as descendent of a UI Type: The
Start
method runs when the graphical object is rendered in any session of any PresentationEngine.
-
Stop()
method-
The method runs when the object where the method was created gets disposed.
-
NetLogic in non-UI type (for example, in a NetLogic folder): The
Stop
method runs when the application runtime stops. -
NetLogic as descendent of a UI type: The Stop method runs when the UI type is disposed in any session of any PresentationEngine (for example, when switching to a different page).
-
public class NetlogicName : BaseNetLogic
{
public override void Start()
{
// Insert code to be executed when the user-defined logic is started
}
public override void Stop()
{
// Insert code to be executed when the user-defined logic is stopped
}
}
Design time NetLogic template
public class NetlogicName : BaseNetLogic
{
[ExportMethod]
public void NetlogicNameMethod()
{
}
}
[ExportMethod]
string. The string is required to execute the method.