0% found this document useful (0 votes)
115 views176 pages

Uniformance PHD .NET Wrapper Guide

Uploaded by

irfanto
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views176 pages

Uniformance PHD .NET Wrapper Guide

Uploaded by

irfanto
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Uniformance®

PHD .NET Wrapper


User Guide
R430
Copyright, Notices, and Trademarks
© Honeywell International Sàrl. 1998 – 2023. All Rights Reserved
While this information is presented in good faith and believed to be accurate, Honeywell disclaims the implied warranties
of merchantability and fitness for a particular purpose and makes no express warranties except as may be stated in its
written agreement with and for its customers.

In no event is Honeywell liable to anyone for any indirect, special or consequential damages. The information and
specifications in this document are subject to change without notice.

Honeywell, Experion, TotalPlant, Uniformance PHD, and [Link] are U.S. registered trademarks of Honeywell
International Sàrl.

Other brand or product names are trademarks of their respective owners.

Honeywell Process Solutions

2101 CityWest Blvd, Houston

TX, 77042, USA

Uniformance PHD .NET Wrapper User Guide • 3


Contact Honeywell
Seeking technical assistance
For technical queries, contact Honeywell Customer Support.
For contact information, visit:
[Link]
Report a security vulnerability
For the purpose of submission, a security vulnerability is defined as a software defect or weakness that can
be exploited to reduce the operational or security capabilities of the software. Honeywell investigates all
reports of security vulnerabilities affecting Honeywell products and services.
To report a potential security vulnerability against any Honeywell product, please follow the instructions at:
[Link]
Submit the requested information to Honeywell using one of the following methods:
• Send an email to security@[Link].
• Contact your local Honeywell Technical Assistance Center (TAC).
Providing documentation feedback
To provide feedback about this document, or to report errors and omissions, write to us at:
hpsdocs@[Link]

Uniformance PHD .NET Wrapper User Guide • 4


Contents

1. Introduction .......................................................................................................... 6
1.1 About this Guide........................................................................................ 6
1.2 Overview ................................................................................................... 6

2. Usage..................................................................................................................... 7
2.1 Example .................................................................................................... 7
2.2 The .NET Wrapper Interface – Methods and Properties ........................ 10

Index 176

Uniformance PHD .NET Wrapper User Guide • 5


1. Introduction

1.1 About this Guide


The PHD .NET Wrapper is available for users developing custom applications using Microsoft .NET
technology to provide access to PHD data. This guide contains information and an example on communicating
with the PHD .NET Wrapper.

1.2 Overview
Honeywell's Process History Database (PHD) provides real-time data capture, historization, and intelligent
process data retrieval required for plant information system support. The result of extensive experience with
interfacing real-time systems with plant information systems, PHD forms a comprehensive platform that
supports Honeywell's entire family of integrated plant information system modules.
Various methods of accessing information are designed to allow data retrieval from PHD. As the
[Link] technology is popular in recent times, the PHD .NET Wrapper is developed for users who
design their client application tools in the .NET Framework environment.
The Wrapper is a set of methods and properties that communicate efficiently with the PHD Server native API
calls to fetch data. The next chapter includes a sample program as a quick starting point for developers, a
section that elaborates in detail on the methods and attributes available from the Wrapper.
Two versions of the Wrapper are available:

• [Link] – intended for use with .Net Framework applications

• [Link] – intended for use with .Net Core applications


Both versions are supported on Windows environments only.

6 • Uniformance PHD .NET Wrapper User Guide


2. Usage

2.1 Example

The following is an example on how to use the PHD .NET Wrapper. This example illustrates a typical three-
stepped sequence that is normally found in an application that requires interfacing to a data storage, through a
support API.
1. Initializing
2. Data fetching
3. Closing

Developers can use the example as the initial guide, and subsequently expand the application using additional
help from the more detailed interface information in the next section, or using the embedded Help system, or
take advantage of features like IntelliSense in the Visual Studio development environment. The example is
provided in C#, but can be easily adapted to another equivalent language, like [Link], and so on.

Uniformance PHD .NET Wrapper User Guide • 7


2 Usage
2.1 Example

Sample code:

// Locate [Link] on your system and add a reference to it into this project.

using System;
using [Link]; // This exposes the methods in the .NET Wrapper to this program.

namespace MySpace
{
class MyClass
{
//
// This program fetches and displays raw data from a tag in the last hour.
//
static void Main()
{
//
// Initialize the interfacing to the .NET Wrapper
// and setup the type of data to fetch.
// PHD Server is running on the localhost.
//
PHDHistorian phd = new PHDHistorian();
[Link] = new PHDServer("localhost", SERVERVERSION.API200);
[Link] = 3100;
[Link] = [Link];
[Link] = [Link];

//
// Fetch data.
//
Double [] timestamps = null;
Double [] values = null;
short [] confidences = null;

Tag MyTag = new Tag("[Link]"); // Use your tag name here.

[Link] = "NOW-1H";
[Link] = "NOW";

[Link](MyTag, ref timestamps, ref values, ref confidences);

//
// Display data.
//
int count = [Link](0);

[Link]("Retrieved {0} data points.",count);


[Link]();

for (int i = 0;i < count; ++i)


{
[Link]("{0}) {1}, {2}, {3}",
i+1,
[Link](timestamps[i]),
values[i],
confidences[i]);
}

//
// Clean up and quit.
//
[Link]();
}
}
}

Uniformance PHD .NET Wrapper User Guide • 8


2 Usage
2.1 Example

Output:

Retrieved 60 data points.

1) 2009-12-04 09:36:00 am, 115.513603210449, 100


2) 2009-12-04 09:37:00 am, 127.670715332031, 100
3) 2009-12-04 09:38:00 am, 153.79655456543, 100
...
...
58) 2009-12-04 10:33:00 am, 109.614990234375, 100
59) 2009-12-04 10:34:00 am, 126.125640869141, 100
60) 2009-12-04 10:35:00 am, 146.692733764648, 100

Uniformance PHD .NET Wrapper User Guide • 9


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

2.2 The .NET Wrapper Interface – Methods and Properties

Contents

[Link]

LinkListStruct Class

LinkListStruct Members

LinkListStruct Constructor

Properties

LinkName Property

ParentTaglistStruct Class

ParentTaglistStruct Members

ParentTaglistStruct Constructor

Properties

Tagname Property

Tagno Property

PHDataStruct Class

PHDataStruct Members

PHDataStruct Constructor

Properties

Confidence Property

ErrorMessage Property

HostName Property

TagName Property

TimeStamp Property

Tolerance Property

Units Property

Value Property

PHDErrorException Class

PHDErrorException Members

Uniformance PHD .NET Wrapper User Guide • 10


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHDErrorException Constructor

PHDErrorException Constructor ()

PHDErrorException Constructor (Int32)

Properties

Message Property

Methods

ToString Method

PHDHistorian Class

PHDHistorian Members

PHDHistorian Constructor

Properties

ConnectionTimeout Property

DefaultServer Property

EndTime Property

MaximumRows Property

MinimumConfidence Property

MostRecentRows Property

Offset Property

ReductionFrequency Property

ReductionOffset Property

ReductionType Property

RetryPeriod Property

SampleFrequency Property

Sampletype Property

StartTime Property

UseSampleFrequency Property

UTCDateTime Property
UTCStartEndTime Property
CalendarMonthEnable Property

Uniformance PHD .NET Wrapper User Guide • 11


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Methods

BrowsingTags Method

BrowsingTags Method (UInt32, TagFilter)

BrowsingTags Method (PHDServer, UInt32, TagFilter)

BrowsingTagsList Method

BrowsingTagsList Method (UInt32, TagFilter)

BrowsingTagsList Method (PHDServer, UInt32, TagFilter)

ClearTagUpdateList Method

ClearTagUpdateList Method ()

ClearTagUpdateList Method (PHDServer)

ConvertToPHDTime Method

ConvertToPHDTime Method (DateTime)

ConvertToPHDTime Method (String, Boolean)

ConvertToPHDTime Method (PHDServer, String, Boolean)

DeleteTagData Method

DeleteTagData Method (Tag, DateTime)

DeleteTagData Method (Tag, String)

Dispose Method

Dispose Method ()

Dispose Method (Boolean)

EnableTagDataChangeNotification Method

EnableTagDataChangeNotification Method (Boolean)

EnableTagDataChangeNotification Method (PHDServer, Boolean)

EnableTagUpdateNotification Method

EnableTagUpdateNotification Method (Boolean)

EnableTagUpdateNotification Method (PHDServer, Boolean)

EngUnitConversion Method

Uniformance PHD .NET Wrapper User Guide • 12


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

EngUnitConversion Method (String, String, Double, Double,


Double, Int32)

EngUnitConversion Method (PHDServer, String, String,


Double, Double, Double, Int32)

FetchAllReductionData Method

FetchAllReductionData Method (String, Boolean)

FetchAllReductionData Method (Tags, Boolean)


FetchReductionsSpecified Method (Tags, Boolean,
REDUCTIONTYPE[])

FetchColumnData Method

FetchColumnData Method (String)

FetchColumnData Method (Tags)

FetchData Method

FetchDataList Method

FetchDataListNullable Method
FetchBestFitDataListNullable Method

FetchRowData Method

FetchRowData Method (String)

FetchRowData Method (Tags)

FetchStructData Method

Finalize Method

GetDBInfo Method

GetDBInfo Method (String, String, Int32)

GetDBInfo Method (PHDServer, String, String, Int32)

GetLinkList Method

GetLinkList Method ()

GetLinkList Method (PHDServer)

GetLinks Method

GetLinks Method ()

GetLinks Method (PHDServer)

Uniformance PHD .NET Wrapper User Guide • 13


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

GetParentTagList Method

GetParentTagList Method ()

GetParentTagList Method (PHDServer)

GetParentTags Method

GetParentTags Method ()

GetParentTags Method (PHDServer)

GetRDIInfo Method

GetRDIInfo Method (String)

GetRDIInfo Method (String, PHDServer)

GetRDIList Method

GetRDIList Method ()

GetRDIList Method (PHDServer)

GetRDIs Method

GetRDIs Method ()

PutData Method

PutData Method (Tag, Object)

PutData Method (Tag, Object, DateTime, SByte, String)

PutData Method (Tag, Object, String)

PutData Method (Tag, Object, String, SByte)

PutList Method

PutList Method (Server, Tag, ds, failed, pending)

PutList Method (Tag, ds, failed, pending)

TagDfn Method

TagDfn Method (String)

TagDfn Method (Tags)

TagDataChangeHandler Method

TagDataChangeHandler Method (TagDataChangeNotify,IntPtr)

TagDataChangeHandler Method
(PHDServer,TagDataChangeNotify,IntPtr)

Uniformance PHD .NET Wrapper User Guide • 14


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

TagUpdateHandler Method

TagUpdateHandler Method (PHDServer, TagUpdateNotify)

TagUpdateHandler Method (TagUpdateNotify)

ValidateCalc Method

ValidateCalc Method (String)

ValidateCalc Method (PHDServer, String)

GetDigitalEnumerationDefinition Method

GetDigitalEnumerationDefinition
GetPHDTagName
[Link] Method(Int32)
[Link] Method(Int32,PHDServer)
[Link] Method(String)
[Link] Method(String, PHDServer)

PHDServer Class

PHDServer Members

PHDServer Constructor

PHDServer Constructor ()

PHDServer Constructor (String)

PHDServer Constructor (String, SERVERVERSION)

Properties

APIVersion Property

HostName Property

MaxSearchBackTime Property

Password Property
PHDServerVersion Property

Port Property

RequestTimeout Property

ServerID Property

Uniformance PHD .NET Wrapper User Guide • 15


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

UserName Property

WindowsPassword Property

WindowsUsername Property

Methods
ConnectToServer Method

Dispose Method

Finalize Method

RDIListStruct Class

RDIListStruct Members

RDIListStruct Constructor

Properties

RDIName Property

REDUCTIONOFFSET Enumeration

REDUCTIONTYPE Enumeration

SAMPLETYPE Enumeration

SERVERVERSION Enumeration

Tag Class

Tag Members

Tag Constructor

Tag Constructor ()

Tag Constructor (String)

Properties

EnumEnable Property

Server Property

TagName Property

Units Property

TagFilter Class

TagFilter Members

TagFilter Constructor

Uniformance PHD .NET Wrapper User Guide • 16


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Fields

Collector Field

DataType Field

ParentTagname Field

ScanRate Field

SourceTagname Field

SourceUnits Field

Tagname Field

TagUnits Field

Methods

Clear Method

TagListStruct Class

TagListStruct Members

TagListStruct Constructor

Properties

CollectorName Property

DataLength Property

DataType Property

ParentTagname Property

ParentTagno Property

SourceTagname Property

SourceUnits Property

Tagname Property

Tagno Property

Units Property

Tags Class

Tags Members

Tags Constructor

Properties

Uniformance PHD .NET Wrapper User Guide • 17


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Count Property

Item Property

Item Property (Int32)

Item Property (String)

Methods

Add Method

GetEnumerator Method

Remove Method

RemoveAll Method

TagDataChangeNotify Delegate

TagUpdateNotify Delegate

Uniformance PHD .NET Wrapper User Guide • 18


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Namespace
Namespace hierarchy

Classes

Class Description

LinkListStruct PHD link to external systems such as experion etc.

ParentTaglistStruct Parent Taglist

PHDataStruct FetchStructData returns an ArrayList of


PHDataStruct. The List can return results from
multiple tags.

PHDErrorException PHD Exception Class

PHDHistorian Main Class

PHDServer PHDServer class describes a connection to a PHD


Server

RDIListStruct

Tag Describes a single Tag

TagFilter A structure is used to specify tag filter conditions

TagListStruct

Tags The Tags class is used to hold a collection of Tag


items

Delegates

Delegate Description

TagUpdateNotify Notification from PHD server when tags are


updated

Enumerations

Enumeration Description

REDUCTIONOFFSET Identifies the offset applied when retrieving


reductions for tags.

REDUCTIONTYPE Identifies the type of reduction fetched for the


tags.

Uniformance PHD .NET Wrapper User Guide • 19


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

SAMPLETYPE Sampling types supported.

SERVERVERSION Enum list if Server API Supported

PHD .NET Wrapper

LinkListStruct Class
PHD link to external systems such as experion etc.

For a list of all members of this type, see LinkListStruct Members.

[Link]
[Link]

[Visual Basic]
Public Class LinkListStruct
[C#]
public class LinkListStruct

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance
members are not guaranteed to be thread-safe.

Requirements

Namespace: [Link]

Assembly: PHDAPINET (in [Link])

See Also

LinkListStruct Members | [Link] Namespace

PHD .NET Wrapper

LinkListStruct Members
LinkListStruct overview

Public Instance Constructors

LinkListStruct Constructor Create an instance of the class.

Public Instance Properties

LinkName PHD Tagname

Uniformance PHD .NET Wrapper User Guide • 20


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Public Instance Methods

Determines whether the specified Object is equal


Equals (inherited from Object)
to the current Object.

GetHashCode (inherited from Object) Serves as a hash function for a particular type,
suitable for use in hashing algorithms and data
structures like a hash table.

GetType (inherited from Object) Gets the Type of the current instance.

ToString (inherited from Object) Returns a String that represents the current
Object.

Protected Instance Methods

Finalize (inherited from Object) Allows an Object to attempt to free resources and
perform other cleanup operations before the
Object is reclaimed by garbage collection.

MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

LinkListStruct Class | [Link] Namespace

PHD .NET Wrapper

LinkListStruct Constructor
Create an instance of the class.

[Visual Basic]
Overloads Public Sub New()
[C#]
public LinkListStruct();

See Also

LinkListStruct Class | [Link] Namespace

PHD .NET Wrapper

LinkListStruct Properties
The properties of the LinkListStruct class are listed below. For a complete list of LinkListStruct class
members, see the LinkListStruct Members topic.

Public Instance Properties

Uniformance PHD .NET Wrapper User Guide • 21


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

LinkName PHD Tagname

See Also

LinkListStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
PHD Tagname

[Visual Basic]
Public ReadOnly Property LinkName As String
[C#]
public string LinkName {get;}

See Also

LinkListStruct Class | [Link] Namespace

PHD .NET Wrapper

ParentTaglistStruct Class
Parent Taglist

For a list of all members of this type, see ParentTaglistStruct Members.

[Link]
[Link]

[Visual Basic]
Public Class ParentTaglistStruct
[C#]
public class ParentTaglistStruct

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance
members are not guaranteed to be thread-safe.

Requirements

Namespace: [Link]

Assembly: PHDAPINET (in [Link])

See Also

ParentTaglistStruct Members | [Link] Namespace

Uniformance PHD .NET Wrapper User Guide • 22


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

ParentTaglistStruct Members
ParentTaglistStruct overview

Public Instance Constructors

ParentTaglistStruct Constructor Create an instance of the class.

Public Instance Properties

Tagname PHD Tagname

Tagno PHD Tagno

Public Instance Methods

Equals (inherited from Object) Determines whether the specified Object is equal
to the current Object.

Serves as a hash function for a particular type,


GetHashCode (inherited from Object)
suitable for use in hashing algorithms and data
structures like a hash table.

GetType (inherited from Object) Gets the Type of the current instance.

Returns a String that represents the current


ToString (inherited from Object)
Object.

Protected Instance Methods

Allows an Object to attempt to free resources and


Finalize (inherited from Object)
perform other cleanup operations before the
Object is reclaimed by garbage collection.

MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

ParentTaglistStruct Class | [Link] Namespace

PHD .NET Wrapper

ParentTaglistStruct Constructor
Create an instance of the class.

[Visual Basic]
Overloads Public Sub New()
[C#]
public ParentTaglistStruct();

Uniformance PHD .NET Wrapper User Guide • 23


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

See Also

ParentTaglistStruct Class | [Link] Namespace

PHD .NET Wrapper

ParentTaglistStruct Properties
The properties of the ParentTaglistStruct class are listed below. For a complete list of ParentTaglistStruct
class members, see the ParentTaglistStruct Members topic.

Public Instance Properties

Tagname PHD Tagname

Tagno PHD Tagno

See Also

ParentTaglistStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
PHD Tagname

[Visual Basic]
Public ReadOnly Property Tagname As String
[C#]
public string Tagname {get;}

See Also

ParentTaglistStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
PHD Tagno

[Visual Basic]
Public ReadOnly Property Tagno As Integer
[C#]
public int Tagno {get;}

See Also

ParentTaglistStruct Class | [Link] Namespace

Uniformance PHD .NET Wrapper User Guide • 24


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

PHDataStruct Class
FetchStructData returns an ArrayList of PHDataStruct. The List can return results from multiple tags.

For a list of all members of this type, see PHDataStruct Members.

[Link]
[Link]

[Visual Basic]
Public Class PHDataStruct
[C#]
public class PHDataStruct

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance
members are not guaranteed to be thread-safe.

Example

This sample shows how return an ArrayList of PHDataStruct objects

PHDataStruct str;

ArrayList lst = [Link](oTags)

for(int i=0;i<[Link];i++)

str=(PHDataStruct)lst[i];

if([Link]!="kst20000")break;

Requirements

Namespace: [Link]

Assembly: PHDAPINET (in [Link])

See Also

PHDataStruct Members | [Link] Namespace

Uniformance PHD .NET Wrapper User Guide • 25


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

PHDataStruct Members
PHDataStruct overview

Public Instance Constructors

PHDataStruct Constructor Create an instance of the class.

Public Instance Properties

Confidence PHD Confidence

ErrorMessage Error Message if there is an error. null indicates


there is no error.

HostName PHD Hostname

TagName PHD Tagname

TimeStamp PHD Timestamp

Tolerance Tolerance for reductions

Units Engineering Units

Value PHD Value

Public Instance Methods

Equals (inherited from Object) Determines whether the specified Object is equal
to the current Object.

Serves as a hash function for a particular type,


GetHashCode (inherited from Object)
suitable for use in hashing algorithms and data
structures like a hash table.

GetType (inherited from Object) Gets the Type of the current instance.

Returns a String that represents the current


ToString (inherited from Object)
Object.

Protected Instance Methods

Allows an Object to attempt to free resources and


Finalize (inherited from Object)
perform other cleanup operations before the
Object is reclaimed by garbage collection.

MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

Uniformance PHD .NET Wrapper User Guide • 26


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHDataStruct Class | [Link] Namespace

PHD .NET Wrapper

PHDataStruct Constructor
Create an instance of the class.

[Visual Basic]
Overloads Public Sub New()
[C#]
public PHDataStruct();

See Also

PHDataStruct Class | [Link] Namespace

PHD .NET Wrapper

PHDataStruct Properties
The properties of the PHDataStruct class are listed below. For a complete list of PHDataStruct class
members, see the PHDataStruct Members topic.

Public Instance Properties

Confidence PHD Confidence

ErrorMessage Error Message if there is an error. null indicates


there is no error.

HostName PHD Hostname

TagName PHD Tagname

TimeStamp PHD Timestamp

Tolerance Tolerance for reductions

Units Engineering Units

Value PHD Value

See Also

PHDataStruct Class | [Link] Namespace

Uniformance PHD .NET Wrapper User Guide • 27


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Property
PHD Confidence

[Visual Basic]
Public ReadOnly Property Confidence As SByte
[C#]
public sbyte Confidence {get;}

See Also

PHDataStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Error Message if there is an error. null indicates there is no error.

[Visual Basic]
Public ReadOnly Property ErrorMessage As String
[C#]
public string ErrorMessage {get;}

See Also

PHDataStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
PHD Hostname

[Visual Basic]
Public ReadOnly Property HostName As String
[C#]
public string HostName {get;}

See Also

PHDataStruct Class | [Link] Namespace

Uniformance PHD .NET Wrapper User Guide • 28


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Property
PHD Tagname

[Visual Basic]
Public ReadOnly Property TagName As String
[C#]
public string TagName {get;}

See Also

PHDataStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
PHD Timestamp

[Visual Basic]
Public ReadOnly Property TimeStamp As Date
[C#]
public [Link] TimeStamp {get;}

See Also

PHDataStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Tolerance for reductions

[Visual Basic]
Public ReadOnly Property Tolerance As Double
[C#]
public double Tolerance {get;}

See Also

PHDataStruct Class | [Link] Namespace

Uniformance PHD .NET Wrapper User Guide • 29


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Property
Engineering Units

[Visual Basic]
Public ReadOnly Property Units As String
[C#]
public string Units {get;}

See Also

PHDataStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
PHD Value

[Visual Basic]
Public ReadOnly Property Value As Object
[C#]
public object Value {get;}

See Also

PHDataStruct Class | [Link] Namespace

PHD .NET Wrapper

PHDErrorException Class
PHD Exception Class

For a list of all members of this type, see PHDErrorException Members.

[Link]
[Link]
[Link]

[Visual Basic]
Public Class PHDErrorException
Inherits Exception
[C#]
public class PHDErrorException : Exception

Uniformance PHD .NET Wrapper User Guide • 30


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance
members are not guaranteed to be thread-safe.

Requirements

Namespace: [Link]

Assembly: PHDAPINET (in [Link])

See Also

PHDErrorException Members | [Link] Namespace

PHD .NET Wrapper

PHDErrorException Members
PHDErrorException overview

Public Instance Constructors

Overloaded. Initializes a new instance of the


PHDErrorException
PHDErrorException class.

Public Instance Properties

Gets or sets a link to the help file associated with


HelpLink (inherited from Exception)
this exception.

InnerException (inherited from Exception) Gets the Exception instance that caused the
current exception.

Message Custom Exception Message

Source (inherited from Exception) Gets or sets the name of the application or the
object that causes the error.

Gets a string representation of the frames on the


StackTrace (inherited from Exception)
call stack at the time the current exception was
thrown.

TargetSite (inherited from Exception) Gets the method that throws the current
exception.

Public Instance Methods

Equals (inherited from Object) Determines whether the specified Object is equal
to the current Object.

When overridden in a derived class, returns the


GetBaseException (inherited from Exception)
Exception that is the root cause of one or more

Uniformance PHD .NET Wrapper User Guide • 31


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

subsequent exceptions.

Serves as a hash function for a particular type,


GetHashCode (inherited from Object)
suitable for use in hashing algorithms and data
structures like a hash table.

GetObjectData (inherited from Exception) When overridden in a derived class, sets the
SerializationInfo with information about the
exception.

GetType (inherited from Object) Gets the Type of the current instance.

ToString Custom Detail exception Information

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value
that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) Allows an Object to attempt to free resources and
perform other cleanup operations before the
Object is reclaimed by garbage collection.

MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

PHDErrorException Class | [Link] Namespace

PHD .NET Wrapper

PHDErrorException Constructor
Default constructor

Overload List

Default constructor

public PHDErrorException();
PHDAPI Exception handler

public PHDErrorException(int);

See Also

PHDErrorException Class | [Link] Namespace

Uniformance PHD .NET Wrapper User Guide • 32


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

PHDErrorException Constructor ()
Default constructor

[Visual Basic]
Overloads Public Sub New()
[C#]
public PHDErrorException();

See Also

PHDErrorException Class | [Link] Namespace | PHDErrorException Constructor Overload List

PHD .NET Wrapper

PHDErrorException Constructor (Int32)


PHDAPI Exception handler

[Visual Basic]
Overloads Public Sub New( _
ByVal ErrorNo As Integer _
)
[C#]
public PHDErrorException(
int ErrorNo
);

Parameters

ErrorNo
PHD Error Number

See Also

PHDErrorException Class | [Link] Namespace | PHDErrorException Constructor Overload List

PHD .NET Wrapper

PHDErrorException Properties
The properties of the PHDErrorException class are listed below. For a complete list of PHDErrorException
class members, see the PHDErrorException Members topic.

Public Instance Properties

Gets or sets a link to the help file associated with


HelpLink (inherited from Exception)
this exception.

InnerException (inherited from Exception) Gets the Exception instance that caused the

Uniformance PHD .NET Wrapper User Guide • 33


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

current exception.

Message Custom Exception Message

Source (inherited from Exception) Gets or sets the name of the application or the
object that causes the error.

Gets a string representation of the frames on the


StackTrace (inherited from Exception)
call stack at the time the current exception was
thrown.

TargetSite (inherited from Exception) Gets the method that throws the current
exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value
that is assigned to a specific exception.

See Also

PHDErrorException Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Custom Exception Message

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

PHDErrorException Class | [Link] Namespace

PHD .NET Wrapper

PHDErrorException Methods
The methods of the PHDErrorException class are listed below. For a complete list of PHDErrorException
class members, see the PHDErrorException Members topic.

Public Instance Methods

Equals (inherited from Object) Determines whether the specified Object is equal
to the current Object.

Uniformance PHD .NET Wrapper User Guide • 34


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

GetBaseException (inherited from Exception) When overridden in a derived class, returns the
Exception that is the root cause of one or more
subsequent exceptions.

GetHashCode (inherited from Object) Serves as a hash function for a particular type,
suitable for use in hashing algorithms and data
structures like a hash table.

When overridden in a derived class, sets the


GetObjectData (inherited from Exception)
SerializationInfo with information about the
exception.

GetType (inherited from Object) Gets the Type of the current instance.

ToString Custom Detail exception Information

Protected Instance Methods

Allows an Object to attempt to free resources and


Finalize (inherited from Object)
perform other cleanup operations before the
Object is reclaimed by garbage collection.

MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

PHDErrorException Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method
Custom Detail exception Information

[Visual Basic]
Overrides Public Function ToString() As String
[C#]
public override string ToString();

Return Value

Detail Error information

See Also

PHDErrorException Class | [Link] Namespace

Uniformance PHD .NET Wrapper User Guide • 35


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

PHDHistorian Class
Main Class

For a list of all members of this type, see PHDHistorian Members.

[Link]
[Link]

[Visual Basic]
Public Class PHDHistorian
Implements IDisposable
[C#]
public class PHDHistorian : IDisposable

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance
members are not guaranteed to be thread-safe.

Example

Create a new instance of PHDHistorian.

PHDHistorian oPhd = new PHDHistorian(false);

Requirements

Namespace: [Link]

Assembly: PHDAPINET (in [Link])

See Also

PHDHistorian Members | [Link] Namespace

PHD .NET Wrapper

PHDHistorian Members
PHDHistorian overview

Public Instance Constructors

PHDHistorian Constructor This Class is the entry point for Accessing the PHD
Server through the 200 and R200 API's

Uniformance PHD .NET Wrapper User Guide • 36


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Public Instance Properties

The ConnectionTimeout property identifies the


ConnectionTimeout
network timeout period used when attempting to
connect to the PHD server. If the connection to
the PHD server is not established within the time
period, the request is abandoned. It is in
milliseconds.

DefaultServer Attach a PHDServer object to the Historian

EndTime Assign a default End Time

MaximumRows Specifies the maximum number of raw values that


will be retrieved to generate the requested data.

Specifies the confidence threshold for values for


MinimumConfidence
validation. Any values that have a confidence less
than these are invalid and return a NULL Value.
Values are between 0 and 100 with a default
value of 0.

MostRecentRows Set or return the MostRecentRows. The most


recent rows will be returned if it is set to true.

Offset Set or return the Offset

ReductionFrequency Set or return the Reduction Frequency

ReductionOffset Set or return the Reduction Offset.

ReductionType Set or return the Reduction Type. Reduction Type


is an Enumerate list

RetryPeriod The RetryPeriod property identifies the period


after a connection timeout occurs before another
connection request to the PHD server will occur.
This property is related to the ConnectionTimeout
property for the handling of network timeout
conditions in communication with the PHD Server.
It is in milliseconds.

SampleFrequency Set or return the Sample Frequency

Sampletype Set or return the Sample Type. Sample Type is an


Enumerate list

StartTime Assign a default Start Time

UseSampleFrequency Set or return the UseSampleFrequency. The


SampleFrequency will be used as
ReductionFrequency if it is set to true.

Set or Get the UTCDateTime flag. When


UTCDateTime
UTCDateTime is set as true timestamp data will be
returned as Universal Time else local time.

Uniformance PHD .NET Wrapper User Guide • 37


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

CalendarMonthEnable Specify whether data must be aggregated based


on the number of days in a particular month/year,
or based on a fixed number irrespective of the
actual number of days in that month/year. The
value can be set as 1 or 0.

• Set the value to 1 to calculate the aggregate


based on the number of days in that particular
month/year. For example, 31 days to calculate
the aggregate for the month of January.

• Set the value to 0 to calculate the aggregate


for any month or year based on a fixed
number. For example, 30 days for a monthly
aggregate and 365 days for a yearly aggregate.

Public Instance Methods

BrowsingTags Overloaded. Return a DataSet of Tags

BrowsingTagsList Overloaded. Return an ArrayList of Tags

ClearTagUpdateList Overloaded. Clear Tag Update List

Overloaded. Using default server to convert the


ConvertToPHDTime
DateTime string (ts) to the format of "yyyy-MM-
dd HH:mm:ss".

DeleteTagData Overloaded. Delete Tag Data

Overloaded. Clean up all managed and


Dispose
unmanaged code

Overloaded. Enable/disable tag update


EnableTagUpdateNotification
notification callback

EngUnitConversion Overloaded. Convert from one Engineering Unit


to another. example ((UnitIn + PreAdd) * Mult)
+ PostAdd

Determines whether the specified Object is equal


Equals (inherited from Object)
to the current Object.

FetchAllReductionData Overloaded. Return Reduction Data for a


Tagname

Overloaded. Fetch a single tag of Data and


FetchColumnData
Display in a Column Format

FetchData Fetch a single tag of Data and return results in


an Array

Overloaded. Fetch a single tag of Data and return


FetchRowData
the data in a DataSet

Uniformance PHD .NET Wrapper User Guide • 38


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

FetchStructData Return all tags from the Tags Collection

GetDBInfo Overloaded. Get Database Information from


default PHD server

Serves as a hash function for a particular type,


GetHashCode (inherited from Object)
suitable for use in hashing algorithms and data
structures like a hash table.

GetLinkList Overloaded. Returns link list from the default


server

Overloaded. Returns link list from the default


GetLinks
server

GetParentTagList Overloaded. Returns Parent Tag list from the


default server

Overloaded. Returns Parent Tag list from the


GetParentTags
default server

GetRDIInfo Overloaded. A 200 API function that will return


the RDI info

Overloaded. Returns RDI list from the default


GetRDIList
server

GetRDIs Overloaded. Returns RDI list from the default


server

GetType (inherited from Object) Gets the Type of the current instance.

ModifyTag Overloaded. Modify Tag Data

Overloaded. Insert Tag Data into a DCS for a


PutData
timestamp of Now

PutList Overloaded. Used to load multiple values in a


dataset for multiple tags of manual type.

Notes:

• Number of entries in the dataset table


must be equivalent to the number of
tags in the array.

• Each row of the dataset table must be


mapped to the corresponding index of
the tag array.

Overloaded. Convert a PHD relative time to the


RelativeToAbsolute
absolute UTC date and time on the client. An
exception will be thrown for a incorrect relative
input.

StringToUniversalTime Overloaded. Convert a PHD string/relative time


to universal DateTime. The conversion will be

Uniformance PHD .NET Wrapper User Guide • 39


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

performed on the default PHD server if the string


starts with "NOW"; otherwise the conversion will
be performed on the local machine.

TagDfn Overloaded. Fetch a single tag of Data

TagUpdateHandler Overloaded. Specify call back function when PHD


Tags have been updated

Returns a String that represents the current


ToString (inherited from Object)
Object.

ValidateCalc Overloaded. Have the Default PHD Server


Validate a function.

Protected Instance Methods

Dispose Overloaded. Clean up all managed and


unmanaged code

destructor to clean up all managed and


Finalize
unmanaged code

MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

PHDHistorian Constructor
This Class is the entry point for Accessing the PHD Server through the 200 and R200 API's

[Visual Basic]
Public Sub New()
[C#]
public PHDHistorian();

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

PHDHistorian Properties
The properties of the PHDHistorian class are listed below. For a complete list of PHDHistorian class
members, see the PHDHistorian Members topic.

Uniformance PHD .NET Wrapper User Guide • 40


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Public Instance Properties

The ConnectionTimeout property identifies the


ConnectionTimeout
network timeout period used when attempting to
connect to the PHD server. If the connection to the
PHD server is not established within the time
period, the request is abandoned. It is in
milliseconds.

DefaultServer Attach a PHDServer object to the Historian

EndTime Assign a default End Time

MaximumRows Specifies the maximum number of raw values that


will be retrieved to generate the requested data.

Specifies the confidence threshold for values for


MinimumConfidence
validation. Any values that have a confidence less
than these are invalid and return a NULL Value.
Values are between 0 and 100 with a default value
of 0.

MostRecentRows Set or return the MostRecentRows. The most


recent rows will be returned if it is set to true.

Offset Set or return the Offset

ReductionFrequency Set or return the Reduction Frequency

ReductionOffset Set or return the Reduction Offset.

ReductionType Set or return the Reduction Type. Reduction Type


is an Enumerate list

RetryPeriod The RetryPeriod property identifies the period after


a connection timeout occurs before another
connection request to the PHD server will occur.
This property is related to the ConnectionTimeout
property for the handling of network timeout
conditions in communication with the PHD Server.
It is in milliseconds.

SampleFrequency Set or return the Sample Frequency

Sampletype Set or return the Sample Type. Sample Type is an


Enumerate list

StartTime Assign a default Start Time

UseSampleFrequency Set or return the UseSampleFrequency. The


SampleFrequency will be used as
ReductionFrequency if it is set to true.

Set or Get the UTCDateTime flag. When


UTCDateTime
UTCDateTime is set as true timestamp data will be
returned as Universal Time else local time.

Uniformance PHD .NET Wrapper User Guide • 41


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

CalendarMonthEnable Set to specify whether to calculate the aggregate


of data based on actual number of days in a
particular month/year, or based on a fixed number
of days irrespective of the actual number of days
in that month/year. The value can be set as 0 or
1. If the CalendarMonthEnable is set to 1, the
aggregate for the month/year is calculated based
on the actual number of days in that particular
month/year. If the CalendarMonthEnable is set to
0, then a fixed number is used to calculate the
aggregate for any month or year (for example, 30
days for a monthly aggregate and 365 days for a
yearly aggregate).

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
The ConnectionTimeout property identifies the network timeout period used when attempting to connect to the
PHD server. If the connection to the PHD server is not established within the time period, the request is
abandoned. It is in milliseconds.

[Visual Basic]
Public Property ConnectionTimeout As UInt32
[C#]
public uint ConnectionTimeout {get; set;}

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Attach a PHDServer object to the Historian

[Visual Basic]
Public Property DefaultServer As PHDServer
[C#]
public PHDServer DefaultServer {get; set;}

Example

Create a new instance of a PHDHistorian and connect to a PHD Server on the local machine.

VB

Dim oPhd as PHDHistorian = new PHDHistorian(false)

Uniformance PHD .NET Wrapper User Guide • 42


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Dim DefaultServer as PHDServer = new PHDServer("localhost")

[Link] = [Link].API200

[Link] = DefaultServer

c#

PHDHistorian oPhd = new PHDHistorian(false);

PHDServer DefaultServer = new PHDServer("localhost");

[Link]= [Link].API200;

[Link] = DefaultServer;

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Assign a default End Time

[Visual Basic]
Public Property EndTime As String
[C#]
public string EndTime {get; set;}

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Specifies the maximum number of raw values that will be retrieved to generate the requested data.

Note: do not use this setting to limit the number of values returned from a reduction – it is specifically to
restrict the input data set to a reduction, not the results.

[Visual Basic]
Public Property MaximumRows As UInt32

Uniformance PHD .NET Wrapper User Guide • 43


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[C#]
public uint MaximumRows {get; set;}

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Specifies the confidence threshold for values for validation. If this is set to a value greater than 0, then any
values that have a confidence less than these are invalid and will not be returned to the client. Values are
between 0 and 100 with a default value of 0.

Note: when calculating reductions on PHD data, any raw values that do not meet the MinimumConfidence
setting will be excluded as inputs for the reduction – and the end effect will be as if the input values interpolate
between good values, with no indication that there were questionable values in between.

For this reason, it is recommended to not use this MinimumConfidence property, but instead use the
MinimumConfidence parameter that is available in the functions FetchDataList, FetchDataListNullable,
FetchBestFitDataListNullable – as this parameter will operate on the output set instead of the input, and more
closely matches the typical user expectation.

[Visual Basic]
Public Property MinimumConfidence As Integer
[C#]
public int MinimumConfidence {get; set;}

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Set or return the MostRecentRows. The most recent rows will be returned if it is set to true.

[Visual Basic]
Public Property MostRecentRows As Boolean
[C#]
public bool MostRecentRows {get; set;}

See Also

PHDHistorian Class | [Link] Namespace

Uniformance PHD .NET Wrapper User Guide • 44


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Property
Set or return the Offset

[Visual Basic]
Public Property Offset As Integer
[C#]
public int Offset {get; set;}

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Set or return the Reduction Frequency

[Visual Basic]
Public Property ReductionFrequency As UInt32
[C#]
public uint ReductionFrequency {get; set;}

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Set or return the Reduction Offset.

[Visual Basic]
Public Property ReductionOffset As REDUCTIONOFFSET
[C#]
public REDUCTIONOFFSET ReductionOffset {get; set;}

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Set or return the Reduction Type. Reduction Type is an Enumerate list

Uniformance PHD .NET Wrapper User Guide • 45


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[Visual Basic]
Public Property ReductionType As REDUCTIONTYPE
[C#]
public REDUCTIONTYPE ReductionType {get; set;}

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
The RetryPeriod property identifies the period after a connection timeout occurs before another connection
request to the PHD server will occur. This property is related to the ConnectionTimeout property for the
handling of network timeout conditions in communication with the PHD Server. It is in milliseconds.

[Visual Basic]
Public Property RetryPeriod As UInt32
[C#]
public uint RetryPeriod {get; set;}

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Set or return the Sample Frequency

[Visual Basic]
Public Property SampleFrequency As UInt32
[C#]
public uint SampleFrequency {get; set;}

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Set or return the Sample Type. Sample Type is an Enumerate list

[Visual Basic]
Public Property Sampletype As SAMPLETYPE
[C#]
public SAMPLETYPE Sampletype {get; set;}

Uniformance PHD .NET Wrapper User Guide • 46


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Assign a default Start Time

[Visual Basic]
Public Property StartTime As String
[C#]
public string StartTime {get; set;}

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Set or return the UseSampleFrequency. The SampleFrequency will be used as ReductionFrequency if it is set to
true.

[Visual Basic]
Public Property UseSampleFrequency As Boolean
[C#]
public bool UseSampleFrequency {get; set;}

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Set or Get the UTCDateTime flag. When UTCDateTime is set as true timestamp data will be returned as
Universal Time else local time.

[Visual Basic]
Public Property UTCDateTime As Boolean
[C#]
public bool UTCDateTime {get; set;}

Example

Return timestamp data in Universal Time format

Uniformance PHD .NET Wrapper User Guide • 47


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

VB

Dim oPhd as PHDHistorian = new PHDHistorian(false)

Dim DefaultServer as PHDServer = new PHDServer("localhost")

[Link] = [Link].API200

[Link] = DefaultServer

[Link] = True

c#

PHDHistorian oPhd = new PHDHistorian(false);

PHDServer DefaultServer = new PHDServer("localhost");

[Link]= [Link].API200;

[Link] = DefaultServer;

[Link] = true;

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Set or Get the UTCStartEndTime flag. When UTCStartEndTime is set as true, the start and end times are
interpreted as Universal Time else local time.

[Visual Basic]
Public Property UTCDateTime As Boolean
[C#]
public bool UTCDateTime {get; set;}

See Also

PHDHistorian Class | [Link] Namespace

[Link]
The CalendarMonthEnable property is set to specify whether to calculate the aggregate of data based on actual
number of days in a particular month/year, or based on a fixed number. The value can be set as 1 or 0. If the
CalendarMonthEnable is set to 1, the aggregate for the month/year is calculated based on the actual number
of days in that month/year. If the CalendarMonthEnable is set to 0, then a fixed number is used to calculate
the aggregate for any month or year (for example, 30 days for a monthly aggregate and 365 days for a yearly
aggregate).

Uniformance PHD .NET Wrapper User Guide • 48


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[Visual Basic]
Public Property CalendarMonthEnable() As Integer

[C#]
public int CalendarMonthEnable { set; get; }

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

PHDHistorian Methods
The methods of the PHDHistorian class are listed below. For a complete list of PHDHistorian class members,
see the PHDHistorian Members topic.

Public Instance Methods

BrowsingTags Overloaded. Return a DataSet of Tags

BrowsingTagsList Overloaded. Return an ArrayList of Tags

ClearTagUpdateList Overloaded. Clear Tag Update List

Overloaded. Using default server to convert the


ConvertToPHDTime
DateTime string (ts) to the format of "yyyy-MM-dd
HH:mm:ss".

DeleteTagData Overloaded. Delete Tag Data

Overloaded. Clean up all managed and


Dispose
unmanaged code

EnableTagUpdateNotification Overloaded. Enable/disable tag update notification


callback

Overloaded. Convert from one Engineering Unit to


EngUnitConversion
another. example ((UnitIn + PreAdd) * Mult) +
PostAdd

Equals (inherited from Object) Determines whether the specified Object is equal
to the current Object.

FetchAllReductionData Overloaded. Return Reduction Data for a Tagname

FetchColumnData Overloaded. Fetch a single tag of Data and Display


in a Column Format

Fetch a single tag of Data and return results in an


FetchData
Array

Fetch data for a single tag and return results in a


FetchDataList
single PHDataList structure

Uniformance PHD .NET Wrapper User Guide • 49


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

FetchDataListNullable Fetch data for a single tag and return results in a


single PHDataListNullable structure. Any values
that have less than the specified
“MinimumConfidence” will be set to a value of
“null” rather than returning a numeric value.

FetchBestFitDataListNullable Fetch BestFit data for a single tag and return


results in a single PHDataListNullable structure.
Any values that have less than the specified
“MinimumConfidence” will be set to a value of
“null” rather than returning a numeric value

Overloaded. Fetch a single tag of Data and return


FetchRowData
the data in a DataSet

FetchStructData Return all tags from the Tags Collection

FetchReductionsSpecified Return Reduction Data for a Tag or Tags

GetDBInfo Overloaded. Get Database Information from


default PHD server

Serves as a hash function for a particular type,


GetHashCode (inherited from Object)
suitable for use in hashing algorithms and data
structures like a hash table.

GetLinkList Overloaded. Returns link list from the default


server

Overloaded. Returns link list from the default


GetLinks
server

GetParentTagList Overloaded. Returns Parent Tag list from the


default server

GetParentTags Overloaded. Returns Parent Tag list from the


default server

Overloaded. A 200 API function that will return


GetRDIInfo
the RDI info

GetRDIList Overloaded. Returns RDI list from the default


server

Overloaded. Returns RDI list from the default


GetRDIs
server

GetType (inherited from Object) Gets the Type of the current instance.

ModifyTag Overloaded. Modify Tag Data

PutData Overloaded. Insert Tag Data into a DCS for a


timestamp of Now

Overloaded. Convert a PHD relative time to the


RelativeToAbsolute
absolute UTC date and time on the client. An

Uniformance PHD .NET Wrapper User Guide • 50


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

exception will be thrown for a incorrect relative


input.

Overloaded. Convert a PHD string/relative time to


StringToUniversalTime
universal DateTime. The conversion will be
performed on the default PHD server if the string
starts with "NOW"; otherwise the conversion will
be performed on the local machine.

TagDfn Overloaded. Fetch a single tag of Data

Overloaded. Specify call back function when PHD


TagUpdateHandler
Tags have been updated

ToString (inherited from Object) Returns a String that represents the current
Object.

Overloaded. Have the Default PHD Server Validate


ValidateCalc
a function.

Protected Instance Methods

Overloaded. Clean up all managed and


Dispose
unmanaged code

Finalize destructor to clean up all managed and


unmanaged code

MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method
Return a DataSet of Tags

Overload List

Return a DataSet of Tags

public DataSet BrowsingTags(uint,TagFilter);


Return a DataSet of Tags

public DataSet BrowsingTags(PHDServer,uint,TagFilter);

Uniformance PHD .NET Wrapper User Guide • 51


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (UInt32, TagFilter)


Return a DataSet of Tags

[Visual Basic]
Overloads Public Function BrowsingTags( _
ByVal MaxTagCount As UInt32, _
ByVal MatchCriteria As TagFilter _
) As DataSet
[C#]
public DataSet BrowsingTags(
uint MaxTagCount,
TagFilter MatchCriteria
);

Parameters

MaxTagCount
Maximum number of tags to be returned
MatchCriteria
Tag filter conditions

Return Value

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (PHDServer, UInt32, TagFilter)


Return a DataSet of Tags

[Visual Basic]
Overloads Public Function BrowsingTags( _
ByVal Server As PHDServer, _
ByVal MaxTagCount As UInt32, _
ByVal MatchCriteria As TagFilter _
) As DataSet
[C#]
public DataSet BrowsingTags(
PHDServer Server,
uint MaxTagCount,
TagFilter MatchCriteria
);

Uniformance PHD .NET Wrapper User Guide • 52


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Parameters

Server
PHDServer object
MaxTagCount
Maximum number of tags to be returned
MatchCriteria
Tag filter conditions

Return Value

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Return an ArrayList of Tags

Overload List

Return an ArrayList of Tags

public ArrayList BrowsingTagsList(uint,TagFilter);


Return an ArrayList of Tags

public ArrayList BrowsingTagsList(PHDServer,uint,TagFilter);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (UInt32, TagFilter)


Return an ArrayList of Tags

[Visual Basic]
Overloads Public Function BrowsingTagsList( _
ByVal MaxTagCount As UInt32, _
ByVal MatchCriteria As TagFilter _
) As ArrayList
[C#]
public ArrayList BrowsingTagsList(
uint MaxTagCount,
TagFilter MatchCriteria
);

Parameters

Uniformance PHD .NET Wrapper User Guide • 53


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

MaxTagCount
Maximum number of tags to be returned
MatchCriteria
Tag filter conditions

Return Value

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (PHDServer, UInt32, TagFilter)


Return an ArrayList of Tags

[Visual Basic]
Overloads Public Function BrowsingTagsList( _
ByVal Server As PHDServer, _
ByVal MaxTagCount As UInt32, _
ByVal MatchCriteria As TagFilter _
) As ArrayList
[C#]
public ArrayList BrowsingTagsList(
PHDServer Server,
uint MaxTagCount,
TagFilter MatchCriteria
);

Parameters

Server
PHDServer object
MaxTagCount
Maximum number of tags to be returned
MatchCriteria
Tag filter conditions

Return Value

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Clear Tag Update List

Uniformance PHD .NET Wrapper User Guide • 54


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Overload List

Clear Tag Update List

public void ClearTagUpdateList();


Clear Tag Update List

public void ClearTagUpdateList(PHDServer);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method ()
Clear Tag Update List

[Visual Basic]
Overloads Public Sub ClearTagUpdateList()
[C#]
public void ClearTagUpdateList();

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (PHDServer)


Clear Tag Update List

[Visual Basic]
Overloads Public Sub ClearTagUpdateList( _
ByVal Server As PHDServer _
)
[C#]
public void ClearTagUpdateList(
PHDServer Server
);

Parameters

Server
PHDServer object

Uniformance PHD .NET Wrapper User Guide • 55


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Convert DateTime to its string representation in the formant of "yyyy-MM-dd HH:mm:ss".

Overload List

Convert DateTime to its string representation in the formant of "yyyy-MM-dd HH:mm:ss".

public string ConvertToPHDTime(DateTime);


Using default server to convert the DateTime string (ts) to the format of "yyyy-MM-dd HH:mm:ss".

public string ConvertToPHDTime(string,bool);


Using the server specified to convert the DateTime string (ts) to the format of "yyyy-MM-dd HH:mm:ss".

public string ConvertToPHDTime(PHDServer,string,bool);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (DateTime)


Convert DateTime to its string representation in the formant of "yyyy-MM-dd HH:mm:ss".

[Visual Basic]
Overloads Public Function ConvertToPHDTime( _
ByVal dt As Date _
) As String
[C#]
public string ConvertToPHDTime(
DateTime dt
);

Parameters

dt
DateTime to be converted.

Uniformance PHD .NET Wrapper User Guide • 56


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Return Value

The string representation of dt in the form of "yyyy-MM-dd HH:mm:ss" (format 2). Or zero length string if ts is
invalid.

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (String, Boolean)


Using default server to convert the DateTime string (ts) to the format of "yyyy-MM-dd HH:mm:ss".

[Visual Basic]
Overloads Public Function ConvertToPHDTime( _
ByVal ts As String, _
ByVal bConvertRelative As Boolean _
) As String
[C#]
public string ConvertToPHDTime(
string ts,
bool bConvertRelative
);

Parameters

ts
The DateTime string to be converted. This will be parsed using InvariantCulture, meaning that absolute date
strings will be interpreted as MM/dd/yyyy regardless of the current culture setting.
bConvertRelative
Indicate whether or not the relative time string should be converted.

Return Value

PHD DateTime string in the form of "yyyy-MM-dd HH:mm:ss" (format 2).

Example

Convert a DateTime format to a PHD Datetime format

PHDHistorian oPhd = new PHDHistorian(false);

string sOutDate="";

sOutDate = [Link]("05/17/02 08:30:30", false);

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

Uniformance PHD .NET Wrapper User Guide • 57


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Method (PHDServer, String, Boolean)


Using the server specified to convert the DateTime string (ts) to the format of "yyyy-MM-dd HH:mm:ss".

[Visual Basic]
Overloads Public Function ConvertToPHDTime( _
ByVal Server As PHDServer, _
ByVal ts As String, _
ByVal bConvertRelative As Boolean _
) As String
[C#]
public string ConvertToPHDTime(
PHDServer Server,
string ts,
bool bConvertRelative
);

Parameters

Server
The PHDServer object that specifies the PHD Server
ts
The DateTime string to be converted. This will be parsed using InvariantCulture, meaning that absolute date
strings will be interpreted as MM/dd/yyyy regardless of the current culture setting.
bConvertRelative
Indicate whether or not the relative time string should be converted.

Return Value

PHD DateTime string in the form of "yyyy-MM-dd HH:mm:ss" (format 2).

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Delete Tag Data

Overload List

Delete Tag Data

public void DeleteTagData(Tag,DateTime);


Delete Tag Data

public void DeleteTagData(Tag,string);

See Also

Uniformance PHD .NET Wrapper User Guide • 58


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (Tag, DateTime)


Delete Tag Data

[Visual Basic]
Overloads Public Sub DeleteTagData( _
ByVal tag As Tag, _
ByVal TimeStamp As Date _
)
[C#]
public void DeleteTagData(
Tag tag,
DateTime TimeStamp
);

Parameters

tag
Tag object
TimeStamp
UTC TimeStamp

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (Tag, String)


Delete Tag Data

[Visual Basic]
Overloads Public Sub DeleteTagData( _
ByVal tag As Tag, _
ByVal TimeStamp As String _
)
[C#]
public void DeleteTagData(
Tag tag,
string TimeStamp
);

Parameters

Uniformance PHD .NET Wrapper User Guide • 59


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

tag
The Tag object
TimeStamp
The string timestamp

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Clean up all managed and unmanaged code

Overload List

Clean up all managed and unmanaged code

public void Dispose();


Clean up all managed and unmanaged code

protected virtual void Dispose(bool);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method ()
Clean up all managed and unmanaged code

[Visual Basic]
NotOverridable Overloads Public Sub Dispose() _
Implements [Link]
[C#]
public void Dispose();

Implements

[Link]

See Also

Uniformance PHD .NET Wrapper User Guide • 60


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (Boolean)


Clean up all managed and unmanaged code

[Visual Basic]
Overridable Overloads Protected Sub Dispose( _
ByVal disposing As Boolean _
)
[C#]
protected virtual void Dispose(
bool disposing
);

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Enable/disable tag data change notification callback

Overload List

Enable/disable tag data change notification callback

public void EnableTagDataChangeNotification (bool);


Enable/disable tag data change notification callback

public void EnableTagDataChangeNotification (PHDServer,bool);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (Boolean)


Enable/disable tag data change notification callback

[Visual Basic]
Overloads Public Sub EnableTagDataChangeNotification ( _
ByVal Enable As Boolean _
)

Uniformance PHD .NET Wrapper User Guide • 61


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[C#]
public void EnableTagDataChangeNotification (
bool Enable
);

Parameters

Enable
A boolean flag. Callback will be enabled if it is true; otherwise callback will be disabled.

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (PHDServer, Boolean)


Enable/disable tag data change notification callback

[Visual Basic]
Overloads Public Sub EnableTagDataChangeNotification ( _
ByVal Server As PHDServer, _
ByVal Enable As Boolean _
)
[C#]
public void EnableTagDataChangeNotification (
PHDServer Server,
bool Enable
);

Parameters

Server
PHDServer object
Enable
A boolean flag. Callback will be enabled if it is true; otherwise callback will be disabled.

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload


List

PHD .NET Wrapper

[Link] Method
Enable/disable tag update notification callback

Overload List

Enable/disable tag update notification callback

public void EnableTagUpdateNotification(bool);

Uniformance PHD .NET Wrapper User Guide • 62


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Enable/disable tag update notification callback

public void EnableTagUpdateNotification(PHDServer,bool);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (Boolean)


Enable/disable tag update notification callback

[Visual Basic]
Overloads Public Sub EnableTagUpdateNotification( _
ByVal Enable As Boolean _
)
[C#]
public void EnableTagUpdateNotification(
bool Enable
);

Parameters

Enable
A boolean flag. Callback will be enabled if it is true; otherwise callback will be disabled.

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (PHDServer, Boolean)


Enable/disable tag update notification callback

[Visual Basic]
Overloads Public Sub EnableTagUpdateNotification( _
ByVal Server As PHDServer, _
ByVal Enable As Boolean _
)
[C#]
public void EnableTagUpdateNotification(
PHDServer Server,
bool Enable
);

Parameters

Server
PHDServer object
Enable

Uniformance PHD .NET Wrapper User Guide • 63


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

A boolean flag. Callback will be enabled if it is true; otherwise callback will be disabled.

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Convert from one Engineering Unit to another. example ((UnitIn + PreAdd) * Mult) + PostAdd

Overload List

Convert from one Engineering Unit to another. example ((UnitIn + PreAdd) * Mult) + PostAdd

public void EngUnitConversion(string,string,ref double,ref double,ref double,ref int);


An overloaded EngUnitConversion method

public void EngUnitConversion(PHDServer,string,string,ref double,ref double,ref double,ref int);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (String, String, Double, Double, Double, Int32)


Convert from one Engineering Unit to another. example ((UnitIn + PreAdd) * Mult) + PostAdd

[Visual Basic]
Overloads Public Sub EngUnitConversion( _
ByVal UnitIn As String, _
ByVal UnitOut As String, _
ByRef PreAdd As Double, _
ByRef Mult As Double, _
ByRef PostAdd As Double, _
ByRef pCode As Integer _
)
[C#]
public void EngUnitConversion(
string UnitIn,
string UnitOut,
ref double PreAdd,
ref double Mult,
ref double PostAdd,
ref int pCode
);

Parameters

UnitIn
The Engineering Unit that is to be converted

Uniformance PHD .NET Wrapper User Guide • 64


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

UnitOut
The new Engineering Unit
PreAdd
The value that is added to the UnitIn
Mult
The multiplation factor
PostAdd
The value that is added after the multiplication
pCode

Return Value

Example

string sEUFrom = "DEGC";

string sEUTo = "DEGF";

double dblPreAdd = 0;

double dblMult = 0;

double dblPostAdd = 0;

int iCode = 0;

try

[Link](sEUFrom, sEUTo, ref dblPreAdd, ref dblMult,


ref dblPostAdd, ref iCode);

catch(PHDErrorException ex)

sMsg = "Conversion Error: " + [Link];

[Link] = "( " + sEUFrom + " + (" + [Link]() + ") ) *


(" + [Link]() + ") + (" + [Link]() + ") => " + sEUTo;

Result:

Uniformance PHD .NET Wrapper User Guide • 65


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

( DEGC + (0) ) * (1.79999999856) + (32) => DEGF

See Also

PHDHistorian Class | [Link] Namespace | [Link]


Overload List

PHD .NET Wrapper

[Link] Method (PHDServer, String, String, Double, Double,


Double, Int32)
An overloaded EngUnitConversion method

[Visual Basic]
Overloads Public Sub EngUnitConversion( _
ByVal Server As PHDServer, _
ByVal UnitIn As String, _
ByVal UnitOut As String, _
ByRef PreAdd As Double, _
ByRef Mult As Double, _
ByRef PostAdd As Double, _
ByRef pCode As Integer _
)
[C#]
public void EngUnitConversion(
PHDServer Server,
string UnitIn,
string UnitOut,
ref double PreAdd,
ref double Mult,
ref double PostAdd,
ref int pCode
);

Parameters

Server
The PHDServer object to be used for the conversion
UnitIn
The Engineering Unit that is to be converted
UnitOut
The new Engineering Unit
PreAdd
The value that is added to the UnitIn
Mult
The multiplation factor
PostAdd
The value that is added after the multiplication
pCode

See Also

PHDHistorian Class | [Link] Namespace | [Link]

Uniformance PHD .NET Wrapper User Guide • 66


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Overload List

PHD .NET Wrapper

[Link] Method
Return Reduction Data for a Tagname

Overload List

Return Reduction Data for a Tagname

public DataSet FetchAllReductionData(string,bool);


Return Reduction Data for a Tag or Tags

public DataSet FetchAllReductionData(Tags,bool);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (String, Boolean)


Return Reduction Data for a Tagname

[Visual Basic]
Overloads Public Function FetchAllReductionData( _
ByVal Tagname As String, _
ByVal bOverallReductionOnly As Boolean _
) As DataSet
[C#]
public DataSet FetchAllReductionData(
string Tagname,
bool bOverallReductionOnly
);

Parameters

Tagname
Valid PHD Tag Name
bOverallReductionOnly
Return all reduction data for the collection of Tags

Return Value

Datset containing the Reduction Data

Example

Example 1: Return all Reduction data for a collection of Tags Example 2: Return as specified reduction type for

Uniformance PHD .NET Wrapper User Guide • 67


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

a collection of Tags

Example 1:

DataSet ds = new DataSet();

try

ds=[Link]("kst20000", true);

catch (PHDErrorException ex)

[Link]([Link]);

return;

Example 2:

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (Tags, Boolean)


Return Reduction Data for a Tag or Tags

[Visual Basic]
Overloads Public Function FetchAllReductionData( _
ByVal oTags As Tags, _
ByVal bOverallReductionOnly As Boolean _
) As DataSet
[C#]
public DataSet FetchAllReductionData(
Tags oTags,
bool bOverallReductionOnly
);

Parameters

oTags
Collection of Tag items

Uniformance PHD .NET Wrapper User Guide • 68


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

bOverallReductionOnly
Return all reduction data for the collection of Tags

Return Value

Datset containing the Reduction Data

Example

Example 1: Return all Reduction data for a collection of Tags Example 2: Return as specified reduction type for
a collection of Tags

PHDHistorian PHD = new PHDHistorian();

Tags oTags = new Tags();

[Link](new Tag("kst20000"));

[Link](new Tag("kst20001"));

DataSet ds = new DataSet();

Example 1:

try

ds=[Link](oTags, true);

catch (PHDErrorException ex)

[Link]([Link]);

return;

Tagname HostName AvgTimeStamp AvgValue AvgConf AvgTolerance


DeltaTimeStamp DeltaValue

kst20001 wi-ab07-xx00000 12/15/2003 0:29:54 121.2412 11 0 12/15/2003

Uniformance PHD .NET Wrapper User Guide • 69


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

12:29:54 115.6561355

kst20000 wi-ab07-xx00000 12/15/2003 0:29:54 131.1062 11 0 12/15/2003


12:29:54 187.2834625

Example 2:

[Link]=[Link].ToUInt32("60");

[Link]=(REDUCTIONOFFSET)[Link](typeof(REDUCTIONOFFSET),"After");

try

ds=[Link](oTags, false);

catch (PHDErrorException ex)

[Link]([Link]);

return;

Results:

Tagname HostName AvgTimeStamp AvgValue AvgConf AvgTolerance


DeltaTimeStamp DeltaValue ...

kst20000 wi-ab07-xx00000 12/14/2003 12:36:24 137.8850 0 0 12/14/2003


12:36:54 -0.014007568 ...

kst20000 wi-ab07-xx00000 12/14/2003 12:37:24 137.8710 0 0


12/14/2003 12:37:54 -0.014022827 ...

...

kst20001 wi-ab07-xx00000 12/14/2003 12:36:24 117.8424 0 0


12/14/2003 12:36:54 -8.39233E-05 ...

kst20001 wi-ab07-xx00000 12/14/2003 12:37:24 117.8423 0 0


12/14/2003 12:37:54 -9.15527E-05 ...

...

Uniformance PHD .NET Wrapper User Guide • 70


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Fetch a single tag of Data and Display in a Column Format

Overload List

Fetch a single tag of Data and Display in a Column Format

public DataSet FetchColumnData(string);


Return all tags from the Tags Collection in a Column Format. The Column data format will not display Raw
Sample Types.

public DataSet FetchColumnData(Tags);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (String)


Fetch a single tag of Data and Display in a Column Format

[Visual Basic]
Overloads Public Function FetchColumnData( _
ByVal Tagname As String _
) As DataSet
[C#]
public DataSet FetchColumnData(
string Tagname
);

Parameters

Tagname
Used to supply the Tag that is to be returned

Example

Retrieve and display in a column format a specified tag

PHDHistorian oPhd = new PHDHistorian(false);

[Link]="now-1h;

Uniformance PHD .NET Wrapper User Guide • 71


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[Link]="now";

try

dsGrid=[Link]("kst20000");

catch (PHDErrorException ex)

[Link]([Link]);

return;

Grid Display Results:

timestamp kst20000

12/14/2003 7:14:57 107.3801

12/14/2003 7:19:57 178.6686

12/14/2003 7:24:57 139.201

12/14/2003 7:29:57 142.3064

12/14/2003 7:34:57 182.0065

12/14/2003 7:39:57 107.7729

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (Tags)


Return all tags from the Tags Collection in a Column Format. The Column data format will not display Raw
Sample Types.

[Visual Basic]
Overloads Public Function FetchColumnData( _

Uniformance PHD .NET Wrapper User Guide • 72


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

ByVal oTags As Tags _


) As DataSet
[C#]
public DataSet FetchColumnData(
Tags oTags
);

Parameters

oTags
Used to supply the collection of Tags

Example

Retrieve and display data in a column format for a collection of tags

PHDHistorian oPhd = new PHDHistorian(false);

[Link]="now-1h;

[Link]="now";

Tags _tags = new Tags();

_tags.Add(new Tag("kst20000");

_tags.Add(new Tag("kst20001");

try

dsGrid=[Link](_tags);

catch (PHDErrorException ex)

[Link]([Link]);

return;

Grid Display Results:

timestamp kst20000 kst20001

Uniformance PHD .NET Wrapper User Guide • 73


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

12/14/2003 7:42:23 123.3794 131.9819

12/14/2003 7:47:23 188.7889 147.0151

12/14/2003 7:52:23 105.5942 174.155

12/14/2003 7:57:23 197.3974 114.2238

12/14/2003 8:02:23 107.3537 195.8699

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Fetch a single tag of Data and return results in an Array

[Visual Basic]
Public Sub FetchData( _
ByVal tag As Tag, _
ByRef datetime As Double(), _
ByRef Value As Double(), _
ByRef confidence As Short() _
)
[C#]
public void FetchData(
Tag tag,
ref double[] datetime,
ref double[] Value,
ref short[] confidence
);

Parameters

tag
Used to supply the Tag that is to be returned

datetime
return array of datetime values

Value
return array of values

confidence
return array of confidence values

Example

PHDHistorian oPhd = new PHDHistorian();

Uniformance PHD .NET Wrapper User Guide • 74


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHDServer defaultServer = new PHDServer("HostName");

[Link] = SERVERVERSION.API200;

[Link] = defaultServer;

[Link]="now-1h;

[Link]="now";

[Link] = [Link];

double[] Value = null;

double[] timeStamp = null;

short[] conf = null;

try

[Link](new Tag("kst20000"), ref timeStamp, ref Value, ref conf);

catch

[Link]([Link]);

return;

..

[Link]();

Results:

timeStamp[0]=37969.338021446762 Value[0]=101.846 conf[0]=100

timeStamp[1]=37969.341493668981 Value[1]=198.474 conf[1]=100

timeStamp[2]=37969.344965891207 Value[2]=109.622 conf[2]=100

Uniformance PHD .NET Wrapper User Guide • 75


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method
Fetch data for a single tag and return results in a single PHDataList structure. Optionally include “Outliers” of
the data set if there is not a value specifically on the specified start time / end time. The result set will include
an array indicating which values do not meet the specified “MinimumConfidence” threshold.

Overload List

Fetch a single tag of Data and return results in a single PHDataList structure. Operates as if calling this
function with includeOutliers = true, minimumConfidence=-1

PHDataList [Link](Tag tag)

Fetch a single tag of Data and return results in a single PHDataList structure. Specify whether outliers should
be returned, and the minimum confidence threshold

PHDataList [Link](Tag tag, bool includeOutliers, short minimumConfidence)

[Link](Tag tag)
Fetch a single tag of Data and return results in a single PHDataList structure. Operates as if calling this
function with includeOutliers=true, minimumConfidence=-1

[Visual Basic]
Public Sub FetchDataList ( _
ByVal tag As Tag,
) As PHDataList

[C#]
public PHDataList FetchDataList (
Tag tag
);

Parameters

Operates as if calling this function with includeOutliers = true, minimumConfidence=-1

tag
Used to supply the Tag that is to be returned

[Link](Tag tag , bool includeOutliers, short minimumConfidence)


Fetch a single tag of Data and return results in a single PHDataList structure. Specify whether outliers should
be returned, and the minimum confidence threshold

[Visual Basic]
Public Sub FetchDataList ( _

Uniformance PHD .NET Wrapper User Guide • 76


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

ByVal tag As Tag,


ByVal includeOutliers As Boolean,
ByVal minimumConfidence As Short
) As PHDataList

[C#]
public PHDataList FetchDataList (
Tag tag ,
bool includeOutliers,
short minimumConfidence
);

Parameters

tag
Used to supply the Tag that is to be returned

includeOutliers
Include the most recent value preceding the start time, and the closest value following the end time, if there
are not values actually on these specified times

minimumConfidence
Threshold of allowed confidence. Any value in the result set that has confidence lower than this threshold will
be included in an array FilterConfIndices in the result structure.

Example

PHDHistorian oPhd = new PHDHistorian();

PHDServer defaultServer = new PHDServer("HostName");

[Link] = SERVERVERSION.API200;

[Link] = defaultServer;

[Link]="now-1h;

[Link]="now";

[Link] = [Link];

try

PHDataList dataList = oPhd. FetchDataList(new Tag("kst20000"));

catch

Uniformance PHD .NET Wrapper User Guide • 77


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[Link]([Link]);

return;

..

[Link]();

Results:

[Link][0]=37969.338021446762 [Link][0]=101.846
[Link][0]=100

[Link][1]=37969.341493668981 [Link][1]=198.474
[Link][1]=100

[Link][2]=37969.344965891207 [Link][2]=109.622
[Link][2]=100

[Link]=37969.338021446762

[Link]=37969.344965891207

[Link]=101.846

[Link]=109.622

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method
Fetch data for a single tag and return results in a single PHDataListNullable structure. Optionally include
“Outliers” of the data set if there is not a value specifically on the specified start time / end time. Any values
that have confidence less than the specified “MinimumConfidence” will be set to a value of “null” rather than
returning a numeric value.

Overload List

Fetch a single tag of Data and return results in a single PHDataListNullable structure. Operates as if calling
this function with includeOutliers = true, minimumConfidence=-1

PHDataListNullable [Link](Tag tag)

Fetch a single tag of Data and return results in a single PHDataListNullable structure. Specify whether outliers
should be returned, and the minimum confidence threshold

PHDataListNullable [Link](Tag tag, bool includeOutliers, short


minimumConfidence)

Uniformance PHD .NET Wrapper User Guide • 78


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[Link](Tag tag)
Fetch a single tag of Data and return results in a single PHDataListNullable structure. Operates as if calling
this function with includeOutliers=true, minimumConfidence=-1

[Visual Basic]
Public Sub FetchDataListNullable( _
ByVal tag As Tag,
) As PHDataListNullable

[C#]
public PHDataListNullable FetchDataListNullable(
Tag tag
);

Parameters

Operates as if calling this function with includeOutliers = true, minimumConfidence=-1

tag
Used to supply the Tag that is to be returned

[Link](Tag tag , bool includeOutliers, short


minimumConfidence)
Fetch a single tag of Data and return results in a single PHDataListNullable structure. Specify whether outliers
should be returned, and the minimum confidence threshold

[Visual Basic]
Public Sub FetchDataListNullable( _
ByVal tag As Tag,
ByVal includeOutliers As Boolean,
ByVal minimumConfidence As Short
) As PHDataListNullable

[C#]
public PHDataListNullable FetchDataListNullable(
Tag tag ,
bool includeOutliers,
short minimumConfidence
);

Parameters

tag
Used to supply the Tag that is to be returned

includeOutliers
Include the most recent value preceding the start time, and the closest value following the end time, if there
are not values actually on these specified times

minimumConfidence
Threshold of allowed confidence. Any value in the result set that has confidence lower than this threshold will
be returned as null

Uniformance PHD .NET Wrapper User Guide • 79


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Example

PHDHistorian oPhd = new PHDHistorian();

PHDServer defaultServer = new PHDServer("HostName");

[Link] = SERVERVERSION.API200;

[Link] = defaultServer;

[Link]="now-1h;

[Link]="now";

[Link] = [Link];

try

PHDataListNullable dataList = oPhd. FetchDataListNullable(new


Tag("kst20000"));

catch

[Link]([Link]);

return;

..

[Link]();

Results:

[Link][0]=37969.338021446762 [Link][0]=101.846
[Link][0]=100

[Link][1]=37969.341493668981 [Link][1]=198.474
[Link][1]=100

[Link][2]=37969.344965891207 [Link][2]=109.622
[Link][2]=100

Uniformance PHD .NET Wrapper User Guide • 80


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[Link]=37969.338021446762

[Link]=37969.344965891207

[Link]=101.846

[Link]=109.622

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method
Fetch BestFit data for a single tag and return results in a single PHDataListNullable structure. Any values that
have less than the specified “MinimumConfidence” will be set to a value of “null” rather than returning a
numeric value.

Using this method to retrieve BestFit data will override any specified [Link].

Understanding the BestFit algorithm

The BestFit algorithm is designed to return a reduced data set that shows the overall representative shape of
the raw data, typically to be used in trending the data. On a screen with (for example) 2000 horizontal pixels,
it isn’t possible to accurately plot 100,000 data values, so instead BestFit can be used. It is the most efficient
way to fetch data over a longer period of time.

The default maximum number of values returned is 2000.

BestFit works by breaking up the query duration into smaller intervals, and then selecting specific points to
characterise those intervals. In each interval, the first, last, minimum and maximum data point will be
selected. If MinimumConfidence is specified, the First and Last values may be null if they do not meet the
confidence threshold.

The resulting data set will be filtered for duplicates, ordered by timestamp, then returned as a
PHDataListNullable structure.

Calculating the ReductionFrequency from Maximum Values

The reduction frequency is calculated knowing that there will be up to 4 data points selected for each sub-
interval. Thus, the Number of Intervals needed is (Maximum Values / 4), and the reduction frequency is
calculated as (Query Duration / Number of Intervals).

If a ReductionFrequency larger than this calculated value is manually specified, it will be used instead of this
value.

Overload List

Fetch a single tag of Data and return BestFit results in a single PHDataListNullable structure. Operates as if
calling this function with maximumValues=2000, includeOutliers = true, minimumConfidence=-1

PHDataListNullable [Link](Tag tag)

Fetch a single tag of Data and return results in a single PHDataListNullable structure. Specify the maximum
values, whether to include outliers, and the minimum confidence threshold.

Uniformance PHD .NET Wrapper User Guide • 81


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHDataListNullable [Link](Tag tag, uint maximumValues, bool


includeOutliers, short minimumConfidence)

[Link](Tag tag)
Fetch a single tag of Data and return results in a single PHDataListNullable structure. Operates as if calling
this function with maximumValues=2000, includeOutliers = true, minimumConfidence=-1

[Visual Basic]
Public Sub FetchBestFitDataListNullable( _
ByVal tag As Tag,
) As PHDataListNullable

[C#]
public PHDataListNullable FetchBestFitDataListNullable(
Tag tag
);

Parameters

Operates as if calling this function with maximumValues=2000, includeOutliers = true, minimumConfidence=-


1

tag
Used to supply the Tag that is to be returned

[Link](Tag tag, uint maximumValues, bool


includeOutliers, short minimumConfidence)
Fetch a single tag of Data and return results in a single PHDataListNullable structure. Specify the maximum
values, whether to include outliers, and the minimum confidence threshold.

[Visual Basic]
Public Sub FetchBestFitDataListNullable( _
ByVal tag As Tag,
ByVal maximumValues As UInt32,
ByVal includeOutliers As Boolean,
ByVal minimumConfidence As Short
) As PHDataListNullable

[C#]
public PHDataListNullable FetchBestFitDataListNullable(
Tag tag ,
uint maximumValues,
bool includeOutliers,
short minimumConfidence
);

Parameters

tag
Used to supply the Tag that is to be returned

maximumValues
Set the maximum number of values that are desired in the result set

includeOutliers

Uniformance PHD .NET Wrapper User Guide • 82


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Include the most recent value preceding the start time, and the closest value following the end time, if there
are not values actually on these specified times

minimumConfidence
Threshold of allowed confidence. Any value in the result set that has confidence lower than this threshold will
be returned as null

Example

PHDHistorian oPhd = new PHDHistorian();

PHDServer defaultServer = new PHDServer("HostName");

[Link] = SERVERVERSION.API200;

[Link] = defaultServer;

[Link] = "now-90d”;

[Link] = "now";

try

PHDataListNullable dataList = oPhd. FetchBestFitDataListNullable (new


Tag("kst20000"), 2000, true, -1);

catch

[Link]([Link]);

return;

..

[Link]();

Results:

(Something similar to the following)

Uniformance PHD .NET Wrapper User Guide • 83


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[Link][0]=37969.338021446762 [Link][0]=101.846
[Link][0]=100

[Link][1]=37969.341493668981 [Link][1]=198.474
[Link][1]=100

[Link][2]=37969.344965891207 [Link][2]=109.622
[Link][2]=100

[Link]=37969.338021446762

[Link]=37969.344965891207

[Link]=101.846

[Link]=109.622

See Also

PHDHistorian Class | [Link] Namespace

Uniformance PHD .NET Wrapper User Guide • 84


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Method
Fetch a single tag of Data and return the data in a DataSet

Overload List

Fetch a single tag of Data and return the data in a DataSet

public DataSet FetchRowData(string);


Return all tags from the Tags Collection

public DataSet FetchRowData(Tags);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (String)


Fetch a single tag of Data and return the data in a DataSet

[Visual Basic]
Overloads Public Function FetchRowData( _
ByVal Tagname As String _
) As DataSet
[C#]
public DataSet FetchRowData(
string Tagname
);

Parameters

Tagname
Tag that is to be returned

Example

Retrieve and display in a row format time series data for tag kst20000

PHDHistorian oPhd = new PHDHistorian();

PHDServer defaultServer = new PHDServer("wi-ab07-xx00000");

[Link] = SERVERVERSION.API200;

[Link] = defaultServer;

[Link]="now-15m;

[Link]="now";

Uniformance PHD .NET Wrapper User Guide • 85


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[Link] = [Link];

[Link] = 300;

try

dsGrid = [Link]("kst20000");

catch (PHDErrorException ex)

[Link]([Link]);

return;

Grid Display Results:

Tag timestamp Value Conf HostName

kst20000 12/15/2003 7:43:41 121.8072 100 wi-ab07-xx00000

kst20000 12/15/2003 7:48:41 121.7371 100 wi-ab07-xx00000

kst20000 12/15/2003 7:53:41 121.667 100 wi-ab07-xx00000

kst20000 12/15/2003 7:58:41 121.597 100 wi-ab07-xx00000

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (Tags)


Return all tags from the Tags Collection

[Visual Basic]
Overloads Public Function FetchRowData( _
ByVal oTags As Tags _

Uniformance PHD .NET Wrapper User Guide • 86


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

) As DataSet
[C#]
public DataSet FetchRowData(
Tags oTags
);

Parameters

oTags
Used to supply the collection of Tags

Example

Retrieve and display in a row format time series data for collection of Tags

PHDHistorian oPhd = new PHDHistorian();

PHDServer defaultServer = new PHDServer("wi-ab07-xx00000");

[Link] = SERVERVERSION.API200;

[Link] = defaultServer;

[Link]="now-15m;

[Link]="now";

[Link] = [Link];

[Link] = 300;

[Link]="now-1h;

[Link]="now";

Tags _tags = new Tags();

_tags.Add(new Tag("kst20000");

_tags.Add(new Tag("kst20001");

try

dsGrid=[Link](_tags);

catch (PHDErrorException ex)

Uniformance PHD .NET Wrapper User Guide • 87


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[Link]([Link]);

return;

...

Grid Display Results:

Tag timestamp Value Conf HostName

kst20000 12/15/2003 7:43:41 121.8072 100 wi-ab07-xx00000

kst20000 12/15/2003 7:48:41 121.7371 100 wi-ab07-xx00000

kst20000 12/15/2003 7:53:41 121.667 100 wi-ab07-xx00000

kst20000 12/15/2003 7:58:41 121.597 100 wi-ab07-xx00000

kst20001 12/15/2003 7:43:41 111.8272 100 wi-ab07-xx00000

kst20001 12/15/2003 7:48:41 110.7371 100 wi-ab07-xx00000

kst20001 12/15/2003 7:53:41 104.667 100 wi-ab07-xx00000

kst20001 12/15/2003 7:58:41 100.597 100 wi-ab07-xx00000

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Return all tags from the Tags Collection

[Visual Basic]
Public Function FetchStructData( _
ByVal oTags As Tags _
) As ArrayList
[C#]
public ArrayList FetchStructData(
Tags oTags
);

Parameters

oTags
Used to supply the collection of Tags

Uniformance PHD .NET Wrapper User Guide • 88


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (Tags, Boolean, REDUCTIONTYPE[])


Return Reduction Data for a Tag or Tags

[Visual Basic]
Public Function FetchReductionsSpecified (
ByVal oTags As Tags,
ByVal bOverallReductionOnly As Boolean,
ByVal Reductions as REDUCTIONTYPE( )
) As DataSet

[C#]
public DataSet FetchReductionsSpecified (
TagsoTags,
bool bOverallReductionOnly,
REDUCTIONTYPE[] Reductions
);

Parameters

oTags
Collection of Tag items
bOverallReductionOnly
Return all reduction data for the collection of Tags
Reductions
Array of reductions to retrieve

Return Value

Datset containing the Reduction Data

Example

Example 1: Return the First, Last, Minimum, and Maximum Reduction data for a collection of Tags

PHDHistorian PHD = new PHDHistorian();

Tags oTags = new Tags();

[Link](new Tag("kst20000"));

[Link](new Tag("kst20001"));

REDUCTIONTYPE[] reductions = new [] { [Link], [Link],


[Link], [Link] };

DataSet ds = new DataSet();

Uniformance PHD .NET Wrapper User Guide • 89


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Example 1:

try

ds=[Link](oTags, true, reductions);

catch (PHDErrorException ex)

[Link]([Link]);

return;

Tagname HostName FirstTimeStamp FirstValue FirstConf FirstTolerance LastTimeStamp LastValue

kst20001 wi-ab07-xx00000 10/15/2020 0:29:54 121.2412 11 0 10/15/2020


12:29:54 115.6561355

kst20000 wi-ab07-xx00000 10/15/2020 0:29:54 131.1062 11 0 15/15/2020


12:29:54 187.2834625

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
destructor to clean up all managed and unmanaged code

[Visual Basic]
Overrides Protected Sub Finalize()
[C#]
protected override void Finalize();

See Also

Uniformance PHD .NET Wrapper User Guide • 90


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method
Get Database Information from default PHD server

Overload List

Get Database Information from default PHD server

public void GetDBInfo(ref string,ref string,ref int);


Get Database Information from the PHD server specified

public void GetDBInfo(PHDServer,ref string,ref string,ref int);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (String, String, Int32)


Get Database Information from default PHD server

[Visual Basic]
Overloads Public Sub GetDBInfo( _
ByRef DBMProvider As String, _
ByRef DBMDataSource As String, _
ByRef UsingINTS As Integer _
)
[C#]
public void GetDBInfo(
ref string DBMProvider,
ref string DBMDataSource,
ref int UsingINTS
);

Parameters

DBMProvider
DBMProvider
DBMDataSource
DBMDataSource
UsingINTS
UsingINTS

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

Uniformance PHD .NET Wrapper User Guide • 91


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Method (PHDServer, String, String, Int32)


Get Database Information from the PHD server specified

[Visual Basic]
Overloads Public Sub GetDBInfo( _
ByVal Server As PHDServer, _
ByRef DBMProvider As String, _
ByRef DBMDataSource As String, _
ByRef UsingINTS As Integer _
)
[C#]
public void GetDBInfo(
PHDServer Server,
ref string DBMProvider,
ref string DBMDataSource,
ref int UsingINTS
);

Parameters

Server
PHDServer object
DBMProvider
DBMProvider
DBMDataSource
DBMDataSource
UsingINTS
UsingINTS

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Returns link list from the default server

Overload List

Returns link list from the default server

public ArrayList GetLinkList();


Returns link list from the server specified

public ArrayList GetLinkList(PHDServer);

See Also

PHDHistorian Class | [Link] Namespace

Uniformance PHD .NET Wrapper User Guide • 92


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Method ()
Returns link list from the default server

[Visual Basic]
Overloads Public Function GetLinkList() As ArrayList
[C#]
public ArrayList GetLinkList();

Return Value

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (PHDServer)


Returns link list from the server specified

[Visual Basic]
Overloads Public Function GetLinkList( _
ByVal Server As PHDServer _
) As ArrayList
[C#]
public ArrayList GetLinkList(
PHDServer Server
);

Parameters

Server

Return Value

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Returns link list from the default server

Overload List

Returns link list from the default server

Uniformance PHD .NET Wrapper User Guide • 93


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

public DataSet GetLinks();


Returns link list from the server specified

public DataSet GetLinks(PHDServer);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method ()
Returns link list from the default server

[Visual Basic]
Overloads Public Function GetLinks() As DataSet
[C#]
public DataSet GetLinks();

Return Value

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (PHDServer)


Returns link list from the server specified

[Visual Basic]
Overloads Public Function GetLinks( _
ByVal Server As PHDServer _
) As DataSet
[C#]
public DataSet GetLinks(
PHDServer Server
);

Parameters

Server

Return Value

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

Uniformance PHD .NET Wrapper User Guide • 94


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Method
Returns Parent Tag list from the default server

Overload List

Returns Parent Tag list from the default server

public ArrayList GetParentTagList();


Returns Parent Tag list from the server specified

public ArrayList GetParentTagList(PHDServer);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method ()
Returns Parent Tag list from the default server

[Visual Basic]
Overloads Public Function GetParentTagList() As ArrayList
[C#]
public ArrayList GetParentTagList();

Return Value

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (PHDServer)


Returns Parent Tag list from the server specified

[Visual Basic]
Overloads Public Function GetParentTagList( _
ByVal Server As PHDServer _
) As ArrayList
[C#]
public ArrayList GetParentTagList(
PHDServer Server
);

Parameters

Server

Return Value

See Also

Uniformance PHD .NET Wrapper User Guide • 95


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Returns Parent Tag list from the default server

Overload List

Returns Parent Tag list from the default server

public DataSet GetParentTags();


Returns Parent Tag list from the server specified

public DataSet GetParentTags(PHDServer);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method ()
Returns Parent Tag list from the default server

[Visual Basic]
Overloads Public Function GetParentTags() As DataSet
[C#]
public DataSet GetParentTags();

Return Value

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (PHDServer)


Returns Parent Tag list from the server specified

[Visual Basic]
Overloads Public Function GetParentTags( _
ByVal Server As PHDServer _
) As DataSet
[C#]

Uniformance PHD .NET Wrapper User Guide • 96


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

public DataSet GetParentTags(


PHDServer Server
);

Parameters

Server

Return Value

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
A 200 API function that will return the RDI info

Overload List

A 200 API function that will return the RDI info

public DataSet GetRDIInfo(string);


A overloaded GetRDIInfo methods

public DataSet GetRDIInfo(string,PHDServer);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (String)


A 200 API function that will return the RDI info

[Visual Basic]
Overloads Public Function GetRDIInfo( _
ByVal RDIName As String _
) As DataSet
[C#]
public DataSet GetRDIInfo(
string RDIName
);

Parameters

RDIName
The RDI Name to return Information for

Return Value

Uniformance PHD .NET Wrapper User Guide • 97


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

DataSet with the RDI Info

Exceptions

Exception Type Condition

Exception Invalid RDI was requested

Example

Return a dataset of RDI information for the specified RDI. This example assumes that there is a datagrid on the
form named dgData

DataSet ds = new DataSet();

try

ds=[Link]([Link]);

[Link](ds,"TEST");

catch (PHDErrorException ex)

[Link]([Link]);

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (String, PHDServer)


A overloaded GetRDIInfo methods

[Visual Basic]
Overloads Public Function GetRDIInfo( _
ByVal RDIName As String, _
ByVal Server As PHDServer _
) As DataSet
[C#]
public DataSet GetRDIInfo(
string RDIName,
PHDServer Server
);

Parameters

RDIName
RDI Name

Uniformance PHD .NET Wrapper User Guide • 98


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Server
The PHDServer object

Return Value

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Returns RDI list from the default server

Overload List

Returns RDI list from the default server

public ArrayList GetRDIList();


Returns RDI list from the server specified

public ArrayList GetRDIList(PHDServer);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method ()
Returns RDI list from the default server

[Visual Basic]
Overloads Public Function GetRDIList() As ArrayList
[C#]
public ArrayList GetRDIList();

Return Value

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

Uniformance PHD .NET Wrapper User Guide • 99


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Method (PHDServer)


Returns RDI list from the server specified

[Visual Basic]
Overloads Public Function GetRDIList( _
ByVal Server As PHDServer _
) As ArrayList
[C#]
public ArrayList GetRDIList(
PHDServer Server
);

Parameters

Server
PHDServer object

Return Value

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Returns RDI list from the default server

Overload List

Returns RDI list from the default server

public DataSet GetRDIs();


Returns RDI list from the server specified

public DataSet GetRDIs(PHDServer);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method ()
Returns RDI list from the default server

[Visual Basic]
Overloads Public Function GetRDIs() As DataSet

Uniformance PHD .NET Wrapper User Guide • 100


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[C#]
public DataSet GetRDIs();

Return Value

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (PHDServer)


Returns RDI list from the server specified

[Visual Basic]
Overloads Public Function GetRDIs( _
ByVal Server As PHDServer _
) As DataSet
[C#]
public DataSet GetRDIs(
PHDServer Server
);

Parameters

Server

Return Value

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Modify Tag Data

Overload List

Modify Tag Data

public void ModifyTag(Tag,object);


Modify Tag Data

public void ModifyTag(Tag,object,DateTime,sbyte,string);


Modify Tag Data

public void ModifyTag(Tag,object,string);


Modify Tag Data

public void ModifyTag(Tag,object,string,sbyte);


Modify Tag Data

Uniformance PHD .NET Wrapper User Guide • 101


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

public void ModifyTag(Tag,object,string,sbyte,string);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (Tag, Object)


Modify Tag Data

[Visual Basic]
Overloads Public Sub ModifyTag( _
ByVal tag As Tag, _
ByVal Value As Object _
)
[C#]
public void ModifyTag(
Tag tag,
object Value
);

Parameters

tag
The Tag object
Value
The value to be inserted

Example

Tag oTag = new Tag();

[Link]="KST20000";

float _value = 123.35;

int istat=[Link](oTag, _value);

if(istat!=0)

[Link]=istat;

[Link]([Link]);

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

Uniformance PHD .NET Wrapper User Guide • 102


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Method (Tag, Object, DateTime, SByte, String)


Modify Tag Data

[Visual Basic]
Overloads Public Sub ModifyTag( _
ByVal tag As Tag, _
ByVal Value As Object, _
ByVal TimeStamp As Date, _
ByVal Confidence As SByte, _
ByVal Units As String _
)
[C#]
public void ModifyTag(
Tag tag,
object Value,
DateTime TimeStamp,
sbyte Confidence,
string Units
);

Parameters

tag
The Tag object
Value
The Value to be inserted
TimeStamp
The UTC timestamp
Confidence
The Confidence
Units
The Engineering Units

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (Tag, Object, String)


Modify Tag Data

[Visual Basic]
Overloads Public Sub ModifyTag( _
ByVal tag As Tag, _
ByVal Value As Object, _
ByVal TimeStamp As String _
)

Uniformance PHD .NET Wrapper User Guide • 103


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[C#]
public void ModifyTag(
Tag tag,
object Value,
string TimeStamp
);

Parameters

tag
The Tag object
Value
The Value of type float, to be inserted
TimeStamp
The timestamp

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (Tag, Object, String, SByte)


Modify Tag Data

[Visual Basic]
Overloads Public Sub ModifyTag( _
ByVal tag As Tag, _
ByVal Value As Object, _
ByVal TimeStamp As String, _
ByVal Confidence As SByte _
)
[C#]
public void ModifyTag(
Tag tag,
object Value,
string TimeStamp,
sbyte Confidence
);

Parameters

tag
The Tag object
Value
The value to be inserted
TimeStamp
The timestamp
Confidence
The Confidence

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

Uniformance PHD .NET Wrapper User Guide • 104


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Method (Tag, Object, String, SByte, String)


Modify Tag Data

[Visual Basic]
Overloads Public Sub ModifyTag( _
ByVal tag As Tag, _
ByVal Value As Object, _
ByVal TimeStamp As String, _
ByVal Confidence As SByte, _
ByVal Units As String _
)
[C#]
public void ModifyTag(
Tag tag,
object Value,
string TimeStamp,
sbyte Confidence,
string Units
);

Parameters

tag
The Tag object
Value
The value to be inserted
TimeStamp
The timestamp
Confidence
The Confidence
Units
The Engineering Units

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Insert Tag Data into a DCS for a timestamp of Now

Overload List

Insert Tag Data into a DCS for a timestamp of Now

public void PutData(Tag,object);


Insert Tag Data into a DCS for a specified timestamp and Confidence

Uniformance PHD .NET Wrapper User Guide • 105


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

public void PutData(Tag,object,DateTime,sbyte,string);


Insert Tag Data into a DCS for a specified timestamp

public void PutData(Tag,object,string);


Insert Tag Data into a DCS for a specified timestamp

public void PutData(Tag,object,string,sbyte);


Insert Tag Data into a DCS for a specified timestamp and Confidence

public void PutData(Tag,object,string,sbyte,string);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (Tag, Object)


Insert Tag Data into a DCS for a timestamp of Now

[Visual Basic]
Overloads Public Sub PutData( _
ByVal tag As Tag, _
ByVal Value As Object _
)
[C#]
public void PutData(
Tag tag,
object Value
);

Parameters

tag
Tag object
Value
The value to be inserted

Example

Insert a value into a DCS for tag KST20000. The record will default to a timestamp of Now and Confidence of
100.

Tag oTag = new Tag();

[Link]="KST20000";

float floatValue = 123.45

try

[Link](oTag, floatValue);

Uniformance PHD .NET Wrapper User Guide • 106


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

catch(PHDErrorException ex)

[Link]([Link]);

return;

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (Tag, Object, DateTime, SByte, String)


Insert Tag Data into a DCS for a specified timestamp and Confidence

[Visual Basic]
Overloads Public Sub PutData( _
ByVal tag As Tag, _
ByVal Value As Object, _
ByVal TimeStamp As Date, _
ByVal Confidence As SByte, _
ByVal Units As String _
)
[C#]
public void PutData(
Tag tag,
object Value,
DateTime TimeStamp,
sbyte Confidence,
string Units
);

Parameters

tag
Tag object
Value
The Value to be inserted
TimeStamp
The UTC timestamp
Confidence
The Confidence
Units
The Engineering Units

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

Uniformance PHD .NET Wrapper User Guide • 107


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[Link] Method (Tag, Object, String)


Insert Tag Data into a DCS for a specified timestamp

[Visual Basic]
Overloads Public Sub PutData( _
ByVal tag As Tag, _
ByVal Value As Object, _
ByVal TimeStamp As String _
)
[C#]
public void PutData(
Tag tag,
object Value,
string TimeStamp
);

Parameters

tag
Tag object
Value
The value to be inserted
TimeStamp
The timestamp

Example

Insert a value into a DCS for tag KST20000. The record will have a timestamp of Now and Confidence of
100.

Tag oTag = new Tag();

[Link]="KST20000";

float _value = 123.456;

try

[Link](oTag, _value, "Now"));

catch(PHDErrorException ex)

[Link]([Link]);

return;

See Also

Uniformance PHD .NET Wrapper User Guide • 108


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (Tag, Object, String, SByte)


Insert Tag Data into a DCS for a specified timestamp

[Visual Basic]
Overloads Public Sub PutData( _
ByVal tag As Tag, _
ByVal Value As Object, _
ByVal TimeStamp As String, _
ByVal Confidence As SByte _
)
[C#]
public void PutData(
Tag tag,
object Value,
string TimeStamp,
sbyte Confidence
);

Parameters

tag
Tag object
Value
The value to be inserted
TimeStamp
The timestamp
Confidence
The Confidence

Example

Insert a value into PHD for tag KST20000.

Tag oTag = new Tag();

[Link]="KST20000";

float _value = 123.23;

sbyte _conf = 100;

try

[Link](oTag, _value, "Now",_conf));

catch(PHDErrorException ex)

Uniformance PHD .NET Wrapper User Guide • 109


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[Link]([Link]);

return;

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (Tag, Object, String, SByte, String)


Insert Tag Data into a DCS for a specified timestamp and Confidence

[Visual Basic]
Overloads Public Sub PutData( _
ByVal tag As Tag, _
ByVal Value As Object, _
ByVal TimeStamp As String, _
ByVal Confidence As SByte, _
ByVal Units As String _
)
[C#]
public void PutData(
Tag tag,
object Value,
string TimeStamp,
sbyte Confidence,
string Units
);

Parameters

tag
Tag object
Value
The Value to be inserted
TimeStamp
The string timestamp
Confidence
The Confidence
Units
The Engineering Units

Example

Insert a value into PHD for tag KST20000.

Tag oTag = new Tag();

[Link]="KST20000";

Uniformance PHD .NET Wrapper User Guide • 110


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

float _value = 123.35;

byte _conf = 100;

string _engUnit = "DEGC";

try

[Link](oTag, _value, "Now",_conf,_engUnit));

catch(PHDErrorException ex)

[Link]([Link]);

return;

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method

Overload List

PutList

Public void PutList(Tag[] TagList, ref DataSet ds, out int failed, out int pending);

PutList

Public void PutList(PHDServer Server, Tag[] TagList, ref DataSet ds, out int failed, out int pending);

PHD .NET Wrapper

[Link] Method (Tag[] TagList, ref DataSet ds, out int failed, out int
pending)
[Visual Basic]
Overloads Public Sub PutList( _
ByVal tags As Tag(), _
ByRef ds As DataSet, _
ByRef failed As Integer, _
ByRef pending As Integer_

)
[C#]

Uniformance PHD .NET Wrapper User Guide • 111


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

public void PutList(


Tag []tags,
ref DataSet ds,
out int failed,
out int pending

);

Parameters

• tags: array of manual tag object

• ds: reference of dataset that contains table schema of the PutListDataTable

• failed: number of put operations that failed

• pending: number of put operation status that are unknown

PHD .NET Wrapper

[Link] Method (PHDServer Server, Tag[] TagList, ref DataSet ds, out int
failed, out int pending)
[Visual Basic]
Overloads Public Sub PutList( _
ByVal Server As PHDServer, _
ByVal tags As Tag(), _
ByRef ds As DataSet, _
ByRef failed As Integer, _
ByRef pending As Integer_
)
[C#]
public void PutList(
PHDServer Server,
Tag []tags,
ref DataSet ds,
out int failed,
out int pending

);

Parameters

• Server: the PHD server name

• tags: array of manual tag object.

• ds: reference of dataset that contains table schema of the PutListDataTable

• failed: number of put operations that failed

• pending: number of put operation status that are unknown

PHD .NET Wrapper

[Link] Method
Convert a PHD relative time to the absolute UTC date and time on the client. An exception will be thrown for a
incorrect relative input.

Uniformance PHD .NET Wrapper User Guide • 112


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Overload List

Convert a PHD relative time to the absolute UTC date and time on the client. An exception will be thrown for a
incorrect relative input.

public void RelativeToAbsolute(string,ref DateTime);


Convert a PHD relative time to the absolute UTC date and time. An exception will be thrown for a incorrect
relative input.

public void RelativeToAbsolute(string,ref DateTime,bool);


Convert a PHD relative time to the absolute UTC date and time on the PHD server specified. An exception will
be thrown for a incorrect relative input.

public void RelativeToAbsolute(string,ref DateTime,PHDServer);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (String, DateTime)


Convert a PHD relative time to the absolute UTC date and time on the client. An exception will be thrown for a
incorrect relative input.

[Visual Basic]
Overloads Public Sub RelativeToAbsolute( _
ByVal RelativeDate As String, _
ByRef AbsoluteDateTimeUTC As Date _
)
[C#]
public void RelativeToAbsolute(
string RelativeDate,
ref DateTime AbsoluteDateTimeUTC
);

Parameters

RelativeDate
The relative value (eq Now, Now-1D etc)
AbsoluteDateTimeUTC
The Absolute Value Returned

Example

Convert Relative dates to Absolute values on the client

PHDHistorian oPhd = new PHDHistorian(false);

...

DateTime dtAbsolute = new DateTime();

[Link]([Link],ref dtAbsolute)

...

Uniformance PHD .NET Wrapper User Guide • 113


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (String, DateTime, Boolean)


Convert a PHD relative time to the absolute UTC date and time. An exception will be thrown for a incorrect
relative input.

[Visual Basic]
Overloads Public Sub RelativeToAbsolute( _
ByVal RelativeDate As String, _
ByRef AbsoluteDateTimeUTC As Date, _
ByVal UsingServerTime As Boolean _
)
[C#]
public void RelativeToAbsolute(
string RelativeDate,
ref DateTime AbsoluteDateTimeUTC,
bool UsingServerTime
);

Parameters

RelativeDate
The relative value (eq Now, Now-1D etc)
AbsoluteDateTimeUTC
The Absolute Value Returned
UsingServerTime
A flag indicating whether or not the absolute time should be gotten from server or client.

Example

Convert Relative dates to Absolute values on the default PHD server.

PHDHistorian oPhd = new PHDHistorian(false);

......

DateTime dtAbsolute = new DateTime();

[Link]([Link], ref dtAbsolute, true);

...

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (String, DateTime, PHDServer)


Convert a PHD relative time to the absolute UTC date and time on the PHD server specified. An exception will

Uniformance PHD .NET Wrapper User Guide • 114


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

be thrown for a incorrect relative input.

[Visual Basic]
Overloads Public Sub RelativeToAbsolute( _
ByVal RelativeDate As String, _
ByRef AbsoluteDateTimeUTC As Date, _
ByVal Server As PHDServer _
)
[C#]
public void RelativeToAbsolute(
string RelativeDate,
ref DateTime AbsoluteDateTimeUTC,
PHDServer Server
);

Parameters

RelativeDate
The relative value (eq Now, Now-1D etc)
AbsoluteDateTimeUTC
The Absolute Value Returned
Server
The PHDServer object that specifies the PHD Server

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Convert a PHD string/relative time to universal DateTime. The conversion will be performed on the default PHD
server if the string starts with "NOW"; otherwise the conversion will be performed on the local machine.

Overload List

Convert a PHD string/relative time to universal DateTime. The conversion will be performed on the default PHD
server if the string starts with "NOW"; otherwise the conversion will be performed on the local machine.

public DateTime StringToUniversalTime(string);


Convert a PHD string/relative time to universal DateTime. The conversion will be performed on the PHD server
if the string starts with "NOW"; otherwise the conversion will be performed on the local machine.

public DateTime StringToUniversalTime(string,PHDServer);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

Uniformance PHD .NET Wrapper User Guide • 115


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[Link] Method (String)


Convert a PHD string/relative time to universal DateTime. The conversion will be performed on the default PHD
server if the string starts with "NOW"; otherwise the conversion will be performed on the local machine.

[Visual Basic]
Overloads Public Function StringToUniversalTime( _
ByVal StringTime As String _
) As Date
[C#]
public DateTime StringToUniversalTime(
string StringTime
);

Parameters

StringTime

Return Value

A exception will be thrown if the conversion fails

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (String, PHDServer)


Convert a PHD string/relative time to universal DateTime. The conversion will be performed on the PHD server
if the string starts with "NOW"; otherwise the conversion will be performed on the local machine.

[Visual Basic]
Overloads Public Function StringToUniversalTime( _
ByVal StringTime As String, _
ByVal Server As PHDServer _
) As Date
[C#]
public DateTime StringToUniversalTime(
string StringTime,
PHDServer Server
);

Parameters

StringTime
PHD string/relative time
Server
PHDServer object

Return Value

A exception will be thrown if the conversion fails

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

Uniformance PHD .NET Wrapper User Guide • 116


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Method
Fetch a single tag of Data

Overload List

Fetch a single tag of Data

public DataSet TagDfn(string);


Return all tags from the Tags Collection

public DataSet TagDfn(Tags);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (String)


Fetch a single tag of Data

[Visual Basic]
Overloads Public Function TagDfn( _
ByVal Tagname As String _
) As DataSet
[C#]
public DataSet TagDfn(
string Tagname
);

Parameters

Tagname
Used to supply the Tag that is to be returned

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (Tags)


Return all tags from the Tags Collection

[Visual Basic]
Overloads Public Function TagDfn( _
ByVal oTags As Tags _
) As DataSet

Uniformance PHD .NET Wrapper User Guide • 117


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[C#]
public DataSet TagDfn(
Tags oTags
);

Parameters

oTags
Used to supply the collection of Tags

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Specify call back function when PHD Tags have had data changed

Overload List

Specify call back function when PHD Tags have been updated

public void TagDataChangeHandler(TagDataChangeNotify,IntPtr);


Specify call back function when PHD Tags have been updated

public void TagDataChangeHandler (PHDServer,TagDataChangeNotify,IntPtr);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (TagDataChangeNotify,IntPtr)


Specify call back function when PHD Tags have had data changed

[Visual Basic]
Overloads Public Sub TagDataChangeHandler( _
ByVal TagDataChangeCallbackFunc As TagDataChangeNotify, _
ByVal lpData As IntPtr _
)
[C#]
public void TagDataChangeHandler(
TagDataChangeNotify TagDataChangeCallbackFunc,
IntPtr lpData
);

Parameters

TagDataChangeCallbackFunc
Tag Data Change callback function

Uniformance PHD .NET Wrapper User Guide • 118


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

lpData
Pointer that will be returned as an argument to the callback function

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (PHDServer,TagDataChangeNotify,IntPtr)


Specify call back function when PHD Tags have had data changed

[Visual Basic]
Overloads Public Sub TagUpdateHandler( _
ByVal Server As PHDServer, _
ByVal TagDataChangeCallbackFunc As TagDataChangeNotify, _
ByVal lpData As IntPtr _
)
[C#]
public void TagUpdateHandler(
PHDServer Server,
TagDataChangeNotify TagDataChangeCallbackFunc,
IntPtr lpData
);

Parameters

Server
PHDServer object
TagDataChangeCallbackFunc
Tag Data Change callback function
lpData
Pointer that will be returned as an argument to the callback function

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Specify call back function when PHD Tags have been updated

Overload List

Specify call back function when PHD Tags have been updated

public void TagUpdateHandler(PHDServer,TagUpdateNotify);


Specify call back function when PHD Tags have been updated

Uniformance PHD .NET Wrapper User Guide • 119


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

public void TagUpdateHandler(TagUpdateNotify);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (PHDServer, TagUpdateNotify)


Specify call back function when PHD Tags have been updated

[Visual Basic]
Overloads Public Sub TagUpdateHandler( _
ByVal Server As PHDServer, _
ByVal TagUpdateCallbackFunc As TagUpdateNotify _
)
[C#]
public void TagUpdateHandler(
PHDServer Server,
TagUpdateNotify TagUpdateCallbackFunc
);

Parameters

Server
PHDServer object
TagUpdateCallbackFunc
Tag update callback function

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (TagUpdateNotify)


Specify call back function when PHD Tags have been updated

[Visual Basic]
Overloads Public Sub TagUpdateHandler( _
ByVal TagUpdateCallbackFunc As TagUpdateNotify _
)
[C#]
public void TagUpdateHandler(
TagUpdateNotify TagUpdateCallbackFunc
);

Parameters

TagUpdateCallbackFunc
Tag update callback function

See Also

Uniformance PHD .NET Wrapper User Guide • 120


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method
Have the Default PHD Server Validate a function.

Overload List

Have the Default PHD Server Validate a function.

public void ValidateCalc(string);


Have the specified PHD Server Validate a function.

public void ValidateCalc(PHDServer,string);

See Also

PHDHistorian Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method (String)


Have the Default PHD Server Validate a function.

[Visual Basic]
Overloads Public Sub ValidateCalc( _
ByVal sCalc As String _
)
[C#]
public void ValidateCalc(
string sCalc
);

Parameters

sCalc
The function to be validated as a string

Example

try

[Link]("Function Test() return 1 ");

[Link]("Calculation Validated");

Uniformance PHD .NET Wrapper User Guide • 121


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

catch (PHDErrorException ex)

[Link] = [Link];

return;

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Method (PHDServer, String)


Have the specified PHD Server Validate a function.

[Visual Basic]
Overloads Public Sub ValidateCalc( _
ByVal Server As PHDServer, _
ByVal sCalc As String _
)
[C#]
public void ValidateCalc(
PHDServer Server,
string sCalc
);

Parameters

Server
The PHDServer object
sCalc
The function to be validated as a string

See Also

PHDHistorian Class | [Link] Namespace | [Link] Overload List

[Link] Method
Get the digital enumeration value definition for the digital value list ID specified from the default server

Overload List
Get the digital enumeration value definition for the digital value list ID specified from the default
server
[Link] (Int32, String, String, ref int[],
ref string[] DvValues)

Uniformance PHD .NET Wrapper User Guide • 122


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Get the digital enumeration value definition for the digital value list ID specified from the server
specified
[Link] (Int32, String, String, ref int[],
ref string[] DvValues, PHDServer)

[Link] Method (Int32, String, String, ref


int[], ref string[] DvValues)
Get the digital enumeration value definition for the digital value list ID specified from the default
server
[Visual Basic]

Overloads Public Sub GetDigitalEnumerationDefinition(

ByVal DvListID As Int,

ByRef DvListName As String,

ByRef DvDefaultValue As String,

ByRef DvOrdinals As Integer(),

ByRef DvValues As String()

[C#]

public void GetDigitalEnumerationDefinition(

int DvListID,

ref string DvListName,

ref string DvDefaultValue,

ref int[] DvOrdinals,

ref string[] DvValues

);

Parameters
DvListID
Digital value list ID

DvListName
A string to hold the digital value list name returned

DvDefaultValue
A string to hold the digital value list default value returned

DvOrdinals
An integer array to hold the digital value list ordinals returned

Uniformance PHD .NET Wrapper User Guide • 123


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

DvValues
A string array to hold the digital value list string values returned

[Link] Method (Int32, String, String, ref


int[], ref string[] DvValues, PHDServer)
Get the digital enumeration value definition for the digital value list ID specified from the server
specified

[Visual Basic]

Overloads Public Sub GetDigitalEnumerationDefinition(

ByVal DvListID As Int,

ByRef DvListName As String,

ByRef DvDefaultValue As String,

ByRef DvOrdinals As Integer(),

ByRef DvValues As String(),

ByVal Server As PHDServer

[C#]

public void GetDigitalEnumerationDefinition(

int DvListID,

ref string DvListName,

ref string DvDefaultValue,

ref int[] DvOrdinals,

ref string[] DvValues,

PHDServer Server

);

Parameters
DvListID

Digital value list ID


DvListName

A string to hold the digital value list name returned


DvDefaultValue

A string to hold the digital value list default value returned

Uniformance PHD .NET Wrapper User Guide • 124


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

DvOrdinals

An integer array to hold the digital value list ordinals returned


DvValues

A string array to hold the digital value list string values returned
Server

PHDServer object

[Link] Method
Get PHD tagname for the tag number specified from the default PHD server

Overload List
Get PHD tagname for the tag number specified from the default PHD server
[Link](Int32)

Get PHD tagname for the tag number specified from the server specified
[Link](Int32, PHDServer)

Get PHD tagname for the [Link] or tagname specified from the default PHD server
[Link](String)

Get PHD tagname for the [Link] or tagname specified from the server specified
[Link](String, PHDServer)

[Link] Method(Int32)

Get PHD tagname for the tag number specified from the default PHD server.

[Visual Basic]

Overloads Public Function GetPHDTagName (

ByVal tagno As Integer,

) As String

[C#]

public string GetPHDTagName (

int tagno

Uniformance PHD .NET Wrapper User Guide • 125


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

);

Parameters
tagno

Tag number

Return Value
Returns the tagname if the tag number is valid. Or returns [Link] if the tag number is invalid.

[Link] Method(Int32,PHDServer)

Get PHD tagname for the tag number specified from the server specified.

[Visual Basic]

Overloads Public Function GetPHDTagName (

ByVal tagno As Integer,

ByVal Server As PHDServer

) As String

[C#]

public string GetPHDTagName (

int tagno,

PHDServer Server

);

Parameters
tagno

Tag number
Server

PHDServer object

Return Value
Returns the tagname if the tag number is valid. Or returns [Link] if the tag number is invalid.

[Link] Method(String)

Uniformance PHD .NET Wrapper User Guide • 126


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Get PHD tagname for the [Link] or tagname specified from the default PHD server.

[Visual Basic]

Overloads Public Function GetPHDTagName (

ByVal pointDotParameterOrTagname As String

) As String

[C#]

public string GetPHDTagName (

string pointDotParameterOrTagname

);

Parameters
pointDotParameterOrTagname

the point dot parameter or tagname

Return Value
Returns the tagname if pointDotParameterOrTagname is valid. Otherwise returns [Link].

[Link] Method(String, PHDServer)

Get PHD tagname for the [Link] or tagname specified from the server specified

[Visual Basic]

Overloads Public Function GetPHDTagName (

ByVal pointDotParameterOrTagname As String,

ByVal Server As PHDServer

) As String

[C#]

public string GetPHDTagName (

string pointDotParameterOrTagname,

PHDServer Server

);

Uniformance PHD .NET Wrapper User Guide • 127


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Parameters
pointDotParameterOrTagname

the point dot parameter or tagname


Server

PHDServer object

Return Value
Returns the tagname if pointDotParameterOrTagname is valid. Otherwise returns [Link].

PHD .NET Wrapper

PHDServer Class
PHDServer class describes a connection to a PHD Server

For a list of all members of this type, see PHDServer Members.

[Link]
[Link]

[Visual Basic]
Public Class PHDServer
Implements IDisposable
[C#]
public class PHDServer : IDisposable

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance
members are not guaranteed to be thread-safe.

Example

Create a PHDServer and make it the default Server. The hostname of the server is stored in a text box labeled
[Link]

PHDHistorian oPhd = new PHDHistorian();

PHDServer DefaultServer = new PHDServer([Link]);

[Link] = [Link].API200;

[Link] = DefaultServer;

Uniformance PHD .NET Wrapper User Guide • 128


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[Link]();

Requirements

Namespace: [Link]

Assembly: PHDAPINET (in [Link])

See Also

PHDServer Members | [Link] Namespace

PHD .NET Wrapper

PHDServer Members
PHDServer overview

Public Instance Constructors

Overloaded. Initializes a new instance of the


PHDServer
PHDServer class.

Public Instance Properties

PHD Server API Version used to communicate


APIVersion
with the historian

HostName PHD Host Name.

Legacy property for PHD 2xx and earlier systems


Password
only. PHD R300 and later use integrated
authentication when connecting to APIServer.

Port PHD Port Number default is 3100.

This is a table schema used for building a dataset


PutListDataTable
required for PutList method.

RequestTimeout The RequestTimeout property identifies the


maximum amount of time to wait for responses
from APIServer or RAPIServer. If not specified,
the PHDMaxRequestTime registry setting on
APIServer or RAPIServer is used. It is in
milliseconds.

ServerID return a unique identifier for the Server GUID

UserName Legacy property for PHD 2xx and earlier systems


only. PHD R300 and later use integrated
authentication when connecting to APIServer.

Uniformance PHD .NET Wrapper User Guide • 129


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

WindowsPassword A Windows user account password. It is only used


by Remote API to make initial connection.

WindowsUsername A Windows user account name. It is only used by


Remote API to make initial connection.

Public Instance Methods

ConnectToServer Explicitly perform a connection to the PHD Server.


This method can optionally be called, and if it is
not called, a connection is performed on the first
call to a method querying data from PHD.

Implement IDisposable. If there is an open


Dispose
connection to PHD then that connection is closed.

Equals (inherited from Object) Determines whether the specified Object is equal
to the current Object.

Serves as a hash function for a particular type,


GetHashCode (inherited from Object)
suitable for use in hashing algorithms and data
structures like a hash table.

GetType (inherited from Object) Gets the Type of the current instance.

Returns a String that represents the current


ToString (inherited from Object)
Object.

Protected Instance Methods

Finalize Finalizer

MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

PHDServer Class | [Link] Namespace

PHD .NET Wrapper

PHDServer Constructor
Create a PHD Server Object that defaults to the 150 API and uses the PHD_HOST environment variable as a
default host name

Overload List

Create a PHD Server Object that defaults to the 150 API and uses the PHD_HOST environment variable as a
default host name

public PHDServer();
Create a PHD Server Object that defaults to the 150 API

Uniformance PHD .NET Wrapper User Guide • 130


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

public PHDServer(string);
Create a PHD Server Object

public PHDServer(string,SERVERVERSION);

See Also

PHDServer Class | [Link] Namespace

PHD .NET Wrapper

PHDServer Constructor ()
Create a PHD Server Object that defaults to the 150 API and uses the PHD_HOST environment variable as a
default host name

[Visual Basic]
Overloads Public Sub New()
[C#]
public PHDServer();

See Also

PHDServer Class | [Link] Namespace | PHDServer Constructor Overload List

PHD .NET Wrapper

PHDServer Constructor (String)


Create a PHD Server Object that defaults to the 150 API

[Visual Basic]
Overloads Public Sub New( _
ByVal Hostname As String _
)
[C#]
public PHDServer(
string Hostname
);

Parameters

Hostname
PHD host that the server object will be assigned to

See Also

PHDServer Class | [Link] Namespace | PHDServer Constructor Overload List

Uniformance PHD .NET Wrapper User Guide • 131


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

PHDServer Constructor (String, SERVERVERSION)


Create a PHD Server Object

[Visual Basic]
Overloads Public Sub New( _
ByVal Hostname As String, _
ByVal APIVersion As SERVERVERSION _
)
[C#]
public PHDServer(
string Hostname,
SERVERVERSION APIVersion
);

Parameters

Hostname
PHD host that the server object will be assigned to
APIVersion
Enum API selection

See Also

PHDServer Class | [Link] Namespace | PHDServer Constructor Overload List

PHD .NET Wrapper

PHDServer Properties
The properties of the PHDServer class are listed below. For a complete list of PHDServer class members, see
the PHDServer Members topic.

Public Instance Properties

APIVersion PHD Server API Version used to communicate


with the historian

HostName PHD Host Name.

MaxSearchBackTime Limit how far back (in minutes) before the


specified start time PHD will look for prior outliers
when there is no raw value exactly on the start
time. The default is -1 which does not restrict
how far back to look. Use a value of 0 to prevent
searching back before the start time. Use a non-
zero positive number (e.g. 120 for 2 hours) to
specify how many minutes to search back. Note:
This is a performance parameter, not a filter.
Prior outliers may still be returned if they are in
the memory queues, or in an already retrieved
archive record.

Password Legacy property for PHD 2xx and earlier systems


only. PHD R300 and later use integrated
authentication when connecting to APIServer.

Uniformance PHD .NET Wrapper User Guide • 132


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHDServerVersion Version of the PHD Server that is being accessed


by the client application.

Port PHD Port Number default is 3100.

The RequestTimeout property identifies the


RequestTimeout
maximum amount of time to wait for responses
from APIServer or RAPIServer. If not specified,
the PHDMaxRequestTime registry setting on
APIServer or RAPIServer is used. It is in
milliseconds.

ServerID Return a unique identifier for the Server GUID

Legacy property for PHD 2xx and earlier systems


UserName
only. PHD R300 and later use integrated
authentication when connecting to APIServer.

WindowsPassword A Windows user account password. It is only used


by Remote API to make initial connection.

A Windows user account name. It is only used by


WindowsUsername
Remote API to make initial connection.

See Also

PHDServer Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
PHD Server API Version used to communicate with the historian

[Visual Basic]
Public Property APIVersion As SERVERVERSION
[C#]
public SERVERVERSION APIVersion {get; set;}

See Also

PHDServer Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
PHD Host Name.

[Visual Basic]
Public Property HostName As String
[C#]
public string HostName {get; set;}

See Also

Uniformance PHD .NET Wrapper User Guide • 133


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHDServer Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Limit how far back (in minutes) before the specified start time PHD will look for prior outliers when there is no
raw value exactly on the start time. The default is -1 which does not restrict how far back to look. Use a value
of 0 to prevent searching back before the start time. Use a non-zero positive number (e.g. 120 for 2 hours) to
specify how many minutes to search back. Note: This is a performance parameter, not a filter. Prior outliers
may still be returned if they are in the memory queues, or in an already retrieved archive record.

[Visual Basic]
Public Property MaxSearchBackTime As Integer
[C#]
public int MaxSearchBackTime {get; set;}

See Also

PHDServer Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Legacy property for PHD 2xx and earlier systems only. PHD R300 and later use integrated authentication when
connecting to APIServer.

[Visual Basic]
Public Property Password As String
[C#]
public string Password {get; set;}

See Also

PHDServer Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Version of the PHD Server that is being accessed by the client application

[Visual Basic]
Public Property PHDServerVersion as PHDVersionStruct
[C#]
public PHDVersionStruct PHDServerVersion {get; set;}

To fetch the PHDServerVersion details, you must connect to the PHD server or perform a query:

[Link]();

The version details can then be queried using,

PHDVersionStruct PHDServerVersion = [Link];

Uniformance PHD .NET Wrapper User Guide • 134


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

The version details can be accessed using,

[Link]("[Link]: {0}" ,
[Link]());

[Link]("[Link]: {0}",
[Link]());

[Link]("[Link]: {0}",
[Link]());

[Link]("[Link]: {0}",
[Link]());

[Link]("[Link]: {0}",
[Link]());

Example Output

[Link]: [Link]

[Link]: 410

[Link]: 1

[Link]: 0

[Link]: 1

See Also

PHDServer Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
PHD Port Number default is 3100.

[Visual Basic]
Public Property Port As Integer
[C#]
public int Port {get; set;}

See Also

PHDServer Class | [Link] Namespace

PHD .NET Wrapper

PHDServer. PutListDataTable Property


[Visual Basic]
Public Property PutListDataTable As DataTable

Uniformance PHD .NET Wrapper User Guide • 135


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[C#]
public DataTable PutListTable {get; set;}

PHD .NET Wrapper

[Link] Property
The RequestTimeout property identifies the maximum amount of time to wait for responses from APIServer or
RAPIServer. If not specified, the PHDMaxRequestTime registry setting on APIServer or RAPIServer is used. It
is in milliseconds.

[Visual Basic]
Public Property RequestTimeout As UInt32
[C#]
public uint RequestTimeout {get; set;}

See Also

PHDServer Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
return a unique identifier for the Server GUID

[Visual Basic]
Public ReadOnly Property ServerID As String
[C#]
public string ServerID {get;}

See Also

PHDServer Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Legacy property for PHD 2xx and earlier systems only. PHD R300 and later use integrated authentication when
connecting to APIServer.

[Visual Basic]
Public Property UserName As String
[C#]
public string UserName {get; set;}

See Also

PHDServer Class | [Link] Namespace

Uniformance PHD .NET Wrapper User Guide • 136


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Property
A Windows user account password. It is only used by Remote API to make initial connection.

[Visual Basic]
Public Property WindowsPassword As String
[C#]
public string WindowsPassword {get; set;}

See Also

PHDServer Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
A Windows user account name. It is only used by Remote API to make initial connection.

[Visual Basic]
Public Property WindowsUsername As String
[C#]
public string WindowsUsername {get; set;}

See Also

PHDServer Class | [Link] Namespace

PHD .NET Wrapper

PHDServer Methods
The methods of the PHDServer class are listed below. For a complete list of PHDServer class members, see
the PHDServer Members topic.

Public Instance Methods

ConnectToServer Explicitly perform a connection to the PHD Server.


This method can optionally be called, and if it is
not called, a connection is performed on the first
call to a method querying data from PHD.

Implement IDisposable. If there is an open


Dispose
connection to PHD then that connection is closed.

Equals (inherited from Object) Determines whether the specified Object is equal
to the current Object.

Serves as a hash function for a particular type,


GetHashCode (inherited from Object)
suitable for use in hashing algorithms and data
structures like a hash table.

GetType (inherited from Object) Gets the Type of the current instance.

Uniformance PHD .NET Wrapper User Guide • 137


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

ToString (inherited from Object) Returns a String that represents the current
Object.

Protected Instance Methods

Finalize Finalizer

MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

PHDServer Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method
Explicitly perform a connection to the PHD Server. This method can optionally be called to cause the calling
application to connect. If this method is not called, then a connection is performed on the first call to a method
querying or writing data to PHD.

[Visual Basic]
Public Sub ConnectToServer()
[C#]
public void ConnectToServer();

See Also

PHDServer Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method
Implement IDisposable. If there is an open connection to PHD then that connection is closed.

[Visual Basic]
NotOverridable Public Sub Dispose() _

Uniformance PHD .NET Wrapper User Guide • 138


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Implements [Link]
[C#]
public void Dispose();

Implements

[Link]

See Also

PHDServer Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method
Finalizer

[Visual Basic]
Overrides Protected Sub Finalize()
[C#]
protected override void Finalize();

See Also

PHDServer Class | [Link] Namespace

PHD .NET Wrapper

RDIListStruct Class
For a list of all members of this type, see RDIListStruct Members.

[Link]
[Link]

[Visual Basic]
Public Class RDIListStruct
[C#]
public class RDIListStruct

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance
members are not guaranteed to be thread-safe.

Requirements

Namespace: [Link]

Assembly: PHDAPINET (in [Link])

Uniformance PHD .NET Wrapper User Guide • 139


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

See Also

RDIListStruct Members | [Link] Namespace

PHD .NET Wrapper

RDIListStruct Members
RDIListStruct overview

Public Instance Constructors

RDIListStruct Constructor Create an instance of the class.

Public Instance Properties

RDIName PHD Tagname

Public Instance Methods

Equals (inherited from Object) Determines whether the specified Object is equal
to the current Object.

Serves as a hash function for a particular type,


GetHashCode (inherited from Object)
suitable for use in hashing algorithms and data
structures like a hash table.

GetType (inherited from Object) Gets the Type of the current instance.

Returns a String that represents the current


ToString (inherited from Object)
Object.

Protected Instance Methods

Allows an Object to attempt to free resources and


Finalize (inherited from Object)
perform other cleanup operations before the
Object is reclaimed by garbage collection.

MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

RDIListStruct Class | [Link] Namespace

PHD .NET Wrapper

RDIListStruct Constructor

Uniformance PHD .NET Wrapper User Guide • 140


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Create an instance of the class.

[Visual Basic]
Overloads Public Sub New()
[C#]
public RDIListStruct();

See Also

RDIListStruct Class | [Link] Namespace

PHD .NET Wrapper

RDIListStruct Properties
The properties of the RDIListStruct class are listed below. For a complete list of RDIListStruct class
members, see the RDIListStruct Members topic.

Public Instance Properties

RDIName PHD Tagname

See Also

RDIListStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
PHD Tagname

[Visual Basic]
Public ReadOnly Property RDIName As String
[C#]
public string RDIName {get;}

See Also

RDIListStruct Class | [Link] Namespace

PHD .NET Wrapper

REDUCTIONOFFSET Enumeration
Identifies the offset applied when retrieving reductions for tags.

[Visual Basic]
Public Enum REDUCTIONOFFSET
[C#]

Uniformance PHD .NET Wrapper User Guide • 141


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

public enum REDUCTIONOFFSET

Members

Member Name Description

After The data value returned specifies the reduction for


the interval that follows the timestamp.

Around The data value returned specifies the reduction for


the interval that the timestamp is the midpoint.

Before The data value returned specifies the reduction for


the interval that precedes the timestamp.

Requirements

Namespace: [Link]

Assembly: PHDAPINET (in [Link])

See Also

[Link] Namespace

PHD .NET Wrapper

REDUCTIONTYPE Enumeration
Identifies the type of reduction fetched for the tags..

[Visual Basic]
Public Enum REDUCTIONTYPE
[C#]
public enum REDUCTIONTYPE

Members

Member Name Description

None No reduction

Average The average data over the reduction frequency

Delta The difference between the value and the end and
start of the reduction frequency.

Minimum The minimum value over the reduction frequency.

Maximum The maximum value over the reduction frequency.

Uniformance PHD .NET Wrapper User Guide • 142


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Mean Arithmetic mean over the reduction frequency.

StandardDeviation The standard deviation of the samples over the


reduction frequency.

RegressionSlope The slope of the regression over the reduction


frequency.

RegressionConstant The y-intercept of the regression line.

RegressionDeviation The standard deviation of the regression line over


the reduction frequency.

First The value at the start of the reduction frequency.

Last The value at the end of the reduction frequency.

Requirements

Namespace: [Link]

Assembly: PHDAPINET (in [Link])

See Also

[Link] Namespace

PHD .NET Wrapper

SAMPLETYPE Enumeration
Sampling types supported.

[Visual Basic]
Public Enum SAMPLETYPE
[C#]
public enum SAMPLETYPE

Members

Member Name Description

Snapshot Query interpolated data at the specified sample interval, using direct
sampling to calculate the interpolated values from the surrounding raw data,
and using the interpolation method specified on the tag (if not specified on
the tag, manual input tags use step interpolation, collected tags use linear
interpolation).

Average Query interpolated data at the specified sample interval, using "around"
resampling to calculate the interpolated value from the surrounding raw data,
and using the interpolation method specified on the tag (if not specified on

Uniformance PHD .NET Wrapper User Guide • 143


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

the tag, manual input tags use step interpolation, collected tags use linear
interpolation).

Resampled Query interpolated data at the specified sample interval, using the resample
method configured on the tag to calculate the interpolated values from the
surrounding raw data, and using the interpolation method specified on the
tag (if not specified on the tag, manual input tags use step interpolation,
collected tags use linear interpolation).

Raw Query raw data – i.e. values stored by PHD.

InterpolatedRaw Returns an interpolated value for each raw value within the requested
timespan, replacing -1 confidence values with an interpolated value, with a 0
confidence. It will interpolate and extrapolate the start and end ranges
accordingly.

Requirements

Namespace: [Link]

Assembly: PHDAPINET (in [Link])

See Also

[Link] Namespace

PHD .NET Wrapper

SERVERVERSION Enumeration
Enum list if Server API Supported

[Visual Basic]
Public Enum SERVERVERSION
[C#]
public enum SERVERVERSION

Members

Member Name Description

DEFAULT The default uses the 150 API as it can communicate with both 150 and 200
historians.

API150 The 150 API can communicate with both 150 and 200 PHD.

API200 The 200 API will only communicate with R200 PHD or newer historians.

RAPI200 The 200 RAPI will only communicate with 200 PHD historians.

Uniformance PHD .NET Wrapper User Guide • 144


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Requirements

Namespace: [Link]

Assembly: PHDAPINET (in [Link])

See Also

[Link] Namespace

PHD .NET Wrapper

Tag Class
Describes a single Tag

For a list of all members of this type, see Tag Members.

[Link]
[Link]

[Visual Basic]
Public Class Tag
[C#]
public class Tag

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance
members are not guaranteed to be thread-safe.

Remarks

This class describes the properties and methods associated with a Tag

Example

Create a new instance of a Tag. Add the Tag to the Tags collection

Tag _tag = new Tag("kst20000");

Tags oTags = new Tags();

[Link](_tag);

Requirements

Namespace: [Link]

Assembly: PHDAPINET (in [Link])

Uniformance PHD .NET Wrapper User Guide • 145


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

See Also

Tag Members | [Link] Namespace

PHD .NET Wrapper

Tag Members
Tag overview

Public Instance Constructors

Tag Overloaded. Initializes a new instance of the Tag


class.

Public Instance Properties

EnumEnable The Tagname of the Tag.

The Server Object that the tag is associated with.


Server
No Server object supplied the base Server is used

TagName The Tagname of the Tag.

The Engineering Units to be converted to for the


Units
Tag.

Public Instance Methods

Determines whether the specified Object is equal


Equals (inherited from Object)
to the current Object.

GetHashCode (inherited from Object) Serves as a hash function for a particular type,
suitable for use in hashing algorithms and data
structures like a hash table.

GetType (inherited from Object) Gets the Type of the current instance.

ToString (inherited from Object) Returns a String that represents the current
Object.

Protected Instance Methods

Finalize (inherited from Object) Allows an Object to attempt to free resources and
perform other cleanup operations before the
Object is reclaimed by garbage collection.

MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

Uniformance PHD .NET Wrapper User Guide • 146


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Tag Class | [Link] Namespace

PHD .NET Wrapper

Tag Constructor
Create a new instance of a Tag.

Overload List

Create a new instance of a Tag.

public Tag();
Tag constructor with tagname as a parameter

public Tag(string);

See Also

Tag Class | [Link] Namespace

PHD .NET Wrapper

Tag Constructor ()
Create a new instance of a Tag.

[Visual Basic]
Overloads Public Sub New()
[C#]
public Tag();

Example

Add a Tag to the Tags collection

Tag _tag = new Tag();

_tag.TagName = "kst20000";

Tags oTags = new Tags();

[Link](_tag);

See Also

Tag Class | [Link] Namespace | Tag Constructor Overload List

Uniformance PHD .NET Wrapper User Guide • 147


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

Tag Constructor (String)


Tag constructor with tagname as a parameter

[Visual Basic]
Overloads Public Sub New( _
ByVal tagname As String _
)
[C#]
public Tag(
string tagname
);

Parameters

tagname

Example

Create a new instance of a Tag. Add the Tag to the Tags collection

Tag _tag = new Tag("kst20000");

Tags oTags = new Tags();

[Link](_tag);

See Also

Tag Class | [Link] Namespace | Tag Constructor Overload List

PHD .NET Wrapper

Tag Properties
The properties of the Tag class are listed below. For a complete list of Tag class members, see the Tag
Members topic.

Public Instance Properties

EnumEnable The Tagname of the Tag.

The Server Object that the tag is associated with.


Server
No Server object supplied the base Server is used

Uniformance PHD .NET Wrapper User Guide • 148


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

TagName The Tagname of the Tag.

Units The Engineering Units to be converted to for the


Tag.

See Also

Tag Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
The Tagname of the Tag.

[Visual Basic]
Public Property EnumEnable As Boolean
[C#]
public bool EnumEnable {get; set;}

See Also

Tag Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
The Server Object that the tag is associated with. No Server object supplied the base Server is used

[Visual Basic]
Public Property Server As PHDServer
[C#]
public PHDServer Server {get; set;}

See Also

Tag Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
The Tagname of the Tag.

[Visual Basic]
Public Property TagName As String
[C#]
public string TagName {get; set;}

See Also

Tag Class | [Link] Namespace

Uniformance PHD .NET Wrapper User Guide • 149


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Property
The Engineering Units to be converted to for the Tag.

[Visual Basic]
Public Property Units As String
[C#]
public string Units {get; set;}

See Also

Tag Class | [Link] Namespace

PHD .NET Wrapper

TagFilter Class
A structure is used to specify tag filter conditions

For a list of all members of this type, see TagFilter Members.

[Link]
[Link]

[Visual Basic]
Public Class TagFilter
[C#]
public class TagFilter

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance
members are not guaranteed to be thread-safe.

Requirements

Namespace: [Link]

Assembly: PHDAPINET (in [Link])

See Also

TagFilter Members | [Link] Namespace

PHD .NET Wrapper

Uniformance PHD .NET Wrapper User Guide • 150


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

TagFilter Members
TagFilter overview

Public Instance Constructors

TagFilter Constructor Constructor

Public Instance Fields

Collector Collector Name Pattern

DataType Data Type

Description Tag description pattern

ParentTagname Parent Tag Name Pattern

ScanRate Scan frequency in second

SourceTagname Source Tag Name Pattern

SourceUnits Source Tag Engineering Unit Pattern

Tagname Tag Name Pattern

TagUnits Engineering Unit Pattern

Public Instance Methods

Clear Clear all data members

Equals (inherited from Object) Determines whether the specified Object is equal
to the current Object.

Serves as a hash function for a particular type,


GetHashCode (inherited from Object)
suitable for use in hashing algorithms and data
structures like a hash table.

GetType (inherited from Object) Gets the Type of the current instance.

Returns a String that represents the current


ToString (inherited from Object)
Object.

Protected Instance Methods

Allows an Object to attempt to free resources and


Finalize (inherited from Object)
perform other cleanup operations before the
Object is reclaimed by garbage collection.

Uniformance PHD .NET Wrapper User Guide • 151


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

TagFilter Class | [Link] Namespace

PHD .NET Wrapper

TagFilter Constructor
Constructor

[Visual Basic]
Public Sub New()
[C#]
public TagFilter();

See Also

TagFilter Class | [Link] Namespace

PHD .NET Wrapper

TagFilter Fields
The fields of the TagFilter class are listed below. For a complete list of TagFilter class members, see the
TagFilter Members topic.

Public Instance Fields

Collector Collector Name Pattern

DataType Data Type

Description Tag description pattern

ParentTagname Parent Tag Name Pattern

ScanRate Scan frequency in second

SourceTagname Source Tag Name Pattern

SourceUnits Source Tag Engineering Unit Pattern

Tagname Tag Name Pattern

Uniformance PHD .NET Wrapper User Guide • 152


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

TagUnits Engineering Unit Pattern

See Also

TagFilter Class | [Link] Namespace

PHD .NET Wrapper

[Link] Field
Collector Name Pattern

[Visual Basic]
Public Collector As String
[C#]
public string Collector;

See Also

TagFilter Class | [Link] Namespace

PHD .NET Wrapper

[Link] Field
Data Type

[Visual Basic]
Public DataType As Char
[C#]
public char DataType;

See Also

TagFilter Class | [Link] Namespace

PHD .NET Wrapper

[Link] Field
Tag description pattern

[Visual Basic]
Public Description As String
[C#]
public string Description;

See Also

Uniformance PHD .NET Wrapper User Guide • 153


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

TagFilter Class | [Link] Namespace

PHD .NET Wrapper

[Link] Field
Parent Tag Name Pattern

[Visual Basic]
Public ParentTagname As String
[C#]
public string ParentTagname;

See Also

TagFilter Class | [Link] Namespace

PHD .NET Wrapper

[Link] Field
Scan frequency in second

[Visual Basic]
Public ScanRate As Long
[C#]
public long ScanRate;

See Also

TagFilter Class | [Link] Namespace

PHD .NET Wrapper

[Link] Field
Source Tag Name Pattern

[Visual Basic]
Public SourceTagname As String
[C#]
public string SourceTagname;

See Also

TagFilter Class | [Link] Namespace

Uniformance PHD .NET Wrapper User Guide • 154


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Field
Source Tag Engineering Unit Pattern

[Visual Basic]
Public SourceUnits As String
[C#]
public string SourceUnits;

See Also

TagFilter Class | [Link] Namespace

PHD .NET Wrapper

[Link] Field
Tag Name Pattern

[Visual Basic]
Public Tagname As String
[C#]
public string Tagname;

See Also

TagFilter Class | [Link] Namespace

PHD .NET Wrapper

[Link] Field
Engineering Unit Pattern

[Visual Basic]
Public TagUnits As String
[C#]
public string TagUnits;

See Also

TagFilter Class | [Link] Namespace

PHD .NET Wrapper

TagFilter Methods
The methods of the TagFilter class are listed below. For a complete list of TagFilter class members, see the
TagFilter Members topic.

Uniformance PHD .NET Wrapper User Guide • 155


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Public Instance Methods

Clear Clear all data members

Equals (inherited from Object) Determines whether the specified Object is equal
to the current Object.

Serves as a hash function for a particular type,


GetHashCode (inherited from Object)
suitable for use in hashing algorithms and data
structures like a hash table.

GetType (inherited from Object) Gets the Type of the current instance.

Returns a String that represents the current


ToString (inherited from Object)
Object.

Protected Instance Methods

Allows an Object to attempt to free resources and


Finalize (inherited from Object)
perform other cleanup operations before the
Object is reclaimed by garbage collection.

MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

TagFilter Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method
Clear all data members

[Visual Basic]
Public Sub Clear()
[C#]
public void Clear();

See Also

TagFilter Class | [Link] Namespace

PHD .NET Wrapper

TagListStruct Class
For a list of all members of this type, see TagListStruct Members.

[Link]
[Link]

[Visual Basic]
Public Class TagListStruct

Uniformance PHD .NET Wrapper User Guide • 156


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[C#]
public class TagListStruct

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance
members are not guaranteed to be thread-safe.

Requirements

Namespace: [Link]

Assembly: PHDAPINET (in [Link])

See Also

TagListStruct Members | [Link] Namespace

PHD .NET Wrapper

TagListStruct Members
TagListStruct overview

Public Instance Constructors

TagListStruct Constructor Create an instance of the class.

Public Instance Properties

CollectorName Collector Name

DataLength Data Length

DataType Data Type

ParentTagname Parent Tag Name

ParentTagno Parent Tag Number

SourceTagname Source Tagname

SourceUnits Source Units

Tagname PHD Tagname

Tagno PHD Tagno

Uniformance PHD .NET Wrapper User Guide • 157


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Units Engineering Units

Public Instance Methods

Equals (inherited from Object) Determines whether the specified Object is equal
to the current Object.

Serves as a hash function for a particular type,


GetHashCode (inherited from Object)
suitable for use in hashing algorithms and data
structures like a hash table.

GetType (inherited from Object) Gets the Type of the current instance.

ToString (inherited from Object) Returns a String that represents the current
Object.

Protected Instance Methods

Allows an Object to attempt to free resources and


Finalize (inherited from Object)
perform other cleanup operations before the
Object is reclaimed by garbage collection.

MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

TagListStruct Class | [Link] Namespace

PHD .NET Wrapper

TagListStruct Constructor
Create an instance of the class.

[Visual Basic]
Overloads Public Sub New()
[C#]
public TagListStruct();

See Also

TagListStruct Class | [Link] Namespace

PHD .NET Wrapper

TagListStruct Properties
The properties of the TagListStruct class are listed below. For a complete list of TagListStruct class
members, see the TagListStruct Members topic.

Uniformance PHD .NET Wrapper User Guide • 158


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Public Instance Properties

CollectorName Collector Name

DataLength Data Length

DataType Data Type

ParentTagname Parent Tag Name

ParentTagno Parent Tag Number

SourceTagname Source Tagname

SourceUnits Source Units

Tagname PHD Tagname

Tagno PHD Tagno

Units Engineering Units

See Also

TagListStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Collector Name

[Visual Basic]
Public ReadOnly Property CollectorName As String
[C#]
public string CollectorName {get;}

See Also

TagListStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Data Length

[Visual Basic]

Uniformance PHD .NET Wrapper User Guide • 159


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Public ReadOnly Property DataLength As Short


[C#]
public short DataLength {get;}

See Also

TagListStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Data Type

[Visual Basic]
Public ReadOnly Property DataType As Char
[C#]
public char DataType {get;}

See Also

TagListStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Parent Tag Name

[Visual Basic]
Public ReadOnly Property ParentTagname As String
[C#]
public string ParentTagname {get;}

See Also

TagListStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Parent Tag Number

[Visual Basic]
Public ReadOnly Property ParentTagno As Integer
[C#]
public int ParentTagno {get;}

See Also

Uniformance PHD .NET Wrapper User Guide • 160


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

TagListStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Source Tagname

[Visual Basic]
Public ReadOnly Property SourceTagname As String
[C#]
public string SourceTagname {get;}

See Also

TagListStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Source Units

[Visual Basic]
Public ReadOnly Property SourceUnits As String
[C#]
public string SourceUnits {get;}

See Also

TagListStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
PHD Tagname

[Visual Basic]
Public ReadOnly Property Tagname As String
[C#]
public string Tagname {get;}

See Also

TagListStruct Class | [Link] Namespace

Uniformance PHD .NET Wrapper User Guide • 161


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

[Link] Property
PHD Tagno

[Visual Basic]
Public ReadOnly Property Tagno As Integer
[C#]
public int Tagno {get;}

See Also

TagListStruct Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Engineering Units

[Visual Basic]
Public ReadOnly Property Units As String
[C#]
public string Units {get;}

See Also

TagListStruct Class | [Link] Namespace

PHD .NET Wrapper

Tags Class
The Tags class is used to hold a collection of Tag items

For a list of all members of this type, see Tags Members.

[Link]
[Link]

[Visual Basic]
Public Class Tags
[C#]
public class Tags

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance
members are not guaranteed to be thread-safe.

Remarks

Uniformance PHD .NET Wrapper User Guide • 162


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Example

Create a new instance of the Tags collection. Add 3 tags to the collection

vb

Dim oTags as Tags = new Tags()

[Link](new Tag("kst20000"))

[Link](new Tag("kst20001"))

[Link](new Tag("kst20002"))

c#

Tags oTags = new Tags();

[Link](new Tag("kst20000"));

[Link](new Tag("kst20001"));

[Link](new Tag("kst20002"));

Requirements

Namespace: [Link]

Assembly: PHDAPINET (in [Link])

See Also

Tags Members | [Link] Namespace

PHD .NET Wrapper

Tags Members
Tags overview

Public Instance Constructors

Uniformance PHD .NET Wrapper User Guide • 163


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Tags Constructor Tags class is a container for Tag items

Public Instance Properties

Count return the number of Tag Items in the Tags


Collection.

Overloaded. Indexer to provide read access to


Item
array list for the hashtable add a tagname and
return the Tag object reference

Public Instance Methods

Add Tag to HashTable. Use Tagname as the key


Add
when no name is supplied. Use Object Hostname
when no Hostname is supplied.

Equals (inherited from Object) Determines whether the specified Object is equal
to the current Object.

GetEnumerator Enumerates the elements in the Tag Collection

Serves as a hash function for a particular type,


GetHashCode (inherited from Object)
suitable for use in hashing algorithms and data
structures like a hash table.

GetType (inherited from Object) Gets the Type of the current instance.

Remove Remove a Tag from the Tags Collection.

RemoveAll Remove all Tag items from the Tags Collection.

Returns a String that represents the current


ToString (inherited from Object)
Object.

Protected Instance Methods

Allows an Object to attempt to free resources and


Finalize (inherited from Object)
perform other cleanup operations before the
Object is reclaimed by garbage collection.

MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

Tags Class | [Link] Namespace

PHD .NET Wrapper

Tags Constructor

Uniformance PHD .NET Wrapper User Guide • 164


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Tags class is a container for Tag items

[Visual Basic]
Public Sub New()
[C#]
public Tags();

Example

Create a new instance of the Tags collection. Add 3 tags to the collection

vb

Dim oTags as Tags = new Tags()

[Link](new Tag("kst20000"))

[Link](new Tag("kst20001"))

[Link](new Tag("kst20002"))

c#

Tags oTags = new Tags();

[Link](new Tag("kst20000"));

[Link](new Tag("kst20001"));

[Link](new Tag("kst20002"));

See Also

Tags Class | [Link] Namespace

PHD .NET Wrapper

Tags Properties
The properties of the Tags class are listed below. For a complete list of Tags class members, see the Tags
Members topic.

Public Instance Properties

Uniformance PHD .NET Wrapper User Guide • 165


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Count return the number of Tag Items in the Tags


Collection.

Item Overloaded. Indexer to provide read access to


array list for the hashtable add a tagname and
return the Tag object reference

See Also

Tags Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
return the number of Tag Items in the Tags Collection.

[Visual Basic]
Public ReadOnly Property Count As Integer
[C#]
public int Count {get;}

Example

Create a new instance of the Tags collection. Add a tag name to the collection return the count of the number
of items in the collection

vb

Dim oTags as Tags = new Tags()

[Link](new Tag("kst20000"))

Dim _count as integer = [Link]

c#

Tags oTags = new Tags();

[Link](new Tag("kst20000"));

int _count = [Link];

See Also

Uniformance PHD .NET Wrapper User Guide • 166


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Tags Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property
Indexer to provide read access to array list for the hashtable add a tagname and return the Tag object
reference

Overload List

Indexer to provide read access to array list for the hashtable add a tagname and return the Tag object
reference

public Tag this[int] {get;}


Indexer to provide read access to array list for the hashtable add a tagname and return the Tag object
reference

public Tag[] this[string] {get;}

See Also

Tags Class | [Link] Namespace

PHD .NET Wrapper

[Link] Property (Int32)


Indexer to provide read access to array list for the hashtable add a tagname and return the Tag object
reference

[Visual Basic]
Overloads Public Default ReadOnly Property Item( _
ByVal index As Integer _
) As Tag
[C#]
public Tag this[
int index
] {get;}

Example

Create a new instance of the Tags collection. Add a tag name to the collection and assign that item in the
collection to a Tag

vb

Dim oTags as Tags = new Tags();

[Link](new Tag("kst20000"))

Dim _tag as Tag = oTags(0)

Uniformance PHD .NET Wrapper User Guide • 167


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

c#

Tags oTags = new Tags();

[Link](new Tag("kst20000"));

Tag _tag = oTags[0];

See Also

Tags Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

[Link] Property (String)


Indexer to provide read access to array list for the hashtable add a tagname and return the Tag object
reference

[Visual Basic]
Overloads Public Default ReadOnly Property Item( _
ByVal TagName As String _
) As Tag()
[C#]
public Tag[] this[
string TagName
] {get;}

Example

Create a new instance of the Tags collection. Add a tag name to the collection and assign that item in the
collection to a Tag[]

vb

Dim oTags as Tags = new Tags()

[Link](new Tag("kst20000"))

Dim _tags() as Tag = oTags("kst20000")

c#

Tags oTags = new Tags();

[Link](new Tag("kst20000"));

Uniformance PHD .NET Wrapper User Guide • 168


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Tag[] _tags = oTags["kst20000"];

See Also

Tags Class | [Link] Namespace | [Link] Overload List

PHD .NET Wrapper

Tags Methods
The methods of the Tags class are listed below. For a complete list of Tags class members, see the Tags
Members topic.

Public Instance Methods

Add Add Tag to HashTable. Use Tagname as the key


when no name is supplied. Use Object Hostname
when no Hostname is supplied.

Determines whether the specified Object is equal


Equals (inherited from Object)
to the current Object.

GetEnumerator Enumerates the elements in the Tag Collection

Serves as a hash function for a particular type,


GetHashCode (inherited from Object)
suitable for use in hashing algorithms and data
structures like a hash table.

GetType (inherited from Object) Gets the Type of the current instance.

Remove Remove a Tag from the Tags Collection.

RemoveAll Remove all Tag items from the Tags Collection.

Returns a String that represents the current


ToString (inherited from Object)
Object.

Protected Instance Methods

Allows an Object to attempt to free resources and


Finalize (inherited from Object)
perform other cleanup operations before the
Object is reclaimed by garbage collection.

MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

Tags Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method
Add Tag to HashTable.

Uniformance PHD .NET Wrapper User Guide • 169


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

Use Tagname as the key when no name is supplied.

Use Object Hostname when no Hostname is supplied.

[Visual Basic]
Public Sub Add( _
ByVal oTag As Tag _
)
[C#]
public void Add(
Tag oTag
);

See Also

Tags Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method
Enumerates the elements in the Tag Collection

[Visual Basic]
Public Function GetEnumerator() As IEnumerator
[C#]
public IEnumerator GetEnumerator();

See Also

Tags Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method
Remove a Tag from the Tags Collection.

[Visual Basic]
Public Sub Remove( _
ByVal oTag As Tag _
)
[C#]
public void Remove(
Tag oTag
);

Example

Create a new instance of the Tags collection. Add a tag name to the collection then remove that tag from the
collection the collection

vb

Dim oTags as Tags = new Tags()

Dim _tag as Tag = new Tag("kst20000")

[Link](_tag)

Uniformance PHD .NET Wrapper User Guide • 170


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[Link](_tag)

c#

Tags oTags = new Tags();

Tag _tag = new Tag("kst20000");

[Link](_tag);

[Link](_tag);

See Also

Tags Class | [Link] Namespace

PHD .NET Wrapper

[Link] Method
Remove all Tag items from the Tags Collection.

[Visual Basic]
Public Sub RemoveAll()
[C#]
public void RemoveAll();

See Also

Tags Class | [Link] Namespace

PHD .NET Wrapper

TagDataChangeNotify Delegate
Notification from PHD server when tag data is updated

[Visual Basic]
Public Delegate Sub TagDataChangeNotify( _
ByVal Mode Integer,
ByVal TagNumber Integer,
ByVal TagName String,
ByVal TagUnits String,
ByVal TimeStamp Long,
ByVal Confidence SByte,
ByVal Sequence Short,

Uniformance PHD .NET Wrapper User Guide • 171


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

ByVal DataType Char,


ByVal DataLength Short,
ByVal data Object,
ByVal lpData Object
)
[C#]
public delegate void TagDataChangeNotify(
int Mode,
int TagNumber,
string TagName,
string TagUnits,
long TimeStamp,
sbyte Confidence,
short Sequence,
char DataType,
short DataLength,
object data,
object lpData
);

Remarks

Mode indicates the type of change being notified:


0 – Insert
1 – Update
2 – Delete
Other – Unknown
Timestamp is a Microsoft FILETIME structure.
DataType is the PHD Data Type - I, L, F, D, C, U, or B
DataLength is the length of the data
Data is the data value being notified
lpData is the value specified in the TagDataChangeHandler() call

Example

Configure and enable a TagDataChangeNotify Delegate

c#

PHDHistorian oPhd;

try

oPhd = new PHDHistorian(false)

Uniformance PHD .NET Wrapper User Guide • 172


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[Link] callback = new


TagDataChangeNotify(TagDataChangeCallbackHandler);

[Link](callback, [Link]);

[Link](true);

catch(Exception ex)

[Link]( [Link]);

private void TagDataChangeCallbackHandler(int Mode, int TagNumber, string TagName, string


TagUnits,

long TimeStamp, sbyte Confidence, short Sequence, char DataType, short DataLength, object
data, object lpData)

string time = [Link](TimeStamp).ToString("dd-MMM-yyyy HH:mm:[Link]");

[Link]([Link]("{0,-6}, {1,8}, {2,-32}, {3,-24}, {4,4}, {5,12}, {6,8},


{7,7}, {8}",

Mode, TagNumber, TagName, time, Confidence, TagUnits, DataType, DataLength, data));

Requirements

Namespace: [Link]

Assembly: PHDAPINET (in [Link])

See Also

[Link] Namespace

Uniformance PHD .NET Wrapper User Guide • 173


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

PHD .NET Wrapper

TagUpdateNotify Delegate
Notification from PHD server when tags are updated

[Visual Basic]
Public Delegate Sub TagUpdateNotify( _
ByVal TagCount As Integer, _
ByVal TagnoList As Integer() _
)
[C#]
public delegate void TagUpdateNotify(
int TagCount,
int[] TagnoList
);

Remarks

Example

Configure a TagUpdateNotify delegate

c#

PHDHistorian oPhd;

try

oPhd = new PHDHistorian(false)

[Link] callback = new


TagUpdateNotify(TagUpdateCallbackHandler);

[Link](callback);

catch(Exception ex)

Uniformance PHD .NET Wrapper User Guide • 174


2 Usage
2.2 The .NET Wrapper Interface – Methods and Properties

[Link]( [Link]);

private void TagUpdateCallbackHandler(int TagCount, int[] TagnoList)

[Link]("TagCount=" + [Link]() + "\nFirst Tagno: " +


TagnoList[0].ToString());

// Clear the TagUpdate list so that you only see new updates next time

[Link]();

Requirements

Namespace: [Link]

Assembly: PHDAPINET (in [Link])

See Also

[Link] Namespace

Uniformance PHD .NET Wrapper User Guide • 175


Index
.NET Framework environment, 6 methods and attributes, 6
Closing, 7 Microsoft .NET technology, 6
Data fetching, 7 PHD .NET Wrapper, 6
Initializing, 7 PHD Server native API calls, 6

Uniformance PHD .NET Wrapper User Guide • 176


Honeywell Process Solutions
2101 CityWest Blvd, Houston
TX, 77042, USA

You might also like