Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

The VB demo from NI web site will not connect to dstp://weather.ni.com/msdemo

I am trying to run the VB demo I down loaded from the NI site and it will not connect to the server. It just times out. Any clue as to why this will not work? Could it be a corporate firewall issue?
0 Kudos
Message 1 of 6
(6,504 Views)
Hello Ralph,

It turns out that we took the "msdemo" DataSocket server offline awhile back and did not take the Measurement Studio 6.0 tutorial offline yet. Since we've upgraded Measurement Studio to version 7.0, we're not maintaining the version 6.0 tutorials anymore. Thanks for letting us know about this.

You can connect to dstp://weather.ni.com/weather/1Minute, which will return you a 2D-array (0 to 4, 0 to 59) of doubles. This is historical weather data (the past 1-minute of data). You could modify the code in the VB demonstration to retrieve this data instead:

Private Sub CWDataSocket1_OnDataUpdated(ByVal Data As CWDSLib.CWData)

Dim mydata As Variant
Dim i As Integer
ReDim mydata(LBound(Data.Value, 2) To UBound(Data.Value, 2))

For i = LBound(Data.Value, 2) To UBound(Data.Value, 2)
mydata(i) = Data.Value(0, i)
Next

'Plot the requested number of points, which is a subset of the data array
'of data read from DataSocket. Because OnDataUpdated returns an object,
'you must use Data.Value to access the data.
mydata = CWArray1.Subset1D(Data.Value, 0, CWNumEdit1.Value)

'Plot the subset of original data
grphOriginal.PlotY mydata, 0, dt

AnalyzeData

End Sub
0 Kudos
Message 2 of 6
(6,504 Views)
Hello David Mc,

Thanks for the response, I tried the changes you suggested. I am still getting time out error on connect when trying CWDataSocket1.ConnectTo "dstp://weather.ni.com/weather/1Minute", cwdsRead

Ralph
0 Kudos
Message 3 of 6
(6,504 Views)
Hello Ralph,

Can you please zip up the code (VBP, FRM, FRX files) and post it here? I'll try to run it. You may be running into a firewall/proxyserver problem.

David Mc.
NI Applications Engineering
0 Kudos
Message 4 of 6
(6,504 Views)
David,

Here is the code as modified that I am trying to run. I get the same time out error as I did trying the original Demo program.

Ralph
Download All
0 Kudos
Message 5 of 6
(6,504 Views)
Ralph,

You can also try using the DSWeather example that ships with Measurement Studio. You'll find it under ..\National Instruments\MeasurementStudio\VB\Samples\DataSocket. That one works on this side and that would answer your question of weather the problem is a firewall.

Best Regards,

Matt P.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 6
(6,504 Views)