Loading API Index...
Open Automation Software API Documentation
Show / Hide Table of Contents

Tag Groups

GetGroupNames

  • The GetGroupNames Function returns a list of Groups in the specified ReferenceGroup path.
  • Returns Empty String Array if service is not reachable.
  • Returns a String Array of Groups in the ReferenceGroup.
  • ReferenceGroup is a string of the Group path to retrieve the Groups from.
  • 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 = "localhost";
            string referenceGroup = "Tanks";
            string[] GroupNames = null;
            GroupNames = oasc.GetGroupNames(referenceGroup, networkNode, ref ErrorString);
            if (ErrorString == "Success")
            {
                foreach (string GroupName in GroupNames)
                {
                    Console.WriteLine(GroupName);
                }
                if (GroupNames.Length == 0)
                {
                    Console.WriteLine("No Groups to Show.");
                }
            }
            else
            {
                Console.WriteLine(ErrorString);
            }
        }

    }

}
VB
Imports System

Namespace OASDataSample
    Class Program
        Shared oasc As OASConfig.Config = New OASConfig.Config()

        Private Shared Sub Main(ByVal args As String())
            Dim ErrorString As String = ""
            Dim networkNode As String = "localhost"
            Dim referenceGroup As String = "Tanks"
            Dim GroupNames As String() = Nothing
            GroupNames = oasc.GetGroupNames(referenceGroup, networkNode, ErrorString)

            If ErrorString = "Success" Then

                For Each GroupName As String In GroupNames
                    Console.WriteLine(GroupName)
                Next

                If GroupNames.Length = 0 Then
                    Console.WriteLine("No Groups to Show.")
                End If
            Else
                Console.WriteLine(ErrorString)
            End If
        End Sub
    End Class
End Namespace

AddGroup

  • The AddGroup Function adds a Group to the existing Tag 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.
  • ReferenceGroup is a string of the Group path to add the Group to.
  • 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 group = "";
            string referenceGroup = "";
            string ErrorString = "";
            string networkNode = "";
            ResultInt32 = oasc.AddGroup(group, referenceGroup, 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 ResultInt32 As Int32 = 0
            Dim group As String = ""
            Dim referenceGroup As String = ""
            Dim ErrorString As String = ""
            Dim networkNode As String = ""
            ResultInt32 = oasc.AddGroup(group, referenceGroup, 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

RemoveGroup

  • The RemoveGroup Function removes a Group to the existing Tag 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.
  • ReferenceGroup is a string of the Group path to remove the Group from.
  • 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 group = "";
            string referenceGroup = "";
            string networkNode = "";
            ResultInt32 = oasc.RemoveGroup(group, referenceGroup, 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 ResultInt32 As Int32 = 0
            Dim ErrorString As String = ""
            Dim group As String = ""
            Dim referenceGroup As String = ""
            Dim networkNode As String = ""
            ResultInt32 = oasc.RemoveGroup(group, referenceGroup, 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

RenameGroup

  • The RenameGroup Function renames an existing Group in the Tag configuration.
  • Returns -1 if service is not reachable.
  • Returns 1 if successful.
  • Returns 0 if the Old Group does not exist, the New Group already exists, or renaming the Group failed.
  • OldGroup is the name of the existing Group to rename.
  • NewGroup is the name to change the Group to.
  • ReferenceGroup is a string of the Group path to rename the Group in.
  • 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 group = "";
            string newGroupName = "";
            string referenceGroup = "";
            string networkNode = "";
            ResultInt32 = oasc.RenameGroup(group, newGroupName, referenceGroup, networkNode, ref ErrorString);
            if (ResultInt32 == -1)
            {
                Console.WriteLine("OAS Service not reached.");
            }
            else if (ResultInt32 == 1)
            {
                Console.WriteLine("Group successfully renamed.");
            }
            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 group As String = ""
            Dim newGroupName As String = ""
            Dim referenceGroup As String = ""
            Dim networkNode As String = ""
            ResultInt32 = oasc.RenameGroup(group, newGroupName, referenceGroup, networkNode, ErrorString)

            If ResultInt32 = -1 Then
                Console.WriteLine("OAS Service not reached.")
            ElseIf ResultInt32 = 1 Then
                Console.WriteLine("Group successfully renamed.")
            Else
                Console.WriteLine(ErrorString)
            End If
        End Sub
    End Class
End Namespace

GetAllAlarmGroups

  • The GetAllAlarmGroups Function returns a list of Alarm Groups in the current Tag Configuration.
  • 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 is in error
C#
using System;

namespace OASDataSample
{
    class Program
    {
        static OASConfig.Config oasc = new OASConfig.Config();
        static void Main(string[] args)
        {

            string[] GroupNames = null;
            string ErrorString = "";
            string networkNode = "";
            GroupNames = oasc.GetAllAlarmGroups(networkNode, ref ErrorString);
            if (ErrorString == "Success")
            {
                foreach (string GroupName in GroupNames)
                {
                    Console.WriteLine(GroupName);
                }
                if (GroupNames.Length == 0)
                {
                    Console.WriteLine("No Groups to Show.");
                }
            }
            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 GroupNames As String() = Nothing
            Dim ErrorString As String = ""
            Dim networkNode As String = ""
            GroupNames = oasc.GetAllAlarmGroups(networkNode, ErrorString)

            If ErrorString = "Success" Then

                For Each GroupName As String In GroupNames
                    Console.WriteLine(GroupName)
                Next

                If GroupNames.Length = 0 Then
                    Console.WriteLine("No Groups to Show.")
                End If
            Else
                Console.WriteLine(ErrorString)
            End If
        End Sub
    End Class
End Namespace
Back to top Copyright (c) Open Automation Software. All rights reserved.