Class Data
The OASData.Data class is a client for accessing real time and historical data from an Open Automation Systems (OAS) Server.
Inheritance
Implements
Inherited Members
Namespace: OASData
Assembly: OASData.dll
Syntax
public class Data : Component, IComponent, IDisposable
Constructors
Data()
Default constructor Typically only one instance of the OASData.Data component is needed for any application.
Declaration
public Data()
Properties
OverridePrimaryWithBackupNodeName
Declaration
public bool OverridePrimaryWithBackupNodeName { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
SetValueOperatorEvent
Enable or Disable Operator Event
Declaration
public bool SetValueOperatorEvent { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Boolean value to get or set |
SetValueOperatorEventDescription
Description for Operator Event
Declaration
public string SetValueOperatorEventDescription { get; set; }
Property Value
Type | Description |
---|---|
System.String | String description to get or set |
SetValueOperatorEventGroup
Group Name for Operator Event
Declaration
public string SetValueOperatorEventGroup { get; set; }
Property Value
Type | Description |
---|---|
System.String | String name to get or set |
SetValueOperatorEventPriority
Priority for Operator Event
Declaration
public int SetValueOperatorEventPriority { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | Integer priority to get or set |
TCPPortNumber
Port number for TCP communications. Defaults to 58727 if not set.
Declaration
public int TCPPortNumber { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | Integer TCP port number to set or get |
Methods
AddBackupNetworkNode(String, String)
Declaration
public void AddBackupNetworkNode(string Original, string Revised)
Parameters
Type | Name | Description |
---|---|---|
System.String | Original | |
System.String | Revised |
AddNetworkNodeAlias(String, String)
Declaration
public void AddNetworkNodeAlias(string Original, string Revised)
Parameters
Type | Name | Description |
---|---|---|
System.String | Original | |
System.String | Revised |
AddTag(String)
Add a Tag to monitor for changes. Any changes to watched Tags will trigger the ValuesChangedAll event.
Declaration
public void AddTag(string Tag)
Parameters
Type | Name | Description |
---|---|---|
System.String | Tag | Tag to monitor in the form <Tag Group>.<Tag>.<Property>. For example "Sine.Value". |
AddTags(String[])
Add one or more Tags to monitor for changes. Any changes to watched Tags will trigger the ValuesChangedAll event.
Declaration
public void AddTags(string[] Tags)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | Tags | String array of Tags to monitor in the form <Tag Group>.<Tag>.<Property>. For example "Sine.Value". |
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
GetBackupNetworkNode(String)
Declaration
public string GetBackupNetworkNode(string Original)
Parameters
Type | Name | Description |
---|---|---|
System.String | Original |
Returns
Type | Description |
---|---|
System.String |
GetNetworkNodeAlias(String)
Declaration
public string GetNetworkNodeAlias(string Original)
Parameters
Type | Name | Description |
---|---|---|
System.String | Original |
Returns
Type | Description |
---|---|
System.String |
ReadOPCItems(String, String[], ref Int32[], Int32)
This is a synchronous read of OPC Items from an OAS Service.
This is a blocking call and should only be called one at a time.
Not as efficient as using the data change events with AddTags method for continuous monitoring.
Declaration
public object[] ReadOPCItems(string NetworkNode, string[] OPCItems, ref int[] Errors, int Timeout = 10000)
Parameters
Type | Name | Description |
---|---|---|
System.String | NetworkNode | Server or IP address of the OAS server - leave null for localhost |
System.String[] | OPCItems | String array of OPC Items to read |
System.Int32[] | Errors | Integer array will be set to 0 for success, 1 for bad quality, 2 for timeout response. |
System.Int32 | Timeout | Timeout in milliseconds |
Returns
Type | Description |
---|---|
System.Object[] | Object array of the OPC Item values |
ReadOPCItemsFromRemoteSCADAHost(String, String, String[], ref Int32[], Int32)
This is a synchronous read of OPC Items from an OAS Service connected via Live Data Cloud.
This is a blocking call and should only be called one at a time.
Not as efficient as using the data change events with AddTags method for continuous monitoring.
Declaration
public object[] ReadOPCItemsFromRemoteSCADAHost(string NetworkNode, string RemoteSCADAHostingName, string[] OPCItems, ref int[] Errors, int Timeout = 10000)
Parameters
Type | Name | Description |
---|---|---|
System.String | NetworkNode | Server or IP address of the OAS server - leave null for localhost |
System.String | RemoteSCADAHostingName | Name of the registered Live Data Cloud host |
System.String[] | OPCItems | String array of OPC Items to read |
System.Int32[] | Errors | Integer array will be set to 0 for success, 1 for bad quality, 2 for timeout response. |
System.Int32 | Timeout | Timeout in milliseconds |
Returns
Type | Description |
---|---|
System.Object[] | Object array of the OPC Item values |
RemoveAllTags()
Remove all Tags from being monitored for changes.
Declaration
public void RemoveAllTags()
RemoveBackupNetworkNode(String)
Declaration
public void RemoveBackupNetworkNode(string Original)
Parameters
Type | Name | Description |
---|---|---|
System.String | Original |
RemoveNetworkNodeAlias(String)
Declaration
public void RemoveNetworkNodeAlias(string Original)
Parameters
Type | Name | Description |
---|---|---|
System.String | Original |
RemoveTag(String)
Remove a Tag from being monitored for changes.
Declaration
public void RemoveTag(string Tag)
Parameters
Type | Name | Description |
---|---|---|
System.String | Tag | Tag to no longer monitor in the form <Tag Group>.<Tag>.<Property>. For example "Sine.Value". |
RemoveTags(String[])
Remove a list of Tags from being monitored for changes.
Declaration
public void RemoveTags(string[] Tags)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | Tags | String array of Tags to no longer monitor in the form <Tag Group>.<Tag>.<Property>. For example "Sine.Value". |
SyncReadTags(String[], ref Int32[], Int32)
Read one or more Tag values synchronously. This is a blocking call and not as efficient as using the ValuesChangedAll event with AddTags method.
Declaration
public object[] SyncReadTags(string[] Tags, ref int[] Errors, int Timeout = 10000)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | Tags | String array of Tags to read in the form <Tag Group>.<Tag>.<Property>. For example "Sine.Value". |
System.Int32[] | Errors | Integer array will be set to 0 for success, 1 for bad quality, 2 for timeout response. |
System.Int32 | Timeout | Timeout in milliseconds |
Returns
Type | Description |
---|---|
System.Object[] | Object array containing Tag values |
SyncWriteTags(String[], Object[])
Writes one or more Tag values synchronously. This is a blocking call and not as efficient as using the WriteTags method and then confirm changed with the ValuesChangedAll event.
Declaration
public int[] SyncWriteTags(string[] Tags, object[] Values)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | Tags | String array of Tags to write in the form <Tag Group>.<Tag>.<Property>. For example "Sine.Value". |
System.Object[] | Values | Object array of values to write |
Returns
Type | Description |
---|---|
System.Int32[] | Integer array of error codes for each Tag. Errors array will be set to 0 for success, 1 for service not reachable, 2 if values array is not the same size as the Tags array. |
SyncWriteTags(String[], Object[], String, String)
Writes one or more Tag values synchronously using an OAS security credential. This is a blocking call and not as efficient as using the WriteTags method and then confirm changed with the ValuesChangedAll event.
Declaration
public int[] SyncWriteTags(string[] Tags, object[] Values, string WriteUserName, string WritePassword)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | Tags | String array of Tags to write in the form <Tag Group>.<Tag>.<Property>. For example "Sine.Value". |
System.Object[] | Values | Object array of values to write |
System.String | WriteUserName | Username for the OAS Credential |
System.String | WritePassword | Password for the OAS Credential |
Returns
Type | Description |
---|---|
System.Int32[] | Errors array will be set to 0 for success, 1 for service not reachable, 2 if values array is not the same size as the Tags array. |
SyncWriteTagsWithConfirmation(String[], Object[], Int32, Double)
Writes one or more Tag values synchronously using full confirmation. This is a blocking call and not as efficient as using the WriteTags method and then confirm changed with the ValuesChangedAll event.
Declaration
public int[] SyncWriteTagsWithConfirmation(string[] Tags, object[] Values, int Timeout = 10000, double FloatDeadband = 0.0001)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | Tags | String array of Tags to write in the form <Tag Group>.<Tag>.<Property>. For example "Sine.Value". |
System.Object[] | Values | Object array of values to write |
System.Int32 | Timeout | Timeout in milliseconds |
System.Double | FloatDeadband | Deadband for write confirmation |
Returns
Type | Description |
---|---|
System.Int32[] | Integer array of error codes for each Tag. The Errors array will be set to 0 for success, 1 for service not reachable during write, 2 if the value returned was never equal to the desired value or within the deadband for Double and Single values within the timeout period. 3 if values array is not the same size as the Tags array. Nothing if Tags Array is nothing. |
SyncWriteTagsWithConfirmation(String[], Object[], Int32, Double, String, String)
Writes one or more Tag values synchronously using an OAS security credential and full confirmation. This is a blocking call and not as efficient as using the WriteTags method and then confirm changed with the ValuesChangedAll event.
Declaration
public int[] SyncWriteTagsWithConfirmation(string[] Tags, object[] Values, int Timeout, double FloatDeadband, string WriteUserName, string WritePassword)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | Tags | String array of Tags to write in the form <Tag Group>.<Tag>.<Property>. For example "Sine.Value". |
System.Object[] | Values | Object array of values to write |
System.Int32 | Timeout | Timeout in milliseconds |
System.Double | FloatDeadband | Deadband for write confirmation |
System.String | WriteUserName | Username for the OAS Credential |
System.String | WritePassword | Password for the OAS Credential |
Returns
Type | Description |
---|---|
System.Int32[] | Integer array of error codes for each Tag. The Errors array will be set to 0 for success, 1 for service not reachable during write, 2 if the value returned was never equal to the desired value or within the deadband for Double and Single values within the timeout period. 3 if values array is not the same size as the Tags array. Nothing if Tags Array is nothing. |
WriteOPCItems(String, String[], Object[], Int32)
This is a synchronous write to OPC Items on the OAS Service. This is a blocking call and should only be called one at a time.
Declaration
public int[] WriteOPCItems(string NetworkNode, string[] OPCItems, object[] WriteValues, int Timeout = 10000)
Parameters
Type | Name | Description |
---|---|---|
System.String | NetworkNode | Server or IP address of the OAS server - leave null for localhost |
System.String[] | OPCItems | String array of OPC Items to read |
System.Object[] | WriteValues | Object array of values to write |
System.Int32 | Timeout | Timeout in milliseconds - default of 10 seconds |
Returns
Type | Description |
---|---|
System.Int32[] | Integer array for each item writen, will be set to 0 for success, 1 for failure, 2 for timeout response, 3 for invalid array size |
WriteOPCItemsFromRemoteSCADAHost(String, String, String[], Object[], Int32)
This is a synchronous write to OPC Items on a registered LiveDataCloud node on the OAS Service. This is a blocking call and should only be called one at a time.
Declaration
public int[] WriteOPCItemsFromRemoteSCADAHost(string NetworkNode, string RemoteSCADAHostingName, string[] OPCItems, object[] WriteValues, int Timeout = 10000)
Parameters
Type | Name | Description |
---|---|---|
System.String | NetworkNode | Server or IP address of the OAS server - leave null for localhost |
System.String | RemoteSCADAHostingName | Name of the registered Live Data Cloud host |
System.String[] | OPCItems | String array of OPC Items to read |
System.Object[] | WriteValues | Object array of values to write |
System.Int32 | Timeout | Timeout in milliseconds - default of 10 seconds |
Returns
Type | Description |
---|---|
System.Int32[] | Integer array for each item writen, will be set to 0 for success, 1 for failure, 2 for timeout response, 3 for invalid array size |
WriteOPCItemsFromRemoteSCADAHostWithoutResults(String, String, String[], Object[])
This is an asynchronous write to OPC Items on a registered LiveDataCloud node on the OAS Service.
Declaration
public int[] WriteOPCItemsFromRemoteSCADAHostWithoutResults(string NetworkNode, string RemoteSCADAHostingName, string[] OPCItems, object[] WriteValues)
Parameters
Type | Name | Description |
---|---|---|
System.String | NetworkNode | Server or IP address of the OAS server - leave null for localhost |
System.String | RemoteSCADAHostingName | Name of the registered Live Data Cloud host |
System.String[] | OPCItems | String array of OPC Items to read |
System.Object[] | WriteValues | Object array of values to write |
Returns
Type | Description |
---|---|
System.Int32[] | This is a non-blocking call and does not return any status. |
WriteOPCItemsWithoutResults(String, String[], Object[])
This is an asynchronous write to OPC Items on OPC Servers. This is a non-blocking call and does not return any status.
Declaration
public void WriteOPCItemsWithoutResults(string NetworkNode, string[] OPCItems, object[] WriteValues)
Parameters
Type | Name | Description |
---|---|---|
System.String | NetworkNode | Server or IP address of the OAS server - leave null for localhost |
System.String[] | OPCItems | String array of OPC Items to read |
System.Object[] | WriteValues | Object array of values to write |
WriteTag(String, Object)
Asynchronously write a new Tag value.
Declaration
public void WriteTag(string Tag, object Value)
Parameters
Type | Name | Description |
---|---|---|
System.String | Tag | Tag to write in the form <Tag Group>.<Tag>.<Property>. For example "Sine.Value". |
System.Object | Value | Value to write |
WriteTag(String, Object, DateTime)
Asynchronously write a Tag value with a forced timestamp.
Declaration
public void WriteTag(string Tag, object Value, DateTime TimeStamp)
Parameters
Type | Name | Description |
---|---|---|
System.String | Tag | Tag to write in the form <Tag Group>.<Tag>.<Property>. For example "Sine.Value". |
System.Object | Value | Value to write |
System.DateTime | TimeStamp | Forced timestamp to write |
WriteTag(String, Object, DateTime, String, String)
Asynchronously write a Tag value with a forced timestamp and specific credentials.
Declaration
public void WriteTag(string Tag, object Value, DateTime TimeStamp, string WriteUserName, string WritePassword)
Parameters
Type | Name | Description |
---|---|---|
System.String | Tag | Tag to write in the form <Tag Group>.<Tag>.<Property>. For example "Sine.Value". |
System.Object | Value | Value to write |
System.DateTime | TimeStamp | Forced timestamp to write |
System.String | WriteUserName | Username for the OAS Credential |
System.String | WritePassword | Password for the OAS Credential |
WriteTag(String, Object, String, String)
Asynchronously write a new Tag value, using specific credentials.
Declaration
public void WriteTag(string Tag, object Value, string WriteUserName, string WritePassword)
Parameters
Type | Name | Description |
---|---|---|
System.String | Tag | Tag to write in the form <Tag Group>.<Tag>.<Property>. For example "Sine.Value". |
System.Object | Value | Value to write to write |
System.String | WriteUserName | Username for the OAS Credential |
System.String | WritePassword | Password for the OAS Credential |
WriteTags(String[], Object[])
Asynchrounously write one or more Tags.
Declaration
public void WriteTags(string[] Tags, object[] Values)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | Tags | String array of Tags to write in the form <Tag Group>.<Tag>.<Property>. For example "Sine.Value". |
System.Object[] | Values | Object array of values to write |
WriteTags(String[], Object[], DateTime[])
Asynchrounously write one or more Tags including timestamps.
Declaration
public void WriteTags(string[] Tags, object[] Values, DateTime[] TimeStamps)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | Tags | String array of Tags to write in the form <Tag Group>.<Tag>.<Property>. For example "Sine.Value". |
System.Object[] | Values | Object array of values to write |
System.DateTime[] | TimeStamps | DateTime array of timestamps to write |
WriteTags(String[], Object[], DateTime[], String, String)
Asynchrounously write one or more Tags including timestamps using specific credentials.
Declaration
public void WriteTags(string[] Tags, object[] Values, DateTime[] TimeStamps, string WriteUserName, string WritePassword)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | Tags | String array of Tags to write in the form <Tag Group>.<Tag>.<Property>. For example "Sine.Value". |
System.Object[] | Values | Object array of values to write |
System.DateTime[] | TimeStamps | DateTime array of timestamps to write |
System.String | WriteUserName | Username for the OAS Credential |
System.String | WritePassword | Password for the OAS Credential |
WriteTags(String[], Object[], String, String)
Asynchrounously write one or more Tags using a specific credential.
Declaration
public void WriteTags(string[] Tags, object[] Values, string WriteUserName, string WritePassword)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | Tags | String array of Tags to write in the form <Tag Group>.<Tag>.<Property>. For example "Sine.Value". |
System.Object[] | Values | Object array of values to write |
System.String | WriteUserName | Username for the OAS Credential |
System.String | WritePassword | Password for the OAS Credential |
WriteTagsWithResults(String[], Object[])
Declaration
public int[] WriteTagsWithResults(string[] Tags, object[] Values)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | Tags | |
System.Object[] | Values |
Returns
Type | Description |
---|---|
System.Int32[] |
WriteTagsWithResults(String[], Object[], DateTime[])
Declaration
public int[] WriteTagsWithResults(string[] Tags, object[] Values, DateTime[] TimeStamps)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | Tags | |
System.Object[] | Values | |
System.DateTime[] | TimeStamps |
Returns
Type | Description |
---|---|
System.Int32[] |
WriteTagsWithResults(String[], Object[], DateTime[], String, String)
Declaration
public int[] WriteTagsWithResults(string[] Tags, object[] Values, DateTime[] TimeStamps, string WriteUserName, string WritePassword)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | Tags | |
System.Object[] | Values | |
System.DateTime[] | TimeStamps | |
System.String | WriteUserName | |
System.String | WritePassword |
Returns
Type | Description |
---|---|
System.Int32[] |
WriteTagsWithResults(String[], Object[], String, String)
Declaration
public int[] WriteTagsWithResults(string[] Tags, object[] Values, string WriteUserName, string WritePassword)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | Tags | |
System.Object[] | Values | |
System.String | WriteUserName | |
System.String | WritePassword |
Returns
Type | Description |
---|---|
System.Int32[] |
Events
ValuesChangedAll
The ValuesChangedAll event fires whenever any watched OAS Tag has changed on the server. Use the Data.AddTag(s) and Data.RemoveTag(s) methods to add or remove Tags to be monitored for changes.
Declaration
public event Data.ValuesChangedAllEventHandler ValuesChangedAll
Event Type
Type | Description |
---|---|
Data.ValuesChangedAllEventHandler |