General

GetVersion

  • The GetVersion Function is useful for an easy check if the OAS Service is started and reachable.
  • Returns – 1 if service is not reachable.
  • Returns positive number of current version if successful.
  • NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.

VB

    Private Sub ButtonGetVersion_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetVersion.Click
        Cursor.Current = Cursors.WaitCursor
        Dim VersionNumber As Int32
        VersionNumber = ModuleNetworkNode.OPCSystemsComponent1.GetVersion(TextBoxNetworkNode.Text)
        If VersionNumber = -1 Then
            LabelGetVersion.Text = "OAS Service not reached"
        Else
            LabelGetVersion.Text = "OAS Service version number " + VersionNumber.ToString("0")
        End If
    End Sub    

C#

	
Private Sub ButtonGetVersion_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetVersion.Click
        Cursor.Current = Cursors.WaitCursor
        Dim VersionNumber As Int32
        VersionNumber = ModuleNetworkNode.OPCSystemsComponent1.GetVersion(TextBoxNetworkNode.Text)
        If VersionNumber = -1 Then
            LabelGetVersion.Text = "OAS Service not reached"
        Else
            LabelGetVersion.Text = "OAS Service version number " + VersionNumber.ToString("0")
        End If
    End Sub   

GetLicenseString

  • The GetLicenseString Function returns a string of the OAS Service license.
  • Returns “OAS Service Not Reachable” if service is not reachable.
  • Returns the license string if successful.
  • NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.

VB

    Private Sub ButtonGetLicenseString_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetLicenseString.Click
        Dim LicenseString As String
        LicenseString = ModuleNetworkNode.OPCSystemsComponent1.GetLicenseString(TextBoxNetworkNode.Text)
        LabelGetLicenseString.Text = LicenseString
    End Sub

C#

	
 Private Sub ButtonGetLicenseString_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetLicenseString.Click
        Dim LicenseString As String
        LicenseString = ModuleNetworkNode.OPCSystemsComponent1.GetLicenseString(TextBoxNetworkNode.Text)
        LabelGetLicenseString.Text = LicenseString
    End Sub   

GetFullyLicensed

  • The GetFullyLicensed Function returns the license status of an OAS Service.
  • Returns -1 if service is not reachable.
  • Returns 0 if the service is not yet fully licensed, running in demo mode or disabled.
  • Returns 1 if the service has been licensed.
  • NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.

VB

    Private Sub ButtonGetFullyLicensed_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetFullyLicensed.Click
        Cursor.Current = Cursors.WaitCursor
        Dim FullyLicensedNumber As Int32
        FullyLicensedNumber = ModuleNetworkNode.OPCSystemsComponent1.GetFullyLicensed(TextBoxNetworkNode.Text)
        If FullyLicensedNumber = -1 Then
            LabelGetFullyLicensed.Text = "OAS Service not reached"
        ElseIf FullyLicensedNumber = 1 Then
            LabelGetFullyLicensed.Text = "OAS Service Fully Licensed"
        Else
            LabelGetFullyLicensed.Text = "OAS Service Not Fully Licensed"
        End If
    End Sub

C#

	
Private Sub ButtonGetFullyLicensed_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetFullyLicensed.Click
        Cursor.Current = Cursors.WaitCursor
        Dim FullyLicensedNumber As Int32
        FullyLicensedNumber = ModuleNetworkNode.OPCSystemsComponent1.GetFullyLicensed(TextBoxNetworkNode.Text)
        If FullyLicensedNumber = -1 Then
            LabelGetFullyLicensed.Text = "OAS Service not reached"
        ElseIf FullyLicensedNumber = 1 Then
            LabelGetFullyLicensed.Text = "OAS Service Fully Licensed"
        Else
            LabelGetFullyLicensed.Text = "OAS Service Not Fully Licensed"
        End If
    End Sub   

InRuntime

  • The InRuntime Function returns the Runtime Status of an OAS Service.
  • Returns -1 if service is not reachable.
  • Returns 0 if service is not in Runtime.
  • Returns 1 if service is in Runtime.
  • NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.

VB

 
    Private Sub ButtonInRuntime_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonInRuntime.Click
        Cursor.Current = Cursors.WaitCursor
        Dim InRuntimeNumber As Int32
        InRuntimeNumber = ModuleNetworkNode.OPCSystemsComponent1.InRuntime(TextBoxNetworkNode.Text)
        If InRuntimeNumber = -1 Then
            LabelInRuntime.Text = "OAS Service not reached"
        ElseIf InRuntimeNumber = 1 Then
            LabelInRuntime.Text = "OAS Service Is In Runtime Mode"
        Else
            LabelInRuntime.Text = "OAS Service Is Stopped"
        End If
    End Sub

C#

	
 Private Sub ButtonInRuntime_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonInRuntime.Click
        Cursor.Current = Cursors.WaitCursor
        Dim InRuntimeNumber As Int32
        InRuntimeNumber = ModuleNetworkNode.OPCSystemsComponent1.InRuntime(TextBoxNetworkNode.Text)
        If InRuntimeNumber = -1 Then
            LabelInRuntime.Text = "OAS Service not reached"
        ElseIf InRuntimeNumber = 1 Then
            LabelInRuntime.Text = "OAS Service Is In Runtime Mode"
        Else
            LabelInRuntime.Text = "OAS Service Is Stopped"
        End If
    End Sub   

StartRuntime

  • The StartRuntime Subroutine Starts the OAS Service Runtime Mode.
  • If the Service is already in Runtime Mode no method occurs.
  • 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.

VB

    Private Sub ButtonStartRuntime_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonStartRuntime.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ErrorString As String = ""
        ModuleNetworkNode.OPCSystemsComponent1.StartRuntime(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub
 

C#

	
 Private Sub ButtonStartRuntime_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonStartRuntime.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ErrorString As String = ""
        ModuleNetworkNode.OPCSystemsComponent1.StartRuntime(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub   

StopRuntime

  • The StopRuntime Subroutine Stops the OAS Service Runtime Mode.
  • If the Service is not in Runtime Mode no method occurs.
  • 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.

VB

    Private Sub ButtonStopRuntime_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonStopRuntime.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ErrorString As String = ""
        ModuleNetworkNode.OPCSystemsComponent1.StopRuntime(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub
     

C#

 Private Sub ButtonStopRuntime_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonStopRuntime.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ErrorString As String = ""
        ModuleNetworkNode.OPCSystemsComponent1.StopRuntime(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub	   

GetMaintenanceExpiration

  • The GetMaintenanceExpiration Function returns the maintenance expiration date within the service.
  • Please note that the actual maintenance expiration is retained by the company records of Open Automation Software and the value returned may be out of date.
  • Returns string Month / Day / Year in the format of 00/00/0000.
  • Returns blank if a failure occurs.
  • 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.

VB

    Private Sub ButtonGetMaintenanceExpiration_Click(sender As System.Object, e As System.EventArgs) Handles ButtonGetMaintenanceExpiration.Click
        Dim LicenseString As String
        Dim ErrorString As String = ""
        LicenseString = ModuleNetworkNode.OPCSystemsComponent1.GetMaintenanceExpiration(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
        LabelGetMaintenanceExpiration.Text = LicenseString
    End Sub

C#

	
 Private Sub ButtonGetMaintenanceExpiration_Click(sender As System.Object, e As System.EventArgs) Handles ButtonGetMaintenanceExpiration.Click
        Dim LicenseString As String
        Dim ErrorString As String = ""
        LicenseString = ModuleNetworkNode.OPCSystemsComponent1.GetMaintenanceExpiration(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
        LabelGetMaintenanceExpiration.Text = LicenseString
    End Sub   

GetClientUsers

  • The GetClientUsers Function returns a list of users that are currently connected to the service.
  • If there was no username specified in the client connection the string is blank for the client connection.
  • The same user may be logged in to multiple clients.
  • 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.

Driver Interfaces

Please note that the most efficient way to add tags and set their properties programmatically is using the DriverInterfaceCSVImport method.

GetDriverInterfaceNames

  • The GetDriverInterfaceNames Function returns a list of the Driver Interfaces.
  • 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.

VB

    Private Sub ButtonGetDriverIntefaceNames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetDriverIntefaceNames.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetDriverInterfaceNames.Items.Clear()
        Dim Groups() As String
        Dim Group As String
        Dim ErrorString As String = ""
        Groups = ModuleNetworkNode.OPCSystemsComponent1.GetDriverInterfaceNames(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each Group In Groups
                ComboBoxGetDriverInterfaceNames.Items.Add(Group)
            Next
            If ComboBoxGetDriverInterfaceNames.Items.Count > 0 Then
                ComboBoxGetDriverInterfaceNames.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub
 
    Private Sub ComboBoxGetDriverInterfaceNames_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetDriverInterfaceNames.SelectedIndexChanged
        TextBoxDriverInterface.Text = ComboBoxGetDriverInterfaceNames.SelectedItem
    End Sub

C#

 Private Sub ButtonGetDriverIntefaceNames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetDriverIntefaceNames.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetDriverInterfaceNames.Items.Clear()
        Dim Groups() As String
        Dim Group As String
        Dim ErrorString As String = ""
        Groups = ModuleNetworkNode.OPCSystemsComponent1.GetDriverInterfaceNames(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each Group In Groups
                ComboBoxGetDriverInterfaceNames.Items.Add(Group)
            Next
            If ComboBoxGetDriverInterfaceNames.Items.Count > 0 Then
                ComboBoxGetDriverInterfaceNames.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub
 
    Private Sub ComboBoxGetDriverInterfaceNames_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetDriverInterfaceNames.SelectedIndexChanged
        TextBoxDriverInterface.Text = ComboBoxGetDriverInterfaceNames.SelectedItem
    End Sub



RemoveDriverInterface

  • The RemoveDriverInterface Function removes a Driver Interface Group from the existing Driver Interface configuration.
  • Returns -1 if service is not reachable.
  • Returns 1 if successful.
  • Returns 0 if the Driver Interface does not exist or removing the Driver Interface failed.
  • Name is the name of the Driver Interface to remove.
  • 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.

VB

    Private Sub ButtonRemoveDriverInterface_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRemoveDriverInterface.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.RemoveDriverInterface(TextBoxDriverInterface.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelRemoveDriverInterfaceResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelRemoveDriverInterfaceResult.Text = "Driver Interface successfully removed."
        Else
            LabelRemoveDriverInterfaceResult.Text = ErrorString
        End If
    End Sub

C#


 Private Sub ButtonRemoveDriverInterface_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRemoveDriverInterface.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.RemoveDriverInterface(TextBoxDriverInterface.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelRemoveDriverInterfaceResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelRemoveDriverInterfaceResult.Text = "Driver Interface successfully removed."
        Else
            LabelRemoveDriverInterfaceResult.Text = ErrorString
        End If
    End Sub

GetDriverInterfaceParameterStrings

  • The GetDriverInterfaceParameterStrings Function returns an array of Strings containing all property types available for each Driver Interface Group.
  • Returns Empty String Array if service is not reachable.
  • Returns a String Array of property types for all possible Parameters for a Driver Interface Group.
  • NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
  • RemoteSCADAHostingName is the name of the Live Data Cloud OAS Service to connect to.

VB

    Private Sub ButtonGetDriverInterfaceParameterStrings_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetDriverInterfaceParameterStrings.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetDriverInterfaceParameterStrings.Items.Clear()
        Dim Parameters() As String
        Dim Parameter As String
        Parameters = ModuleNetworkNode.OPCSystemsComponent1.GetDriverInterfaceParameterStrings(TextBoxNetworkNode.Text)
        For Each Parameter In Parameters
            ComboBoxGetDriverInterfaceParameterStrings.Items.Add(Parameter)
        Next
        If ComboBoxGetDriverInterfaceParameterStrings.Items.Count > 0 Then
            ComboBoxGetDriverInterfaceParameterStrings.SelectedIndex = 0
        End If
    End Sub
 
    Private Sub ComboBoxGetDriverInterfaceParameterStrings_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetDriverInterfaceParameterStrings.SelectedIndexChanged
        TextBoxParameter.Text = ComboBoxGetDriverInterfaceParameterStrings.SelectedItem
    End Sub

C#

Private Sub ButtonGetDriverInterfaceParameterStrings_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetDriverInterfaceParameterStrings.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetDriverInterfaceParameterStrings.Items.Clear()
        Dim Parameters() As String
        Dim Parameter As String
        Parameters = ModuleNetworkNode.OPCSystemsComponent1.GetDriverInterfaceParameterStrings(TextBoxNetworkNode.Text)
        For Each Parameter In Parameters
            ComboBoxGetDriverInterfaceParameterStrings.Items.Add(Parameter)
        Next
        If ComboBoxGetDriverInterfaceParameterStrings.Items.Count > 0 Then
            ComboBoxGetDriverInterfaceParameterStrings.SelectedIndex = 0
        End If
    End Sub
 
    Private Sub ComboBoxGetDriverInterfaceParameterStrings_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetDriverInterfaceParameterStrings.SelectedIndexChanged
        TextBoxParameter.Text = ComboBoxGetDriverInterfaceParameterStrings.SelectedItem
    End Sub
 

GetDriverInterface_Parameter_Value

  • The GetDriverInterface_Parameter_Value Function returns an object value for the Driver Interface Group and Parameter specified.
  • Returns nothing if service is not reachable.
  • Parameter is a String of the Parameter Type desired of the Driver Interface Group.
  • Name is a String of the Driver Interface 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.

VB

    Private Sub ButtonGetDriverInterface_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetDriverInterface_Parameter_Value.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultObject As Object
        Dim ErrorString As String = ""
        ResultObject = ModuleNetworkNode.OPCSystemsComponent1.GetDriverInterface_Parameter_Value(TextBoxParameter.Text, TextBoxDriverInterface.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            Try
                LabelGetDriverInterface_Parameter_ValueResult.Text = ResultObject
                TextBoxValueToSet.Text = ResultObject
            Catch ex As Exception
                LabelGetDriverInterface_Parameter_ValueResult.Text = "Error converting value to string."
                TextBoxValueToSet.Text = ""
            End Try
        Else
            LabelGetDriverInterface_Parameter_ValueResult.Text = ErrorString
            TextBoxValueToSet.Text = ""
        End If
    End Sub

C#


  Private Sub ButtonGetDriverInterface_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetDriverInterface_Parameter_Value.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultObject As Object
        Dim ErrorString As String = ""
        ResultObject = ModuleNetworkNode.OPCSystemsComponent1.GetDriverInterface_Parameter_Value(TextBoxParameter.Text, TextBoxDriverInterface.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            Try
                LabelGetDriverInterface_Parameter_ValueResult.Text = ResultObject
                TextBoxValueToSet.Text = ResultObject
            Catch ex As Exception
                LabelGetDriverInterface_Parameter_ValueResult.Text = "Error converting value to string."
                TextBoxValueToSet.Text = ""
            End Try
        Else
            LabelGetDriverInterface_Parameter_ValueResult.Text = ErrorString
            TextBoxValueToSet.Text = ""
        End If
    End Sub

GetDriverInterface_Parameter_Values

  • The GetDriverInterface_Parameter_Values Function returns an array of object values for the Driver Interface Group specified.
  • The order of the array corresponds with the GetDataLoggingParameterStrings Function order.
  • Returns empty array if service is not reachable.
  • Name is a String of the Driver Interface 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.

VB

    Private Sub ButtonGetDriverInterface_Parameter_Values_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetDriverInterface_Parameter_Values.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetDriverInterface_Parameter_Values.Items.Clear()
        Dim ResultObjects() As Object
        Dim ResultObject As Object
        Dim ResultString As String = ""
        Dim ParameterIndex As Int32 = 0
        Dim ErrorString As String = ""
        ResultObjects = ModuleNetworkNode.OPCSystemsComponent1.GetDriverInterface_Parameter_Values(TextBoxDriverInterface.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each ResultObject In ResultObjects
                Try
                    If ResultObject Is Nothing Then
                        ResultString = ""
                    Else
                        ResultString = System.Convert.ToString(ResultObject)
                    End If
                    ComboBoxGetDriverInterface_Parameter_Values.Items.Add(ResultString)
                Catch ex As Exception
                    ComboBoxGetDriverInterface_Parameter_Values.Items.Add("Error Converting Object")
                End Try
                ParameterIndex += 1
            Next
            If ComboBoxGetDriverInterface_Parameter_Values.Items.Count > 0 Then
                ComboBoxGetDriverInterface_Parameter_Values.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#


Private Sub ButtonGetDriverInterface_Parameter_Values_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetDriverInterface_Parameter_Values.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetDriverInterface_Parameter_Values.Items.Clear()
        Dim ResultObjects() As Object
        Dim ResultObject As Object
        Dim ResultString As String = ""
        Dim ParameterIndex As Int32 = 0
        Dim ErrorString As String = ""
        ResultObjects = ModuleNetworkNode.OPCSystemsComponent1.GetDriverInterface_Parameter_Values(TextBoxDriverInterface.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each ResultObject In ResultObjects
                Try
                    If ResultObject Is Nothing Then
                        ResultString = ""
                    Else
                        ResultString = System.Convert.ToString(ResultObject)
                    End If
                    ComboBoxGetDriverInterface_Parameter_Values.Items.Add(ResultString)
                Catch ex As Exception
                    ComboBoxGetDriverInterface_Parameter_Values.Items.Add("Error Converting Object")
                End Try
                ParameterIndex += 1
            Next
            If ComboBoxGetDriverInterface_Parameter_Values.Items.Count > 0 Then
                ComboBoxGetDriverInterface_Parameter_Values.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

SetDriverInterface_Parameter_Value

  • The SetDriverInterface_Parameter_Value Function sets an object value for the Driver Interface Group and Parameter specified.
  • If the Driver Interface specified does not exist it will be added.
  • Returns -1 if service is not reachable.
  • Returns 0 if 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 Driver Interface Group.
  • Value is the desired value to set.
  • Name is a String of the Driver Interface 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.

VB

    Private Sub ButtonSetDriverInterface_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSetDriverInterface_Parameter_Value.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
 
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.SetDriverInterface_Parameter_Value(TextBoxParameter.Text, TextBoxValueToSet.Text, TextBoxDriverInterface.Text, TextBoxNetworkNode.Text, ErrorString)
 
        If ResultInt32 = -1 Then
            LabelSetDataLogging_Parameter_ValueResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelSetDataLogging_Parameter_ValueResult.Text = "Parameter Successfully Updated."
        Else
            LabelSetDataLogging_Parameter_ValueResult.Text = ErrorString
        End If
    End Sub

C#


 Private Sub ButtonGetDriverInterface_Parameter_Values_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetDriverInterface_Parameter_Values.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetDriverInterface_Parameter_Values.Items.Clear()
        Dim ResultObjects() As Object
        Dim ResultObject As Object
        Dim ResultString As String = ""
        Dim ParameterIndex As Int32 = 0
        Dim ErrorString As String = ""
        ResultObjects = ModuleNetworkNode.OPCSystemsComponent1.GetDriverInterface_Parameter_Values(TextBoxDriverInterface.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each ResultObject In ResultObjects
                Try
                    If ResultObject Is Nothing Then
                        ResultString = ""
                    Else
                        ResultString = System.Convert.ToString(ResultObject)
                    End If
                    ComboBoxGetDriverInterface_Parameter_Values.Items.Add(ResultString)
                Catch ex As Exception
                    ComboBoxGetDriverInterface_Parameter_Values.Items.Add("Error Converting Object")
                End Try
                ParameterIndex += 1
            Next
            If ComboBoxGetDriverInterface_Parameter_Values.Items.Count > 0 Then
                ComboBoxGetDriverInterface_Parameter_Values.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub
 

Data Logging Groups

GetDataLoggingNames

  • 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.

VB

Private Sub ButtonGetDataLoggingNames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetDataLoggingNames.Click
 Cursor.Current = Cursors.WaitCursor
 ComboBoxGetDataLoggingNames.Items.Clear()
 Dim Groups() As String
 Dim Group As String
 Dim ErrorString As String = ""
 Groups = ModuleNetworkNode.OPCSystemsComponent1.GetDataLoggingNames(TextBoxNetworkNode.Text, ErrorString)
 If ErrorString = "Success" Then
 For Each Group In Groups
 ComboBoxGetDataLoggingNames.Items.Add(Group)
 Next
 If ComboBoxGetDataLoggingNames.Items.Count > 0 Then
 ComboBoxGetDataLoggingNames.SelectedIndex = 0
 End If
 Else
 MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
 End If
 End Sub

Private Sub ComboBoxGetDataLoggingNames_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetDataLoggingNames.SelectedIndexChanged
 TextBoxDataLoggingGroup.Text = ComboBoxGetDataLoggingNames.SelectedItem
 End Sub

C#

Private Sub ButtonGetDataLoggingNames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetDataLoggingNames.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetDataLoggingNames.Items.Clear()
        Dim Groups() As String
        Dim Group As String
        Dim ErrorString As String = ""
        Groups = ModuleNetworkNode.OPCSystemsComponent1.GetDataLoggingNames(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each Group In Groups
                ComboBoxGetDataLoggingNames.Items.Add(Group)
            Next
            If ComboBoxGetDataLoggingNames.Items.Count > 0 Then
                ComboBoxGetDataLoggingNames.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub
 
    Private Sub ComboBoxGetDataLoggingNames_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetDataLoggingNames.SelectedIndexChanged
        TextBoxDataLoggingGroup.Text = ComboBoxGetDataLoggingNames.SelectedItem
    End Sub

AddDataLoggingGroup

  • 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.

VB

Private Sub ButtonAddDataLoggingGroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAddDataLoggingGroup.Click
 Cursor.Current = Cursors.WaitCursor
 Dim ResultInt32 As Int32
 Dim ErrorString As String = ""
 ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.AddDataLoggingGroup(TextBoxDataLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
 If ResultInt32 = -1 Then
 LabelAddDataLoggingGroupResult.Text = "OAS Service not reached."
 ElseIf ResultInt32 = 1 Then
 LabelAddDataLoggingGroupResult.Text = "Group successfully added."
 Else
 LabelAddDataLoggingGroupResult.Text = ErrorString
 End If
 End Sub

C#

 Private Sub ButtonAddDataLoggingGroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAddDataLoggingGroup.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.AddDataLoggingGroup(TextBoxDataLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelAddDataLoggingGroupResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelAddDataLoggingGroupResult.Text = "Group successfully added."
        Else
            LabelAddDataLoggingGroupResult.Text = ErrorString
        End If
    End Sub

RemoveDataLoggingGroup

  • 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.

VB

Private Sub ButtonRemoveDataLoggingGroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRemoveDataLoggingGroup.Click
 Cursor.Current = Cursors.WaitCursor
 Dim ResultInt32 As Int32
 Dim ErrorString As String = ""
 ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.RemoveDataLoggingGroup(TextBoxDataLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
 If ResultInt32 = -1 Then
 LabelRemoveDataLoggingGroupResult.Text = "OAS Service not reached."
 ElseIf ResultInt32 = 1 Then
 LabelRemoveDataLoggingGroupResult.Text = "Group successfully removed."
 Else
 LabelRemoveDataLoggingGroupResult.Text = ErrorString
 End If
 End Sub

C#

 Private Sub ButtonRemoveDataLoggingGroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRemoveDataLoggingGroup.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.RemoveDataLoggingGroup(TextBoxDataLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelRemoveDataLoggingGroupResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelRemoveDataLoggingGroupResult.Text = "Group successfully removed."
        Else
            LabelRemoveDataLoggingGroupResult.Text = ErrorString
        End If
    End Sub

GetDataLoggingParameterStrings

  • 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.

VB

Private Sub ButtonGetDataLoggingParameterStrings_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetDataLoggingParameterStrings.Click
 Cursor.Current = Cursors.WaitCursor
 ComboBoxGetDataLoggingParameterStrings.Items.Clear()
 Dim Parameters() As String
 Dim Parameter As String
 Parameters = ModuleNetworkNode.OPCSystemsComponent1.GetDataLoggingParameterStrings(TextBoxNetworkNode.Text)
 For Each Parameter In Parameters
 ComboBoxGetDataLoggingParameterStrings.Items.Add(Parameter)
 Next
 If ComboBoxGetDataLoggingParameterStrings.Items.Count > 0 Then
 ComboBoxGetDataLoggingParameterStrings.SelectedIndex = 0
 End If
 End Sub

Private Sub ComboBoxGetDataLoggingParameterStrings_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetDataLoggingParameterStrings.SelectedIndexChanged
 TextBoxParameter.Text = ComboBoxGetDataLoggingParameterStrings.SelectedItem
 End Sub

C#

Private Sub ButtonGetDataLoggingParameterStrings_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetDataLoggingParameterStrings.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetDataLoggingParameterStrings.Items.Clear()
        Dim Parameters() As String
        Dim Parameter As String
        Parameters = ModuleNetworkNode.OPCSystemsComponent1.GetDataLoggingParameterStrings(TextBoxNetworkNode.Text)
        For Each Parameter In Parameters
            ComboBoxGetDataLoggingParameterStrings.Items.Add(Parameter)
        Next
        If ComboBoxGetDataLoggingParameterStrings.Items.Count > 0 Then
            ComboBoxGetDataLoggingParameterStrings.SelectedIndex = 0
        End If
    End Sub
 
    Private Sub ComboBoxGetDataLoggingParameterStrings_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetDataLoggingParameterStrings.SelectedIndexChanged
        TextBoxParameter.Text = ComboBoxGetDataLoggingParameterStrings.SelectedItem
    End Sub

GetDataLogging_Parameter_Value

  • 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.

VB

Private Sub ButtonGetDataLogging_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetDataLogging_Parameter_Value.Click
 Cursor.Current = Cursors.WaitCursor
 Dim ResultObject As Object
 Dim ErrorString As String = ""
 ResultObject = ModuleNetworkNode.OPCSystemsComponent1.GetDataLogging_Parameter_Value(TextBoxParameter.Text, TextBoxDataLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
 If ErrorString = "Success" Then
 Try
 If TextBoxParameter.Text = "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
 LabelGetDataLogging_Parameter_ValueResult.Text = ResultString
 TextBoxValueToSet.Text = ResultString
 End If
 Catch ex As Exception
 LabelGetDataLogging_Parameter_ValueResult.Text = "Error converting value to string."
 TextBoxValueToSet.Text = ""
 End Try
 ElseIf TextBoxParameter.Text = "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
 LabelGetDataLogging_Parameter_ValueResult.Text = ResultString
 End If
 Catch ex As Exception
 LabelGetDataLogging_Parameter_ValueResult.Text = "Error converting value to string."
 TextBoxValueToSet.Text = ""
 End Try
 Else
 LabelGetDataLogging_Parameter_ValueResult.Text = ResultObject
 TextBoxValueToSet.Text = ResultObject
 End If
 Catch ex As Exception
 LabelGetDataLogging_Parameter_ValueResult.Text = "Error converting value to string."
 TextBoxValueToSet.Text = ""
 End Try
 Else
 LabelGetDataLogging_Parameter_ValueResult.Text = ErrorString
 TextBoxValueToSet.Text = ""
 End If
 End Sub

C#

 Private Sub ButtonGetDataLogging_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetDataLogging_Parameter_Value.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultObject As Object
        Dim ErrorString As String = ""
        ResultObject = ModuleNetworkNode.OPCSystemsComponent1.GetDataLogging_Parameter_Value(TextBoxParameter.Text, TextBoxDataLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            Try
                If TextBoxParameter.Text = "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
                            LabelGetDataLogging_Parameter_ValueResult.Text = ResultString
                            TextBoxValueToSet.Text = ResultString
                        End If
                    Catch ex As Exception
                        LabelGetDataLogging_Parameter_ValueResult.Text = "Error converting value to string."
                        TextBoxValueToSet.Text = ""
                    End Try
                ElseIf TextBoxParameter.Text = "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
                            LabelGetDataLogging_Parameter_ValueResult.Text = ResultString
                        End If
                    Catch ex As Exception
                        LabelGetDataLogging_Parameter_ValueResult.Text = "Error converting value to string."
                        TextBoxValueToSet.Text = ""
                    End Try
                Else
                    LabelGetDataLogging_Parameter_ValueResult.Text = ResultObject
                    TextBoxValueToSet.Text = ResultObject
                End If
            Catch ex As Exception
                LabelGetDataLogging_Parameter_ValueResult.Text = "Error converting value to string."
                TextBoxValueToSet.Text = ""
            End Try
        Else
            LabelGetDataLogging_Parameter_ValueResult.Text = ErrorString
            TextBoxValueToSet.Text = ""
        End If
    End Sub

GetDataLogging_Parameter_Values

  • 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.

VB

Private Sub ButtonGetDataLogging_Parameter_Values_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetDataLogging_Parameter_Values.Click
 Cursor.Current = Cursors.WaitCursor
 ComboBoxGetDataLogging_Parameter_Values.Items.Clear()
 Dim ResultObjects() As Object
 Dim ResultObject As Object
 Dim ResultString As String = ""
 Dim ParameterIndex As Int32 = 0
 Dim ErrorString As String = ""
 ResultObjects = ModuleNetworkNode.OPCSystemsComponent1.GetDataLogging_Parameter_Values(TextBoxDataLoggingGroup.Text, TextBoxNetworkNode.Text, 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
 ComboBoxGetDataLogging_Parameter_Values.Items.Add(ResultString)
 Catch ex As Exception
 ComboBoxGetDataLogging_Parameter_Values.Items.Add("Error Converting Object")
 End Try
 ParameterIndex += 1
 Next
 If ComboBoxGetDataLogging_Parameter_Values.Items.Count > 0 Then
 ComboBoxGetDataLogging_Parameter_Values.SelectedIndex = 0
 End If
 Else
 MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
 End If
 End Sub

C#


C#

 Private Sub ButtonGetDataLogging_Parameter_Values_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetDataLogging_Parameter_Values.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetDataLogging_Parameter_Values.Items.Clear()
        Dim ResultObjects() As Object
        Dim ResultObject As Object
        Dim ResultString As String = ""
        Dim ParameterIndex As Int32 = 0
        Dim ErrorString As String = ""
        ResultObjects = ModuleNetworkNode.OPCSystemsComponent1.GetDataLogging_Parameter_Values(TextBoxDataLoggingGroup.Text, TextBoxNetworkNode.Text, 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
                    ComboBoxGetDataLogging_Parameter_Values.Items.Add(ResultString)
                Catch ex As Exception
                    ComboBoxGetDataLogging_Parameter_Values.Items.Add("Error Converting Object")
                End Try
                ParameterIndex += 1
            Next
            If ComboBoxGetDataLogging_Parameter_Values.Items.Count > 0 Then
                ComboBoxGetDataLogging_Parameter_Values.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

SetDataLogging_Parameter_Value

  • The SetDataLogging_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.

VB

Private Sub ButtonSetDataLogging_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSetDataLogging_Parameter_Value.Click
 Cursor.Current = Cursors.WaitCursor
 Dim ResultInt32 As Int32
 Dim ErrorString As String = ""
 If TextBoxParameter.Text = "DBFields" Then
 Dim ArrayToSend(9) As Object
 Dim TagsToSend() As String
 ArrayToSend(0) = 2
 Version
 ArrayToSend(1) = 2
 Number of Fields
 ArrayToSend(2) = "Field01"
 First Field Name
 ArrayToSend(3) = "Field02"
 Second Field Name
 ReDim TagsToSend(0)
 Example of one Tag per field for Field01
 TagsToSend(0) = "Ramp.Value"
 ArrayToSend(4) = TagsToSend
 ReDim TagsToSend(1)
 Example of multiple Tags per field for Field02
 TagsToSend(0) = "Sine.Value"
 TagsToSend(1) = "Random.Value"
 ArrayToSend(5) = TagsToSend
 ArrayToSend(6) = "Double"
 Data Type for first field
 ArrayToSend(7) = "Double"
 Data Type fo second field
 ArrayToSend(8) = 100
 Length of text for first field if String field
 ArrayToSend(9) = 100
 Length of text for second field if String field

ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.SetDataLogging_Parameter_Value(TextBoxParameter.Text, ArrayToSend, TextBoxDataLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
 Else
 If TextBoxParameter.Text = "DataChangeTagsWithAlias" Then
 Dim ArrayToSend(5) As String
 Array of Tags and Aliases
 ArrayToSend(0) = "Ramp.Value"
 Tag Name
 ArrayToSend(1) = "Ramp"
 Alias Name
 ArrayToSend(2) = "Sine.Value"
 Tag Name
 ArrayToSend(3) = "Sine"
 Alias Name
 ArrayToSend(4) = "Random.Value"
 Tag Name
 ArrayToSend(5) = "Random"
 Alias Name
 ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.SetDataLogging_Parameter_Value(TextBoxParameter.Text, ArrayToSend, TextBoxDataLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
 Else
 ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.SetDataLogging_Parameter_Value(TextBoxParameter.Text, TextBoxValueToSet.Text, TextBoxDataLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
 End If
 End If

If ResultInt32 = -1 Then
 LabelSetDataLogging_Parameter_ValueResult.Text = "OAS Service not reached."
 ElseIf ResultInt32 = 1 Then
 LabelSetDataLogging_Parameter_ValueResult.Text = "Parameter Successfully Updated."
 Else
 LabelSetDataLogging_Parameter_ValueResult.Text = ErrorString
 End If
 End Sub

C#

  Private Sub ButtonSetDataLogging_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSetDataLogging_Parameter_Value.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        If TextBoxParameter.Text = "DBFields" Then
            Dim ArrayToSend(9) As Object
            Dim TagsToSend() As String
            ArrayToSend(0) = 2 ' Version
            ArrayToSend(1) = 2 ' Number of Fields
            ArrayToSend(2) = "Field01" ' First Field Name
            ArrayToSend(3) = "Field02" ' Second Field Name
            ReDim TagsToSend(0) ' Example of one Tag per field for Field01
            TagsToSend(0) = "Ramp.Value"
            ArrayToSend(4) = TagsToSend
            ReDim TagsToSend(1) ' Example of multiple Tags per field for Field02
            TagsToSend(0) = "Sine.Value"
            TagsToSend(1) = "Random.Value"
            ArrayToSend(5) = TagsToSend
            ArrayToSend(6) = "Double"   ' Data Type for first field
            ArrayToSend(7) = "Double"   ' Data Type fo second field
            ArrayToSend(8) = 100  ' Length of text for first field if String field
            ArrayToSend(9) = 100  ' Length of text for second field if String field
 
            ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.SetDataLogging_Parameter_Value(TextBoxParameter.Text, ArrayToSend, TextBoxDataLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        Else
            If TextBoxParameter.Text = "DataChangeTagsWithAlias" Then
                Dim ArrayToSend(5) As String  ' Array of Tags and Aliases
                ArrayToSend(0) = "Ramp.Value" ' Tag Name
                ArrayToSend(1) = "Ramp" ' Alias Name
                ArrayToSend(2) = "Sine.Value" ' Tag Name
                ArrayToSend(3) = "Sine" ' Alias Name
                ArrayToSend(4) = "Random.Value" ' Tag Name
                ArrayToSend(5) = "Random" ' Alias Name
                ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.SetDataLogging_Parameter_Value(TextBoxParameter.Text, ArrayToSend, TextBoxDataLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
            Else
                ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.SetDataLogging_Parameter_Value(TextBoxParameter.Text, TextBoxValueToSet.Text, TextBoxDataLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
            End If
        End If
 
        If ResultInt32 = -1 Then
            LabelSetDataLogging_Parameter_ValueResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelSetDataLogging_Parameter_ValueResult.Text = "Parameter Successfully Updated."
        Else
            LabelSetDataLogging_Parameter_ValueResult.Text = ErrorString
        End If
    End Sub

SaveDataLoggingConfiguration

  • 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.

VB

Private Sub ButtonSaveDataLoggingConfiguration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSaveDataLoggingConfiguration.Click
 Cursor.Current = Cursors.WaitCursor
 Dim ErrorString As String = ""
 ModuleNetworkNode.OPCSystemsComponent1.SaveDataLoggingConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ErrorString)
 If ErrorString <> "Success" Then
 MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
 End If
 End Sub

C#


LoadDataLoggingConfiguration

  • 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.

VB

Private Sub ButtonLoadDataLoggingConfiguration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonLoadDataLoggingConfiguration.Click
 Cursor.Current = Cursors.WaitCursor
 Dim ErrorString As String = ""
 ModuleNetworkNode.OPCSystemsComponent1.LoadDataLoggingConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ErrorString)
 If ErrorString <> "Success" Then
 MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
 End If
 End Sub

C#


AddDataLoggingField

  • 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.

VB

Private Sub ButtonAddDataLoggingField_Click(sender As System.Object, e As System.EventArgs) Handles ButtonAddDataLoggingField.Click
 Cursor.Current = Cursors.WaitCursor
 Dim ResultInt32 As Int32
 Dim ErrorString As String = ""

ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.AddDataLoggingField(TextBoxFieldNameToAdd.Text, TextBoxTagNameToAdd.Text, "Double", 100, TextBoxDataLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
 If ResultInt32 = -1 Then
 LabelAddDataLoggingFieldResult.Text = "OAS Service not reached."
 ElseIf ResultInt32 = 1 Then
 LabelAddDataLoggingFieldResult.Text = "Parameter Successfully Updated."
 Else
 LabelAddDataLoggingFieldResult.Text = ErrorString
 End If
 End Sub

C#

 Private Sub ButtonSaveDataLoggingConfiguration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSaveDataLoggingConfiguration.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ErrorString As String = ""
        ModuleNetworkNode.OPCSystemsComponent1.SaveDataLoggingConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub
 
    ' 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.
    Private Sub ButtonLoadDataLoggingConfiguration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonLoadDataLoggingConfiguration.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ErrorString As String = ""
        ModuleNetworkNode.OPCSystemsComponent1.LoadDataLoggingConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub
 
    ' 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.
    Private Sub ButtonAddDataLoggingField_Click(sender As System.Object, e As System.EventArgs) Handles ButtonAddDataLoggingField.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
 
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.AddDataLoggingField(TextBoxFieldNameToAdd.Text, TextBoxTagNameToAdd.Text, "Double", 100, TextBoxDataLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelAddDataLoggingFieldResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelAddDataLoggingFieldResult.Text = "Parameter Successfully Updated."
        Else
            LabelAddDataLoggingFieldResult.Text = ErrorString
        End If
    End Sub

CSV Import and Export

TagCSVHeaderString

  • The TagCSVHeaderString Function returns a String of comma seperated heading to be used with the TagCSVExport Function.
  • Returns Empty String 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.

VB

    Private Sub ButtonTagCSVHeaderString_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonTagCSVHeaderString.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultString As String
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.TagCSVHeaderString(TextBoxNetworkNode.Text)
        If ResultString = "" Then
            TextBoxTagCSVHeaderResult.Text = "OAS Service not reached."
        Else
            TextBoxTagCSVHeaderResult.Text = ResultString
        End If
    End Sub

C#

 private void ButtonTagCSVHeaderString_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     string ResultString = null;
                     ResultString = ModuleNetworkNode.OPCSystemsComponent1.TagCSVHeaderString(TextBoxNetworkNode.Text);
                     if (string.IsNullOrEmpty(ResultString))
                     {
                           TextBoxTagCSVHeaderResult.Text = "OAS Service not reached.";
                     }
                     else
                     {
                           TextBoxTagCSVHeaderResult.Text = ResultString;
                     }
              }

TagCSVExportWithDesiredColumns

  • The TagCSVExportWithDesiredColumns Function returns an array of comma seperated Strings, each String representing all attributes of a Tag.
  • The DesiredColumns is the properties of each tag to return.
  • Returns Empty 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.

VB

Private Sub ButtonTagCSVExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonTagCSVExport.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxTagCSVExport.Items.Clear()
        Dim CSVStrings() As String
        Dim ErrorString As String = ""
        Dim DesiredColumns(1) As String
        DesiredColumns(0) = "Tag"
        DesiredColumns(1) = "Value - Value"
        CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.TagCSVExportWithDesiredColumns(DesiredColumns, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            ComboBoxTagCSVExport.Items.AddRange(CSVStrings)
            If ComboBoxTagCSVExport.Items.Count > 0 Then
                ComboBoxTagCSVExport.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

	       private void ButtonTagCSVExport_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxTagCSVExport.Items.Clear();
                     string[] CSVStrings = null;
                     string ErrorString = "";
                     string[] DesiredColumns = new string[2];
                     DesiredColumns[0] = "Tag";
                     DesiredColumns[1] = "Value - Value";
                     CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.TagCSVExportWithDesiredColumns(DesiredColumns, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           ComboBoxTagCSVExport.Items.AddRange(CSVStrings);
                           if (ComboBoxTagCSVExport.Items.Count > 0)
                           {
                                  ComboBoxTagCSVExport.SelectedIndex = 0;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }

	    

TagCSVImport

  • The TagCSVImport Function is used to import comma seperated strings to the Tag configuration.
  • Returns a status String describing the success or failure of the import.
  • Returns Empty String if service is not reachable.
  • CSVStrings is an array of comma seperated Strings.
  • The first String in the passed array must be a header String with the unique heading columns that can be obtained with the TagCSVHeaderString Function.
  • Import all or just a few selected columns, but as a minimum the Tag column must be specified.
  • 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.

VB

Private Sub ButtonTagCSVImport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonTagCSVImport.Click
        Dim ResultString As String
        Dim CSVStrings(3) As String
        CSVStrings(0) = "Tag,Value - Data Type,Value - Value,Value - Source"
        CSVStrings(1) = "CSV Import Group.Tag1,Float,1.0,Value"
        CSVStrings(2) = "CSV Import Group.Tag2,Float,2.0,Value"
        CSVStrings(3) = "CSV Import Group.Tag3,Float,3.0,Value"
        Dim ErrorString As String = ""
 
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.TagCSVImport(CSVStrings, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            LabelTagCSVImportResult.Text = ResultString
        Else
            LabelTagCSVImportResult.Text = ErrorString
        End If
 
    End Sub

C#

	    private void ButtonTagCSVImport_Click(object sender, System.EventArgs e)
              {
                     string ResultString = null;
                     string[] CSVStrings = new string[4];
                     CSVStrings[0] = "Tag,Value - Data Type,Value - Value,Value - Source";
                     CSVStrings[1] = "CSV Import Group.Tag1,Float,1.0,Value";
                     CSVStrings[2] = "CSV Import Group.Tag2,Float,2.0,Value";
                     CSVStrings[3] = "CSV Import Group.Tag3,Float,3.0,Value";
                     string ErrorString = "";
 
                     ResultString = ModuleNetworkNode.OPCSystemsComponent1.TagCSVImport(CSVStrings, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           LabelTagCSVImportResult.Text = ResultString;
                     }
                     else
                     {
                           LabelTagCSVImportResult.Text = ErrorString;
                     }
 
              }

DriverInterfaceCSVHeaderString

  • The DriverInterfaceCSVHeaderString Function returns a String of comma seperated heading to be used with the DriverInterCSVExport Function.
  • Returns Empty String 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.
  • RemoteSCADAHostingName is the name of the Live Data Cloud OAS Service to connect to.

VB

Private Sub ButtonDriverInterfaceCSVHeaderString_Click(sender As System.Object, e As System.EventArgs) Handles ButtonDriverInterfaceCSVHeaderString.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultString As String
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.DriverInterfaceCSVHeaderString(TextBoxNetworkNode.Text)
        If ResultString = "" Then
            TextBoxDriverInterfaceCSVHeaderResult.Text = "OAS Service not reached."
        Else
            TextBoxDriverInterfaceCSVHeaderResult.Text = ResultString
        End If
    End Sub

C#

	    private void ButtonDriverInterfaceCSVHeaderString_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     string ResultString = null;
                     ResultString = ModuleNetworkNode.OPCSystemsComponent1.DriverInterfaceCSVHeaderString(TextBoxNetworkNode.Text);
                     if (string.IsNullOrEmpty(ResultString))
                     {
                           TextBoxDriverInterfaceCSVHeaderResult.Text = "OAS Service not reached.";
                     }
                     else
                     {
                           TextBoxDriverInterfaceCSVHeaderResult.Text = ResultString;
                     }
              }

DriverInterfaceCSVExport

  • The DriverInterfaceCSVExport Function returns an array of comma seperated Strings, each String representing all attributes of a Driver Interface Group.
  • This function is to be used in conjuction with the DriverInterfaceCSVHeaderString Function.
  • Returns Empty 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.

VB

Private Sub ButtonDriverInterfaceCSVExport_Click(sender As System.Object, e As System.EventArgs) Handles ButtonDriverInterfaceCSVExport.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxDriverInterfaceCSVExport.Items.Clear()
        Dim CSVStrings() As String
        Dim ErrorString As String = ""
        CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.DriverInterfaceCSVExport(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            ComboBoxDriverInterfaceCSVExport.Items.AddRange(CSVStrings)
            If ComboBoxDriverInterfaceCSVExport.Items.Count > 0 Then
                ComboBoxDriverInterfaceCSVExport.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

	      private void ButtonDriverInterfaceCSVExport_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxDriverInterfaceCSVExport.Items.Clear();
                     string[] CSVStrings = null;
                     string ErrorString = "";
                     CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.DriverInterfaceCSVExport(TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           ComboBoxDriverInterfaceCSVExport.Items.AddRange(CSVStrings);
                           if (ComboBoxDriverInterfaceCSVExport.Items.Count > 0)
                           {
                                  ComboBoxDriverInterfaceCSVExport.SelectedIndex = 0;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }
 

DriverInterfaceCSVImport

  • The DriverInterfaceCSVImport Function is used to import comma seperated strings to the Driver Interface configuration.
  • Returns a status String describing the success or failure of the import.
  • Returns Empty String if service is not reachable.
  • CSVStrings is an array of comma seperated Strings.
  • The first String in the passed array must be a header String with the unique heading columns that can be obtained with the DriverInterfaceCSVHeaderString Function.
  • Import all or just a few selected columns, but as a minimum the Logging Group Name column must be specified.
  • 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.

VB

Private Sub ButtonDriverInterfaceCSVImport_Click(sender As System.Object, e As System.EventArgs) Handles ButtonDriverInterfaceCSVImport.Click
        Dim ResultString As String
        Dim CSVStrings(3) As String
        CSVStrings(0) = "Name,Driver,Connection,Simulation,IP Address,TCP Port Number,Modbus Ethernet Type,Serial Port Number,Serial Type,Baud Rate,Data Bits,Parity,Stop Bits,Number Of Retries,Number Of Bad Messages To Offline,Check To Return To Online Rate,AB Logix Processor Type,AB Classic Processor Type,Backplane,Slot,Simulate,Gateway,AB Classic Driver,Transaction Timeout,Connection Timeout,AB CSP TCP Port Number,AB EIP TCP Port Number,Siemens Processor Type,Siemens Rack,Siemens Slot,Last Column"
        CSVStrings(1) = "Modbus Driver Interface 01,Modbus,Ethernet,StaticReadWrite,192.168.0.1,502,TCP,1,RTU,9600,8,None,One,3,3,60,ControlLogix,PLC5,1,0,False,False,CSP,250,2500,2222,44818,S7_1500,0,1,Last Column"
        CSVStrings(2) = "Modbus Driver Interface 02,Modbus,Ethernet,StaticReadWrite,192.168.0.2,502,TCP,1,RTU,9600,8,None,One,3,3,60,ControlLogix,PLC5,1,0,False,False,CSP,250,2500,2222,44818,S7_1500,0,1,Last Column"
        CSVStrings(3) = "Modbus Driver Interface 03,Modbus,Ethernet,StaticReadWrite,192.168.0.3,502,TCP,1,RTU,9600,8,None,One,3,3,60,ControlLogix,PLC5,1,0,False,False,CSP,250,2500,2222,44818,S7_1500,0,1,Last Column"
        Dim ErrorString As String = ""
 
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.DriverInterfaceCSVImport(CSVStrings, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            LabelDriverInterfaceCSVImportResult.Text = ResultString
        Else
            LabelDriverInterfaceCSVImportResult.Text = ErrorString
        End If
    End Sub

C#

	    private void ButtonDriverInterfaceCSVImport_Click(object sender, System.EventArgs e)
              {
                     string ResultString = null;
                     string[] CSVStrings = new string[4];
                     CSVStrings[0] = "Name,Driver,Connection,Simulation,IP Address,TCP Port Number,Modbus Ethernet Type,Serial Port Number,Serial Type,Baud Rate,Data Bits,Parity,Stop Bits,Number Of Retries,Number Of Bad Messages To Offline,Check To Return To Online Rate,AB Logix Processor Type,AB Classic Processor Type,Backplane,Slot,Simulate,Gateway,AB Classic Driver,Transaction Timeout,Connection Timeout,AB CSP TCP Port Number,AB EIP TCP Port Number,Siemens Processor Type,Siemens Rack,Siemens Slot,Last Column";
                     CSVStrings[1] = "Modbus Driver Interface 01,Modbus,Ethernet,StaticReadWrite,192.168.0.1,502,TCP,1,RTU,9600,8,None,One,3,3,60,ControlLogix,PLC5,1,0,False,False,CSP,250,2500,2222,44818,S7_1500,0,1,Last Column";
                     CSVStrings[2] = "Modbus Driver Interface 02,Modbus,Ethernet,StaticReadWrite,192.168.0.2,502,TCP,1,RTU,9600,8,None,One,3,3,60,ControlLogix,PLC5,1,0,False,False,CSP,250,2500,2222,44818,S7_1500,0,1,Last Column";
                     CSVStrings[3] = "Modbus Driver Interface 03,Modbus,Ethernet,StaticReadWrite,192.168.0.3,502,TCP,1,RTU,9600,8,None,One,3,3,60,ControlLogix,PLC5,1,0,False,False,CSP,250,2500,2222,44818,S7_1500,0,1,Last Column";
                     string ErrorString = "";
 
                     ResultString = ModuleNetworkNode.OPCSystemsComponent1.DriverInterfaceCSVImport(CSVStrings, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           LabelDriverInterfaceCSVImportResult.Text = ResultString;
                     }
                     else
                     {
                           LabelDriverInterfaceCSVImportResult.Text = ErrorString;
                     }
              }

DataLoggingCSVHeaderString

  • The DataLoggingCSVHeaderString Function returns a String of comma seperated heading to be used with the DataLoggingCSVExport Function.
  • Returns Empty String 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.

VB

 Private Sub ButtonDataLoggingCSVHeaderString_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonDataLoggingCSVHeaderString.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultString As String
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.DataLoggingCSVHeaderString(TextBoxNetworkNode.Text)
        If ResultString = "" Then
            TextBoxDataLoggingCSVHeaderStringResult.Text = "OAS Service not reached."
        Else
            TextBoxDataLoggingCSVHeaderStringResult.Text = ResultString
        End If
    End Sub

C#

	         private void ButtonDataLoggingCSVHeaderString_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     string ResultString = null;
                     ResultString = ModuleNetworkNode.OPCSystemsComponent1.DataLoggingCSVHeaderString(TextBoxNetworkNode.Text);
                     if (string.IsNullOrEmpty(ResultString))
                     {
                           TextBoxDataLoggingCSVHeaderStringResult.Text = "OAS Service not reached.";
                     }
                     else
                     {
                           TextBoxDataLoggingCSVHeaderStringResult.Text = ResultString;
                     }
              }
 

DataLoggingCSVExport

  • The DataLoggingCSVExport Function returns an array of comma seperated Strings, each String representing all attributes of a Data Logging Group.
  • This function is to be used in conjuction with the DataLoggingCSVHeaderString Function.
  • Returns Empty 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.

VB

Private Sub ButtonDataLoggingCSVExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonDataLoggingCSVExport.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxDataLoggingCSVExport.Items.Clear()
        Dim CSVStrings() As String
        Dim CSVString As String
        Dim ErrorString As String = ""
        CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.DataLoggingCSVExport(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each CSVString In CSVStrings
                ComboBoxDataLoggingCSVExport.Items.Add(CSVString)
            Next
            If ComboBoxDataLoggingCSVExport.Items.Count > 0 Then
                ComboBoxDataLoggingCSVExport.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

	      private void ButtonDataLoggingCSVExport_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxDataLoggingCSVExport.Items.Clear();
                     string[] CSVStrings = null;
//INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
//                   string CSVString = null;
                     string ErrorString = "";
                     CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.DataLoggingCSVExport(TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           foreach (string CSVString in CSVStrings)
                           {
                                  ComboBoxDataLoggingCSVExport.Items.Add(CSVString);
                           }
                           if (ComboBoxDataLoggingCSVExport.Items.Count > 0)
                           {
                                  ComboBoxDataLoggingCSVExport.SelectedIndex = 0;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }

DataLoggingCSVImport

  • The DataLoggingCSVImport Function is used to import comma seperated strings to the Data Logging configuration.
  • Returns a status String describing the success or failure of the import.
  • Returns Empty String if service is not reachable.
  • CSVStrings is an array of comma seperated Strings.
  • The first String in the passed array must be a header String with the unique heading columns that can be obtained with the DataLoggingCSVHeaderString Function.
  • Import all or just a few selected columns, but as a minimum the Logging Group Name column must be specified.
  • 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.

VB

Private Sub ButtonDataLoggingCSVImport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonDataLoggingCSVImport.Click
        Dim ResultString As String
        Dim CSVStrings(3) As String
        Dim ErrorString As String = ""
        CSVStrings(0) = "Logging Group Name,Logging Type,Logging Rate,Logging Active"
        CSVStrings(1) = "Group1,Continuous,1.0,False"
        CSVStrings(2) = "Group2,EventDriven,1.0,False"
        CSVStrings(3) = "Group3,SpecificTimeOfDay,1.0,False"
 
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.DataLoggingCSVImport(CSVStrings, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            LabelDataLoggingCSVImportResult.Text = ResultString
        Else
            LabelDataLoggingCSVImportResult.Text = ErrorString
        End If
    End Sub

C#

	        private void ButtonDataLoggingCSVImport_Click(object sender, System.EventArgs e)
              {
                     string ResultString = null;
                     string[] CSVStrings = new string[4];
                     string ErrorString = "";
                     CSVStrings[0] = "Logging Group Name,Logging Type,Logging Rate,Logging Active";
                     CSVStrings[1] = "Group1,Continuous,1.0,False";
                     CSVStrings[2] = "Group2,EventDriven,1.0,False";
                     CSVStrings[3] = "Group3,SpecificTimeOfDay,1.0,False";
 
                     ResultString = ModuleNetworkNode.OPCSystemsComponent1.DataLoggingCSVImport(CSVStrings, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           LabelDataLoggingCSVImportResult.Text = ResultString;
                     }
                     else
                     {
                           LabelDataLoggingCSVImportResult.Text = ErrorString;
                     }
              }

AlarmLoggingCSVHeaderString

  • The AlarmLoggingCSVHeaderString Function returns a String of comma seperated heading to be used with the AlarmLoggingCSVExport Function.
  • Returns Empty String 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.

VB

Private Sub ButtonAlarmLoggingCSVHeaderString_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAlarmLoggingCSVHeaderString.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultString As String
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.AlarmLoggingCSVHeaderString(TextBoxNetworkNode.Text)
        If ResultString = "" Then
            TextBoxAlarmLoggingCSVHeaderStringResult.Text = "OAS Service not reached."
        Else
            TextBoxAlarmLoggingCSVHeaderStringResult.Text = ResultString
        End If
    End Sub

C#

	         private void ButtonAlarmLoggingCSVHeaderString_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     string ResultString = null;
                     ResultString = ModuleNetworkNode.OPCSystemsComponent1.AlarmLoggingCSVHeaderString(TextBoxNetworkNode.Text);
                     if (string.IsNullOrEmpty(ResultString))
                     {
                           TextBoxAlarmLoggingCSVHeaderStringResult.Text = "OAS Service not reached.";
                     }
                     else
                     {
                           TextBoxAlarmLoggingCSVHeaderStringResult.Text = ResultString;
                     }
              }

AlarmLoggingCSVExport Function

  • The AlarmLoggingCSVExport Function returns an array of comma seperated Strings, each String representing all attributes of a Alarm Logging Group.
  • This function is to be used in conjuction with the AlarmLoggingCSVHeaderString Function.
  • Returns Empty 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.

VB

Private Sub ButtonAlarmLoggingCSVExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAlarmLoggingCSVExport.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxAlarmLoggingCSVExport.Items.Clear()
        Dim CSVStrings() As String
        Dim CSVString As String
        Dim ErrorString As String = ""
        CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.AlarmLoggingCSVExport(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each CSVString In CSVStrings
                ComboBoxAlarmLoggingCSVExport.Items.Add(CSVString)
            Next
            If ComboBoxAlarmLoggingCSVExport.Items.Count > 0 Then
                ComboBoxAlarmLoggingCSVExport.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

	       private void ButtonAlarmLoggingCSVExport_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxAlarmLoggingCSVExport.Items.Clear();
                     string[] CSVStrings = null;
//INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
//                   string CSVString = null;
                     string ErrorString = "";
                     CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.AlarmLoggingCSVExport(TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           foreach (string CSVString in CSVStrings)
                           {
                                  ComboBoxAlarmLoggingCSVExport.Items.Add(CSVString);
                           }
                           if (ComboBoxAlarmLoggingCSVExport.Items.Count > 0)
                           {
                                  ComboBoxAlarmLoggingCSVExport.SelectedIndex = 0;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }
 

AlarmLoggingCSVImport

  • The AlarmLoggingCSVImport Function is used to import comma seperated strings to the Alarm Logging configuration.
  • Returns a status String describing the success or failure of the import.
  • Returns Empty String if service is not reachable.
  • CSVStrings is an array of comma seperated Strings.
  • The first String in the passed array must be a header String with the unique heading columns that can be obtained with the AlarmLoggingCSVHeaderString Function.
  • Import all or just a few selected columns, but as a minimum the Logging Group Name column must be specified.
  • 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.

VB

Private Sub ButtonAlarmLoggingCSVImport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAlarmLoggingCSVImport.Click
        Dim ResultString As String
        Dim CSVStrings(3) As String
        Dim ErrorString As String = ""
        CSVStrings(0) = "Logging Group Name,Min Priority,Max Priority"
        CSVStrings(1) = "Group1,0,1000000"
        CSVStrings(2) = "Group2,0,1000000"
        CSVStrings(3) = "Group3,0,1000000"
 
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.AlarmLoggingCSVImport(CSVStrings, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            LabelAlarmLoggingCSVImportResult.Text = ResultString
        Else
            LabelAlarmLoggingCSVImportResult.Text = ErrorString
        End If
 
    End Sub

C#

	       private void ButtonAlarmLoggingCSVImport_Click(object sender, System.EventArgs e)
              {
                     string ResultString = null;
                     string[] CSVStrings = new string[4];
                     string ErrorString = "";
                     CSVStrings[0] = "Logging Group Name,Min Priority,Max Priority";
                     CSVStrings[1] = "Group1,0,1000000";
                     CSVStrings[2] = "Group2,0,1000000";
                     CSVStrings[3] = "Group3,0,1000000";
 
                     ResultString = ModuleNetworkNode.OPCSystemsComponent1.AlarmLoggingCSVImport(CSVStrings, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           LabelAlarmLoggingCSVImportResult.Text = ResultString;
                     }
                     else
                     {
                           LabelAlarmLoggingCSVImportResult.Text = ErrorString;
                     }
 
              }

ReportCSVHeaderString

  • The ReportCSVHeaderString Function returns a String of comma seperated heading to be used with the ReportCSVExport Function.
  • Returns Empty String 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.

VB

Private Sub ButtonReportCSVHeaderString_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonReportCSVHeaderString.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultString As String
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.ReportCSVHeaderString(TextBoxNetworkNode.Text)
        If ResultString = "" Then
            TextBoxReportCSVHeaderStringResult.Text = "OAS Service not reached."
        Else
            TextBoxReportCSVHeaderStringResult.Text = ResultString
        End If
    End Sub

C#

	  
 private void ButtonReportCSVHeaderString_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     string ResultString = null;
                     ResultString = ModuleNetworkNode.OPCSystemsComponent1.ReportCSVHeaderString(TextBoxNetworkNode.Text);
                     if (string.IsNullOrEmpty(ResultString))
                     {
                           TextBoxReportCSVHeaderStringResult.Text = "OAS Service not reached.";
                     }
                     else
                     {
                           TextBoxReportCSVHeaderStringResult.Text = ResultString;
                     }
              }  

ReportCSVExport

  • The ReportCSVExport Function returns an array of comma seperated Strings, each String representing all attributes of a Alarm Logging Group.
  • This function is to be used in conjuction with the ReportCSVHeaderString Function.
  • Returns Empty 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.

VB

Private Sub ButtonReportCSVExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonReportCSVExport.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxReportCSVExport.Items.Clear()
        Dim CSVStrings() As String
        Dim CSVString As String
        Dim ErrorString As String = ""
        CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.ReportCSVExport(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each CSVString In CSVStrings
                ComboBoxReportCSVExport.Items.Add(CSVString)
            Next
            If ComboBoxReportCSVExport.Items.Count > 0 Then
                ComboBoxReportCSVExport.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

	     private void ButtonReportCSVExport_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxReportCSVExport.Items.Clear();
                     string[] CSVStrings = null;
//INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
//                   string CSVString = null;
                     string ErrorString = "";
                     CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.ReportCSVExport(TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           foreach (string CSVString in CSVStrings)
                           {
                                  ComboBoxReportCSVExport.Items.Add(CSVString);
                           }
                           if (ComboBoxReportCSVExport.Items.Count > 0)
                           {
                                  ComboBoxReportCSVExport.SelectedIndex = 0;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }

ReportCSVImport

  • The ReportCSVImport Function is used to import comma seperated strings to the Alarm Logging configuration.
  • Returns a status String describing the success or failure of the import.
  • Returns Empty String if service is not reachable.
  • CSVStrings is an array of comma seperated Strings.
  • The first String in the passed array must be a header String with the unique heading columns that can be obtained with the ReportCSVHeaderString Function.
  • Import all or just a few selected columns, but as a minimum the Logging Group Name column must be specified.
  • 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.

VB

 Private Sub ButtonReportCSVImport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonReportCSVImport.Click
        Dim ResultString As String
        Dim CSVStrings(3) As String
        Dim ErrorString As String = ""
 
        CSVStrings(0) = "Report Name,Output Type"
        CSVStrings(1) = "Report1,Excel"
        CSVStrings(2) = "Report2,HTML_Plain"
        CSVStrings(3) = "Report3,PDF_SystemFonts"
 
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.ReportCSVImport(CSVStrings, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            LabelReportCSVImportResult.Text = ResultString
        Else
            LabelReportCSVImportResult.Text = ErrorString
        End If
    End Sub

C#

	      private void ButtonReportCSVImport_Click(object sender, System.EventArgs e)
              {
                     string ResultString = null;
                     string[] CSVStrings = new string[4];
                     string ErrorString = "";
 
                     CSVStrings[0] = "Report Name,Output Type";
                     CSVStrings[1] = "Report1,Excel";
                     CSVStrings[2] = "Report2,HTML_Plain";
                     CSVStrings[3] = "Report3,PDF_SystemFonts";
 
                     ResultString = ModuleNetworkNode.OPCSystemsComponent1.ReportCSVImport(CSVStrings, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           LabelReportCSVImportResult.Text = ResultString;
                     }
                     else
                     {
                           LabelReportCSVImportResult.Text = ErrorString;
                     }
              }

RecipeCSVHeaderString

  • The RecipeCSVHeaderString Function returns a String of comma seperated heading to be used with the RecipeCSVExport Function.
  • Returns Empty String 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.

VB

Private Sub ButtonRecipeCSVHeaderString_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRecipeCSVHeaderString.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultString As String
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.RecipeCSVHeaderString(TextBoxNetworkNode.Text)
        If ResultString = "" Then
            TextBoxRecipeCSVHeaderStringResult.Text = "OAS Service not reached."
        Else
            TextBoxRecipeCSVHeaderStringResult.Text = ResultString
        End If
    End Sub

C#

	     private void ButtonRecipeCSVHeaderString_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     string ResultString = null;
                     ResultString = ModuleNetworkNode.OPCSystemsComponent1.RecipeCSVHeaderString(TextBoxNetworkNode.Text);
                     if (string.IsNullOrEmpty(ResultString))
                     {
                           TextBoxRecipeCSVHeaderStringResult.Text = "OAS Service not reached.";
                     }
                     else
                     {
                           TextBoxRecipeCSVHeaderStringResult.Text = ResultString;
                     }
              }

RecipeCSVExport

  • The RecipeCSVExport Function returns an array of comma seperated Strings, each String representing all attributes of a Alarm Logging Group.
  • This function is to be used in conjuction with the RecipeCSVHeaderString Function.
  • Returns Empty 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.

VB

Private Sub ButtonRecipeCSVExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRecipeCSVExport.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxRecipeCSVExport.Items.Clear()
        Dim CSVStrings() As String
        Dim CSVString As String
        Dim ErrorString As String = ""
        CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.RecipeCSVExport(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each CSVString In CSVStrings
                ComboBoxRecipeCSVExport.Items.Add(CSVString)
            Next
            If ComboBoxRecipeCSVExport.Items.Count > 0 Then
                ComboBoxRecipeCSVExport.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

	

  private void ButtonRecipeCSVExport_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxRecipeCSVExport.Items.Clear();
                     string[] CSVStrings = null;
//INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
//                   string CSVString = null;
                     string ErrorString = "";
                     CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.RecipeCSVExport(TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                            foreach (string CSVString in CSVStrings)
                           {
                                  ComboBoxRecipeCSVExport.Items.Add(CSVString);
                           }
                           if (ComboBoxRecipeCSVExport.Items.Count > 0)
                           {
                                  ComboBoxRecipeCSVExport.SelectedIndex = 0;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }    

RecipeCSVImport

  • The RecipeCSVImport Function is used to import comma seperated strings to the Alarm Logging configuration.
  • Returns a status String describing the success or failure of the import.
  • Returns Empty String if service is not reachable.
  • CSVStrings is an array of comma seperated Strings.
  • The first String in the passed array must be a header String with the unique heading columns that can be obtained with the RecipeCSVHeaderString Function.
  • Import all or just a few selected columns, but as a minimum the Logging Group Name column must be specified.
  • 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.

VB

Private Sub ButtonRecipeCSVImport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRecipeCSVImport.Click
        Dim ResultString As String
        Dim CSVStrings(3) As String
        Dim ErrorString As String = ""
 
        CSVStrings(0) = "Recipe Name,Recipe Type"
        CSVStrings(1) = "Recipe1,MultipleRecords"
        CSVStrings(2) = "Recipe2,SingleRecord"
        CSVStrings(3) = "Recipe3,Queued"
 
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.RecipeCSVImport(CSVStrings, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            LabelRecipeCSVImportResult.Text = ResultString
        Else
            LabelRecipeCSVImportResult.Text = ErrorString
        End If
    End Sub

C#

	     private void ButtonRecipeCSVImport_Click(object sender, System.EventArgs e)
              {
                     string ResultString = null;
                     string[] CSVStrings = new string[4];
                     string ErrorString = "";
 
                     CSVStrings[0] = "Recipe Name,Recipe Type";
                     CSVStrings[1] = "Recipe1,MultipleRecords";
                     CSVStrings[2] = "Recipe2,SingleRecord";
                     CSVStrings[3] = "Recipe3,Queued";
 
                     ResultString = ModuleNetworkNode.OPCSystemsComponent1.RecipeCSVImport(CSVStrings, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           LabelRecipeCSVImportResult.Text = ResultString;
                     }
                     else
                     {
                           LabelRecipeCSVImportResult.Text = ErrorString;
                     }
              }

AlarmNotificationCSVHeaderString

  • The AlarmNotificationCSVHeaderString Function returns a String of comma seperated heading to be used with the AlarmNotificationCSVExport Function.
  • Returns Empty String 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.

VB

	      Private Sub ButtonAlarmNotificationCSVHeaderString_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAlarmNotificationCSVHeaderString.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultString As String
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.AlarmNotificationCSVHeaderString(TextBoxNetworkNode.Text)
        If ResultString = "" Then
            TextBoxAlarmNotificationCSVHeaderStringResult.Text = "OAS Service not reached."
        Else
            TextBoxAlarmNotificationCSVHeaderStringResult.Text = ResultString
        End If
    End Sub

C#

	     private void ButtonAlarmNotificationCSVHeaderString_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     string ResultString = null;
                     ResultString = ModuleNetworkNode.OPCSystemsComponent1.AlarmNotificationCSVHeaderString(TextBoxNetworkNode.Text);
                     if (string.IsNullOrEmpty(ResultString))
                     {
                           TextBoxAlarmNotificationCSVHeaderStringResult.Text = "OAS Service not reached.";
                     }
                     else
                     {
                           TextBoxAlarmNotificationCSVHeaderStringResult.Text = ResultString;
                     }
              }

AlarmNotificationCSVExport

  • The AlarmNotificationCSVExport Function returns an array of comma seperated Strings, each String representing all attributes of a Alarm Notification Group.
  • This function is to be used in conjuction with the AlarmNotificationCSVHeaderString Function.
  • Returns Empty 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.

VB

Private Sub ButtonAlarmNotificationCSVExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAlarmNotificationCSVExport.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxAlarmNotificationCSVExport.Items.Clear()
        Dim CSVStrings() As String
        Dim CSVString As String
        Dim ErrorString As String = ""
        CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.AlarmNotificationCSVExport(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each CSVString In CSVStrings
                ComboBoxAlarmNotificationCSVExport.Items.Add(CSVString)
            Next
            If ComboBoxAlarmNotificationCSVExport.Items.Count > 0 Then
                ComboBoxAlarmNotificationCSVExport.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

 private void ButtonAlarmNotificationCSVExport_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxAlarmNotificationCSVExport.Items.Clear();
                     string[] CSVStrings = null;
//INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
//                   string CSVString = null;
                     string ErrorString = "";
                     CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.AlarmNotificationCSVExport(TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           foreach (string CSVString in CSVStrings)
                           {
                                  ComboBoxAlarmNotificationCSVExport.Items.Add(CSVString);
                           }
                           if (ComboBoxAlarmNotificationCSVExport.Items.Count > 0)
                           {
                                  ComboBoxAlarmNotificationCSVExport.SelectedIndex = 0;
                           }
                     }
                     else
                     {
                            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }	    

AlarmNotificationCSVImport

  • The AlarmNotificationCSVImport Function is used to import comma seperated strings to the Alarm Notification configuration.
  • Returns a status String describing the success or failure of the import.
  • Returns Empty String if service is not reachable.
  • CSVStrings is an array of comma seperated Strings.
  • The first String in the passed array must be a header String with the unique heading columns that can be obtained with the AlarmNotificationCSVHeaderString Function.
  • Import all or just a few selected columns, but as a minimum the Notification Group Name column must be specified.
  • 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.

VB

Private Sub ButtonAlarmNotificationCSVImport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAlarmNotificationCSVImport.Click
        Dim ResultString As String
        Dim CSVStrings(3) As String
        Dim ErrorString As String = ""
        CSVStrings(0) = "Notification Group Name,Min Priority,Max Priority"
        CSVStrings(1) = "Group1,0,1000000"
        CSVStrings(2) = "Group2,0,1000000"
        CSVStrings(3) = "Group3,0,1000000"
 
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.AlarmNotificationCSVImport(CSVStrings, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            LabelAlarmNotificationCSVImportResult.Text = ResultString
        Else
            LabelAlarmNotificationCSVImportResult.Text = ErrorString
        End If
    End Sub

C#

	     private void ButtonAlarmNotificationCSVImport_Click(object sender, System.EventArgs e)
              {
                     string ResultString = null;
                     string[] CSVStrings = new string[4];
                     string ErrorString = "";
                     CSVStrings[0] = "Notification Group Name,Min Priority,Max Priority";
                     CSVStrings[1] = "Group1,0,1000000";
                     CSVStrings[2] = "Group2,0,1000000";
                     CSVStrings[3] = "Group3,0,1000000";
 
                     ResultString = ModuleNetworkNode.OPCSystemsComponent1.AlarmNotificationCSVImport(CSVStrings, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           LabelAlarmNotificationCSVImportResult.Text = ResultString;
                     }
                     else
                     {
                           LabelAlarmNotificationCSVImportResult.Text = ErrorString;
                     }
              }
 

SecurityCSVHeaderString

  • The SecurityCSVHeaderString Function returns a String of comma seperated heading to be used with the SecurityCSVExport Function.
  • Returns Empty String 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.
  • VB
Private Sub ButtonSecurityCSVHeaderString_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSecurityCSVHeaderString.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultString As String
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.SecurityCSVHeaderString(TextBoxNetworkNode.Text)
        If ResultString = "" Then
            TextBoxSecurityCSVHeaderStringResult.Text = "OAS Service not reached."
        Else
            TextBoxSecurityCSVHeaderStringResult.Text = ResultString
        End If
    End Sub

C#

	     private void ButtonSecurityCSVHeaderString_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     string ResultString = null;
                     ResultString = ModuleNetworkNode.OPCSystemsComponent1.SecurityCSVHeaderString(TextBoxNetworkNode.Text);
                     if (string.IsNullOrEmpty(ResultString))
                     {
                           TextBoxSecurityCSVHeaderStringResult.Text = "OAS Service not reached.";
                     }
                     else
                     {
                           TextBoxSecurityCSVHeaderStringResult.Text = ResultString;
                     }
              }

SecurityCSVExport

  • The SecurityCSVExport Function returns an array of comma seperated Strings, each String representing all attributes of a Alarm Logging Group.
  • This function is to be used in conjuction with the SecurityCSVHeaderString Function.
  • Returns Empty 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.

VB

Private Sub ButtonSecurityCSVExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSecurityCSVExport.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxSecurityCSVExport.Items.Clear()
        Dim CSVStrings() As String
        Dim CSVString As String
        Dim ErrorString As String = ""
        CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.SecurityCSVExport(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each CSVString In CSVStrings
                ComboBoxSecurityCSVExport.Items.Add(CSVString)
            Next
            If ComboBoxSecurityCSVExport.Items.Count > 0 Then
                ComboBoxSecurityCSVExport.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

	  private void ButtonSecurityCSVExport_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxSecurityCSVExport.Items.Clear();
                     string[] CSVStrings = null;
//INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
//                   string CSVString = null;
                     string ErrorString = "";
                     CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.SecurityCSVExport(TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           foreach (string CSVString in CSVStrings)
                           {
                                  ComboBoxSecurityCSVExport.Items.Add(CSVString);
                           }
                           if (ComboBoxSecurityCSVExport.Items.Count > 0)
                           {
                                  ComboBoxSecurityCSVExport.SelectedIndex = 0;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }

SecurityCSVImport

  • The SecurityCSVImport Function is used to import comma seperated strings to the Alarm Logging configuration.
  • Returns a status String describing the success or failure of the import.
  • Returns Empty String if service is not reachable.
  • CSVStrings is an array of comma seperated Strings.
  • The first String in the passed array must be a header String with the unique heading columns that can be obtained with the SecurityCSVHeaderString Function.
  • Import all or just a few selected columns, but as a minimum the Logging Group Name column must be specified.
  • 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.

VB

    Private Sub ButtonSecurityCSVImport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSecurityCSVImport.Click
        Dim ResultString As String
        Dim CSVStrings(3) As String
        Dim ErrorString As String = ""
 
        CSVStrings(0) = "Group Name,Enable All"
        CSVStrings(1) = "Security1,1"
        CSVStrings(2) = "Security2,1"
        CSVStrings(3) = "Security3,1"
 
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.SecurityCSVImport(CSVStrings, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            LabelSecurityCSVImportResult.Text = ResultString
        Else
            LabelSecurityCSVImportResult.Text = ErrorString
        End If
    End Sub

C#

	    

The SecurityUsersCSVHeaderString

  • The SecurityUsersCSVHeaderString Function returns a String of comma seperated heading to be used with the SecurityUsersCSVExport Function.
  • Returns Empty String if service is not reachable.

VB

   
 NetworkNode is the name of the network node of the OAS Service to connect to.  Leave blank for localhost connection.
    Private Sub ButtonSecurityUsersCSVHeaderString_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSecurityUsersCSVHeaderString.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultString As String
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.SecurityUsersCSVHeaderString(TextBoxNetworkNode.Text)
        If ResultString = "" Then
            TextBoxSecurityUsersCSVHeaderStringResult.Text = "OAS Service not reached."
        Else
            TextBoxSecurityUsersCSVHeaderStringResult.Text = ResultString
        End If
    End Sub

C#

	    private void ButtonSecurityUsersCSVHeaderString_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     string ResultString = null;
                     ResultString = ModuleNetworkNode.OPCSystemsComponent1.SecurityUsersCSVHeaderString(TextBoxNetworkNode.Text);
                     if (string.IsNullOrEmpty(ResultString))
                     {
                           TextBoxSecurityUsersCSVHeaderStringResult.Text = "OAS Service not reached.";
                     }
                     else
                     {
                           TextBoxSecurityUsersCSVHeaderStringResult.Text = ResultString;
                     }
              }
 

SecurityUsersCSVExport

  • The SecurityUsersCSVExport Function returns an array of comma seperated Strings, each String representing all attributes of a Alarm Logging Group.
  • This function is to be used in conjuction with the SecurityUsersCSVHeaderString Function.
  • Returns Empty 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.

VB

	       Private Sub ButtonSecurityUsersCSVExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSecurityUsersCSVExport.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxSecurityUsersCSVExport.Items.Clear()
        Dim CSVStrings() As String
        Dim CSVString As String
        Dim ErrorString As String = ""
        CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.SecurityUsersCSVExport(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each CSVString In CSVStrings
                ComboBoxSecurityUsersCSVExport.Items.Add(CSVString)
            Next
            If ComboBoxSecurityUsersCSVExport.Items.Count > 0 Then
                ComboBoxSecurityUsersCSVExport.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

	      private void ButtonSecurityUsersCSVExport_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxSecurityUsersCSVExport.Items.Clear();
                     string[] CSVStrings = null;
//INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
//                   string CSVString = null;
                     string ErrorString = "";
                     CSVStrings = ModuleNetworkNode.OPCSystemsComponent1.SecurityUsersCSVExport(TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           foreach (string CSVString in CSVStrings)
                           {
                                  ComboBoxSecurityUsersCSVExport.Items.Add(CSVString);
                           }
                           if (ComboBoxSecurityUsersCSVExport.Items.Count > 0)
                           {
                                  ComboBoxSecurityUsersCSVExport.SelectedIndex = 0;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }

SecurityUsersCSVImport

  • The SecurityUsersCSVImport Function is used to import comma seperated strings to the Alarm Logging configuration.
  • Returns a status String describing the success or failure of the import.
  • Returns Empty String if service is not reachable.
  • CSVStrings is an array of comma seperated Strings.
  • The first String in the passed array must be a header String with the unique heading columns that can be obtained with the SecurityUsersCSVHeaderString Function.
  • Import all or just a few selected columns, but as a minimum the Logging Group Name column must be specified.
  • 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.

VB

    Private Sub ButtonSecurityUsersCSVImport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSecurityUsersCSVImport.Click
        Dim ResultString As String
        Dim CSVStrings(3) As String
        Dim ErrorString As String = ""
 
        CSVStrings(0) = "UserName,Password,Security Group"
        CSVStrings(1) = "User1,Password1,Security1"
        CSVStrings(2) = "User2,Password2,Security2"
        CSVStrings(3) = "User3,Password3,Security3"
 
        ResultString = ModuleNetworkNode.OPCSystemsComponent1.SecurityUsersCSVImport(CSVStrings, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            LabelSecurityUsersCSVImportResult.Text = ResultString
        Else
            LabelSecurityUsersCSVImportResult.Text = ErrorString
        End If
    End Sub

C#

	      private void ButtonSecurityUsersCSVImport_Click(object sender, System.EventArgs e)
              {
                     string ResultString = null;
                     string[] CSVStrings = new string[4];
                     string ErrorString = "";
 
                     CSVStrings[0] = "UserName,Password,Security Group";
                     CSVStrings[1] = "User1,Password1,Security1";
                     CSVStrings[2] = "User2,Password2,Security2";
                     CSVStrings[3] = "User3,Password3,Security3";
 
                     ResultString = ModuleNetworkNode.OPCSystemsComponent1.SecurityUsersCSVImport(CSVStrings, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           LabelSecurityUsersCSVImportResult.Text = ResultString;
                     }
                     else
                     {
                           LabelSecurityUsersCSVImportResult.Text = ErrorString;
                     }
              }

Alarm Notification Groups

Use the OPC Systems component in your Visual Studio application to programmatically modify alarm notification groups. Refer to the FormConfigureAlarmNotification Form in the WinForm Example Code example for an example and how to add and modify alarm logging groups.

GetAlarmNotificationNames

The GetAlarmNotificationNames Function returns a list of the Alarm Notification 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.

VB

Private Sub ButtonGetAlarmNotificationNames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetAlarmNotificationNames.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetAlarmNotificationNames.Items.Clear()
        Dim Groups() As String
        Dim Group As String
        Dim ErrorString As String = ""
        Groups = ModuleNetworkNode.OPCSystemsComponent1.GetAlarmNotificationNames(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each Group In Groups
                ComboBoxGetAlarmNotificationNames.Items.Add(Group)
            Next
            If ComboBoxGetAlarmNotificationNames.Items.Count > 0 Then
                ComboBoxGetAlarmNotificationNames.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub
 
    Private Sub ComboBoxGetAlarmNotificationNames_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetAlarmNotificationNames.SelectedIndexChanged
        TextBoxAlarmNotificationGroup.Text = ComboBoxGetAlarmNotificationNames.SelectedItem
    End Sub

C#

              private void ButtonGetAlarmNotificationNames_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetAlarmNotificationNames.Items.Clear();
                     string[] Groups = null;

//INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
//                   string Group = null;
                     string ErrorString = "";
                     Groups = ModuleNetworkNode.OPCSystemsComponent1.GetAlarmNotificationNames(TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           foreach (string Group in Groups)
                           {
                                  ComboBoxGetAlarmNotificationNames.Items.Add(Group);
                           }
                           if (ComboBoxGetAlarmNotificationNames.Items.Count > 0)
                           {
                                  ComboBoxGetAlarmNotificationNames.SelectedIndex = 0;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }
 
              private void ComboBoxGetAlarmNotificationNames_SelectedIndexChanged(object sender, System.EventArgs e)
              {
                     TextBoxAlarmNotificationGroup.Text = ComboBoxGetAlarmNotificationNames.SelectedItem.ToString();
              }
 

AddAlarmNotificationGroup

The AddAlarmNotificationGroup Function adds a Alarm Notification Group to the existing Alarm Notification 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.

VB

    Private Sub ButtonAddAlarmNotificationGroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAddAlarmNotificationGroup.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.AddAlarmNotificationGroup(TextBoxAlarmNotificationGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelAddAlarmNotificationGroupResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelAddAlarmNotificationGroupResult.Text = "Group successfully added."
        Else
            LabelAddAlarmNotificationGroupResult.Text = ErrorString
        End If
    End Sub

C#

              private void ButtonAddAlarmNotificationGroup_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     Int32 ResultInt32 = 0;
                     string ErrorString = "";
                     ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.AddAlarmNotificationGroup(TextBoxAlarmNotificationGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ResultInt32 == -1)
                     {
                           LabelAddAlarmNotificationGroupResult.Text = "OAS Service not reached.";
                     }
                     else if (ResultInt32 == 1)
                     {
                           LabelAddAlarmNotificationGroupResult.Text = "Group successfully added.";
                     }
                     else
                     {
                           LabelAddAlarmNotificationGroupResult.Text = ErrorString;
                     }
              }
              

RemoveAlarmNotificationGroup

The RemoveAlarmNotificationGroup Function removes a Alarm Notification Group from the existing Alarm Notification 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.

VB

    Private Sub ButtonRemoveAlarmNotificationGroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRemoveAlarmNotificationGroup.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.RemoveAlarmNotificationGroup(TextBoxAlarmNotificationGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelRemoveAlarmNotificationGroupResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelRemoveAlarmNotificationGroupResult.Text = "Group successfully removed."
        Else
            LabelRemoveAlarmNotificationGroupResult.Text = ErrorString
        End If
    End Sub

C#

              private void ButtonRemoveAlarmNotificationGroup_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     Int32 ResultInt32 = 0;
                     string ErrorString = "";
                     ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.RemoveAlarmNotificationGroup(TextBoxAlarmNotificationGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ResultInt32 == -1)
                     {
                           LabelRemoveAlarmNotificationGroupResult.Text = "OAS Service not reached.";
                     }
                     else if (ResultInt32 == 1)
                     {
                           LabelRemoveAlarmNotificationGroupResult.Text = "Group successfully removed.";
                     }
                     else
                     {
                           LabelRemoveAlarmNotificationGroupResult.Text = ErrorString;
                     }
              }

GetAlarmNotificationParameterStrings

The GetAlarmNotificationParameterStrings Function returns an array of Strings containing all property types available for each Alarm Notification Group.

Returns Empty String Array if service is not reachable.

Returns a String Array of property types for all possible Parameters for a Alarm Notification Group.

NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.

VB

    Private Sub ButtonGetAlarmNotificationParameterStrings_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetAlarmNotificationParameterStrings.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetAlarmNotificationParameterStrings.Items.Clear()
        Dim Parameters() As String
        Dim Parameter As String
        Parameters = ModuleNetworkNode.OPCSystemsComponent1.GetAlarmNotificationParameterStrings(TextBoxNetworkNode.Text)
        For Each Parameter In Parameters
            ComboBoxGetAlarmNotificationParameterStrings.Items.Add(Parameter)
        Next
        If ComboBoxGetAlarmNotificationParameterStrings.Items.Count > 0 Then
            ComboBoxGetAlarmNotificationParameterStrings.SelectedIndex = 1
        End If
    End Sub
 
    Private Sub ComboBoxGetAlarmNotificationParameterStrings_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetAlarmNotificationParameterStrings.SelectedIndexChanged
        TextBoxParameter.Text = ComboBoxGetAlarmNotificationParameterStrings.SelectedItem
    End Sub

C#

              private void ButtonGetAlarmNotificationParameterStrings_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetAlarmNotificationParameterStrings.Items.Clear();
                     string[] Parameters = null;
//INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
//                   string Parameter = null;
                     Parameters = ModuleNetworkNode.OPCSystemsComponent1.GetAlarmNotificationParameterStrings(TextBoxNetworkNode.Text);
                     foreach (string Parameter in Parameters)
                     {
                           ComboBoxGetAlarmNotificationParameterStrings.Items.Add(Parameter);
                     }
                     if (ComboBoxGetAlarmNotificationParameterStrings.Items.Count > 0)
                     {
                           ComboBoxGetAlarmNotificationParameterStrings.SelectedIndex = 1;
                     }
              }
 
              private void ComboBoxGetAlarmNotificationParameterStrings_SelectedIndexChanged(object sender, System.EventArgs e)
              {
                     TextBoxParameter.Text = ComboBoxGetAlarmNotificationParameterStrings.SelectedItem.ToString();
              }

GetAlarmNotification_Parameter_Value

The GetAlarmNotification_Parameter_Value Function returns an object value for the Alarm Notification Group and Parameter specified.

Returns nothing if service is not reachable.

Parameter is a String of the Parameter Type desired of the Alarm Notification Group.

Group is a String of the Alarm Notification 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.

VB

    Private Sub ButtonGetAlarmNotification_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetAlarmNotification_Parameter_Value.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultObject As Object
        Dim ErrorString As String = ""
        ResultObject = ModuleNetworkNode.OPCSystemsComponent1.GetAlarmNotification_Parameter_Value(TextBoxParameter.Text, TextBoxAlarmNotificationGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            If ResultObject Is Nothing Then
                LabelGetAlarmNotification_Parameter_ValueResult.Text = ""
                TextBoxValueToSet.Text = ""
            Else
                Try
                    LabelGetAlarmNotification_Parameter_ValueResult.Text = ResultObject
                    TextBoxValueToSet.Text = ResultObject
                Catch ex As Exception
                    LabelGetAlarmNotification_Parameter_ValueResult.Text = "Error converting value to string."
                    TextBoxValueToSet.Text = ""
                End Try
            End If
        Else
            LabelGetAlarmNotification_Parameter_ValueResult.Text = ErrorString
            TextBoxValueToSet.Text = ""
        End If
    End Sub

C#

              private void ButtonGetAlarmNotification_Parameter_Value_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     object ResultObject = null;
                     string ErrorString = "";
                     ResultObject = ModuleNetworkNode.OPCSystemsComponent1.GetAlarmNotification_Parameter_Value(TextBoxParameter.Text, TextBoxAlarmNotificationGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           if (ResultObject == null)
                           {
                                   LabelGetAlarmNotification_Parameter_ValueResult.Text = "";
                                  TextBoxValueToSet.Text = "";
                           }
                           else
                           {
                                  try
                                  {
                                         LabelGetAlarmNotification_Parameter_ValueResult.Text = ResultObject.ToString();
                                         TextBoxValueToSet.Text = ResultObject.ToString();
                                  }
                                  catch (Exception ex)
                                  {
                                         LabelGetAlarmNotification_Parameter_ValueResult.Text = "Error converting value to string.";
                                         TextBoxValueToSet.Text = "";
                                  }
                           }
                     }
                     else
                     {
                           LabelGetAlarmNotification_Parameter_ValueResult.Text = ErrorString;
                           TextBoxValueToSet.Text = "";
                     }
              }

GetAlarmNotification_Parameter_Values

The GetAlarmNotification_Parameter_Values Function returns an array of object values for the Alarm Notification Group specified.

The order of the array corresponds with the GetAlarmNotificationParameterStrings Function order.

Returns empty array if service is not reachable.

Group is a String of the Alarm Notification 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.

VB

Private Sub ButtonGetAlarmNotification_Parameter_Values_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetAlarmNotification_Parameter_Values.Click
 Cursor.Current = Cursors.WaitCursor
 ComboBoxGetAlarmNotification_Parameter_Values.Items.Clear()
 Dim ResultObjects() As Object
 Dim ResultObject As Object
 Dim ResultString As String
 Dim ErrorString As String = ""
 ResultObjects = ModuleNetworkNode.OPCSystemsComponent1.GetAlarmNotification_Parameter_Values(TextBoxAlarmNotificationGroup.Text, TextBoxNetworkNode.Text, ErrorString)
 If ErrorString = "Success" Then
 For Each ResultObject In ResultObjects
 Try
 If ResultObject Is Nothing Then
 ResultString = ""
 Else
 ResultString = ResultObject
 End If
 ComboBoxGetAlarmNotification_Parameter_Values.Items.Add(ResultString)
 Catch ex As Exception
 ComboBoxGetAlarmNotification_Parameter_Values.Items.Add("Error Converting Object")
 End Try
 Next
 If ComboBoxGetAlarmNotification_Parameter_Values.Items.Count > 0 Then
 ComboBoxGetAlarmNotification_Parameter_Values.SelectedIndex = 1
 End If
 Else
 MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
 End If
 End Sub

SetAlarmNotification_Parameter_Value

The SetAlarmNotification_Parameter_Value Function sets an object value for the Alarm Notification 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 Alarm Notification Group.

Value is the desired value to set.

Group is a String of the Alarm Notification 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.

VB

    Private Sub ButtonSetAlarmNotification_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSetAlarmNotification_Parameter_Value.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.SetAlarmNotification_Parameter_Value(TextBoxParameter.Text, TextBoxValueToSet.Text, TextBoxAlarmNotificationGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelSetAlarmNotification_Parameter_ValueResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelSetAlarmNotification_Parameter_ValueResult.Text = "Parameter Successfully Updated."
        Else
            LabelSetAlarmNotification_Parameter_ValueResult.Text = ErrorString
        End If
    End Sub

C#

              private void ButtonGetAlarmNotification_Parameter_Values_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetAlarmNotification_Parameter_Values.Items.Clear();
                     object[] ResultObjects = null;
//INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
//                   object ResultObject = null;
                     string ResultString = null;
                     string ErrorString = "";
                     ResultObjects = ModuleNetworkNode.OPCSystemsComponent1.GetAlarmNotification_Parameter_Values(TextBoxAlarmNotificationGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           foreach (object ResultObject in ResultObjects)
                           {
                                  try
                                  {
                                         if (ResultObject == null)
                                         {
                                                ResultString = "";
                                         }
                                         else
                                         {
                                                ResultString = ResultObject.ToString();
                                         }
                                         ComboBoxGetAlarmNotification_Parameter_Values.Items.Add(ResultString);
                                  }
                                  catch (Exception ex)
                                  {
                                         ComboBoxGetAlarmNotification_Parameter_Values.Items.Add("Error Converting Object");
                                  }
                           }
                           if (ComboBoxGetAlarmNotification_Parameter_Values.Items.Count > 0)
                           {
                                  ComboBoxGetAlarmNotification_Parameter_Values.SelectedIndex = 1;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }

SaveAlarmNotificationConfiguration

The SaveAlarmNotificationConfiguration Subroutine saves the current Alarm Notification 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.

VB

    Private Sub ButtonSaveAlarmNotificationConfiguration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSaveAlarmNotificationConfiguration.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ErrorString As String = ""
        ModuleNetworkNode.OPCSystemsComponent1.SaveAlarmNotificationConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub
              private void ButtonSetAlarmNotification_Parameter_Value_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     Int32 ResultInt32 = 0;
                     string ErrorString = "";
                     ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.SetAlarmNotification_Parameter_Value(TextBoxParameter.Text, TextBoxValueToSet.Text, TextBoxAlarmNotificationGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ResultInt32 == -1)
                     {
                           LabelSetAlarmNotification_Parameter_ValueResult.Text = "OAS Service not reached.";
                     }
                     else if (ResultInt32 == 1)
                     {
                           LabelSetAlarmNotification_Parameter_ValueResult.Text = "Parameter Successfully Updated.";
                     }
                     else
                     {
                           LabelSetAlarmNotification_Parameter_ValueResult.Text = ErrorString;
                     }
              }

LoadAlarmNotificationConfiguration

The LoadAlarmNotificationConfiguration Subroutine saves the current Alarm Notification 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.

VB

    Private Sub ButtonLoadAlarmNotificationConfiguration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonLoadAlarmNotificationConfiguration.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ErrorString As String = ""
        ModuleNetworkNode.OPCSystemsComponent1.LoadAlarmNotificationConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

              private void ButtonSaveAlarmNotificationConfiguration_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     string ErrorString = "";
                     ModuleNetworkNode.OPCSystemsComponent1.SaveAlarmNotificationConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString != "Success")
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }

Alarm Logging Groups – VB & C#

Code examples for VB and C# environments

GetAlarmLoggingNames

  • The GetAlarmLoggingNames Function returns a list of the Alarm 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.

VB

 
    Private Sub ButtonGetAlarmLoggingNames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetAlarmLoggingNames.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetAlarmLoggingNames.Items.Clear()
        Dim Groups() As String
        Dim Group As String
        Dim ErrorString As String = ""
        Groups = ModuleNetworkNode.OPCSystemsComponent1.GetAlarmLoggingNames(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each Group In Groups
                ComboBoxGetAlarmLoggingNames.Items.Add(Group)
            Next
            If ComboBoxGetAlarmLoggingNames.Items.Count > 0 Then
                ComboBoxGetAlarmLoggingNames.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub
 
    Private Sub ComboBoxGetAlarmLoggingNames_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetAlarmLoggingNames.SelectedIndexChanged
        TextBoxAlarmLoggingGroup.Text = ComboBoxGetAlarmLoggingNames.SelectedItem
    End Sub
    

C#

  private void ButtonGetAlarmNotificationNames_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetAlarmNotificationNames.Items.Clear();
                     string[] Groups = null;
//INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
//                   string Group = null;
                     string ErrorString = "";
                     Groups = ModuleNetworkNode.OPCSystemsComponent1.GetAlarmNotificationNames(TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           foreach (string Group in Groups)
                           {
                                  ComboBoxGetAlarmNotificationNames.Items.Add(Group);
                           }
                           if (ComboBoxGetAlarmNotificationNames.Items.Count > 0)
                           {
                                  ComboBoxGetAlarmNotificationNames.SelectedIndex = 0;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }
 
              private void ComboBoxGetAlarmNotificationNames_SelectedIndexChanged(object sender, System.EventArgs e)
              {
                     TextBoxAlarmNotificationGroup.Text = ComboBoxGetAlarmNotificationNames.SelectedItem.ToString();
              }

 

AddAlarmLoggingGroup Function

  • The AddAlarmLoggingGroup Function adds a Alarm Logging Group to the existing Alarm 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.

VB

 
    Private Sub ButtonAddAlarmLoggingGroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAddAlarmLoggingGroup.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.AddAlarmLoggingGroup(TextBoxAlarmLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelAddAlarmLoggingGroupResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelAddAlarmLoggingGroupResult.Text = "Group successfully added."
        Else
            LabelAddAlarmLoggingGroupResult.Text = ErrorString
        End If
    End Sub
 

C#

rivate void ButtonAddAlarmNotificationGroup_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     Int32 ResultInt32 = 0;
                     string ErrorString = "";
                     ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.AddAlarmNotificationGroup(TextBoxAlarmNotificationGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ResultInt32 == -1)
                     {
                           LabelAddAlarmNotificationGroupResult.Text = "OAS Service not reached.";
                     }
                     else if (ResultInt32 == 1)
                     {
                           LabelAddAlarmNotificationGroupResult.Text = "Group successfully added.";
                     }
                     else
                     {
                           LabelAddAlarmNotificationGroupResult.Text = ErrorString;
                     }
              }

 

RemoveAlarmLoggingGroup

  • The RemoveAlarmLoggingGroup Function removes a Alarm Logging Group from the existing Alarm 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.

VB

    

    Private Sub ButtonRemoveAlarmLoggingGroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRemoveAlarmLoggingGroup.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.RemoveAlarmLoggingGroup(TextBoxAlarmLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelRemoveAlarmLoggingGroupResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelRemoveAlarmLoggingGroupResult.Text = "Group successfully removed."
        Else
            LabelRemoveAlarmLoggingGroupResult.Text = ErrorString
        End If
    End Sub

C#

 private void ButtonRemoveAlarmLoggingGroup_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     Int32 ResultInt32 = 0;
                     string ErrorString = "";
                     ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.RemoveAlarmLoggingGroup(TextBoxAlarmLoggingGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ResultInt32 == -1)
                     {
                           LabelRemoveAlarmLoggingGroupResult.Text = "OAS Service not reached.";
                     }
                     else if (ResultInt32 == 1)
                     {
                           LabelRemoveAlarmLoggingGroupResult.Text = "Group successfully removed.";
                     }
                     else
                     {
                           LabelRemoveAlarmLoggingGroupResult.Text = ErrorString;
                     }
              }

 

GetAlarmLoggingParameterStrings

  • The GetAlarmLoggingParameterStrings Function returns an array of Strings containing all property types available for each Alarm Logging Group.
  • Returns Empty String Array if service is not reachable.
  • Returns a String Array of property types for all possible Parameters for a Alarm Logging Group.
  • NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.

VB

      
Private Sub ButtonGetAlarmLoggingParameterStrings_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetAlarmLoggingParameterStrings.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetAlarmLoggingParameterStrings.Items.Clear()
        Dim Parameters() As String
        Dim Parameter As String
        Parameters = ModuleNetworkNode.OPCSystemsComponent1.GetAlarmLoggingParameterStrings(TextBoxNetworkNode.Text)
        For Each Parameter In Parameters
            ComboBoxGetAlarmLoggingParameterStrings.Items.Add(Parameter)
        Next
        If ComboBoxGetAlarmLoggingParameterStrings.Items.Count > 0 Then
            ComboBoxGetAlarmLoggingParameterStrings.SelectedIndex = 1
        End If
    End Sub    
 
    Private Sub ComboBoxGetAlarmLoggingParameterStrings_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetAlarmLoggingParameterStrings.SelectedIndexChanged
        TextBoxParameter.Text = ComboBoxGetAlarmLoggingParameterStrings.SelectedItem
    End Sub

C#

            private void ButtonGetAlarmLoggingParameterStrings_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetAlarmLoggingParameterStrings.Items.Clear();
                     string[] Parameters = null;
//INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
//                   string Parameter = null;
                     Parameters = ModuleNetworkNode.OPCSystemsComponent1.GetAlarmLoggingParameterStrings(TextBoxNetworkNode.Text);
                     foreach (string Parameter in Parameters)
                     {
                           ComboBoxGetAlarmLoggingParameterStrings.Items.Add(Parameter);
                     }
                     if (ComboBoxGetAlarmLoggingParameterStrings.Items.Count > 0)
                     {
                           ComboBoxGetAlarmLoggingParameterStrings.SelectedIndex = 1;
                     }
              }
 
              private void ComboBoxGetAlarmLoggingParameterStrings_SelectedIndexChanged(object sender, System.EventArgs e)
              {
                     TextBoxParameter.Text = ComboBoxGetAlarmLoggingParameterStrings.SelectedItem.ToString();
              }

 

GetAlarmLogging_Parameter_Value

  • The GetAlarmLogging_Parameter_Value Function returns an object value for the Alarm Logging Group and Parameter specified.
  • Returns nothing if service is not reachable. ‘ Parameter is a String of the Parameter Type desired of the Alarm Logging Group.
  • Group is a String of the Alarm 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.

VB

      

   Private Sub ButtonGetAlarmLogging_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetAlarmLogging_Parameter_Value.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultObject As Object
        Dim ErrorString As String = ""
        ResultObject = ModuleNetworkNode.OPCSystemsComponent1.GetAlarmLogging_Parameter_Value(TextBoxParameter.Text, TextBoxAlarmLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            If ResultObject Is Nothing Then
                LabelGetAlarmLogging_Parameter_ValueResult.Text = ""
                TextBoxValueToSet.Text = ""
            Else
                Try
                    LabelGetAlarmLogging_Parameter_ValueResult.Text = ResultObject
                    TextBoxValueToSet.Text = ResultObject
                Catch ex As Exception
                    LabelGetAlarmLogging_Parameter_ValueResult.Text = "Error converting value to string."
                    TextBoxValueToSet.Text = ""
                End Try
            End If
        Else
            LabelGetAlarmLogging_Parameter_ValueResult.Text = ErrorString
            TextBoxValueToSet.Text = ""
        End If
    End Sub

C#

   private void ButtonGetAlarmLogging_Parameter_Value_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     object ResultObject = null;
                     string ErrorString = "";
                     ResultObject = ModuleNetworkNode.OPCSystemsComponent1.GetAlarmLogging_Parameter_Value(TextBoxParameter.Text, TextBoxAlarmLoggingGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           if (ResultObject == null)
                           {
                                  LabelGetAlarmLogging_Parameter_ValueResult.Text = "";
                                  TextBoxValueToSet.Text = "";
                           }
                           else
                           {
                                  try
                                  {
                                         LabelGetAlarmLogging_Parameter_ValueResult.Text = ResultObject.ToString();
                                         TextBoxValueToSet.Text = ResultObject.ToString();
                                  }
                                  catch (Exception ex)
                                  {
                                         LabelGetAlarmLogging_Parameter_ValueResult.Text = "Error converting value to string.";
                                         TextBoxValueToSet.Text = "";
                                  }
                           }
                     }
                     else
                     {
                           LabelGetAlarmLogging_Parameter_ValueResult.Text = ErrorString;
                           TextBoxValueToSet.Text = "";
                     }
              }

 

GetAlarmLogging_Parameter_Values

  • The GetAlarmLogging_Parameter_Values Function returns an array of object values for the Alarm Logging Group specified.
  • The order of the array corresponds with the GetAlarmLoggingParameterStrings Function order.
  • Returns empty array if service is not reachable.
  • Group is a String of the Alarm 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.

VB

      

 Private Sub ButtonGetAlarmLogging_Parameter_Values_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetAlarmLogging_Parameter_Values.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetAlarmLogging_Parameter_Values.Items.Clear()
        Dim ResultObjects() As Object
        Dim ResultObject As Object
        Dim ResultString As String
        Dim ErrorString As String = ""
        ResultObjects = ModuleNetworkNode.OPCSystemsComponent1.GetAlarmLogging_Parameter_Values(TextBoxAlarmLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each ResultObject In ResultObjects
                Try
                    If ResultObject Is Nothing Then
                        ResultString = ""
                    Else
                        ResultString = ResultObject
                    End If
                    ComboBoxGetAlarmLogging_Parameter_Values.Items.Add(ResultString)
                Catch ex As Exception
                    ComboBoxGetAlarmLogging_Parameter_Values.Items.Add("Error Converting Object")
                End Try
            Next
            If ComboBoxGetAlarmLogging_Parameter_Values.Items.Count > 0 Then
                ComboBoxGetAlarmLogging_Parameter_Values.SelectedIndex = 1
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

   private void ButtonGetAlarmLogging_Parameter_Values_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetAlarmLogging_Parameter_Values.Items.Clear();
                     object[] ResultObjects = null;
//INSTANT C# NOTE: Commented this declaration since looping variables in 'foreach' loops are declared in the 'foreach' header in C#:
//                   object ResultObject = null;
                     string ResultString = null;
                     string ErrorString = "";
                     ResultObjects = ModuleNetworkNode.OPCSystemsComponent1.GetAlarmLogging_Parameter_Values(TextBoxAlarmLoggingGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           foreach (object ResultObject in ResultObjects)
                           {
                                  try
                                  {
                                         if (ResultObject == null)
                                         {
                                                ResultString = "";
                                         }
                                         else
                                         {
                                                ResultString = ResultObject.ToString();
                                         }
                                         ComboBoxGetAlarmLogging_Parameter_Values.Items.Add(ResultString);
                                  }
                                  catch (Exception ex)
                                  {
                                         ComboBoxGetAlarmLogging_Parameter_Values.Items.Add("Error Converting Object");
                                  }
                           }
                           if (ComboBoxGetAlarmLogging_Parameter_Values.Items.Count > 0)
                           {
                                  ComboBoxGetAlarmLogging_Parameter_Values.SelectedIndex = 1;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }

 

SetAlarmLogging_Parameter_Value

  • The SetAlarmLogging_Parameter_Value Function sets an object value for the Alarm 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 Alarm Logging Group.
  • Value is the desired value to set.
  • Group is a String of the Alarm 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.

VB

    Private Sub ButtonSetAlarmLogging_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSetAlarmLogging_Parameter_Value.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.SetAlarmLogging_Parameter_Value(TextBoxParameter.Text, TextBoxValueToSet.Text, TextBoxAlarmLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelSetAlarmLogging_Parameter_ValueResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelSetAlarmLogging_Parameter_ValueResult.Text = "Parameter Successfully Updated."
        Else
            LabelSetAlarmLogging_Parameter_ValueResult.Text = ErrorString
        End If
    End Sub

C#

    private void ButtonSetAlarmLogging_Parameter_Value_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     Int32 ResultInt32 = 0;
                     string ErrorString = "";
                     ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.SetAlarmLogging_Parameter_Value(TextBoxParameter.Text, TextBoxValueToSet.Text, TextBoxAlarmLoggingGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ResultInt32 == -1)
                     {
                           LabelSetAlarmLogging_Parameter_ValueResult.Text = "OAS Service not reached.";
                     }
                     else if (ResultInt32 == 1)
                     {
                           LabelSetAlarmLogging_Parameter_ValueResult.Text = "Parameter Successfully Updated.";
                     }
                     else
                     {
                           LabelSetAlarmLogging_Parameter_ValueResult.Text = ErrorString;
                     }
              }

 

SaveAlarmLoggingConfiguration

  • The SaveAlarmLoggingConfiguration Subroutine saves the current Alarm 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.

VB

     
 Private Sub ButtonSaveAlarmLoggingConfiguration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSaveAlarmLoggingConfiguration.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ErrorString As String = ""
        ModuleNetworkNode.OPCSystemsComponent1.SaveAlarmLoggingConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub
    

C#

   private void ButtonSaveAlarmLoggingConfiguration_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     string ErrorString = "";
                     ModuleNetworkNode.OPCSystemsComponent1.SaveAlarmLoggingConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString != "Success")
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }

 

LoadAlarmLoggingConfiguration

  • The LoadAlarmLoggingConfiguration Subroutine saves the current Alarm 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.

VB

      

    Private Sub ButtonLoadAlarmLoggingConfiguration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonLoadAlarmLoggingConfiguration.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ErrorString As String = ""
        ModuleNetworkNode.OPCSystemsComponent1.LoadAlarmLoggingConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

 private void ButtonLoadAlarmLoggingConfiguration_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     string ErrorString = "";
                     ModuleNetworkNode.OPCSystemsComponent1.LoadAlarmLoggingConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString != "Success")
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }

 

 

.NET Programmatic Server Configuration

Programmatic setup of OAS configuration is supported with the methods in the assembly OASConfig.dll which is a .NET Standard 2.0 assembly.  It can be used in applications that target the following.

  • .NET 5
  • .NET Core 2.o or greater
  • .NET Framework 4.61 or greater
  • Xamarin.iOS 10.14 or greater
  • Xamarin.Android 8.0 or greater
  • UWP 1.0.0.16299 or greater

The same methods are also included in the legacy OPCSystems.dll assembly for .NET Framework 4.6 or less.

The most commonly used methods are Get and Set Tag Properties to obtain and set desired properties of multiple tags in one call.

All configurations can be programmatically defined. This would include Tags, Data Logging, Alarm Logging, Alarm Notification, Recipes, Security, and Options.

Refer to the OAS Example Service Code for a working example of programmatically adding tags to a service.  This includes example projects for both C# and VB for .NET Core Console App to run on all operating systems including Linux, Windows, Mac, Android, and iOS.  There is also C# and VB projects to run as a Windows Service.  The code examples in all 4 projects are the same to show adding tags programmatically and the asynchronous and synchronous methods for reading and writing data.

Applications can be deployed locally or remotely and can optionally implement OAS Basic Networking or Live Data Cloud Networking.

See our OASConfig documentation for more details.
See Automatic Configuration with Dynamic User Interface to view WPF application that creates tags and adapts the user interface based on the configuration defined.

Overview – Programmatic Interface

There are five different methods of interfacing with the Programmatic Interfaces of the OAS server, each targeted at a specific set of needs.

.NET Configuration for all platforms

The free to use .NET Standard 2.0 OASConfig assembly is used to programmatically add and update all OAS Engine configurations and can target .NET 7, 6, 5, .NET Core 2.0 or greater, .NET Framework 4.61 or greater, Xamarin.iOS 10.14, Xamarin.Android 8.0, and UWP 1.0.0.16299.

.NET Data Connector for all platforms

The .NET Standard 2.0 OASData assembly is used to provide read and write access to OAS tag variables and can target .NET 7, 6, 5, .NET Core 2.0 or greater, .NET Framework 4.61 or greater, Xamarin.iOS 10.14, Xamarin.Android 8.0, and UWP 1.0.0.16299.

.NET Connector and Windows Components

For .NET developers who wish to create HMIs or system automations on a windows platform, these components provide visual and programmatic access to real time and historical data, as well as interfaces into automated configuration of the OAS server.

.NET Core for Native Mobile Applications

The .NET Core Components are a programmatic interface designed to be used in a Xamarin Application, which allows developers to compile native applications for iOS and Android devices with a single code base.

Universal Driver Interface

Create data sources for OAS with target to both .NET Standard 2.0 for cross platform deployment and .NET Framework 4.6.1 or greater and .NET Framework 4.6 or less to deploy Windows Services locally and remotely.
Define your own properties that are automatically added to the OAS engine.
See the UDI Technical Overview on how to create a Universal Driver.

REST API

Using standard REST patterns and JSON over HTTP, the REST API provides a programmatic interface for any platform that supports those technologies, including Linux servers, RaspberryPI and Arduino devices, and more.

Web HMI

For developers interested in creating HMIs in HTML5 web applications, the OAS Web HMI includes libraries for displaying real time and historical data in any web browser, using both a markup technique as well as a programmatic Javascript API.

The following graphic shows how Open Automation Software provides programmatic access for real time and historical data and shows the protocols and tools to create specific applications.

For more details on how to use any of these interfaces, see below: