Trend Tags

GetTrendPointGroupNames

  • The GetTrendPointGroupNames Function returns a list of Groups in the specified ReferenceGroup path that contain Tags that are enabled for trending.
  • Returns Empty String if service is not reachable.
  • Returns a String Array of Groups in the ReferenceGroup that have Tags that are enabled for trending.
  • ReferenceGroup is a string of the Group path to retrieve the Groupss from.
  • NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
  • Optional ErrorString will be set to Success when function is successful and an error message when in error.

VB

    Private Sub ButtonGetTrendPointGroupNames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetTrendPointGroupNames.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetTrendPointGroupNames.Items.Clear()
        Dim GroupNames() As String
        Dim GroupName As String
        Dim ErrorString As String = ""
        GroupNames = ModuleNetworkNode.OPCSystemsComponent1.GetTrendPointGroupNames(TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each GroupName In GroupNames
                ComboBoxGetTrendPointGroupNames.Items.Add(GroupName)
            Next
            If ComboBoxGetTrendPointGroupNames.Items.Count > 0 Then
                ComboBoxGetTrendPointGroupNames.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
 
    End Sub

C#

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

GetTrendPointTagNames

  • The GetTrendPointTagNames Function returns a list of Tags in the specified ReferenceGroup path that are enabled for trending.
  • Returns Empty String if service is not reachable.
  • Returns a String Array of Tags in the ReferenceGroup that are enabled for trending.
  • ReferenceGroup is a string of the Group path to retrieve the Tags from.
  • NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
  • Optional ErrorString will be set to Success when function is successful and an error message when in error.

VB

    Private Sub ButtonGetTrendPointTagNames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetTrendPointTagNames.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetTrendPointTagNames.Items.Clear()
        Dim TagNames() As String
        Dim TagName As String
        Dim ErrorString As String = ""
        TagNames = ModuleNetworkNode.OPCSystemsComponent1.GetTrendPointTagNames(TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each TagName In TagNames
                ComboBoxGetTrendPointTagNames.Items.Add(TagName)
            Next
            If ComboBoxGetTrendPointTagNames.Items.Count > 0 Then
                ComboBoxGetTrendPointTagNames.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

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

GetAllTrendPointTagNames

  • The GetAllTrendPointTagNames Function returns a list of all Tags in the specified ReferenceGroup and all sub groups path that are enabled for trending.
  • Returns Empty String if service is not reachable.” + vbCr + “Returns a String Array of Tags in the ReferenceGroup that are enabled for trending.
  • ReferenceGroup is a string of the Group path to retrieve the Tags from.
  • 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 ButtonGetAllTrendPointTagNames_Click(sender As System.Object, e As System.EventArgs) Handles ButtonGetAllTrendPointTagNames.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetTrendPointTagNames.Items.Clear()
        Dim TagNames() As String
        Dim TagName As String
        Dim ErrorString As String = ""
        TagNames = ModuleNetworkNode.OPCSystemsComponent1.GetAllTrendPointTagNames(TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each TagName In TagNames
                ComboBoxGetTrendPointTagNames.Items.Add(TagName)
            Next
            If ComboBoxGetTrendPointTagNames.Items.Count > 0 Then
                ComboBoxGetTrendPointTagNames.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub
 
    Private Sub ComboBoxGetTrendPointTagNames_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetTrendPointTagNames.SelectedIndexChanged
        TextBoxTag.Text = ComboBoxGetTrendPointTagNames.SelectedItem
    End Sub

C#

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

GetTrendPointParameterNames

  • The GetTrendPointParameterNames Function returns a list of Parameters of a Tag in the specified ReferenceGroup path that is enabled for trending.
  • Returns Empty String if service is not reachable.
  • Returns a String Array of Tags in the ReferenceGroup that are enabled for trending.
  • TagName is a string of the tag name to query.
  • ReferenceGroup is a string of the Group path to retrieve the Tags from.
  • NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.

VB

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

C#

  private void ButtonGetTrendPointParameterNames_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetTrendPointParameterNames.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.GetTrendPointParameterNames(TextBoxTag.Text, TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text);
                     foreach (string Parameter in Parameters)
                     {
                           ComboBoxGetTrendPointParameterNames.Items.Add(Parameter);
                     }
                     if (ComboBoxGetTrendPointParameterNames.Items.Count > 0)
                     {
                           ComboBoxGetTrendPointParameterNames.SelectedIndex = 0;
                     }
 
              }

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.

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
        Groups = ModuleNetworkNode.OPCSystemsComponent1.GetDataLoggingNames(TextBoxNetworkNode.Text)
        For Each Group In Groups
            ComboBoxGetDataLoggingNames.Items.Add(Group)
        Next
        If ComboBoxGetDataLoggingNames.Items.Count > 0 Then
            ComboBoxGetDataLoggingNames.SelectedIndex = 0
        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 void ButtonGetDataLoggingNames_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetDataLoggingNames.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;
                     Groups = ModuleNetworkNode.OPCSystemsComponent1.GetDataLoggingNames(TextBoxNetworkNode.Text);
                     foreach (string Group in Groups)
                     {
                           ComboBoxGetDataLoggingNames.Items.Add(Group);
                     }
                     if (ComboBoxGetDataLoggingNames.Items.Count > 0)
                     {
                           ComboBoxGetDataLoggingNames.SelectedIndex = 0;
                     }
              }
 
              private void ComboBoxGetDataLoggingNames_SelectedIndexChanged(object sender, System.EventArgs e)
              {
                     TextBoxDataLoggingGroup.Text = ComboBoxGetDataLoggingNames.SelectedItem.ToString();
              }

GetHistoryTagNames

  • The GetHistoryTagNames Function returns a list of Field Names in the Data Logging Group.
  • Returns Empty String if service is not reachable.
  • Returns a String Array of Field Names in the Data Logging Group.
  • Group is a string of the Data Logging Group path to retrieve the Field Names from.
  • NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
  • Optional ErrorString will be set to Success when function is successful and an error message when in error.

VB

    Private Sub ButtonGetHistoryTagNames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetHistoryTagNames.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetHistoryTagNames.Items.Clear()
        Dim FieldNames() As String
        Dim FieldName As String
        Dim ErrorString As String = ""
        FieldNames = ModuleNetworkNode.OPCSystemsComponent1.GetHistoryTagNames(TextBoxDataLoggingGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each FieldName In FieldNames
                ComboBoxGetHistoryTagNames.Items.Add(FieldName)
            Next
            If ComboBoxGetHistoryTagNames.Items.Count > 0 Then
                ComboBoxGetHistoryTagNames.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

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