dOPC Client Toolkit
Close
dOPCDA.TdOPCPropertyBrowser
dOPCDA_TdOPCPropertyBrowser

class to browse for properties of given items 

 

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

TdOPCPropertyBrowser can be used to browse the available properties (also referred to as attributes or parameters) of one or more TdOPCItem objects and to read the current values of these properties.

procedure TForm1.Button1Click(Sender: TObject); var PB : TdOPCPropertyBrowser; P : TdOPCItemProperty; begin PB := TdOPCPropertyBrowser.create(nil); //create property browser try PB.OPCServer := dOPCServer1; //set server PB.AddItem('Random.Int4'); //add one item more are possible PB.AddProperty(OPC_PROP_CDT); //add property data type PB.AddProperty(OPC_PROP_DESC); //add property description PB.Execute; //get properties for item from opc server P := PB[0].ById(OPC_PROP_CDT); //get property data type if P <> nil then //if property exists lDataType.Caption := VarToAStr(P.Value); //show value P := PB[0].ById(OPC_PROP_DESC); //get property description if P <> nil then //if property exists lNote.Caption := VarToAStr(P.Value); //show value finally PB.Free; end; end;
Kassl GmbH Copyright © 2019. All rights reserved.