LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combine two programs

Hi,

I have pretty basic LabView skills and I am trying to write a program that will allow me to remotely control a microscope.

one part of the program is the control side which at the moment works but I need to add area limits (so that the motors stop when they reach the end of travel). The other part is the vision part so that I can see what the microscope sees on screen. For this I am using a toolkit from HYTEK automation (http://www.hytekautomation.com/Products/IVision.html) which allows me to use a webcam and take a snapshot.

 

What I want to do is combine these two into one program but I don't know how to go about it.

I have tried pasting one into the other but that doesn't seem to work.

 

Ideally what I want is to have the controls from both programs on one front panel.

 

I will attach the two programs I have below 

 

thanks for your help

Anthony

Download All
0 Kudos
Message 1 of 24
(4,248 Views)

As I do not have the hardware and some of the software you do not have I can not edit you code, but I can suggest an architecture these may help you Producer consumer architecture or maybe the Master Slave architecture

 

hope this helped a little

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 2 of 24
(4,232 Views)
Well assuming that you have no device conficts, you should be able to put both of these VI's into a while loop and move the relivent controls to the front page. See the attached vi's. I added the controls to the connector pain so that I can get to them outside your program and make them work together. You will have to do this with the other VI.
Tim
GHSP
Download All
Message 3 of 24
(4,226 Views)

Now looking at your code there are a lot of thing that I would do differently. In your move up and down left and right vi:

 

  • it would be nice for all of your code to fit into one window.
  • I would use an event based structure and try to initilize everything at one time. Put it all in one loop and only run the code that you need when you need it.
  • It looks like you have a lot of redundant code. It could be smplified a lot by using an event structure if you have them avaliable. 

This would be where I would start. You can look at the help files for starting with the event structures.
Tim
GHSP
0 Kudos
Message 4 of 24
(4,221 Views)

Thanks for the reply aeaste,

I guess I should have mentioned that Im using LabVIEW 8 so unfortunately I can't open the files you attached.

 

I will also try to learn about the event structures you suggested to simplify the program.

 

thanks for your help

 

0 Kudos
Message 5 of 24
(4,207 Views)
Here is version 8.0
Tim
GHSP
Download All
0 Kudos
Message 6 of 24
(4,203 Views)

 

 Could you tell me how you added the terminals to the left right up down VI I was trying to do that earlier but couldnt figure it out.

 

thanks

0 Kudos
Message 7 of 24
(4,181 Views)

If should look in the top right hand corner of the VI.and click show connector if it does not look like this.

 

Connector Pane.png

 

After you get the VI to look like this you will need to select a pattern that will allow you to connect all of the controls. You can do this by right clicking and selecting the  patterns option.

 

Right Click.png

 

From here you will have to click on the square on the connector then the control that you want to connect to it. It is that simple.

Tim
GHSP
0 Kudos
Message 8 of 24
(4,175 Views)

Thanks again I can't believe its that simple.

 

I've been trying to run the example program made and Im having a little trouble.

 

First of all I took out the TESTCAM part and tried running just the left right.....VI (I should have named it something shorter Ill call it LRDU from now on), but when it runs it isn't giving an output to my hardware it is as if it is not opening the program at all and just operating the buttons on the front panel. Am I missing something obvious or is it because I need to simplify the program?

 

I renamed the example one to direction

0 Kudos
Message 9 of 24
(4,168 Views)
You will need to leave the while loop on the main program. The direction vi is now a sub vi.
Tim
GHSP
0 Kudos
Message 10 of 24
(4,156 Views)