Develop a NetLogic that sets label text
This runtime NetLogic changes the text of a label. The NetLogic can be triggered with an MouseClickEvent event.
Prerequisites:
Set the default external code editor. See Set the default code editor.
- In theProject viewpane, right-click theNetLogicfolder and select .
- Double-click the NetLogic.The external code editor opens.
- Edit the NetLogic by replacing the existingRuntimeNetLogic1class with the following code. See Edit a NetLogic.#region Using directives using System; using UAManagedCore; using OpcUa = UAManagedCore.OpcUa; using FTOptix.HMIProject; using FTOptix.UI; using FTOptix.NativeUI; using FTOptix.Core; using FTOptix.CoreBase; using FTOptix.NetLogic; #endregion public class RuntimeNetLogic1 : FTOptix.NetLogic.BaseNetLogic { [ExportMethod] public void SetLabelTextToHelloWord(NodeId labelNodeId) { var label = InformationModel.Get<Label>(labelNodeId); label.Text = "Changed label text"; } }
- Save the code.
Fornire un feedback