Write Tag Array IIS
Home Product
Details Free 
Demo Pricing &
Ordering Related
Products Support About Us

Please use our Code Center to obtain source-code and example projects/solutions:

http://codecenter.softwaretoolbox.com

 

Web Based Applications using the OPC Web Client Web Service

Objective

    Write new values of a Tag Array from a web-page.

    This example assumes that you have the Software Toolbox TOPServer installed, and the modified project "simdemo.opf" is loaded within the TOPServer.

Source Code

    ASP.NET

     Try
        '
         'define our OPC Web Client
 
      Dim objOWC As New OPCLabs.EasyOPCDANet.EasyDAWS
         '
         'now to create an array of values to write to our tag
         Dim arrValues() As Integer = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
         '
         'now to write the array to the tag
         objOWC.WriteItemValue( _
           strPCName, _
           strOPCServer, _
           strTag, _
           arrValues)
         '
         'now to make sure there was no error
         If Err.Number = 0 Then
           Response.Write("Array Write successful!")
         Else
           Response.Write("Error (" & Err.Number & ") " & Err.Description)
         End If
         '
         'now to dispose of our object
         objOWC = Nothing
         '
     Catch ex As Exception
         '
         'display an exception to screen
         Response.Write(ex.Message)
     End Try

Copyright Software Toolbox, Inc., 1996-2004, All Rights Reserved Worldwide.
148A East Charles Street, Matthews, North Carolina, USA 28105
Phone: 704-849-2773 or 1-888-665-3678 (US), Fax: 704-849-6388
sales@softwaretoolbox.com | support@softwaretoolbox.com