Create a NetLogic that fetches UI

Create a NetLogic that fetches UI elements from the OPC UA server.
Set the default external code editor. See Set the default code editor.
  1. To create a NetLogic that fetches UI
  2. In
    Project view
    , right-click
    MainWindow (type)
    and select
    New
    Runtime NetLogic
    .
  3. Hover-over the NetLogic, select
    Edit
    , and enter
    UIFetcher
    .
  4. Double-click the NetLogic.
    The external code editor opens.
  5. In the code editor, replace the existing code with the following code:
    #region StandardUsing using System; using FTOptix.Core; using FTOptix.CoreBase; using FTOptix.HMIProject; using UAManagedCore; using OpcUa = UAManagedCore.OpcUa; using FTOptix.NetLogic; using FTOptix.UI; using FTOptix.OPCUAServer; #endregion public class UIFetcher : FTOptix.NetLogic.BaseNetLogic { public override void Start() { myDelayedTask = new DelayedTask(LoadRemotePanel, 2000, LogicObject); myDelayedTask.Start(); } public void LoadRemotePanel() { var clientPanelLoader = (PanelLoader)LogicObject.Owner.Get("ClientPanelLoader"); var remoteMainPanel = Project.Current.Get("UI/RemotePanels/MainPanel"); if (remoteMainPanel == null) { Log.Error("Remote server main panel not found"); return; } clientPanelLoader.ChangePanel(remoteMainPanel.NodeId, NodeId.Empty); } [ExportMethod] public void ReloadRemote() { Start(); } public override void Stop() { // Insert code to be executed when the user-defined logic is stopped myDelayedTask.Dispose(); } private DelayedTask myDelayedTask; }
  6. Save the code.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.