dOPC Client Toolkit Help file
public: class TdOPCGUI : public TComponent;
public class TdOPCGUI : TComponent;
Visual Basic
Public Class TdOPCGUI
Inherits TComponent


component to show opc values in visual controls 

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

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 TdOPItem 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. 



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


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:



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
TdOPCGUI Events 
OnSetProperty is generated when a property is associated with an item. 
TdOPCGUI Methods 
This is the overview for the AddItem method overload. 
deletes an existing Item
DeleteItems deletes an assignment between a control and an item. 
search for Control and returns the name and Propertyname of the Control and the assigned OPCItemId and GroupName
Find searches the passed control and fills the passed Name, PropName, OPCGroup and OPCItem assigned to the control and returns the TdGUIItem if found, otherwise nil
get the orginal dOPCItem from dOPCServer
GetdOPCItem returns the assigned TdOPCItem for the passed control. 
TdOPCGUI Properties 
Items contains TdGUIItems
OPCServer contains the TdOPCServer you want to use with the TdOPCGUI class. 
UseTags is True if the OPC item pointer should be stored in the Tag property of the assigned control, otherwise False
What do you think about this topic? Send feedback!
Copyright © 2001-2014 Kassl GmbH ( All rights reserved.