OPC .Net client server toolkits for OPC DA, HDA, AE, XML-DA      Advanced
OPC
Solutions    
         OPC .Net client server toolkits for OPC DA, HDA, AE, XML-DA
Online Tools
- OPC Error Lookup
Search  
   
* privacy and security Guaranteed  
XMLDA.NET DataBind ASP.NET Sample Application Login  

XMLDA.NET Sample Application

ASP.NET Application with Visual Basic code behind that uses DataBind subscriptions

XMLDA.NET Sample ASP.NET client application

DataBind subscriptions are defined from a ListBuilder created XML file.
The DataBind subscriptions work in combination with the ASP.NET DataBind feature to update a CheckBox from a binary OPC-DA or XML-DA server item value, a ListBox with an array item value and TextBoxes with integer values.

 


   'Shared OpcURL As String = "http://localhost/OpcXmlGateway/OpcDaGateway.asmx"
   Shared OpcURL As String = "OCSTK.DA.Sim.32"
   Private Shared OpcSrv As XmlServer
 
   '-----------------------------------------------------------------------------------------
   Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      ' Put user code to initialize the page here
      If Not IsPostBack Then
         chkStopped.Checked = False
         OpcSrv = New XmlServer(OpcURL)
         Dim err As OPCError()
         Dim subscr As DataBindSubscription()
         OpcSrv.DataBindFromXmlFile(Me, "AspDemo1.xml", "Demo1", Nothing, 1000, Nothing, subscr, err)
      End If
      DataBind()
   End Sub

   '------------------------------------------------------
   ' method used in DataBind definitons
   Public Function GetOpcItemValue(ByVal SubscrID As String) As Object
      If OpcSrv Is Nothing Then
         Return ""
      End If
      Return OpcSrv.GetBindValue(SubscrID)
   End Function

   '------------------------------------------------------
   Private Sub btnRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRefresh.Click
      ' only postback handling is required
   End Sub

   Private Sub chkStopped_CheckedChanged(ByVal sender As System.Object, _
                              ByVal e As System.EventArgs) Handles chkStopped.CheckedChanged
      Dim err As OPCError()
      OpcSrv.DataBindCancel(Nothing, Nothing, err)
   End Sub

 

 

home | contact us | return policy | privacy policy | security policy | Copyright © 2018 Advosol Inc. All Rights Reserved.