Data Logging Groups
- The GetDataLoggingNames Function returns a list of the Data Logging Groups.
- Returns Empty String Array if service is not reachable.
- 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 NetworkNode = "";
string ErrorString = "";
string[] Groups;
Groups = oasc.GetDataLoggingNames(NetworkNode, ref ErrorString);
if (ErrorString == "Success")
{
foreach (var Group in Groups)
Console.WriteLine(Group);
}
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 NetworkNode As String = ""
Dim ErrorString As String = ""
Dim Groups As String()
Groups = oasc.GetDataLoggingNames(NetworkNode, ErrorString)
If ErrorString = "Success" Then
For Each Group In Groups
Console.WriteLine(Group)
Next
Else
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
- The AddDataLoggingGroup Function adds a Data Logging Group to the existing Data Logging configuration.
- Returns -1 if service is not reachable.
- Returns 1 if successful.
- Returns 0 if the Group already exists or adding the Group failed.
- Group is the name of the Group to add.
- 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 NetworkNode = "";
string ErrorString = "";
Int32 ResultInt32;
string newGroup = "";
ResultInt32 = oasc.AddDataLoggingGroup(newGroup, NetworkNode, ref ErrorString);
if (ResultInt32 == -1)
Console.WriteLine("OAS Service not reached.");
else if (ResultInt32 == 1)
Console.WriteLine("Group successfully added.");
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 NetworkNode As String = ""
Dim ErrorString As String = ""
Dim ResultInt32 As Int32
Dim newGroup As String = ""
ResultInt32 = oasc.AddDataLoggingGroup(newGroup, NetworkNode, ErrorString)
If ResultInt32 = -1 Then
Console.WriteLine("OAS Service not reached.")
ElseIf ResultInt32 = 1 Then
Console.WriteLine("Group successfully added.")
Else
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
- The RemoveDataLoggingGroup Function removes a Data Logging Group from the existing Data Logging configuration.
- Returns -1 if service is not reachable.
- Returns 1 if successful.
- Returns 0 if the Group does not exist or removing the Group failed.
- Group is the name of the Group to remove.
- 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 NetworkNode = "";
string ErrorString = "";
Int32 ResultInt32;
string group = "";
ResultInt32 = oasc.RemoveDataLoggingGroup(group, NetworkNode, ref ErrorString);
if (ResultInt32 == -1)
Console.WriteLine("OAS Service not reached.");
else if (ResultInt32 == 1)
Console.WriteLine("Group successfully removed.");
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 NetworkNode As String = ""
Dim ErrorString As String = ""
Dim ResultInt32 As Int32
Dim group As String = ""
ResultInt32 = oasc.RemoveDataLoggingGroup(group, NetworkNode, ErrorString)
If ResultInt32 = -1 Then
Console.WriteLine("OAS Service not reached.")
ElseIf ResultInt32 = 1 Then
Console.WriteLine("Group successfully removed.")
Else
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
- The GetDataLoggingParameterStrings Function returns an array of Strings containing all property types available for each Data Logging Group.
- Returns Empty String Array if service is not reachable.
- Returns a String Array of property types for all possible Parameters for a Data Logging Group.
- 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 NetworkNode = "";
string[] Parameters;
Parameters = oasc.GetDataLoggingParameterStrings(NetworkNode);
foreach (var Parameter in Parameters)
{
Console.WriteLine(Parameter);
}
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim NetworkNode As String = ""
Dim Parameters As String()
Parameters = oasc.GetDataLoggingParameterStrings(NetworkNode)
For Each Parameter In Parameters
Console.WriteLine(Parameter)
Next
End Sub
End Class
End Namespace
- The GetDataLogging_Parameter_Value Function returns an object value for the Data Logging Group and Parameter specified.
- Returns nothing if service is not reachable.
- Parameter is a String of the Parameter Type desired of the Data Logging Group.
- Group is a String of the Data Logging Group desired.
- 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;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualBasic;
namespace OASDataSample
{
class Program
{
private static OASConfig.Config oasc = new OASConfig.Config();
public static void Main(string[] args)
{
string NetworkNode = "";
object ResultObject;
string ErrorString = "";
string parameter = "";
string group = "";
ResultObject = oasc.GetDataLogging_Parameter_Value(parameter, group, NetworkNode, ref ErrorString);
if (ErrorString == "Success")
{
try
{
if (parameter == "DBFields")
{
try
{
object[] DBFieldsArray;
DBFieldsArray = (object[])ResultObject;
Int32 Version;
Int32 NumberOfFields;
string[] FieldNames;
Array[] TagNames; // Array of Strings
string[] NewTags = new string[0];
string[] DataTypes;
Int32[] TextLengths;
Int32 Index;
Int32 BaseIndex;
Int32 TagIndex;
Version = (Int32)DBFieldsArray[0]; // 2 is the current version to use.
NumberOfFields = (Int32)DBFieldsArray[1];
if (Version >= 1)
{
FieldNames = new string[NumberOfFields];
TagNames = new Array[NumberOfFields];
DataTypes = new string[NumberOfFields];
TextLengths = new int[NumberOfFields];
BaseIndex = 2;
for (Index = 0; Index <= NumberOfFields - 1; Index++)
{
FieldNames[Index] = (string)DBFieldsArray[BaseIndex];
BaseIndex += 1;
}
if (Version >= 2)
{
for (Index = 0; Index <= NumberOfFields - 1; Index++)
{
TagNames[Index] = (Array)DBFieldsArray[BaseIndex];
BaseIndex += 1;
}
}
else
{
NewTags = new string[1];
for (Index = 0; Index <= NumberOfFields - 1; Index++)
{
NewTags[0] = (string)DBFieldsArray[BaseIndex];
BaseIndex += 1;
TagNames[Index] = NewTags;
}
}
for (Index = 0; Index <= NumberOfFields - 1; Index++)
{
switch (DBFieldsArray[BaseIndex].ToString())
{
case "Boolean":
{
DataTypes[Index] = "Boolean";
break;
}
case "Double":
{
DataTypes[Index] = "Double";
break;
}
case "Integer":
{
DataTypes[Index] = "Integer";
break;
}
case "String":
{
DataTypes[Index] = "String";
break;
}
case "Date/Time":
{
DataTypes[Index] = "Date/Time";
break;
}
}
BaseIndex += 1;
}
for (Index = 0; Index <= NumberOfFields - 1; Index++)
{
TextLengths[Index] = (Int32)DBFieldsArray[BaseIndex];
BaseIndex += 1;
}
string ResultString;
ResultString = "Version: " + Version.ToString();
ResultString += " Number Of Fields: " + NumberOfFields.ToString();
if (NumberOfFields > 0)
{
for (Index = 0; Index <= NumberOfFields - 1; Index++)
{
ResultString += " Field" + Index.ToString() + ": " + FieldNames[Index];
NewTags = (string[])TagNames[Index];
for (TagIndex = 0; TagIndex <= NewTags.GetLength(0) - 1; TagIndex++)
ResultString += " Tag" + TagIndex.ToString() + ": " + NewTags[TagIndex];
ResultString += " DataType" + Index.ToString() + ": " + DataTypes[Index];
ResultString += " Text Length" + Index.ToString() + ": " + TextLengths[Index].ToString();
}
}
Console.WriteLine(ResultString);
Console.WriteLine(ResultString);
}
}
catch (Exception ex)
{
Console.WriteLine("Error converting value to string.");
}
}
else if (parameter == "DataChangeTagsWithAlias")
{
try
{
string[] TagsAndAliases;
TagsAndAliases = (string[])ResultObject;
string ResultString = "";
if (!(TagsAndAliases == null))
{
Int32 NumberOfTags;
NumberOfTags = TagsAndAliases.GetLength(0) /2;
Int32 Index;
for (Index = 0; Index <= NumberOfTags - 1; Index++)
ResultString += "Tag: " + TagsAndAliases[Index * 2] + " Alias: " + TagsAndAliases[Index * 2 + 1] + " - ";
Console.WriteLine(ResultString);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message.ToString());
}
}
else
Console.WriteLine(ResultObject);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message.ToString());
}
}
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 NetworkNode As String = ""
Dim ResultObject As Object
Dim ErrorString As String = ""
Dim parameter As String = ""
Dim group As String = ""
ResultObject = oasc.GetDataLogging_Parameter_Value(parameter, group, NetworkNode, ErrorString)
If ErrorString = "Success" Then
Try
If parameter = "DBFields" Then
Try
Dim DBFieldsArray() As Object
DBFieldsArray = ResultObject
Dim Version As Int32
Dim NumberOfFields As Int32
Dim FieldNames() As String
Dim TagNames() As Array ' Array of Strings
Dim NewTags(-1) As String
Dim DataTypes() As String
Dim TextLengths() As Int32
Dim Index As Int32
Dim BaseIndex As Int32
Dim TagIndex As Int32
Version = DBFieldsArray(0) ' 2 is the current version to use.
NumberOfFields = DBFieldsArray(1)
If Version >= 1 Then
If Version >= 2 Then ' Current version of DBFields type
End If
ReDim FieldNames(NumberOfFields - 1)
ReDim TagNames(NumberOfFields - 1)
ReDim DataTypes(NumberOfFields - 1)
ReDim TextLengths(NumberOfFields - 1)
BaseIndex = 2
For Index = 0 To NumberOfFields - 1
FieldNames(Index) = DBFieldsArray(BaseIndex)
BaseIndex += 1
Next
If Version >= 2 Then
For Index = 0 To NumberOfFields - 1
TagNames(Index) = DBFieldsArray(BaseIndex)
BaseIndex += 1
Next
Else
ReDim NewTags(0)
For Index = 0 To NumberOfFields - 1
NewTags(0) = DBFieldsArray(BaseIndex)
BaseIndex += 1
TagNames(Index) = NewTags
Next
End If
For Index = 0 To NumberOfFields - 1
Select Case DBFieldsArray(BaseIndex).ToString
Case "Boolean"
DataTypes(Index) = "Boolean"
Case "Double"
DataTypes(Index) = "Double"
Case "Integer"
DataTypes(Index) = "Integer"
Case "String"
DataTypes(Index) = "String"
Case "Date/Time"
DataTypes(Index) = "Date/Time"
End Select
BaseIndex += 1
Next
For Index = 0 To NumberOfFields - 1
TextLengths(Index) = DBFieldsArray(BaseIndex)
BaseIndex += 1
Next
Dim ResultString As String
ResultString = "Version: " + Version.ToString
ResultString += " Number Of Fields: " + NumberOfFields.ToString
If NumberOfFields > 0 Then
For Index = 0 To NumberOfFields - 1
ResultString += " Field" + Index.ToString + ": " + FieldNames(Index)
NewTags = TagNames(Index)
For TagIndex = 0 To NewTags.GetLength(0) - 1
ResultString += " Tag" + TagIndex.ToString + ": " + NewTags(TagIndex)
Next
ResultString += " DataType" + Index.ToString + ": " + DataTypes(Index)
ResultString += " Text Length" + Index.ToString + ": " + TextLengths(Index).ToString
Next
End If
Console.WriteLine(ResultString)
Console.WriteLine(ResultString)
End If
Catch ex As Exception
Console.WriteLine("Error converting value to string.")
End Try
ElseIf parameter = "DataChangeTagsWithAlias" Then
Try
Dim TagsAndAliases() As String
TagsAndAliases = ResultObject
Dim ResultString As String = ""
If Not (TagsAndAliases Is Nothing) Then
Dim NumberOfTags As Int32
NumberOfTags = TagsAndAliases.GetLength(0) / 2
Dim Index As Int32
For Index = 0 To NumberOfTags - 1
ResultString += "Tag: " + TagsAndAliases(Index * 2) + " Alias: " + TagsAndAliases(Index * 2 + 1) + " - "
Next
Console.WriteLine(ResultString)
End If
Catch ex As Exception
Console.WriteLine("Error converting value to string.")
End Try
Else
Console.WriteLine(ResultObject)
End If
Catch ex As Exception
Console.WriteLine("Error converting value to string.")
End Try
Else
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
- The GetDataLogging_Parameter_Values Function returns an array of object values for the Data Logging Group specified.
- The order of the array corresponds with the GetDataLoggingParameterStrings Function order.
- Returns empty array if service is not reachable.
- Group is a String of the Data Logging Group desired.
- 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;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualBasic;
namespace OASDataSample
{
class Program
{
private static OASConfig.Config oasc = new OASConfig.Config();
public static void Main(string[] args)
{
object[] ResultObjects;
string ResultString = "";
Int32 ParameterIndex = 0;
string ErrorString = "";
string NetworkNode = "";
string group = "MyGroup";
ResultObjects = oasc.GetDataLogging_Parameter_Values(group, NetworkNode, ref ErrorString);
if (ErrorString == "Success")
{
foreach (var ResultObject in ResultObjects)
{
try
{
if (ResultObject == null)
ResultString = "";
else if (ParameterIndex == 2)
{
try
{
object[] DBFieldsArray;
DBFieldsArray = (object[])ResultObject;
Int32 Version;
Int32 NumberOfFields;
string[] FieldNames;
Array[] TagNames; // Array of Strings
string[] NewTags = new string[0];
string[] DataTypes;
Int32[] TextLengths;
Int32 Index;
Int32 BaseIndex;
Int32 TagIndex;
Version = (Int32)DBFieldsArray[0]; // 2 is the current version to use.
NumberOfFields = (Int32)DBFieldsArray[1];
if (Version >= 1)
{
FieldNames = new string[NumberOfFields];
TagNames = new Array[NumberOfFields];
DataTypes = new string[NumberOfFields];
TextLengths = new int[NumberOfFields];
BaseIndex = 2;
for (Index = 0; Index <= NumberOfFields - 1; Index++)
{
FieldNames[Index] = (string)DBFieldsArray[BaseIndex];
BaseIndex += 1;
}
if (Version >= 2)
{
for (Index = 0; Index <= NumberOfFields - 1; Index++)
{
TagNames[Index] = (Array)DBFieldsArray[BaseIndex];
BaseIndex += 1;
}
}
else
{
NewTags = new string[1];
for (Index = 0; Index <= NumberOfFields - 1; Index++)
{
NewTags[0] = (string)DBFieldsArray[BaseIndex];
BaseIndex += 1;
TagNames[Index] = NewTags;
}
}
for (Index = 0; Index <= NumberOfFields - 1; Index++)
{
switch (DBFieldsArray[BaseIndex].ToString())
{
case "Boolean":
{
DataTypes[Index] = "Boolean";
break;
}
case "Double":
{
DataTypes[Index] = "Double";
break;
}
case "Integer":
{
DataTypes[Index] = "Integer";
break;
}
case "String":
{
DataTypes[Index] = "String";
break;
}
case "Date/Time":
{
DataTypes[Index] = "Date/Time";
break;
}
}
BaseIndex += 1;
}
for (Index = 0; Index <= NumberOfFields - 1; Index++)
{
TextLengths[Index] = (Int32)DBFieldsArray[BaseIndex];
BaseIndex += 1;
}
ResultString = "Version: " + Version.ToString();
ResultString += " Number Of Fields: " + NumberOfFields.ToString();
if (NumberOfFields > 0)
{
for (Index = 0; Index <= NumberOfFields - 1; Index++)
{
ResultString += " Field" + Index.ToString() + ": " + FieldNames[Index];
NewTags = (string[])TagNames[Index];
for (TagIndex = 0; TagIndex <= NewTags.GetLength(0) - 1; TagIndex++)
ResultString += " Tag" + TagIndex.ToString() + ": " + NewTags[TagIndex];
ResultString += " DataType" + Index.ToString() + ": " + DataTypes[Index];
ResultString += " Text Length" + Index.ToString() + ": " + TextLengths[Index].ToString();
}
}
}
}
catch (Exception ex)
{
ResultString = ex.Message.ToString();
}
}
else
ResultString = ResultObject.ToString();
Console.WriteLine(ResultString);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message.ToString());
}
ParameterIndex += 1;
}
}
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 ResultObjects() As Object
Dim ResultObject As Object
Dim ResultString As String = ""
Dim ParameterIndex As Int32 = 0
Dim ErrorString As String = ""
Dim NetworkNode As String = ""
Dim group As String = "MyGroup"
ResultObjects = oasc.GetDataLogging_Parameter_Values(group, NetworkNode, ErrorString)
If ErrorString = "Success" Then
For Each ResultObject In ResultObjects
Try
If ResultObject Is Nothing Then
ResultString = ""
Else
If ParameterIndex = 2 Then ' DBFields type
Try
Dim DBFieldsArray() As Object
DBFieldsArray = ResultObject
Dim Version As Int32
Dim NumberOfFields As Int32
Dim FieldNames() As String
Dim TagNames() As Array ' Array of Strings
Dim NewTags(-1) As String
Dim DataTypes() As String
Dim TextLengths() As Int32
Dim Index As Int32
Dim BaseIndex As Int32
Dim TagIndex As Int32
Version = DBFieldsArray(0) ' 2 is the current version to use.
NumberOfFields = DBFieldsArray(1)
If Version >= 1 Then
If Version >= 2 Then ' Current version of DBFields type
End If
ReDim FieldNames(NumberOfFields - 1)
ReDim TagNames(NumberOfFields - 1)
ReDim DataTypes(NumberOfFields - 1)
ReDim TextLengths(NumberOfFields - 1)
BaseIndex = 2
For Index = 0 To NumberOfFields - 1
FieldNames(Index) = DBFieldsArray(BaseIndex)
BaseIndex += 1
Next
If Version >= 2 Then
For Index = 0 To NumberOfFields - 1
TagNames(Index) = DBFieldsArray(BaseIndex)
BaseIndex += 1
Next
Else
ReDim NewTags(0)
For Index = 0 To NumberOfFields - 1
NewTags(0) = DBFieldsArray(BaseIndex)
BaseIndex += 1
TagNames(Index) = NewTags
Next
End If
For Index = 0 To NumberOfFields - 1
Select Case DBFieldsArray(BaseIndex).ToString
Case "Boolean"
DataTypes(Index) = "Boolean"
Case "Double"
DataTypes(Index) = "Double"
Case "Integer"
DataTypes(Index) = "Integer"
Case "String"
DataTypes(Index) = "String"
Case "Date/Time"
DataTypes(Index) = "Date/Time"
End Select
BaseIndex += 1
Next
For Index = 0 To NumberOfFields - 1
TextLengths(Index) = DBFieldsArray(BaseIndex)
BaseIndex += 1
Next
ResultString = "Version: " + Version.ToString
ResultString += " Number Of Fields: " + NumberOfFields.ToString
If NumberOfFields > 0 Then
For Index = 0 To NumberOfFields - 1
ResultString += " Field" + Index.ToString + ": " + FieldNames(Index)
NewTags = TagNames(Index)
For TagIndex = 0 To NewTags.GetLength(0) - 1
ResultString += " Tag" + TagIndex.ToString + ": " + NewTags(TagIndex)
Next
ResultString += " DataType" + Index.ToString + ": " + DataTypes(Index)
ResultString += " Text Length" + Index.ToString + ": " + TextLengths(Index).ToString
Next
End If
End If
Catch ex As Exception
ResultString = "Error converting value to string."
End Try
Else
ResultString = ResultObject
End If
End If
Console.WriteLine(ResultString)
Catch ex As Exception
Console.WriteLine(ex.Message.ToString())
End Try
ParameterIndex += 1
Next
Else
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
- The SeDataLogging_Parameter_Value Function sets an object value for the Data Logging Group and Parameter specified.
- Returns -1 if service is not reachable.
- Returns 0 if the Group does not exist or the value did not get set correctly.
- Returns 1 if the function was successful.
- Parameter is a String of the Parameter Type desired of the Data Logging Group.
- Value is the desired value to set.
- Group is a String of the Data Logging Group desired.
- 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 networkNode = "";
Int32 ResultInt32 = 0;
string ErrorString = "";
string parameterName = "";
object valueToSet = "";
string group = "";
ResultInt32 = oasc.SetDataLogging_Parameter_Value(parameterName, valueToSet, group, networkNode, ref ErrorString);
if (ResultInt32 == -1)
{
Console.WriteLine("OAS Service not reached.");
}
else if (ResultInt32 == 1)
{
Console.WriteLine("Parameter 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 networkNode As String = ""
Dim ResultInt32 As Int32 = 0
Dim ErrorString As String = ""
Dim parameterName As String = ""
Dim valueToSet As Object = ""
Dim group As String = ""
ResultInt32 = oasc.SetDataLogging_Parameter_Value(parameterName, valueToSet, group, networkNode, ErrorString)
If ResultInt32 = -1 Then
Console.WriteLine("OAS Service not reached.")
ElseIf ResultInt32 = 1 Then
Console.WriteLine("Parameter Successfully Updated.")
Else
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
- The SaveDataLoggingConfiguration Subroutine saves the current Data Logging 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 NetworkNode = "";
string ErrorString = "";
string path = "";
oasc.SaveDataLoggingConfiguration(path, NetworkNode, ref ErrorString);
if (ErrorString != "Success")
Console.WriteLine(ErrorString);
else
Console.WriteLine("Path Saved");
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim NetworkNode As String = ""
Dim ErrorString As String = ""
Dim path As String = ""
oasc.SaveDataLoggingConfiguration(path, NetworkNode, ErrorString)
If ErrorString <> "Success" Then
Console.WriteLine(ErrorString)
Else
Console.WriteLine("Path Saved")
End If
End Sub
End Class
End Namespace
- The LoadDataLoggingConfiguration Subroutine saves the current Data Logging 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 NetworkNode = "";
string ErrorString = "";
string file = "";
oasc.LoadDataLoggingConfiguration(file, NetworkNode, ref ErrorString);
if (ErrorString != "Success")
Console.WriteLine(ErrorString);
else
Console.WriteLine("File Loaded");
}
}
}
VB
Imports System
Namespace OASDataSample
Class Program
Shared oasc As OASConfig.Config = New OASConfig.Config()
Public Shared Sub Main(ByVal args As String())
Dim NetworkNode As String = ""
Dim ErrorString As String = ""
Dim file As String = ""
oasc.LoadDataLoggingConfiguration(file, NetworkNode, ErrorString)
If ErrorString <> "Success" Then
Console.WriteLine(ErrorString)
Else
Console.WriteLine("File Loaded")
End If
End Sub
End Class
End Namespace
- The AddDataLoggingField Function adds just one field to an existing Data Logging Group specified that is a wide table format.
- Returns -1 if service is not reachable.
- Returns 0 if the Group does not exist or the value did not get set correctly.
- Returns 1 if the function was successful.
- FieldName is the field name to add to the logging group.
- TagName is the tag name to assign to the field.
- DataType is a string of the field data type.
- StringLength is the length of the string field if the data type is a string.
- Group is a String of the Data Logging Group desired.
- NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
- ErrorString will be set to Success when function is successful and an error message when in error.
- RemoteSCADAHostingName is the name of the Live Data Cloud OAS Service to connect to.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
string NetworkNode = "";
string ErrorString = "";
string tag = "";
string group = "";
string field = "";
string datatype = "";
Int32 length = 0;
Int32 ResultInt32;
ResultInt32 = oasc.AddDataLoggingField(field, tag, datatype, length, group, NetworkNode, ref ErrorString);
if (ResultInt32 == -1)
Console.WriteLine("OAS Service not reached.");
else if (ResultInt32 == 1)
Console.WriteLine("Parameter Successfully Added.");
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 NetworkNode As String = ""
Dim ErrorString As String = ""
Dim tag As String = ""
Dim group As String = ""
Dim field As String = ""
Dim datatype As String = ""
Dim length As Int32 = 0
Dim ResultInt32 As Int32
ResultInt32 = oasc.AddDataLoggingField(field, tag, datatype, length, group, NetworkNode, ErrorString)
If ResultInt32 = -1 Then
Console.WriteLine("OAS Service not reached.")
ElseIf ResultInt32 = 1 Then
Console.WriteLine("Parameter Successfully Added.")
Else
Console.WriteLine(ErrorString)
End If
End Sub
End Class
End Namespace
- Adds fields to log to an exisitng data logging group.
- First parameter is a string array of field names, second parameter is a string array of tag names, third parameter is a string array of data types, fourth parameter is an integer array of string lengths, fifth parameter is the name of the data logging group.
- Returns an integer value.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
{
string errorString = "";
string networknode = "localhost";
string[] FieldNames = new string[2];
FieldNames[0] = "Field01";
FieldNames[1] = "Field02";
string[] TagNames = new string[2];
TagNames[0] = "Ramp.Value";
TagNames[1] = "Sine.Value";
string[] DataTypes = new string[2];
DataTypes[0] = "Double";
DataTypes[1] = "Double";
Int32[] StringLengths = new Int32[2];
StringLengths[0] = 100;
StringLengths[1] = 100;
Int32 resultInt = oasc.AddDataLoggingFields(FieldNames, TagNames, DataTypes, StringLengths, "TestGroup", networknode, ref errorString);
if (resultInt == 1)
{
Console.WriteLine("Success");
}
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())
If True Then
Dim errorString As String = ""
Dim networknode As String = "localhost"
Dim FieldNames As String() = New String(1) {}
FieldNames(0) = "Field01"
FieldNames(1) = "Field02"
Dim TagNames As String() = New String(1) {}
TagNames(0) = "Ramp.Value"
TagNames(1) = "Sine.Value"
Dim DataTypes As String() = New String(1) {}
DataTypes(0) = "Double"
DataTypes(1) = "Double"
Dim StringLengths As Int32() = New Int32(1) {}
StringLengths(0) = 100
StringLengths(1) = 100
Dim resultInt As Int32 = oasc.AddDataLoggingFields(FieldNames, TagNames, DataTypes, StringLengths, "TestGroup", networknode, errorString)
If resultInt = 1 Then
Console.WriteLine("Success")
Else
Console.WriteLine(errorString)
End If
End If
End Sub
End Class
End Namespace
- Adds a tag alias for for data logging group.
- First parameter is the tag name, second parameter is the alias, third parameter is the data logging group.
- Returns an integer value.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
{
string errorString = "";
string networknode = "localhost";
Int32 resultInt = oasc.AddDataLoggingTagAlias("Ramp.Value", "Ramp", "TestGroup", networknode, ref errorString);
if (resultInt == 1)
{
Console.WriteLine("Success");
}
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())
If True Then
Dim errorString As String = ""
Dim networknode As String = "localhost"
Dim resultInt As Int32 = oasc.AddDataLoggingTagAlias("Ramp.Value", "Ramp", "TestGroup", networknode, errorString)
If resultInt = 1 Then
Console.WriteLine("Success")
Else
Console.WriteLine(errorString)
End If
End If
End Sub
End Class
End Namespace
- Adds tag aliases for for data logging group.
- First parameter is a string array of tag names, second parameter a string array of the aliases, third parameter is the data logging group.
- Returns an integer value.
C#
using System;
namespace OASDataSample
{
class Program
{
static OASConfig.Config oasc = new OASConfig.Config();
static void Main(string[] args)
{
{
string errorString = "";
string networknode = "localhost";
string[] Tag_Names = new string[2];
Tag_Names[0] = "Ramp.Value";
Tag_Names[1] = "Sine.Value";
string[] TagAliases = new string[2];
TagAliases[0] = "Ramp";
TagAliases[1] = "Sine";
Int32 resultInt = oasc.AddDataLoggingTagAliases(Tag_Names, TagAliases, "TestGroup", networknode, ref errorString);
if (resultInt == 1)
{
Console.WriteLine("Success");
}
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())
If True Then
Dim errorString As String = ""
Dim networknode As String = "localhost"
Dim Tag_Names As String() = New String(1) {}
Tag_Names(0) = "Ramp.Value"
Tag_Names(1) = "Sine.Value"
Dim TagAliases As String() = New String(1) {}
TagAliases(0) = "Ramp"
TagAliases(1) = "Sine"
Dim resultInt As Int32 = oasc.AddDataLoggingTagAliases(Tag_Names, TagAliases, "TestGroup", networknode, errorString)
If resultInt = 1 Then
Console.WriteLine("Success")
Else
Console.WriteLine(errorString)
End If
End If
End Sub
End Class
End Namespace