dOPC Client Toolkit Help file
TdOPCPropertyBrowser.Props Property
C++
public: __property TdOPCItemProperties Props[int Index];
C#
public TdOPCItemProperties Props;
Visual Basic
Public Property Props() As TdOPCItemProperties

Props contains the TdOPCItemProperties objects which can be accessed via the Index parameter.

It is the default property of TdOPCPropertyBrowser.

procedure TForm1.Button1Click(Sender: TObject);
var
  PB    : TdOPCPropertyBrowser;
  Props : TdOPCItemProperties;
  Prop  : TdOPCItemProperty;
  i,c   : integer;
begin
  PB := TdOPCPropertyBrowser.create(nil); //create property browser
  PB.OPCServer := dOPCServer1; //set server
  PB.AddItem('Random.Int4'); //add item id
  PB.AddItem('Random.String'); //add item id
  PB.Execute; //get properties for item from opc server
  for i := 0 to PB.Count-1 do
  begin
    Props := PB[i];
    if Props <> nil then
      for c := 0 to Props.Count-1 do
      begin
        Prop :=  Props[c];
        ShowMessage(IntToStr(Prop.Id)+' -> '+ Prop.Description);
      end;
  end;
  PB.Free;
end;

or

procedure TForm1.Button1Click(Sender: TObject);
var
  PB    : TdOPCPropertyBrowser;
  Prop  : TdOPCItemProperty; // defined in unit dOPCIntf
  i,c   : integer;
begin
  PB := TdOPCPropertyBrowser.create(nil); //create property browser
  PB.OPCServer := dOPCServer1; //set server
  PB.AddItem('Random.Int4'); //add item id
  PB.AddItem('Random.String'); //add item id
  PB.Execute; //get properties for item from opc server
  for i := 0 to PB.Count-1 do
    for c := 0 to PB[i].Count-1 do
    begin
      Prop := PB[i][c];
      if Prop <> nil then
        ShowMessage(IntToStr(Prop.Id)+' -> '+ Prop.Description);
    end;
  PB.Free;
end;
What do you think about this topic? Send feedback!
Copyright © 2001-2014 Kassl GmbH (http://www.kassl.de). All rights reserved.