Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

ASP.NET , OPC, DataSocket

Hi,
 
I'm doing an ASP.NET web site which reads some variables from a local OPC  server and displays the value on a gauge ....
 
 
First Question:
One interesting thing is that when developing web sites, the Visual Studio Toolbox does not have a "Data Socket" control..........why ????
 
Second Question:
 
Bellow is my code ..... Is this the general accepted way of writing such an application ?????
I just want to check and make sure ...
 

Partial

Class MyForm

Inherits System.Web.UI.Page

Dim T_DS As NationalInstruments.Net.DataSocket = New NationalInstruments.Net.DataSocket()

Protected Sub AutoRefresh1_Refresh(ByVal sender As Object, ByVal e As NationalInstruments.UI.RefreshEventArgs) Handles AutoRefresh1.Refresh

TG.Value = T1_WS_DS.Data.Value

REM TG Is a gauge control

REM TG is registered in the update items of the autorefresh control

End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

T_DS.Url =

"opc://localhost/National Instruments.OPCLookoutDrivers/DL1.T"

T_DS.Connect()

End Sub

End

Class

 
 
0 Kudos
Message 1 of 2
(4,124 Views)
Hello Sebastian,
 
It looks like the answer to your first question can be found in this previous discussion.
 
For your second question, as with all programming languages there are a number of ways to perform most functions.
 
Specifically in regards to Measurement Studio and Datasockets, I would recommend looking at the Datasocket examples for reader and write that we have provided, this will provide you with one successful implementation of datasockets.
 
Thanks for posting!
With warm regards,

David D.
0 Kudos
Message 2 of 2
(4,098 Views)