Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I launch DataSocket Server from Visual Basic or VBA?

I have been running several LabVIEW applications (built .exe as ActiveX objects) from VBA in order to sample various data from a variety of devices.
This allows us to gather data and enter directly into spreadsheet cells on demand(button click).
 
Presently, I have the first of the AX apps launching DataSocket Server.
The problem with this is that often, one or another of the data acquisition apps tries to write to the DataSocket before the Server is ready to accept a connection.  Then, everything stops on errors.
 
I would like to try to avert this issue by launching DataSocket Server before launching the first of the AX apps.
I've tried my usual approach, which is to include a reference, dim and then create an object.
It either does nothing, or cannot create object.
 
Anyone have suggestions on how to do this?
 
Thanks
Dave
0 Kudos
Message 1 of 7
(8,283 Views)

Hi Dave,

Are you even using Measurement Studio in Visual Basic 6.0 or are you just using Visual Basic to launch LabVIEW executables? If you are just having trouble launching LabVIEW executables that launch datasocket, I would suggest posting your questiosn in the LabVIEW forums.

If you are using DataSocket with Measurement Studio, refer to the shipping examples that comes with Measurement Studio located at C:\Program Files\National Instruments\MeasurementStudio\VB\Samples\DataSocket.

Hope this helps!

Best Regards,

Jonathan N.
National Instruments
0 Kudos
Message 2 of 7
(8,266 Views)
Hi Jonathan,
I am really having no trouble using LabVIEW exe's with either Measurement Studio in VB or with VBA.
 
And, I have built a VI that simply launches DataSocket Server.  So, I can launch that from either VB or VBA.
 
But I would really like to launch DataSocket Server directly from VB or VBA, (maybe using Measurment Studio).
Basically, I would like to get around having to use the LV RTE in cases that I don't otherwise need to use it.
 
Thanks
Dave
0 Kudos
Message 3 of 7
(8,264 Views)

Hi Dave,

If you want to use DataSocket with Measurement Studio, refer to the shipping examples I mentioned below. Also refer to the DataSocket developer zone section for more information. Also, there is a tutorial called Building an Interactive Web Page with DataSocket that might give you some insight.

Hope this helps!

Best Regards,

Jonathan N.
National Instruments
0 Kudos
Message 4 of 7
(8,259 Views)
Hi Jonathan,
Thanks for the quick reply.
However, I keep thinking that it is off point.
 
I want to be able to programmatically  launch DataSocket Server from an application. (not a LV VI).
 
I have no trouble using DataSocket, either writing to or reading from, in any application once the DataSOcket Server is running.
 
I do not see any reference to or description of how to launch DataSocket Server in the Measurement Studio documentation or examples.
I sure I must have missed something, but still I don't see it.
 
I have done the exersize in AN-127 that you mentioned, "Building an Interactive Web Page with DataSocket".
And that works fine, once DataSocket Server is running, but it is the starting of DataSocket Server that I am asking about.
 
Thanks
Dave
0 Kudos
Message 5 of 7
(8,256 Views)

Hi Dan,

The example "DS Server Control" located in the mentioned shipping examples directory does this exactly. This example demonstrates using automation to control the DataSocket Server.  You can launch the server, hide it, show it, and close it. This should be exactly what you are looking for.

Hope this helps!

Best Regards,

 

Jonathan N.
National Instruments
0 Kudos
Message 6 of 7
(8,252 Views)

Jonathan,

Thanks.  For some reason not all of the examples installed.  I found that example. It does have exactly the one detail I missed.

(using the "Set xxx = new yyyy.zzzz" vs. "Set xxx = CreateObject("yyyy.zzzz")" )

Thanks

Dave

 

0 Kudos
Message 7 of 7
(8,244 Views)