I have an application where LabView acquires data through 5 channels and writes them to data sockets which are then accessed through VB MS. I am currently writing the data from each channed to a different data socket (say, dstp://localhost/test1, ... dstp://localhost/test5). In VB, I have placed a separate DS connection for each channel on the User Control panel and for each DS, I have the following routine for accessing the data written to the DS:
For DS 1:
Private Sub CWDataSocket1_OnDataUpdated(ByVal Data As CWDSLib.CWData)
If IsArray(Data.Value) Then
CWGraph1.PlotY Data.Value
End If
End Sub
For DS2:
Private Sub CWDataSocket2_OnDataUpdated(ByVal Data As CWDSLib.CWData)
If IsArray(Data.Value) Then
CWGraph2.PlotY Data.Value
End If
End Sub
.... etc.
So, basically I am trying to plot the data from each channel's DS connection on a different CWGraph. The source for each DS connection is also specified, and I have the connection procedure for each DS coded as follows:
Private Sub ConnectButton_Click()
CWDataSocket1.ConnectTo Text1.Text, cwdsReadAutoUpdate
CWDataSocket2.ConnectTo Text2.Text, cwdsReadAutoUpdate
........
End Sub
So, on the mouse click on the connect button on the web page I generated using the application setup wizard, the individual data sockets connect to the data specified by the path Text(n).Text and plot them on different graphs.
However, when I run the program, even though the status for each DS is displayed as "connected", the CWGraphs are not updated with the data. Exactly the same code, but with just one channel works fine, with the graph being updated with the data written on the Data Socket.
So, I am wondering whether the approach I am using is wrong. i.e. should I not use individual data sockets for each channel of data? Can I write data from all channels on the same DS connection and then somehow retrieve them separately in VB? Or is the problem I am having due to my code in VB (I am only a beginner) and if so, what would you suggest (currently I have separate procedures for each DS connection - may be i should have them all within one)
thanks!