LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending an Array Of Data To A VB6 App

Hi,
 
I'd like to be able to send data to a vb6 data reduction programme. This will be written by myself so i can tailor it for whatever way is best. It would be an array of channel values. What is the best way to do this - and could you provide an example.
I would like  aslick way rather than writing the values out to a file and then reading them from that, if possible id also like to return data to Labview - would a dll be the best way to go? and how?
 
Regards
 
Mike
 
 
0 Kudos
Message 1 of 7
(3,432 Views)
Ive got this working using a tcp/ip connection in labview with winsock in VB, seems to work fine, just wondering if this is the best way to send data?
0 Kudos
Message 2 of 7
(3,412 Views)

Hi Mike,

Could you clarify a little more exactly what your wishing to do over your current setup. I must admit it's been a while since I looked at vb6 but I could try and create an example for you during the course of the day (although perhaps also part of next week too as our machine with VB6 on is usually in high demand!). If you could include your LabVIEW code in this forum that would be great too.

Thanks,

Applications Engineer
0 Kudos
Message 3 of 7
(3,406 Views)
You can compile the VB6 code into a DLL. Since VB6 creates ActiveX DLLs, read this article: Passing Arrays from Visual Basic DLL to LabVIEW.

You can also do it in the other direction. I.e., compile the LabVIEW code into a DLL and call it from VB.
0 Kudos
Message 4 of 7
(3,396 Views)

Hi, its quite a large app, so dont really want to put all the code on here...but basically in part of it an array gets filled with all the channel data. And i would just like to be able to click a button and a vb app on another machine have the data to use for data reduction, performance checking etc. So its its simplistic form i have a 1 dimensional array of around 200 rows of data. I have simply flattened this at the mo to a string and sent it down the tcp/ip port to the other pc running the vb app and the winsock which does work, fine, i was just wondering if that is the best way.

I cant make the whole app a dll as it does alot more than just this, this is just probably 1% of the whole picture...but important none the less..

0 Kudos
Message 5 of 7
(3,392 Views)
You didn't mention initially that the VB6 app was on another machine. True, you said you got it working with TCP/IP, but that didn't necessarily mean the VB6 app was on another machine, as you can use TCP/IP on the same machine for inter-app communication.

That said, the TCP/IP route is a very simple way to do it. Another method is to use LabVIEW's ActiveX Server capabilities, allowing you to access LabVIEW from VB via ActiveX. Don't really know if you can categorize as "slicker", though. It's just a different way of doing it.
0 Kudos
Message 6 of 7
(3,389 Views)

 Hi,

I can't think of a way that would be better if the app is too large or complex for a dll to do all the work. If this way it meeting your time requirements and not throttling your PC then I would suggest sticking with it as TCP/IP is connection orientated so there should be no data loss/corruption.

Regards,

Applications Engineer
0 Kudos
Message 7 of 7
(3,361 Views)