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