Overview – Web User Interface Programming

 

Real-time Data JS Interface

Refer to the Web HMI – Programming Reference for reference and examples of accessing real-time data in a web client using Javascript

Real-time and Historical Trend JS Interface

Refer to the Web Trend – Programming Reference – Web Trend for reference and examples of accessing real-time and historical trend data in a web client using Javascript

Real-time and Historical Alarm JS Interface

Refer to the Web Alarm – Programming Reference –  Web Alarm for reference and examples of accessing real-time and historical alarm data in a web client using Javascript

 

Frequently Asked Questions – Programmatic Interface

After authentication, how long can I use the token and clientid?
The security token and client id granted to the caller after authentication represent a REST API session. As long as the server remains active (not rebooted), and the credentials are continually used, the session will not expire. If there is no activity on the session after 30 minutes, the session will expire and a 401 Unauthorized response will be returned for all operations. This idle timeout can be configured on the server using the OAS Configuration app. Go to Configure > Options, select your OAS server (usually localhost when configuring the current machine) and then go to the Networking tab. Here you can set the REST API Session Timeout in minutes.
How can I programmatically browse OPC Servers?
Yes, using the free to use OPCSystems component. Refer to the WinForm Example Code under the program group Open Automation Software-Example in the Form FormConfigureOPC. This example is also listed in this help file in Programmatic Interface - .NET Programmatic Configuration - Programmatic Access OPC Browsing.

Videos – Programmatic Interface

.NET Data Connector

Connect Visual Studio applications on-premise or over the Internet to live data using the .NET Data Connector, a 100% managed .NET component for asynchronous and synchronous communications.

Realtime Data Access .NET Applications

Demonstration of the OAS Example Service Code and explanation of use of the most common methods.

  • 00:00 – Introduction
  • 00:33 – Source code example
  • 01:07 – Visual studio projects example
  • 01:33 – How to get a visual studio app
  • 01:40 – How to create projects and use visual studio
  • 03:05 – OAS service code example
  • 15:00 – Tag variables
  • 15:37 – How to browse tags
  • 17:10 – Networking
  • 20:55 – How to implement security
  • 21:31 – How to publish
  • 22:15 – How to register service
  • 23:41 – How to change project name
  • 26:20 – Questions
Client Failover

.NET applications can implement an automated or controlled switch to data servers to add redundancy to your application.

View UDI – Videos to create your own OAS Drivers for cross platform deployment with the free Universal Driver Interface SDK.

.NET Realtime Data Access

The .NET Data Connector product provides read and write to realtime tags including data sources of direct drivers to Modbus, Allen Bradley, Siemens, OPC UA Servers, Classic OPC Servers, MQTT, AWS IoT, Azure IoT Data Hub, Microsoft Excel, data from SQL Server, Oracle, Access, mySQL, MongoDB, REST API, and other .NET applications.

Installation of Assemblies

  • All OAS .NET Assemblies are distributed with the OAS Platform and located within the installation directory and subdirectory \Controls\.
  • Optionally, you can install the assembly package from NuGet within Visual Studio
    Direct link to the OASIOT.OASData package: https://www.nuget.org/packages/OASIOT.OASData

Assembly Usage

The OASData.dll assembly is a .NET Standard 2.0 assembly which can be integrated into any .NET application with the following targets.

  • .NET 5 or greater
  • .NET Core 2.0 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 access can also be provided in the legacy assemblies for Framework 4.6 or less located in the OAS installation directory C:\Program Files\Open Automation Software\OAS\Controls\.
If you are using the OAS WPF HMI product use the OPCWPFDasbhoard.OPCWPFData component.
If you are using the OAS WinForm HMI product use the OPCControls.OPCControlData component.
For .NET Framework 4.6 or less projects without the need for user interface controls use the OPCSystemsDataConnector assembly.

The .NET Data Connector is also a very powerful method to turn any data from a .NET application into a realtime source for the Open Automation Software platform. This is easily done with the WriteTags method which you can optionally specify TimeStamps.

All components have the same easy to use programmatic methods.

Sample Code

The OAS Example Service Code is a working example of reading and writing tags synchronously and asynchronously.  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
  • 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.

All Tag Variables are accessible for reading and writing.

Examples:

  • TagName.Value
  • TagName.Desription
  • TagName.Units
  • TagName.HighHighAlarmLimit
  • TagName.HighHighAlarmActive (read only)

See a complete list of Tag Variables

Networking

Tag names can include an IP Address, network node name, or registered domain name if the application is deployed remote from the OAS Engine.

Basis Networking Example:

\\192.168.0.1\TagName.Value

If Live Data Cloud networking is implemented for self-hosting with a dynamic IP Address the LDC syntax is applicable.

Live Data Cloud Networking Example:

\\www.opcweb.com\RemoteSCADAHosting.MyLDCNode.TagName.Value

Common Methods

See our OASData documentation for more details.

And also Realtime Data Access – VB and C# – Windows Server and .NET Core Console App examples for programmatic tag creation and realtime data access.

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);
                     }
              }

Tags

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

Please note that the most efficient way to add tags and set their properties programmatically is using the SetTagProperty or TagCSVImport methods.

GetTagValuesByGroup

The GetTagValuesByGroup Function returns an array of Tag Names and Values for all of the Tags in the specified group. Tag Names and Values are alternating with the the array of tags.

Returns Empty Array if service is not reachable.

The returned array of objects will contain first the tag name followed by the value.

Example is element 0 contains Tag01, element 1 contains the value of Tag01 element 2 contains Tag02, element 3 contains the value of Tag02.

If the data quality of the Tag value is bad the individual returned value will be null.

The GroupName is the reference path of the group to get the values 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 ButtonGetTagValuesByGroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetTagValuesByGroup.Click
    Cursor.Current = Cursors.WaitCursor
    ComboBoxGetTagValuesByGroup.Items.Clear()
    Dim TagNamesAndValues() As Object
    Dim TagName As String
    Dim ValueString As String
    Dim ErrorString As String = ""
    TagNamesAndValues = ModuleNetworkNode.OPCSystemsComponent1.GetTagValuesByGroup(TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text, ErrorString)
    If ErrorString = "Success" Then
        Dim numberOfTags As Int32 = TagNamesAndValues.GetLength(0) / 2
        Dim tagIndex As Int32
        Dim itemIndex As Int32
        Dim tagsToAdd As New ArrayList

        For tagIndex = 0 To numberOfTags - 1
            TagName = TagNamesAndValues(itemIndex)
            itemIndex += 1
            If TagNamesAndValues(itemIndex) Is Nothing Then
                tagsToAdd.Add(TagName + " = Bad Quality")
            Else
                Try
                    ValueString = TagNamesAndValues(itemIndex).ToString
                    tagsToAdd.Add(TagName + " = " + ValueString)
                Catch ex As Exception
                    tagsToAdd.Add(TagName + " = Value Cannot Be Converted To String")
                End Try
            End If
            itemIndex += 1
        Next
        ComboBoxGetTagValuesByGroup.Items.AddRange(CType(tagsToAdd.ToArray(GetType(String)), String()))
        If ComboBoxGetTagValuesByGroup.Items.Count > 0 Then
            ComboBoxGetTagValuesByGroup.SelectedIndex = 0
        End If
    Else
        MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
    End If
End Sub

C#

private void ButtonGetTagValuesByGroup_Click(object sender, System.EventArgs e) {
   System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
   ComboBoxGetTagValuesByGroup.Items.Clear();
   object[] TagNamesAndValues = null;
   string TagName = null;
   string ValueString = null;
   string ErrorString = "";
   TagNamesAndValues = ModuleNetworkNode.OPCSystemsComponent1.GetTagValuesByGroup(TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
   if (ErrorString == "Success")
   {
         Int32 numberOfTags = Convert.ToInt32(TagNamesAndValues.GetLength(0) / 2);
         Int32 tagIndex = 0;
         Int32 itemIndex = 0;
         ArrayList tagsToAdd = new ArrayList();

         for (tagIndex = 0; tagIndex < numberOfTags; tagIndex++)
         {
                TagName = TagNamesAndValues[itemIndex].ToString();
                itemIndex += 1;
                if (TagNamesAndValues[itemIndex] == null)
                {
                       tagsToAdd.Add(TagName + " = Bad Quality");
                }
                else
                {
                       try
                       {
                              ValueString = TagNamesAndValues[itemIndex].ToString();
                              tagsToAdd.Add(TagName + " = " + ValueString);
                       }
                       catch (Exception ex)
                       {
                              tagsToAdd.Add(TagName + " = Value Cannot Be Converted To String");
                       }
                }
                itemIndex += 1;
         }
          ComboBoxGetTagValuesByGroup.Items.AddRange((string[])tagsToAdd.ToArray(typeof(string)));
         if (ComboBoxGetTagValuesByGroup.Items.Count > 0)
         {
                ComboBoxGetTagValuesByGroup.SelectedIndex = 0;
         }
   }
   else
   {
         MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
   }
}

GetTagNames

The GetTagNames Function returns a list of Tags in the specified ReferenceGroup path.

Returns Empty String if service is not reachable.

Returns a String Array of Tags in the ReferenceGroup.

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 ButtonGetTagNames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetTagNames.Click
    Cursor.Current = Cursors.WaitCursor
    ComboBoxGetTagNames.Items.Clear()
    Dim TagNames() As String
    Dim TagName As String
    Dim ErrorString As String = ""
    TagNames = ModuleNetworkNode.OPCSystemsComponent1.GetTagNames(TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text, ErrorString)
    If ErrorString = "Success" Then
        For Each TagName In TagNames
            ComboBoxGetTagNames.Items.Add(TagName)
        Next
        If ComboBoxGetTagNames.Items.Count > 0 Then
            ComboBoxGetTagNames.SelectedIndex = 0
        End If
    Else
        MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
    End If
End Sub

C#

private void ButtonGetTagNames_Click(object sender, System.EventArgs e) {
     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
     ComboBoxGetTagNames.Items.Clear();
     string[] TagNames = null;
     string ErrorString = "";
     TagNames = ModuleNetworkNode.OPCSystemsComponent1.GetTagNames(TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
     if (ErrorString == "Success")
     {
           foreach (string TagName in TagNames)
           {
                  ComboBoxGetTagNames.Items.Add(TagName);
           }
           if (ComboBoxGetTagNames.Items.Count > 0)
           {
                  ComboBoxGetTagNames.SelectedIndex = 0;
           }
     }
     else
     {
           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
}

GetAllTagNames

The GetAllTagNames Function returns a list of all of the Tags from the specified ReferenceGroup path and all tags in all sub groups within the Reference Group.

Returns Empty String Array if service is not reachable.

Returns a String Array of Tags in the ReferenceGroup and all tags within the sub groups of the Reference Group.

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 ButtonGetAllTagNames_Click(sender As System.Object, e As System.EventArgs) Handles ButtonGetAllTagNames.Click
    ComboBoxGetTagNames.Items.Clear()
    Dim TagNames() As String
    Dim TagName As String
    Dim ErrorString As String = ""
    TagNames = ModuleNetworkNode.OPCSystemsComponent1.GetAllTagNames(TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text, ErrorString)
    If ErrorString = "Success" Then
        For Each TagName In TagNames
            ComboBoxGetTagNames.Items.Add(TagName)
        Next
        If ComboBoxGetTagNames.Items.Count > 0 Then
            ComboBoxGetTagNames.SelectedIndex = 0
        End If
    Else
        MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
    End If
End Sub

Private Sub ComboBoxGetTagNames_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetTagNames.SelectedIndexChanged
    TextBoxTag.Text = ComboBoxGetTagNames.SelectedItem
End Sub  

C#

private void ButtonGetAllTagNames_Click(object sender, System.EventArgs e) {
     ComboBoxGetTagNames.Items.Clear();
     string[] TagNames = null;
     string ErrorString = "";
     TagNames = ModuleNetworkNode.OPCSystemsComponent1.GetAllTagNames(TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
     if (ErrorString == "Success")
     {
           foreach (string TagName in TagNames)
           {
                  ComboBoxGetTagNames.Items.Add(TagName);
           }
           if (ComboBoxGetTagNames.Items.Count > 0)
           {
                  ComboBoxGetTagNames.SelectedIndex = 0;
           }
     }
     else
     {
           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
}

private void ComboBoxGetTagNames_SelectedIndexChanged(object sender, System.EventArgs e) {
     TextBoxTag.Text = ComboBoxGetTagNames.SelectedItem.ToString();
}

AddTag

The AddTag Function adds a Tag to the existing Tag configuration.

*** Note to add multiple Tags with mutliple parameters use the TagCSVImport method as demonstrated under Configure-Tags

Returns -1 if service is not reachable.

Returns 1 if successful.

Returns 0 if the Tag already exists or adding the Tag failed.

Tag is the name of the Tag to add.

ReferenceGroup is a string of the Group path to add the Tag to.

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

Optional ErrorString will be set to Success when function is successful and an error message is in error.

VB

Private Sub ButtonAddTag_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAddTag.Click
    Cursor.Current = Cursors.WaitCursor
    Dim ResultInt32 As Int32
    Dim ErrorString As String = ""
    ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.AddTag(TextBoxTag.Text, TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text, ErrorString)
    If ResultInt32 = -1 Then
        LabelAddTagResult.Text = "OAS Service not reached."
    ElseIf ResultInt32 = 1 Then
        LabelAddTagResult.Text = "Tag successfully added."
    Else
        LabelAddTagResult.Text = ErrorString
    End If
End Sub

C#

private void ButtonAddTag_Click(object sender, System.EventArgs e) {
     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
     Int32 ResultInt32 = 0;
     string ErrorString = "";
     ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.AddTag(TextBoxTag.Text, TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
     if (ResultInt32 == -1)
     {
           LabelAddTagResult.Text = "OAS Service not reached.";
     }
     else if (ResultInt32 == 1)
     {
           LabelAddTagResult.Text = "Tag successfully added.";
     }
     else
     {
           LabelAddTagResult.Text = ErrorString;
     }
}
 

RemoveTag

The RemoveTag Function removes a Tag to the existing Tag configuration.

Returns -1 if service is not reachable.

Returns 1 if successful.

Returns 0 if the Tag does not exist..

Tag is the name of the Tag to remove.

ReferenceGroup is a string of the Group path to remove the Tag 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 is in error.

VB

Private Sub ButtonRemoveTag_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRemoveTag.Click
    Cursor.Current = Cursors.WaitCursor
    Dim ResultInt32 As Int32
    Dim ErrorString As String = ""
    ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.RemoveTag(TextBoxTag.Text, TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text, ErrorString)
    If ResultInt32 = -1 Then
        LabelRemoveTagResult.Text = "OAS Service not reached."
    ElseIf ResultInt32 = 1 Then
        LabelRemoveTagResult.Text = "Tag successfully removed."
    Else
        LabelRemoveTagResult.Text = ErrorString
    End If
End Sub

C#

   

private void ButtonRemoveTag_Click(object sender, System.EventArgs e) {
     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
     Int32 ResultInt32 = 0;
     string ErrorString = "";
     ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.RemoveTag(TextBoxTag.Text, TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
     if (ResultInt32 == -1)
     {
           LabelRemoveTagResult.Text = "OAS Service not reached.";
     }
     else if (ResultInt32 == 1)
     {
           LabelRemoveTagResult.Text = "Tag successfully removed.";
     }
     else
     {
           LabelRemoveTagResult.Text = ErrorString;
     }
}

DeleteAllTags

The DeleteAllTags Function removes all Tags from the existing Tag configuration.

Returns -1 if service is not reachable.

Returns 0 if error occurs.

Returns 1 if successful.

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 ButtonDeleteAllTags_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonDeleteAllTags.Click
    Cursor.Current = Cursors.WaitCursor
    Dim ResultInt32 As Int32
    Dim ErrorString As String = ""
    ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.DeleteAllTags(TextBoxNetworkNode.Text, ErrorString)
    If ResultInt32 = 1 Then
        LabelDeleteAllTagsResult.Text = "All Tags successfully removed."
    Else
        LabelDeleteAllTagsResult.Text = ErrorString
    End If
End Sub

C#

private void ButtonDeleteAllTags_Click(object sender, System.EventArgs e) {
     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
     Int32 ResultInt32 = 0;
     string ErrorString = "";
     ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.DeleteAllTags(TextBoxNetworkNode.Text, ref ErrorString);
     if (ResultInt32 == 1)
     {
           LabelDeleteAllTagsResult.Text = "All Tags successfully removed.";
     }
     else
     {
           LabelDeleteAllTagsResult.Text = ErrorString;
     }
}

GetTag_Parameter_Strings

The GetTag_Parameter_Strings Function returns an array of Strings containing all Parameter Types available for each Tag.

Returns Empty String Array if service is not reachable.

Returns a String Array of Parameter Types for all Tags.

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

VB

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

C#

private void ButtonGetTag_Parameter_Strings_Click(object sender, System.EventArgs e) {
     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
     ComboBoxGetTag_Parameter_Strings.Items.Clear();
     string[] Parameters = null;
     Parameters = ModuleNetworkNode.OPCSystemsComponent1.GetTag_Parameter_Strings(TextBoxNetworkNode.Text);
     foreach (string Parameter in Parameters)
     {
           ComboBoxGetTag_Parameter_Strings.Items.Add(Parameter);
     }
     if (ComboBoxGetTag_Parameter_Strings.Items.Count > 0)
     {
           ComboBoxGetTag_Parameter_Strings.SelectedIndex = 0;
     }

}

private void ComboBoxGetTag_Parameter_Strings_SelectedIndexChanged(object sender, System.EventArgs e) {
     TextBoxParameter.Text = ComboBoxGetTag_Parameter_Strings.SelectedItem.ToString();
}

GetParameter_Property_Strings

The GetParameter_Property_Strings Function returns an array of Strings containing all property types available for each Parameter.

Returns Empty String Array if service is not reachable.

Returns a String Array of property types for all Parameters.

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

VB

Private Sub ButtonGetParameter_Property_Strings_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetParameter_Property_Strings.Click
    Cursor.Current = Cursors.WaitCursor
    ComboBoxGetParameter_Property_Strings.Items.Clear()
    Dim Properties() As String
    Dim PropertyType As String
    Properties = ModuleNetworkNode.OPCSystemsComponent1.GetParameter_Property_Strings(TextBoxNetworkNode.Text)
    For Each PropertyType In Properties
        ComboBoxGetParameter_Property_Strings.Items.Add(PropertyType)
    Next
    If ComboBoxGetParameter_Property_Strings.Items.Count > 1 Then
        ComboBoxGetParameter_Property_Strings.SelectedIndex = 2
    End If
End Sub
 
Private Sub ComboBoxGetParameter_Property_Strings_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetParameter_Property_Strings.SelectedIndexChanged
    TextBoxProperty.Text = ComboBoxGetParameter_Property_Strings.SelectedItem
End Sub

C#

private void ButtonGetParameter_Property_Strings_Click(object sender, System.EventArgs e) {
     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
     ComboBoxGetParameter_Property_Strings.Items.Clear();
     string[] Properties = null;
     Properties = ModuleNetworkNode.OPCSystemsComponent1.GetParameter_Property_Strings(TextBoxNetworkNode.Text);
     foreach (string PropertyType in Properties)
     {
           ComboBoxGetParameter_Property_Strings.Items.Add(PropertyType);
     }
     if (ComboBoxGetParameter_Property_Strings.Items.Count > 1)
     {
           ComboBoxGetParameter_Property_Strings.SelectedIndex = 2;
     }

}

private void ComboBoxGetParameter_Property_Strings_SelectedIndexChanged(object sender, System.EventArgs e) {
     TextBoxProperty.Text = ComboBoxGetParameter_Property_Strings.SelectedItem.ToString();
}

GetTag_Parameter_Value

The GetTag_Parameter_Value Function returns an object value for the Tag.Parameter.Property specified.

Returns nothing if service is not reachable.

Parameter is a String of the Parameter Type desired of the Tag.

PropertyType is a String of the Property Type desired of the Parameter.

TagName is a String of the Tag desired.

ReferenceGroup is a String of the Group(s) where the Tag is to be contained.

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 ButtonGetTag_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetTag_Parameter_Value.Click
    Cursor.Current = Cursors.WaitCursor
    Dim ResultObject As Object
    Dim ErrorString As String = ""
    ResultObject = ModuleNetworkNode.OPCSystemsComponent1.GetTag_Parameter_Value(TextBoxParameter.Text, TextBoxProperty.Text, TextBoxTag.Text, TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text, ErrorString)
    If ErrorString = "Success" Then
        If ResultObject Is Nothing Then
            LabelGetTag_Parameter_ValueResult.Text = "OAS Service not reached or Tag, Parameter, or Property not found."
            TextBoxValueToSet.Text = ""
        Else
            Try
                LabelGetTag_Parameter_ValueResult.Text = ResultObject
                TextBoxValueToSet.Text = ResultObject
            Catch ex As Exception
                LabelGetTag_Parameter_ValueResult.Text = "Error converting value to string."
                TextBoxValueToSet.Text = ""
            End Try
        End If
    Else
        LabelGetTag_Parameter_ValueResult.Text = ErrorString
        TextBoxValueToSet.Text = ""
    End If
End Sub

C#

  

private void ButtonGetTag_Parameter_Value_Click(object sender, System.EventArgs e) {
     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
     object ResultObject = null;
     string ErrorString = null;
     ResultObject = ModuleNetworkNode.OPCSystemsComponent1.GetTag_Parameter_Value(TextBoxParameter.Text, TextBoxProperty.Text, TextBoxTag.Text, TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text, ErrorString);
     if (ErrorString == "Success") {
        if (ResultObject == null)
        {
            LabelGetTag_Parameter_ValueResult.Text = "OAS Service not reached or Tag, Parameter, or Property not found.";
            TextBoxValueToSet.Text = "";
        }
        else
        {
            try
             {
                LabelGetTag_Parameter_ValueResult.Text = ResultObject;
                TextBoxValueToSet.Text = ResultObject;
             }
             catch (Exception ex)
             {
                LabelGetTag_Parameter_ValueResult.Text = "Error converting value to string.";
                TextBoxValueToSet.Text = "";
             }

        }
     }
     else 
     {
        LabelGetTag_Parameter_ValueResult.Text = ErrorString;
        TextBoxValueToSet.Text = "";
     }
}

GetTag_Parameter_Values

The GetTag_Parameter_Values Function returns an array of object values for the Tag.Parameter specified.

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

Returns empty array if service is not reachable.

Parameter is a String of the Parameter Type desired of the Tag.

TagName is a String of the Tag desired.

ReferenceGroup is a String of the Group(s) where the Tag is to be contained.

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

VB

Private Sub ButtonGetTag_Parameter_Values_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetTag_Parameter_Values.Click
    Cursor.Current = Cursors.WaitCursor
    ComboBoxGetTag_Parameter_Values.Items.Clear()
    Dim ResultObjects() As Object
    Dim ResultObject As Object
    Dim ResultString As String
    ResultObjects = ModuleNetworkNode.OPCSystemsComponent1.GetTag_Parameter_Values(TextBoxParameter.Text, TextBoxTag.Text, TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text)
    For Each ResultObject In ResultObjects
        Try
            If ResultObject Is Nothing Then
                ResultString = ""
            Else
                ResultString = ResultObject
            End If
            ComboBoxGetTag_Parameter_Values.Items.Add(ResultString)
        Catch ex As Exception
            ComboBoxGetTag_Parameter_Values.Items.Add("Error Converting Object")
        End Try
    Next
    If ComboBoxGetTag_Parameter_Values.Items.Count > 0 Then
        ComboBoxGetTag_Parameter_Values.SelectedIndex = 0
    End If
End Sub

C#

  

private void ButtonGetTag_Parameter_Values_Click(object sender, System.EventArgs e) {
     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
     ComboBoxGetTag_Parameter_Values.Items.Clear();
     object[] ResultObjects = null;
     string ResultString = null;
     ResultObjects = ModuleNetworkNode.OPCSystemsComponent1.GetTag_Parameter_Values(TextBoxParameter.Text, TextBoxTag.Text, TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text);
     foreach (object ResultObject in ResultObjects)
     {
           try
           {
                  if (ResultObject == null)
                  {
                         ResultString = "";
                  }
                  else
                  {
                         ResultString = ResultObject.ToString();
                  }
                  ComboBoxGetTag_Parameter_Values.Items.Add(ResultString);
           }
           catch (Exception ex)
           {
                  ComboBoxGetTag_Parameter_Values.Items.Add("Error Converting Object");
           }
     }
     if (ComboBoxGetTag_Parameter_Values.Items.Count > 0)
     {
           ComboBoxGetTag_Parameter_Values.SelectedIndex = 0;
     }
}

SetTag_Parameter_Value

The SetTag_Parameter_Value Function sets an object value for the Tag.Parameter.Property specified.

Returns -1 if service is not reachable.

Returns 1 if the function was successful.

Parameter is a String of the Parameter Type desired of the Tag.

PropertyType is a String of the Property Type desired of the Parameter.

Value is the desired value to set.

TagName is a String of the Tag desired.

ReferenceGroup is a String of the Group(s) where the Tag is to be contained.

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 ButtonSetTag_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSetTag_Parameter_Value.Click
    Cursor.Current = Cursors.WaitCursor
    Dim ResultInt32 As Int32
    Dim ErrorString As String = ""
    ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.SetTag_Parameter_Value(TextBoxParameter.Text, TextBoxProperty.Text, TextBoxValueToSet.Text, TextBoxTag.Text, TextBoxReferenceGroup.Text, TextBoxNetworkNode.Text, ErrorString)
    If ResultInt32 = -1 Then
        LabelSetTag_Parameter_ValueResult.Text = "OAS Service not reached."
    ElseIf ResultInt32 = 1 Then
        LabelSetTag_Parameter_ValueResult.Text = "Parameter Property Successfully Updated."
    Else
        LabelSetTag_Parameter_ValueResult.Text = ErrorString
    End If
End Sub

C#

  

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

SaveTagConfiguration

The SaveTagConfiguration Subroutine saves the current Tag 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 ButtonSaveTagConfiguration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSaveTagConfiguration.Click
    Cursor.Current = Cursors.WaitCursor
    Dim ErrorString As String = ""
    ModuleNetworkNode.OPCSystemsComponent1.SaveTagConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ErrorString)
    If ErrorString <> "Success" Then
        MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
    End If
End Sub 

C#

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

LoadTagConfiguration

The LoadTagConfiguration Subroutine saves the current Tag 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 ButtonLoadTagConfiguration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonLoadTagConfiguration.Click
    Cursor.Current = Cursors.WaitCursor
    Dim ErrorString As String = ""
    If ModuleNetworkNode.OPCSystemsComponent1.InRuntime(TextBoxNetworkNode.Text) = 1 Then
        MessageBox.Show("Cannot Load Tag configuraitons while in Runtime Mode", "Cannot Load Tags", MessageBoxButtons.OK, MessageBoxIcon.Information)
        Exit Sub
    End If
    ModuleNetworkNode.OPCSystemsComponent1.LoadTagConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ErrorString)
    If ErrorString <> "Success" Then
        MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
    End If
End Sub

C#

  

private void ButtonLoadTagConfiguration_Click(object sender, System.EventArgs e) {
     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
     string ErrorString = "";
     if (ModuleNetworkNode.OPCSystemsComponent1.InRuntime(TextBoxNetworkNode.Text) == 1)
     {
           MessageBox.Show("Cannot Load Tag configuraitons while in Runtime Mode", "Cannot Load Tags", MessageBoxButtons.OK, MessageBoxIcon.Information);
           return;
     }
     ModuleNetworkNode.OPCSystemsComponent1.LoadTagConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ref ErrorString);
     if (ErrorString != "Success")
     {
           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
}

CheckTagAccessRead

The CheckTagAccessRead Function returns a list of Tags that have read access from the UserName and Password specified.

This method requires Security access for Get Secuirty Parameters from the user and password specified in the LogIn method of the component.

Returns Empty String Array if service is not reachable.

Returns a String Array of Tags that are allowed for Read Access.

UserName is the user to verify with the Tags.

Password is the password of the user to verify with the Tags.

Tags is a list of tags to check in the service, do not include the remote network path in the tag names.

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 ButtonCheckTagAccessRead_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCheckTagAccessRead.Click
    Cursor.Current = Cursors.WaitCursor
    ComboBoxCheckTagAccessRead.Items.Clear()
    Dim TagNames() As String
    Dim TagName As String
    Dim ErrorString As String = ""
    Dim TagsToCheck(2) As String
    TagsToCheck(0) = "Ramp.Value"
    TagsToCheck(1) = "Sine.Value"
    TagsToCheck(2) = "Random.Value"
    TagNames = ModuleNetworkNode.OPCSystemsComponent1.CheckTagAccessRead(TextBoxUserNameToCheck.Text, TextBoxPasswordToCheck.Text, TagsToCheck, TextBoxNetworkNode.Text, ErrorString)
    If ErrorString = "Success" Then
        For Each TagName In TagNames
            ComboBoxCheckTagAccessRead.Items.Add(TagName)
        Next
        If ComboBoxCheckTagAccessRead.Items.Count > 0 Then
            ComboBoxCheckTagAccessRead.SelectedIndex = 0
        End If
    Else
        MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
    End If
End Sub

C#

private void ButtonCheckTagAccessRead_Click(object sender, System.EventArgs e) {
     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
     ComboBoxCheckTagAccessRead.Items.Clear();
     string[] TagNames = null;
     string ErrorString = "";
     string[] TagsToCheck = new string[3];
     TagsToCheck[0] = "Ramp.Value";
     TagsToCheck[1] = "Sine.Value";
     TagsToCheck[2] = "Random.Value";
     TagNames = ModuleNetworkNode.OPCSystemsComponent1.CheckTagAccessRead(TextBoxUserNameToCheck.Text, TextBoxPasswordToCheck.Text, TagsToCheck, TextBoxNetworkNode.Text, ref ErrorString);
     if (ErrorString == "Success")
     {
           foreach (string TagName in TagNames)
           {
                  ComboBoxCheckTagAccessRead.Items.Add(TagName);
           }
           if (ComboBoxCheckTagAccessRead.Items.Count > 0)
           {
                  ComboBoxCheckTagAccessRead.SelectedIndex = 0;
           }
     }
     else
     {
           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
}

CheckTagAccessWrite

The CheckTagAccessWrite Function returns a list of Tags that have write access from the UserName and Password specified.

This method requires Security access for Get Secuirty Parameters from the user and password specified in the LogIn method of the component.

Returns Empty String Array if service is not reachable.

Returns a String Array of Tags that are allowed for Write Access.

UserName is the user to verify with the Tags.

Password is the password of the user to verify with the Tags.

Tags is a list of tags to check in the service, do not include the remote network path in the tag names.

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 ButtonCheckTagAccessWrite_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCheckTagAccessWrite.Click
    Cursor.Current = Cursors.WaitCursor
    ComboBoxCheckTagAccessWrite.Items.Clear()
    Dim TagNames() As String
    Dim TagName As String
    Dim ErrorString As String = ""
    Dim TagsToCheck(2) As String
    TagsToCheck(0) = "Write OPC Output.Value"
    TagsToCheck(1) = "Write String.Value"
    TagsToCheck(2) = "Pump.Value"
    TagNames = ModuleNetworkNode.OPCSystemsComponent1.CheckTagAccessWrite(TextBoxUserNameToCheck.Text, TextBoxPasswordToCheck.Text, TagsToCheck, TextBoxNetworkNode.Text, ErrorString)
    If ErrorString = "Success" Then
        For Each TagName In TagNames
            ComboBoxCheckTagAccessWrite.Items.Add(TagName)
        Next
        If ComboBoxCheckTagAccessWrite.Items.Count > 0 Then
            ComboBoxCheckTagAccessWrite.SelectedIndex = 0
        End If
    Else
        MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
    End If
End Sub

C#

  

private void ButtonCheckTagAccessWrite_Click(object sender, System.EventArgs e) {
     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
     ComboBoxCheckTagAccessWrite.Items.Clear();
     string[] TagNames = null;
     string ErrorString = "";
     string[] TagsToCheck = new string[3];
     TagsToCheck[0] = "Write OPC Output.Value";
     TagsToCheck[1] = "Write String.Value";
     TagsToCheck[2] = "Pump.Value";
     TagNames = ModuleNetworkNode.OPCSystemsComponent1.CheckTagAccessWrite(TextBoxUserNameToCheck.Text, TextBoxPasswordToCheck.Text, TagsToCheck, TextBoxNetworkNode.Text, ref ErrorString);
     if (ErrorString == "Success")
     {
           foreach (string TagName in TagNames)
           {
                  ComboBoxCheckTagAccessWrite.Items.Add(TagName);
           }
           if (ComboBoxCheckTagAccessWrite.Items.Count > 0)
           {
                  ComboBoxCheckTagAccessWrite.SelectedIndex = 0;
           }
     }
     else
     {
           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
}

System Errors

GetSystemErrors

  • The GetSystemErrors Function returns a list of the System Errors from the System Type, Group, and Category specified.
  • The CurrentlyInError returns a Boolean error with a value of True if the System Type, Group, or Category is in error and False if it is not, This list should be the same length as the number of System Error names that are returned.
  • To return a list of all System Types that are in error or have had an error specify System Type as blank.
  • To return a list of all Groups that are in error or have had an error specify the System Type to obtain and Group as blank.
  • To return a list of all Categories that are in error or have had an error specify the System Type and Group to obtain and Category as blank.
  • To return a history list of all previous system error messages specify the System Type, Group, and Category to obtain the messages from.
  • Returns Empty String Array if service is not reachable.
  • NetworkNode is the name of the network node of the OAS Service to connect to. Leave blank for localhost connection.
  • ErrorString will be set to Success when function is successful and an error message when in error.
  • RemoteSCADAHostingName is the name of the Live Data Cloud OAS Service to connect to.

VB

    Private Sub ButtonGetSystemErrors_Click(sender As System.Object, e As System.EventArgs) Handles ButtonGetSystemErrors.Click
        Cursor.Current = Cursors.WaitCursor
        Dim localGetSystemTypes As Boolean
        Dim localGetGroups As Boolean
        Dim localGetCategories As Boolean
        Dim localSystemType As String = ""
        Dim localGroup As String = ""
        Dim localCategory As String = ""
 
        ComboBoxPreviousMessages.Items.Clear()
 
        If ComboBoxSystemType.SelectedItem = "" Then
            localGetSystemTypes = True
            ComboBoxSystemType.Items.Clear()
            ComboBoxGroup.Items.Clear()
            ComboBoxCategory.Items.Clear()
        ElseIf ComboBoxGroup.SelectedItem = "" Then
            localSystemType = ComboBoxSystemType.SelectedItem.Remove(0, 8)
            localGetGroups = True
            ComboBoxGroup.Items.Clear()
            ComboBoxCategory.Items.Clear()
        ElseIf ComboBoxCategory.SelectedItem = "" Then
            localSystemType = ComboBoxSystemType.SelectedItem.Remove(0, 8)
            localGroup = ComboBoxGroup.SelectedItem.Remove(0, 8)
            localGetCategories = True
            ComboBoxCategory.Items.Clear()
        Else
            localSystemType = ComboBoxSystemType.SelectedItem.Remove(0, 8)
            localGroup = ComboBoxGroup.SelectedItem.Remove(0, 8)
            localCategory = ComboBoxCategory.SelectedItem.Remove(0, 8)
        End If
        Dim SystemErrors() As String
        Dim CurrentlyInError(-1) As Boolean
        Dim ErrorString As String = ""
 
 
        SystemErrors = ModuleNetworkNode.OPCSystemsComponent1.GetSystemErrors(localSystemType, localGroup, localCategory, CurrentlyInError, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            Dim localIndex As Int32
            For localIndex = 0 To SystemErrors.GetLength(0) - 1
                If localGetSystemTypes Then
                    If CurrentlyInError(localIndex) Then
                        ComboBoxSystemType.Items.Add("Error - " + SystemErrors(localIndex))
                    Else
                        ComboBoxSystemType.Items.Add("OK -    " + SystemErrors(localIndex))
                    End If
                    If localIndex = 0 Then
                        ComboBoxSystemType.SelectedIndex = 0
                    End If
                ElseIf localGetGroups Then
                    If CurrentlyInError(localIndex) Then
                        ComboBoxGroup.Items.Add("Error - " + SystemErrors(localIndex))
                    Else
                        ComboBoxGroup.Items.Add("OK -    " + SystemErrors(localIndex))
                    End If
                    If localIndex = 0 Then
                        ComboBoxGroup.SelectedIndex = 0
                    End If
                ElseIf localGetCategories Then
                    If CurrentlyInError(localIndex) Then
                        ComboBoxCategory.Items.Add("Error - " + SystemErrors(localIndex))
                    Else
                        ComboBoxCategory.Items.Add("OK -    " + SystemErrors(localIndex))
                    End If
                    If localIndex = 0 Then
                        ComboBoxCategory.SelectedIndex = 0
                    End If
                Else
                    ComboBoxPreviousMessages.Items.Add(SystemErrors(localIndex))
                    If localIndex = 0 Then
                        ComboBoxPreviousMessages.SelectedIndex = 0
                    End If
                End If
            Next
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
 
    End Sub

C#

	        private void ButtonGetSystemErrors_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     bool localGetSystemTypes = false;
                     bool localGetGroups = false;
                     bool localGetCategories = false;
                     string localSystemType = "";
                     string localGroup = "";
                     string localCategory = "";
 
                     ComboBoxPreviousMessages.Items.Clear();
 
                     if (string.IsNullOrEmpty(ComboBoxSystemType.SelectedItem.ToString()))
                     {
                           localGetSystemTypes = true;
                           ComboBoxSystemType.Items.Clear();
                           ComboBoxGroup.Items.Clear();
                           ComboBoxCategory.Items.Clear();
                     }
                     else if (string.IsNullOrEmpty(ComboBoxGroup.SelectedItem.ToString()))
                     {
                localSystemType = ComboBoxSystemType.SelectedItem.ToString().Remove(0, 8);
                            localGetGroups = true;
                           ComboBoxGroup.Items.Clear();
                           ComboBoxCategory.Items.Clear();
                     }
                     else if (string.IsNullOrEmpty(ComboBoxCategory.SelectedItem.ToString()))
                     {
                localSystemType = ComboBoxSystemType.SelectedItem.ToString().Remove(0, 8);
                localGroup = ComboBoxGroup.SelectedItem.ToString().Remove(0, 8);
                           localGetCategories = true;
                           ComboBoxCategory.Items.Clear();
                     }
                     else
                     {
                localSystemType = ComboBoxSystemType.SelectedItem.ToString().Remove(0, 8);
                localGroup = ComboBoxGroup.SelectedItem.ToString().Remove(0, 8);
                localCategory = ComboBoxCategory.SelectedItem.ToString().Remove(0, 8);
                     }
                     string[] SystemErrors = null;
                     bool[] CurrentlyInError = new bool[0];
                     string ErrorString = "";
 
 
                     SystemErrors = ModuleNetworkNode.OPCSystemsComponent1.GetSystemErrors(localSystemType, localGroup, localCategory, ref CurrentlyInError, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           Int32 localIndex = 0;
                           for (localIndex = 0; localIndex < SystemErrors.GetLength(0); localIndex++)
                           {
                                  if (localGetSystemTypes)
                                  {
                                         if (CurrentlyInError[localIndex])
                                         {
                                                ComboBoxSystemType.Items.Add("Error - " + SystemErrors[localIndex]);
                                         }
                                         else
                                         {
                                                ComboBoxSystemType.Items.Add("OK -    " + SystemErrors[localIndex]);
                                         }
                                         if (localIndex == 0)
                                         {
                                                ComboBoxSystemType.SelectedIndex = 0;
                                         }
                                  }
                                  else if (localGetGroups)
                                  {
                                         if (CurrentlyInError[localIndex])
                                         {
                                                ComboBoxGroup.Items.Add("Error - " + SystemErrors[localIndex]);
                                         }
                                         else
                                         {
                                                ComboBoxGroup.Items.Add("OK -    " + SystemErrors[localIndex]);
                                         }
                                         if (localIndex == 0)
                                         {
                                                ComboBoxGroup.SelectedIndex = 0;
                                         }
                                  }
                                  else if (localGetCategories)
                                  {
                                         if (CurrentlyInError[localIndex])
                                         {
                                                ComboBoxCategory.Items.Add("Error - " + SystemErrors[localIndex]);
                                         }
                                         else
                                         {
                                                ComboBoxCategory.Items.Add("OK -    " + SystemErrors[localIndex]);
                                         }
                                         if (localIndex == 0)
                                         {
                                                ComboBoxCategory.SelectedIndex = 0;
                                         }
                                  }
                                  else
                                  {
                                         ComboBoxPreviousMessages.Items.Add(SystemErrors[localIndex]);
                                         if (localIndex == 0)
                                         {
                                                ComboBoxPreviousMessages.SelectedIndex = 0;
                                         }
                                  }
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
 
              }
 
              private void ButtonReset_Click(object sender, System.EventArgs e)
              {
                     ComboBoxSystemType.Items.Clear();
                     ComboBoxGroup.Items.Clear();
                     ComboBoxCategory.Items.Clear();
                     ComboBoxPreviousMessages.Items.Clear();
              }	

 

Security Groups

GetSecurityGroupNames

  • The GetSecurityGroupNames Function returns a list of the Security 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 ButtonGetSecurityGroupNames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetSecurityGroupNames.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetSecurityGroupNames.Items.Clear()
        Dim Groups() As String
        Dim Group As String
        Dim ErrorString As String = ""
        Groups = ModuleNetworkNode.OPCSystemsComponent1.GetSecurityGroupNames(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each Group In Groups
                ComboBoxGetSecurityGroupNames.Items.Add(Group)
            Next
            If ComboBoxGetSecurityGroupNames.Items.Count > 0 Then
                ComboBoxGetSecurityGroupNames.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub
 
     Private Sub ComboBoxGetSecurityGroupNames_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetSecurityGroupNames.SelectedIndexChanged
        TextBoxSecurityGroup.Text = ComboBoxGetSecurityGroupNames.SelectedItem
    End Sub

C#

	      private void ButtonGetSecurityGroupNames_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetSecurityGroupNames.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.GetSecurityGroupNames(TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           foreach (string Group in Groups)
                           {
                                  ComboBoxGetSecurityGroupNames.Items.Add(Group);
                           }
                           if (ComboBoxGetSecurityGroupNames.Items.Count > 0)
                           {
                                  ComboBoxGetSecurityGroupNames.SelectedIndex = 0;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }
 
              private void ComboBoxGetSecurityGroupNames_SelectedIndexChanged(object sender, System.EventArgs e)
              {
                     TextBoxSecurityGroup.Text = ComboBoxGetSecurityGroupNames.SelectedItem.ToString();
              }

AddSecurityGroup

  • The AddSecurityGroup Function adds a Security Group to the existing Security 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 ButtonAddSecurityGroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAddSecurityGroup.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.AddSecurityGroup(TextBoxSecurityGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelAddSecurityGroupResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelAddSecurityGroupResult.Text = "Group successfully added."
        Else
            LabelAddSecurityGroupResult.Text = ErrorString
        End If
    End Sub
 

C#

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

GetSecurityParameterStrings

  • The RemoveSecurityGroup Function removes a Security Group from the existing Security 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 ButtonRemoveSecurityGroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRemoveSecurityGroup.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.RemoveSecurityGroup(TextBoxSecurityGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelRemoveSecurityGroupResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelRemoveSecurityGroupResult.Text = "Group successfully removed."
        Else
            LabelRemoveSecurityGroupResult.Text = ErrorString
        End If
    End Sub
 

C#

	    

GetSecurityParameterStrings

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

VB

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

C#

	     private void ButtonGetSecurityParameterStrings_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetSecurityParameterStrings.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.GetSecurityParameterStrings(TextBoxNetworkNode.Text);
                     foreach (string Parameter in Parameters)
                     {
                           ComboBoxGetSecurityParameterStrings.Items.Add(Parameter);
                     }
                     if (ComboBoxGetSecurityParameterStrings.Items.Count > 0)
                     {
                           ComboBoxGetSecurityParameterStrings.SelectedIndex = 1;
                     }
              }
 
              private void ComboBoxGetSecurityParameterStrings_SelectedIndexChanged(object sender, System.EventArgs e)
              {
                     TextBoxParameter.Text = ComboBoxGetSecurityParameterStrings.SelectedItem.ToString();
              }

GetSecurity_Parameter_Value

  • The GetSecurity_Parameter_Value Function returns an object value for the Security Group and Parameter specified.
  • Returns nothing if service is not reachable.
  • Parameter is a String of the Parameter Type desired of the Security Group.
  • Group is a String of the Security 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 ButtonGetSecurity_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetSecurity_Parameter_Value.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultObject As Object
        Dim ErrorString As String = ""
        ResultObject = ModuleNetworkNode.OPCSystemsComponent1.GetSecurity_Parameter_Value(TextBoxParameter.Text, TextBoxSecurityGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            Try
                LabelGetSecurity_Parameter_ValueResult.Text = ResultObject
                TextBoxValueToSet.Text = ResultObject
            Catch ex As Exception
                LabelGetSecurity_Parameter_ValueResult.Text = "Error converting value to string."
                TextBoxValueToSet.Text = ""
            End Try
        Else
            LabelGetSecurity_Parameter_ValueResult.Text = ErrorString
            TextBoxValueToSet.Text = ""
        End If
    End Sub

C#

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

GetSecurity_Parameter_Values

  • The GetSecurity_Parameter_Values Function returns an array of object values for the Security Group specified.
  • The order of the array corresponds with the GetSecurityParameterStrings Function order.
  • Returns empty array if service is not reachable.
  • Group is a String of the Security 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 ButtonGetSecurity_Parameter_Values_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetSecurity_Parameter_Values.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetSecurity_Parameter_Values.Items.Clear()
        Dim ResultObjects() As Object
        Dim ResultObject As Object
        Dim ResultString As String
        Dim ErrorString As String = ""
        ResultObjects = ModuleNetworkNode.OPCSystemsComponent1.GetSecurity_Parameter_Values(TextBoxSecurityGroup.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
                    ComboBoxGetSecurity_Parameter_Values.Items.Add(ResultString)
                Catch ex As Exception
                    ComboBoxGetSecurity_Parameter_Values.Items.Add("Error Converting Object")
                End Try
            Next
            If ComboBoxGetSecurity_Parameter_Values.Items.Count > 0 Then
                ComboBoxGetSecurity_Parameter_Values.SelectedIndex = 1
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

	     private void ButtonGetSecurity_Parameter_Values_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetSecurity_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.GetSecurity_Parameter_Values(TextBoxSecurityGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           foreach (object ResultObject in ResultObjects)
                           {
                                  try
                                  {
                                         if (ResultObject == null)
                                         {
                                                ResultString = "";
                                         }
                                         else
                                         {
                                                ResultString = ResultObject.ToString();
                                         }
                                         ComboBoxGetSecurity_Parameter_Values.Items.Add(ResultString);
                                  }
                                  catch (Exception ex)
                                  {
                                         ComboBoxGetSecurity_Parameter_Values.Items.Add("Error Converting Object");
                                  }
                           }
                           if (ComboBoxGetSecurity_Parameter_Values.Items.Count > 0)
                           {
                                  ComboBoxGetSecurity_Parameter_Values.SelectedIndex = 1;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }

SetSecurity_Parameter_Value

  • The SetSecurity_Parameter_Value Function sets an object value for the Security 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 Security Group.
  • Value is the desired value to set.
  • Group is a String of the Security 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 ButtonSetSecurity_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSetSecurity_Parameter_Value.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.SetSecurity_Parameter_Value(TextBoxParameter.Text, TextBoxValueToSet.Text, TextBoxSecurityGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelSetSecurity_Parameter_ValueResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelSetSecurity_Parameter_ValueResult.Text = "Parameter Successfully Updated."
        Else
            LabelSetSecurity_Parameter_ValueResult.Text = ErrorString
        End If
    End Sub

C#

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

GetSecurityUserNames

  • The GetSecurityUserNames Function returns a list of the Security User Names.
  • 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 GetSecurityUserNames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetSecurityUserNames.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetSecurityUserNames.Items.Clear()
        Dim Users() As String
        Dim User As String
        Dim ErrorString As String = ""
        Users = ModuleNetworkNode.OPCSystemsComponent1.GetSecurityUserNames(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each User In Users
                ComboBoxGetSecurityUserNames.Items.Add(User)
            Next
            If ComboBoxGetSecurityUserNames.Items.Count > 0 Then
                ComboBoxGetSecurityUserNames.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub
     Private Sub ComboBoxGetSecurityUserNames_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetSecurityUserNames.SelectedIndexChanged
        TextBoxSecurityUserName.Text = ComboBoxGetSecurityUserNames.SelectedItem
    End Sub

C#

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

AddSecurityUser

  • The AddSecurityUser Function adds a Security User to the existing Security configuration.
  • Returns -1 if service is not reachable.
  • Returns 1 if successful.
  • Returns 0 if the User already exists or adding the User failed.
  • UserName is the name of the User 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 ButtonAddSecurityUser_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAddSecurityUser.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.AddSecurityUser(TextBoxSecurityUserName.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelAddSecurityUserResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelAddSecurityUserResult.Text = "User successfully added."
        Else
            LabelAddSecurityUserResult.Text = ErrorString
        End If
    End Sub

C#

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

RemoveSecurityUser

  • The RemoveSecurityUser Function removes a Security User from the existing Security configuration.
  • Returns -1 if service is not reachable.
  • Returns 1 if successful.
  • Returns 0 if the User does not exist or removing the User failed.
  • UserName is the name of the User 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 ButtonRemoveSecurityUser_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRemoveSecurityUser.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.RemoveSecurityUser(TextBoxSecurityUserName.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelRemoveSecurityUserResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelRemoveSecurityUserResult.Text = "User successfully removed."
        Else
            LabelRemoveSecurityUserResult.Text = ErrorString
        End If
    End Sub

C#

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

GetSecurityUserParameterStrings

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

VB

    Private Sub ButtonGetSecurityUserParameterStrings_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetSecurityUserParameterStrings.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetSecurityUserParameterStrings.Items.Clear()
        Dim Parameters() As String
        Dim Parameter As String
        Parameters = ModuleNetworkNode.OPCSystemsComponent1.GetSecurityUserParameterStrings(TextBoxNetworkNode.Text)
        For Each Parameter In Parameters
            ComboBoxGetSecurityUserParameterStrings.Items.Add(Parameter)
        Next
        If ComboBoxGetSecurityUserParameterStrings.Items.Count > 0 Then
            ComboBoxGetSecurityUserParameterStrings.SelectedIndex = 1
        End If
    End Sub
 
     Private Sub ComboBoxGetSecurityUserParameterStrings_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetSecurityUserParameterStrings.SelectedIndexChanged
        TextBoxUserParameter.Text = ComboBoxGetSecurityUserParameterStrings.SelectedItem
    End Sub

C#

	     private void ButtonGetSecurityUserParameterStrings_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetSecurityUserParameterStrings.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.GetSecurityUserParameterStrings(TextBoxNetworkNode.Text);
                     foreach (string Parameter in Parameters)
                     {
                           ComboBoxGetSecurityUserParameterStrings.Items.Add(Parameter);
                     }
                     if (ComboBoxGetSecurityUserParameterStrings.Items.Count > 0)
                     {
                           ComboBoxGetSecurityUserParameterStrings.SelectedIndex = 1;
                     }
              }
 
              private void ComboBoxGetSecurityUserParameterStrings_SelectedIndexChanged(object sender, System.EventArgs e)
              {
                     TextBoxUserParameter.Text = ComboBoxGetSecurityUserParameterStrings.SelectedItem.ToString();
              }

GetSecurityUser_Parameter_Value

  • The GetSecurityUser_Parameter_Value Function returns an object value for the Security User and Parameter specified.
  • Returns nothing if service is not reachable.
  • Parameter is a String of the Parameter Type desired of the Security User.
  • UserName is a String of the Security User 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 ButtonGetSecurityUser_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetSecurityUser_Parameter_Value.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultObject As Object
        Dim ErrorString As String = ""
        ResultObject = ModuleNetworkNode.OPCSystemsComponent1.GetSecurityUser_Parameter_Value(TextBoxUserParameter.Text, TextBoxSecurityUserName.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            Try
                LabelGetSecurityUser_Parameter_ValueResult.Text = ResultObject
                TextBoxUserValueToSet.Text = ResultObject
            Catch ex As Exception
                LabelGetSecurityUser_Parameter_ValueResult.Text = "Error converting value to string."
                TextBoxUserValueToSet.Text = ""
            End Try
        Else
            LabelGetSecurityUser_Parameter_ValueResult.Text = ErrorString
            TextBoxUserValueToSet.Text = ""
        End If
    End Sub

C#

	      private void ButtonGetSecurityUser_Parameter_Value_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     object ResultObject = null;
                     string ErrorString = "";
                     ResultObject = ModuleNetworkNode.OPCSystemsComponent1.GetSecurityUser_Parameter_Value(TextBoxUserParameter.Text, TextBoxSecurityUserName.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           try
                           {
                                  LabelGetSecurityUser_Parameter_ValueResult.Text = ResultObject.ToString();
                                  TextBoxUserValueToSet.Text = ResultObject.ToString();
                           }
                           catch (Exception ex)
                           {
                                  LabelGetSecurityUser_Parameter_ValueResult.Text = "Error converting value to string.";
                                  TextBoxUserValueToSet.Text = "";
                           }
                     }
                     else
                     {
                           LabelGetSecurityUser_Parameter_ValueResult.Text = ErrorString;
                           TextBoxUserValueToSet.Text = "";
                     }
              }

GetSecurityUser_Parameter_Values

  • The GetSecurityUser_Parameter_Values Function returns an array of object values for the Security User specified.
  • The order of the array corresponds with the GetSecurityUserParameterStrings Function order.
  • Returns empty array if service is not reachable.
  • UserName is a String of the Security User 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 ButtonGetSecurityUser_Parameter_Values_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetSecurityUser_Parameter_Values.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetSecurityUser_Parameter_Values.Items.Clear()
        Dim ResultObjects() As Object
        Dim ResultObject As Object
        Dim ResultString As String
        Dim ErrorString As String = ""
        ResultObjects = ModuleNetworkNode.OPCSystemsComponent1.GetSecurityUser_Parameter_Values(TextBoxSecurityUserName.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
                    ComboBoxGetSecurityUser_Parameter_Values.Items.Add(ResultString)
                Catch ex As Exception
                    ComboBoxGetSecurityUser_Parameter_Values.Items.Add("Error Converting Object")
                End Try
            Next
            If ComboBoxGetSecurityUser_Parameter_Values.Items.Count > 0 Then
                ComboBoxGetSecurityUser_Parameter_Values.SelectedIndex = 1
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

	      private void ButtonGetSecurityUser_Parameter_Values_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetSecurityUser_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.GetSecurityUser_Parameter_Values(TextBoxSecurityUserName.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           foreach (object ResultObject in ResultObjects)
                           {
                                  try
                                  {
                                         if (ResultObject == null)
                                         {
                                                ResultString = "";
                                         }
                                         else
                                         {
                                                ResultString = ResultObject.ToString();
                                         }
                                         ComboBoxGetSecurityUser_Parameter_Values.Items.Add(ResultString);
                                  }
                                  catch (Exception ex)
                                  {
                                         ComboBoxGetSecurityUser_Parameter_Values.Items.Add("Error Converting Object");
                                  }
                           }
                           if (ComboBoxGetSecurityUser_Parameter_Values.Items.Count > 0)
                           {
                                  ComboBoxGetSecurityUser_Parameter_Values.SelectedIndex = 1;
                           }
                     }
                     else
                     {
                            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }

SetSecurityUser_Parameter_Value

  • The SetSecurityUser_Parameter_Value Function sets an object value for the Security User and Parameter specified.
  • Returns -1 if service is not reachable.
  • Returns 0 if the User 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 Security User.
  • Value is the desired value to set.
  • UserName is a String of the Security User 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 ButtonSetSecurityUser_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSetSecurityUser_Parameter_Value.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.SetSecurityUser_Parameter_Value(TextBoxUserParameter.Text, TextBoxUserValueToSet.Text, TextBoxSecurityUserName.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelSetSecurityUser_Parameter_ValueResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelSetSecurityUser_Parameter_ValueResult.Text = "Parameter Successfully Updated."
        Else
            LabelSetSecurityUser_Parameter_ValueResult.Text = ErrorString
        End If
    End Sub

C#

	      private void ButtonSetSecurityUser_Parameter_Value_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     Int32 ResultInt32 = 0;
                     string ErrorString = "";
                     ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.SetSecurityUser_Parameter_Value(TextBoxUserParameter.Text, TextBoxUserValueToSet.Text, TextBoxSecurityUserName.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ResultInt32 == -1)
                     {
                           LabelSetSecurityUser_Parameter_ValueResult.Text = "OAS Service not reached.";
                     }
                     else if (ResultInt32 == 1)
                     {
                           LabelSetSecurityUser_Parameter_ValueResult.Text = "Parameter Successfully Updated.";
                     }
                     else
                     {
                           LabelSetSecurityUser_Parameter_ValueResult.Text = ErrorString;
                     }
              }

SaveSecurityConfiguration

  • The SaveSecurityConfiguration Subroutine saves the current Security 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 ButtonSaveSecurityConfiguration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSaveSecurityConfiguration.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ErrorString As String = ""
        ModuleNetworkNode.OPCSystemsComponent1.SaveSecurityConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

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

LoadSecurityConfiguration

  • The LoadSecurityConfiguration Subroutine saves the current Security 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 ButtonLoadSecurityConfiguration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonLoadSecurityConfiguration.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ErrorString As String = ""
        ModuleNetworkNode.OPCSystemsComponent1.LoadSecurityConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

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

Report Groups

GetReportNames

  • The GetReportNames Function returns a list of the Report 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 ButtonGetReportNames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetReportNames.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetReportNames.Items.Clear()
        Dim Groups() As String
        Dim Group As String
        Dim ErrorString As String = ""
        Groups = ModuleNetworkNode.OPCSystemsComponent1.GetReportNames(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each Group In Groups
                ComboBoxGetReportNames.Items.Add(Group)
            Next
            If ComboBoxGetReportNames.Items.Count > 0 Then
                ComboBoxGetReportNames.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub
 
        Private Sub ComboBoxGetReportNames_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetReportNames.SelectedIndexChanged
        TextBoxReportGroup.Text = ComboBoxGetReportNames.SelectedItem
    End Sub
 

C#

	     private void ButtonGetReportNames_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetReportNames.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.GetReportNames(TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           foreach (string Group in Groups)
                           {
                                  ComboBoxGetReportNames.Items.Add(Group);
                           }
                           if (ComboBoxGetReportNames.Items.Count > 0)
                           {
                                  ComboBoxGetReportNames.SelectedIndex = 0;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }
 
              private void ComboBoxGetReportNames_SelectedIndexChanged(object sender, System.EventArgs e)
              {
                     TextBoxReportGroup.Text = ComboBoxGetReportNames.SelectedItem.ToString();
              }
   

AddReportGroup

  • The AddReportGroup Function adds a Report Group to the existing Report 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 ButtonAddReportGroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAddReportGroup.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.AddReportGroup(TextBoxReportGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelAddReportGroupResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelAddReportGroupResult.Text = "Group successfully added."
        Else
            LabelAddReportGroupResult.Text = ErrorString
        End If
    End Sub

C#

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

RemoveReportGroup

  • The RemoveReportGroup Function removes a Report Group from the existing Report 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 ButtonRemoveReportGroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRemoveReportGroup.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.RemoveReportGroup(TextBoxReportGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelRemoveReportGroupResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelRemoveReportGroupResult.Text = "Group successfully removed."
        Else
            LabelRemoveReportGroupResult.Text = ErrorString
        End If
    End Sub

C#

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

GetReportParameterStrings

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

VB

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

C#

	     private void ButtonGetReportParameterStrings_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetReportParameterStrings.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.GetReportParameterStrings(TextBoxNetworkNode.Text);
                     foreach (string Parameter in Parameters)
                     {
                           ComboBoxGetReportParameterStrings.Items.Add(Parameter);
                     }
                     if (ComboBoxGetReportParameterStrings.Items.Count > 0)
                     {
                           ComboBoxGetReportParameterStrings.SelectedIndex = 1;
                     }
              }
 
              private void ComboBoxGetReportParameterStrings_SelectedIndexChanged(object sender, System.EventArgs e)
              {
                     TextBoxParameter.Text = ComboBoxGetReportParameterStrings.SelectedItem.ToString();
              }

GetReport_Parameter_Value

  • The GetReport_Parameter_Value Function returns an object value for the Report Group and Parameter specified.
  • Returns nothing if service is not reachable.
  • Parameter is a String of the Parameter Type desired of the Report Group.
  • Group is a String of the Report 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 ButtonGetReport_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetReport_Parameter_Value.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultObject As Object
        Dim ErrorString As String = ""
        ResultObject = ModuleNetworkNode.OPCSystemsComponent1.GetReport_Parameter_Value(TextBoxParameter.Text, TextBoxReportGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            Try
                LabelGetReport_Parameter_ValueResult.Text = ResultObject
                TextBoxValueToSet.Text = ResultObject
            Catch ex As Exception
                LabelGetReport_Parameter_ValueResult.Text = "Error converting value to string."
                TextBoxValueToSet.Text = ""
            End Try
        Else
            LabelGetReport_Parameter_ValueResult.Text = ErrorString
            TextBoxValueToSet.Text = ""
        End If
    End Sub
 

C#

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

GetReport_Parameter_Values

  • The GetReport_Parameter_Values Function returns an array of object values for the Report Group specified.
  • The order of the array corresponds with the GetReportParameterStrings Function order.
  • Returns empty array if service is not reachable.
  • Group is a String of the Report 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 ButtonGetReport_Parameter_Values_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetReport_Parameter_Values.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetReport_Parameter_Values.Items.Clear()
        Dim ResultObjects() As Object
        Dim ResultObject As Object
        Dim ResultString As String
        Dim ErrorString As String = ""
        ResultObjects = ModuleNetworkNode.OPCSystemsComponent1.GetReport_Parameter_Values(TextBoxReportGroup.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
                    ComboBoxGetReport_Parameter_Values.Items.Add(ResultString)
                Catch ex As Exception
                    ComboBoxGetReport_Parameter_Values.Items.Add("Error Converting Object")
                End Try
            Next
            If ComboBoxGetReport_Parameter_Values.Items.Count > 0 Then
                ComboBoxGetReport_Parameter_Values.SelectedIndex = 1
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

	       private void ButtonGetReport_Parameter_Values_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetReport_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.GetReport_Parameter_Values(TextBoxReportGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           foreach (object ResultObject in ResultObjects)
                           {
                                  try
                                  {
                                         if (ResultObject == null)
                                         {
                                                ResultString = "";
                                         }
                                         else
                                         {
                                                ResultString = ResultObject.ToString();
                                         }
                                         ComboBoxGetReport_Parameter_Values.Items.Add(ResultString);
                                  }
                                  catch (Exception ex)
                                  {
                                         ComboBoxGetReport_Parameter_Values.Items.Add("Error Converting Object");
                                  }
                           }
                           if (ComboBoxGetReport_Parameter_Values.Items.Count > 0)
                           {
                                  ComboBoxGetReport_Parameter_Values.SelectedIndex = 1;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }

SetReport_Parameter_Value

  • The SetReport_Parameter_Value Function sets an object value for the Report 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 Report Group.
  • Value is the desired value to set.
  • Group is a String of the Report 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 ButtonSetReport_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSetReport_Parameter_Value.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.SetReport_Parameter_Value(TextBoxParameter.Text, TextBoxValueToSet.Text, TextBoxReportGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelSetReport_Parameter_ValueResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelSetReport_Parameter_ValueResult.Text = "Parameter Successfully Updated."
        Else
            LabelSetReport_Parameter_ValueResult.Text = ErrorString
        End If
    End Sub

C#

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

SaveReportConfiguration

  • The SaveReportConfiguration Subroutine saves the current Report 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 ButtonSaveReportConfiguration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSaveReportConfiguration.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ErrorString As String = ""
        ModuleNetworkNode.OPCSystemsComponent1.SaveReportConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

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

LoadReportConfiguration

  • The LoadReportConfiguration Subroutine saves the current Report 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 ButtonLoadReportConfiguration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonLoadReportConfiguration.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ErrorString As String = ""
        ModuleNetworkNode.OPCSystemsComponent1.LoadReportConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

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

Recipe Groups

GetRecipeNames

  • The GetRecipeNames Function returns a list of the Recipe 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 ButtonGetRecipeNames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetRecipeNames.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetRecipeNames.Items.Clear()
        Dim Groups() As String
        Dim Group As String
        Dim ErrorString As String = ""
        Groups = ModuleNetworkNode.OPCSystemsComponent1.GetRecipeNames(TextBoxNetworkNode.Text, ErrorString)
        If ErrorString = "Success" Then
            For Each Group In Groups
                ComboBoxGetRecipeNames.Items.Add(Group)
            Next
            If ComboBoxGetRecipeNames.Items.Count > 0 Then
                ComboBoxGetRecipeNames.SelectedIndex = 0
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub
 
    Private Sub ComboBoxGetRecipeNames_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxGetRecipeNames.SelectedIndexChanged
        TextBoxRecipeGroup.Text = ComboBoxGetRecipeNames.SelectedItem
    End Sub
 

C#

	  private void ButtonGetRecipeNames_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetRecipeNames.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.GetRecipeNames(TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           foreach (string Group in Groups)
                           {
                                  ComboBoxGetRecipeNames.Items.Add(Group);
                           }
                           if (ComboBoxGetRecipeNames.Items.Count > 0)
                           {
                                  ComboBoxGetRecipeNames.SelectedIndex = 0;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              }
 
              private void ComboBoxGetRecipeNames_SelectedIndexChanged(object sender, System.EventArgs e)
              {
                     TextBoxRecipeGroup.Text = ComboBoxGetRecipeNames.SelectedItem.ToString();
              }
  

AddRecipeGroup

  • The AddRecipeGroup Function adds a Recipe Group to the existing Recipe 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 ButtonAddRecipeGroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAddRecipeGroup.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.AddRecipeGroup(TextBoxRecipeGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelAddRecipeGroupResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelAddRecipeGroupResult.Text = "Group successfully added."
        Else
            LabelAddRecipeGroupResult.Text = ErrorString
        End If
    End Sub

C#

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

RemoveRecipeGroup

  • The RemoveRecipeGroup Function removes a Recipe Group from the existing Recipe 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 ButtonRemoveRecipeGroup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRemoveRecipeGroup.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.RemoveRecipeGroup(TextBoxRecipeGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelRemoveRecipeGroupResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelRemoveRecipeGroupResult.Text = "Group successfully removed."
        Else
            LabelRemoveRecipeGroupResult.Text = ErrorString
        End If
    End Sub

C#

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

GetRecipeParameterStrings

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

VB

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

C#

	  private void ButtonGetRecipeParameterStrings_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetRecipeParameterStrings.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.GetRecipeParameterStrings(TextBoxNetworkNode.Text);
                     foreach (string Parameter in Parameters)
                     {
                           ComboBoxGetRecipeParameterStrings.Items.Add(Parameter);
                     }
                     if (ComboBoxGetRecipeParameterStrings.Items.Count > 0)
                     {
                           ComboBoxGetRecipeParameterStrings.SelectedIndex = 1;
                     }
              }
 
              private void ComboBoxGetRecipeParameterStrings_SelectedIndexChanged(object sender, System.EventArgs e)
              {
                     TextBoxParameter.Text = ComboBoxGetRecipeParameterStrings.SelectedItem.ToString();
              }

GetRecipe_Parameter_Value

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

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

C#

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

GetRecipe_Parameter_Values

  • The GetRecipe_Parameter_Values Function returns an array of object values for the Recipe Group specified.
  • The order of the array corresponds with the GetRecipeParameterStrings Function order.
  • Returns empty array if service is not reachable.
  • Group is a String of the Recipe 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 ButtonGetRecipe_Parameter_Values_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonGetRecipe_Parameter_Values.Click
        Cursor.Current = Cursors.WaitCursor
        ComboBoxGetRecipe_Parameter_Values.Items.Clear()
        Dim ResultObjects() As Object
        Dim ResultObject As Object
        Dim ResultString As String
        Dim ErrorString As String = ""
        ResultObjects = ModuleNetworkNode.OPCSystemsComponent1.GetRecipe_Parameter_Values(TextBoxRecipeGroup.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
                    ComboBoxGetRecipe_Parameter_Values.Items.Add(ResultString)
                Catch ex As Exception
                    ComboBoxGetRecipe_Parameter_Values.Items.Add("Error Converting Object")
                End Try
            Next
            If ComboBoxGetRecipe_Parameter_Values.Items.Count > 0 Then
                ComboBoxGetRecipe_Parameter_Values.SelectedIndex = 1
            End If
        Else
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

	  private void ButtonGetRecipe_Parameter_Values_Click(object sender, System.EventArgs e)
              {
                     System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                     ComboBoxGetRecipe_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.GetRecipe_Parameter_Values(TextBoxRecipeGroup.Text, TextBoxNetworkNode.Text, ref ErrorString);
                     if (ErrorString == "Success")
                     {
                           foreach (object ResultObject in ResultObjects)
                           {
                                  try
                                  {
                                         if (ResultObject == null)
                                         {
                                                ResultString = "";
                                         }
                                         else
                                         {
                                                ResultString = ResultObject.ToString();
                                         }
                                         ComboBoxGetRecipe_Parameter_Values.Items.Add(ResultString);
                                  }
                                  catch (Exception ex)
                                  {
                                         ComboBoxGetRecipe_Parameter_Values.Items.Add("Error Converting Object");
                                  }
                           }
                           if (ComboBoxGetRecipe_Parameter_Values.Items.Count > 0)
                           {
                                  ComboBoxGetRecipe_Parameter_Values.SelectedIndex = 1;
                           }
                     }
                     else
                     {
                           MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
              } 

SetRecipe_Parameter_Value

  • The SetRecipe_Parameter_Value Function sets an object value for the Recipe 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 Recipe Group.
  • Value is the desired value to set.
  • Group is a String of the Recipe 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 ButtonSetRecipe_Parameter_Value_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSetRecipe_Parameter_Value.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ResultInt32 As Int32
        Dim ErrorString As String = ""
        ResultInt32 = ModuleNetworkNode.OPCSystemsComponent1.SetRecipe_Parameter_Value(TextBoxParameter.Text, TextBoxValueToSet.Text, TextBoxRecipeGroup.Text, TextBoxNetworkNode.Text, ErrorString)
        If ResultInt32 = -1 Then
            LabelSetRecipe_Parameter_ValueResult.Text = "OAS Service not reached."
        ElseIf ResultInt32 = 1 Then
            LabelSetRecipe_Parameter_ValueResult.Text = "Parameter Successfully Updated."
        Else
            LabelSetRecipe_Parameter_ValueResult.Text = ErrorString
        End If
    End Sub 

C#

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

SaveRecipeConfiguration

  • The SaveRecipeConfiguration Subroutine saves the current Recipe 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 ButtonSaveRecipeConfiguration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSaveRecipeConfiguration.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ErrorString As String = ""
        ModuleNetworkNode.OPCSystemsComponent1.SaveRecipeConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub

C#

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

LoadRecipeConfiguration

  • The LoadRecipeConfiguration Subroutine saves the current Recipe 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 ButtonLoadRecipeConfiguration_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonLoadRecipeConfiguration.Click
        Cursor.Current = Cursors.WaitCursor
        Dim ErrorString As String = ""
        ModuleNetworkNode.OPCSystemsComponent1.LoadRecipeConfiguration(TextBoxFilePath.Text, TextBoxNetworkNode.Text, ErrorString)
        If ErrorString <> "Success" Then
            MessageBox.Show(ErrorString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
    End Sub    

C#

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