Tag Parameters and Properties
- The GetTag_Parameter_Strings Function returns an array of Strings containing all Parameter Types available for each Tag.
- Returns Empty String Array if service is not reachable.
- Returns a String Array of Parameter Types for all Tags.
- NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
string[] Parameters = null;
string networkNode = "";
Parameters = oasc.GetTag_Parameter_Strings(networkNode);
foreach (string Parameter in Parameters)
{
Console.WriteLine(Parameter);
}
if (Parameters.Length == 0)
{
Console.WriteLine("There are no parameters to list");
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Private Shared Sub Main(ByVal args As String())
Dim Parameters As String() = Nothing
Dim networkNode As String = ""
Parameters = oasc.GetTag_Parameter_Strings(networkNode)
For Each Parameter As String In Parameters
Console.WriteLine(Parameter)
Next
If Parameters.Length = 0 Then
Console.WriteLine("There are no parameters to list")
End If
End Sub
End Class
End Namespace
- The GetParameter_Property_Strings Function returns an array of Strings containing all property types available for each Parameter.
- Returns Empty String Array if service is not reachable.
- Returns a String Array of property types for all Parameters.
- NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
string[] Properties = null;
string networkNode = "";
Properties = oasc.GetParameter_Property_Strings(networkNode);
foreach (string PropertyType in Properties)
{
Console.WriteLine(PropertyType);
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Private Shared Sub Main(ByVal args As String())
Dim Properties As String() = Nothing
Dim networkNode As String = ""
Properties = oasc.GetParameter_Property_Strings(networkNode)
For Each PropertyType As String In Properties
Console.WriteLine(PropertyType)
Next
End Sub
End Class
End Namespace
- The GetTag_Parameter_Value Function returns an object value for the Tag.Parameter.Property specified.
- Returns nothing if service is not reachable.
- Parameter is a String of the Parameter Type desired of the Tag.
- PropertyType is a String of the Property Type desired of the Parameter.
- TagName is a String of the Tag desired.
- ReferenceGroup is a String of the Group(s) where the Tag is to be contained.
- NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
- Optional ErrorString will be set to Success when function is successful and an error message when in error.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
object ResultObject = null;
string ErrorString = null;
string parameter = "";
string property = "";
string tag = "";
string referenceGroup = "";
string networkNode = "";
string messOut = "";
ResultObject = oasc.GetTag_Parameter_Value(parameter, property, tag, referenceGroup, networkNode, ref ErrorString);
if (ErrorString == "Success")
{
if (ResultObject == null)
{
messOut = "OAS Service not reached or Tag, Parameter, or Property not found.";
}
else
{
try
{
Console.WriteLine(ResultObject);
}
catch
{
messOut = "Error converting value to string.";
}
}
}
else
{
messOut = ErrorString;
}
Console.WriteLine(messOut);
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim ResultObject As Object = Nothing
Dim ErrorString As String = Nothing
Dim parameter As String = ""
Dim [property] As String = ""
Dim tag As String = ""
Dim referenceGroup As String = ""
Dim networkNode As String = ""
Dim messOut As String = ""
ResultObject = oasc.GetTag_Parameter_Value(parameter, [property], tag, referenceGroup, networkNode, ErrorString)
If ErrorString = "Success" Then
If ResultObject Is Nothing Then
messOut = "OAS Service not reached or Tag, Parameter, or Property not found."
Else
Try
Console.WriteLine(ResultObject)
Catch
messOut = "Error converting value to string."
End Try
End If
Else
messOut = ErrorString
End If
Console.WriteLine(messOut)
End Sub
End Class
End Namespace
- The GetTag_Parameter_Values Function returns an array of object values for the Tag.Parameter specified.
- The order of the array corresponds with the GetParameter_Property_Strings Function order.
- Returns empty array if service is not reachable.
- Parameter is a String of the Parameter Type desired of the Tag.
- TagName is a String of the Tag desired.
- ReferenceGroup is a String of the Group(s) where the Tag is to be contained.
- NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
object[] ResultObjects = null;
string ResultString = null;
string parameter = "";
string tag = "";
string referenceGroup = "";
string networkNode = "";
ResultObjects = oasc.GetTag_Parameter_Values(parameter, tag, referenceGroup, networkNode);
foreach (object ResultObject in ResultObjects)
{
try
{
if (ResultObject == null)
{
ResultString = "";
}
else
{
ResultString = ResultObject.ToString();
}
Console.WriteLine(ResultString);
}
catch (Exception ex)
{
Console.WriteLine("Error Converting Object");
}
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim ResultObjects As Object() = Nothing
Dim ResultString As String = Nothing
Dim parameter As String = ""
Dim tag As String = ""
Dim referenceGroup As String = ""
Dim networkNode As String = ""
ResultObjects = oasc.GetTag_Parameter_Values(parameter, tag, referenceGroup, networkNode)
For Each ResultObject As Object In ResultObjects
Try
If ResultObject Is Nothing Then
ResultString = ""
Else
ResultString = ResultObject.ToString()
End If
Console.WriteLine(ResultString)
Catch ex As Exception
Console.WriteLine("Error Converting Object")
End Try
Next
End Sub
End Class
End Namespace
- The SetTag_Parameter_Value Function sets an object value for the Tag.Parameter.Property specified.
- Returns -1 if service is not reachable.
- Returns 1 if the function was successful.
- Parameter is a String of the Parameter Type desired of the Tag.
- PropertyType is a String of the Property Type desired of the Parameter.
- Value is the desired value to set.
- TagName is a String of the Tag desired.
- ReferenceGroup is a String of the Group(s) where the Tag is to be contained.
- NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
- Optional ErrorString will be set to Success when function is successful and an error message when in error.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
Int32 ResultInt32 = 0;
string ErrorString = "";
string parameter = "";
string property = "";
string valueToSet = "";
string tag = "";
string referenceGroup = "";
string networkNode = "";
ResultInt32 = oasc.SetTag_Parameter_Value(parameter, property, valueToSet, tag, referenceGroup, networkNode, ref ErrorString);
if (ResultInt32 == -1)
{
Console.WriteLine("OAS Service not reached.");
}
else if (ResultInt32 == 1)
{
Console.WriteLine("Parameter Property Successfully Updated.");
}
else
{
Console.WriteLine(ErrorString);
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim ResultInt32 As Int32 = 0
Dim ErrorString As String = ""
Dim parameter As String = ""
Dim [property] As String = ""
Dim valueToSet As String = ""
Dim tag As String = ""
Dim referenceGroup As String = ""
Dim networkNode As String = ""
ResultInt32 = oasc.SetTag_Parameter_Value(parameter, [property], valueToSet, tag, referenceGroup, networkNode, ErrorString)
If ResultInt32 = -1 Then
Console.WriteLine("OAS Service not reached.")
ElseIf ResultInt32 = 1 Then
Console.WriteLine("Parameter Property Successfully Updated.")
Else
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
- The SaveTagConfiguration Subroutine saves the current Tag configuration to the specified file path.
- NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
- Optional ErrorString will be set to Success when function is successful and an error message when in error.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
string ErrorString = "";
string path = @"";
string networkNode = "";
oasc.SaveTagConfiguration(path, networkNode, ref ErrorString);
if (ErrorString != "Success")
{
Console.WriteLine(ErrorString);
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim ErrorString As String = ""
Dim path As String = ""
Dim networkNode As String = ""
oasc.SaveTagConfiguration(path, networkNode, ErrorString)
If ErrorString <> "Success" Then
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
- The LoadTagConfiguration Subroutine saves the current Tag configuration to the specified file path.
- NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
- Optional ErrorString will be set to Success when function is successful and an error message when in error.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
string ErrorString = "";
string networkNode = "";
string path = @"";
if (oasc.InRuntime(networkNode) == 1)
{
Console.WriteLine("Cannot Load Tag configuraitons while in Runtime Mode");
return;
}
oasc.LoadTagConfiguration(path, networkNode, ref ErrorString);
if (ErrorString != "Success")
{
Console.WriteLine(ErrorString);
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim ErrorString As String = ""
Dim networkNode As String = ""
Dim path As String = ""
If oasc.InRuntime(networkNode) = 1 Then
Console.WriteLine("Cannot Load Tag configuraitons while in Runtime Mode")
Return
End If
oasc.LoadTagConfiguration(path, networkNode, ErrorString)
If ErrorString <> "Success" Then
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
- The CheckTagAccessRead Function returns a list of Tags that have read access from the UserName and Password specified.
- This method requires Security access for Get Secuirty Parameters from the user and password specified in the LogIn method of the component.
- Returns Empty String Array if service is not reachable.
- Returns a String Array of Tags that are allowed for Read Access.
- UserName is the user to verify with the Tags.
- Password is the password of the user to verify with the Tags.
- Tags is a list of tags to check in the service, do not include the remote network path in the tag names.
- NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
- Optional ErrorString will be set to Success when function is successful and an error message when in error.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
string ErrorString = "";
string networkNode = "";
string userName = "";
string passWord = "";
string[] TagNames = null;
string[] TagsToCheck = new string[3];
TagsToCheck[0] = "Ramp.Value";
TagsToCheck[1] = "Sine.Value";
TagsToCheck[2] = "Random.Value";
TagNames = oasc.CheckTagAccessRead(userName, passWord, TagsToCheck, networkNode, ref ErrorString);
if (ErrorString == "Success")
{
foreach (string TagName in TagNames)
{
Console.WriteLine(TagName);
}
if (TagNames.Length == 0)
{
Console.WriteLine("None of the tags that you have selected have read access");
}
}
else
{
Console.WriteLine(ErrorString);
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim ErrorString As String = ""
Dim networkNode As String = ""
Dim userName As String = ""
Dim passWord As String = ""
Dim TagNames As String() = Nothing
Dim TagsToCheck As String() = New String(2) {}
TagsToCheck(0) = "Ramp.Value"
TagsToCheck(1) = "Sine.Value"
TagsToCheck(2) = "Random.Value"
TagNames = oasc.CheckTagAccessRead(userName, passWord, TagsToCheck, networkNode, ErrorString)
If ErrorString = "Success" Then
For Each TagName As String In TagNames
Console.WriteLine(TagName)
Next
If TagNames.Length = 0 Then
Console.WriteLine("None of the tags that you have selected have read access.")
End If
Else
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
- The CheckTagAccessWrite Function returns a list of Tags that have write access from the UserName and Password specified.
- This method requires Security access for Get Secuirty Parameters from the user and password specified in the LogIn method of the component.
- Returns Empty String Array if service is not reachable.
- Returns a String Array of Tags that are allowed for Write Access.
- UserName is the user to verify with the Tags.
- Password is the password of the user to verify with the Tags.
- Tags is a list of tags to check in the service, do not include the remote network path in the tag names.
- NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
- Optional ErrorString will be set to Success when function is successful and an error message when in error.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
string ErrorString = "";
string networkNode = "";
string userName = "";
string passWord = "";
string[] TagNames = null;
string[] TagsToCheck = new string[3];
TagsToCheck[0] = "Ramp.Value";
TagsToCheck[1] = "Sine.Value";
TagsToCheck[2] = "Pump.Value";
TagNames = oasc.CheckTagAccessWrite(userName, passWord, TagsToCheck, networkNode, ref ErrorString);
if (ErrorString == "Success")
{
foreach (string TagName in TagNames)
{
Console.WriteLine(TagName);
}
if (TagNames.Length == 0)
{
Console.WriteLine("None of the tags that you have selected have write access.");
}
}
else
{
Console.WriteLine(ErrorString);
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim ErrorString As String = ""
Dim networkNode As String = ""
Dim userName As String = ""
Dim passWord As String = ""
Dim TagNames As String() = Nothing
Dim TagsToCheck As String() = New String(2) {}
TagsToCheck(0) = "Ramp.Value"
TagsToCheck(1) = "Sine.Value"
TagsToCheck(2) = "Pump.Value"
TagNames = oasc.CheckTagAccessWrite(userName, passWord, TagsToCheck, networkNode, ErrorString)
If ErrorString = "Success" Then
For Each TagName As String In TagNames
Console.WriteLine(TagName)
Next
If TagNames.Length = 0 Then
Console.WriteLine("None of the tags that you have selected have write access.")
End If
Else
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace