LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I pass boolean data between VisualBasic and LabView?

Hi all,
I'm relatively new to Visual Basic, but a few other people in my lab have programmed in it. They want an interface between their program and one that I've created to control a robot. My program in LabView takes boolean controls to output commands to move parts of this robot. They have an external controller that interfaces with their VB program and they want a way to send those boolean controls to my program. What is the best way to accomplish this?
I also want to be able to control the program through LabView as well, so I'm thinking "or" gates with one input as the data from VB and one as the button I've already set up.
Oh yeah, I'm running LV 8.5, interfacing with Mindstorms NXT kit, Windows Vista.

Any suggestions, ideas, etc, on how to best do this will be greatly appreciated, and any examples you can point me to would be great. If you need any more information from my end let me know. Thanks!


Message Edited by aguptaweb on 07-24-2008 10:35 AM
0 Kudos
Message 1 of 6
(2,946 Views)
Hi again,
I was looking at this example:
http://zone.ni.com/devzone/cda/epd/p/id/3430
and it seems to be the sort of thing that I'm looking for. Now like I said, I don't know too much about programming in VB, so what should I do to change the output from an operand to a boolean? It seems like it shouldn't be too hard... am I oversimplifying?
0 Kudos
Message 2 of 6
(2,936 Views)

In my opinion the best way is to use the ActiveX Automation interface.

Make an application from your LV program and check the box in the Build Properties to active the ActiveX server.

From the VB side you must open a reference to the automation server and the VI. You can set the controls,run the VI and get the reult back.

Make a search in the tutorials or knowledge base with VB ActiveX and LabVIEW. There was example code creted by NI.

in labview\examples\comm\freqresp.xls is an example shipping with LV how to do this in MS Excel.

Added:

There was an overlap in our posts.

I don't know VB.Net, I have little knowledge about VB. In VB I created variables of type variant and filled the part according to the data type in LV. Go in the LV help to Fundamentals>>Windows Connectivity>>Concepts>>Using ActiveX with LabVIEW. Start from there to find the technics and information your VB programmers need. There should be a table how to map LabVIEW data types to varant data types.

Message Edited by waldemar.hersacher on 07-24-2008 06:09 PM

Message Edited by waldemar.hersacher on 07-24-2008 06:17 PM
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 3 of 6
(2,935 Views)
Waldemar,
Thanks for the information - I'll try building the VI as an app and show it to the VB programmers, I'll also look at the help file you referenced. I'll get back if I need any more specifics, but right now I think what our plan is is to feed a stream of 1's and 0's to LV... apparently this stream is easily accomplished in VB. Now my question is what's the best way to interface with that stream in real time?
0 Kudos
Message 4 of 6
(2,921 Views)
The example that you pointed to uses VB.NET. VB.NET is not the same as VB. Two different beasts. VB.NET is not an upgrade to VB - it's a different language. Thus, you need to first device whether you're going to be using VB or VB.NET.
0 Kudos
Message 5 of 6
(2,906 Views)
mercurio,
that's a good point - I'm told we are programming in VB.NET.


Message Edited by aguptaweb on 07-24-2008 02:12 PM
0 Kudos
Message 6 of 6
(2,894 Views)