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

System Errors

GetSystemErrors

  • The GetSystemErrors Function returns a list of the System Errors from the System Type, Group, and Category specified.
  • The CurrentlyInError returns a Boolean error with a value of True if the System Type, Group, or Category is in error and False if it is not, This list should be the same length as the number of System Error names that are returned.
  • To return a list of all System Types that are in error or have had an error specify System Type as blank.
  • To return a list of all Groups that are in error or have had an error specify the System Type to obtain and Group as blank.
  • To return a list of all Categories that are in error or have had an error specify the System Type and Group to obtain and Category as blank.
  • To return a history list of all previous system error messages specify the System Type, Group, and Category to obtain the messages from.
  • 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.
  • 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 path = "";
            string ErrorString = "";
            bool localGetSystemTypes = false;
            bool localGetGroups = false;
            bool localGetCategories = false;
            string localSystemType = "";
            string localGroup = "";
            string localCategory = "";
            string[] SystemErrors = null;
            bool[] CurrentlyInError = new bool[0];
   

            SystemErrors = oasc.GetSystemErrors(localSystemType, localGroup, localCategory, ref CurrentlyInError, NetworkNode, ref ErrorString);
            if (ErrorString == "Success")
            {
                Int32 localIndex = 0;
                for (localIndex = 0; localIndex < SystemErrors.GetLength(0); localIndex++)
                {
                    if (localGetSystemTypes)
                    {
                        if (CurrentlyInError[localIndex])
                        {
                            Console.WriteLine("Error - " + SystemErrors[localIndex]);
                        }
                        else
                        {
                            Console.WriteLine("OK -    " + SystemErrors[localIndex]);
                        }
                    }
                    else if (localGetGroups)
                    {
                        if (CurrentlyInError[localIndex])
                        {
                            Console.WriteLine("Error - " + SystemErrors[localIndex]);
                        }
                        else
                        {
                            Console.WriteLine("OK -    " + SystemErrors[localIndex]);
                        }
                    }
                    else if (localGetCategories)
                    {
                        if (CurrentlyInError[localIndex])
                        {
                            Console.WriteLine("Error - " + SystemErrors[localIndex]);
                        }
                        else
                        {
                            Console.WriteLine("OK -    " + SystemErrors[localIndex]);
                        }
                    }
                    else
                    {
                        Console.WriteLine(SystemErrors[localIndex]);
                    }
                }
            }
            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 path As String = ""
            Dim ErrorString As String = ""
            Dim localGetSystemTypes As Boolean = False
            Dim localGetGroups As Boolean = False
            Dim localGetCategories As Boolean = False
            Dim localSystemType As String = ""
            Dim localGroup As String = ""
            Dim localCategory As String = ""
            Dim SystemErrors As String() = Nothing
            Dim CurrentlyInError As Boolean() = New Boolean(-1) {}
            SystemErrors = oasc.GetSystemErrors(localSystemType, localGroup, localCategory, CurrentlyInError, NetworkNode, ErrorString)

            If ErrorString = "Success" Then
                Dim localIndex As Int32 = 0

                For localIndex = 0 To SystemErrors.GetLength(0) - 1

                    If localGetSystemTypes Then

                        If CurrentlyInError(localIndex) Then
                            Console.WriteLine("Error - " & SystemErrors(localIndex))
                        Else
                            Console.WriteLine("OK -    " & SystemErrors(localIndex))
                        End If
                    ElseIf localGetGroups Then

                        If CurrentlyInError(localIndex) Then
                            Console.WriteLine("Error - " & SystemErrors(localIndex))
                        Else
                            Console.WriteLine("OK -    " & SystemErrors(localIndex))
                        End If
                    ElseIf localGetCategories Then

                        If CurrentlyInError(localIndex) Then
                            Console.WriteLine("Error - " & SystemErrors(localIndex))
                        Else
                            Console.WriteLine("OK -    " & SystemErrors(localIndex))
                        End If
                    Else
                        Console.WriteLine(SystemErrors(localIndex))
                    End If
                Next
            Else
                Console.WriteLine(ErrorString)
            End If
        End Sub
    End Class
End Namespace
Back to top Copyright (c) Open Automation Software. All rights reserved.