dOPC Client Toolkit
Close
dOPCGUI.TdOPCGUI
dOPCGUI_TdOPCGUI

TdOPCGUI is a component to show values (items) of an OPC server on a graphical user interface (GUI).

TdOPCGUI = class(TComponent);
class TdOPCGUI : public TComponent;

Thus it provides the ability to change properties (e.g. "Text") of a visual control (e.g. "TEdit") with values from an OPC server. You can make allocations at design or at runtime. 

 

Design time: 

1. Double-click the TdOPCGUI component, which lets you get a list of all controls on your form. 

2. After selecting one control by double-clicking it, a new form with all TdOPCGroup and TdOPCItem objects is displayed. 

3. Select the property of the visual control you want to use (e.g. Text, Value, Width, Left, ...). If you want to set the property as default for the class of the selected control, check default. 

4. Select the TdOPCItem (values of this item will set the selected property) by double-clicking it. Now you have allocated the control to the item. 

5. For further allocations please repeat steps 1 to 4. 

 

Runtime: 

At runtime use the AddItem method to connect controls with TOPCItem objects. 

Example: 

If you want to show the value of an TOPCItem (e.g. "Random.String") in a TEdit control (e.g. "Edit1"), simply call the following method:

dOPCGUI.AddItem('MyGoupName','Random.String',Edit1,'Text');

 

After calling this method, all changes to the value of the "Random.String" item will be shown in "Edit1". 

 

You can also call the AddItem method with an TdOPCItem directly:

G := OPCServer.OPCGroups.Add('MyGoupName'); //make a new group Item := G.OPCItems.AddItem('Random.String'); //add new item to group dOPCGUI.AddItem(Item,Edit1,'Text'); //show value in Edit1
Kassl GmbH Copyright © 2024. All rights reserved.