LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Operating two Vis at same time

First time posting here on NI, need some help with setting up a Labview program. A little background so you know what we are attempting to do and the level of skills involved in it. I'm a undergrad research assistant and I have never used labview before until I started on this project and just have a basic understand of the program now. All the programs involved in this were written before I started on the project by other undergrad and grad students. So any answers will probably have to be dumbed down to a noobs level for me. Here is our problem : 

 

We have two VIs that we are having to run at the same time. The First VI is a program that we use to run a automated arm/probe. It is setup to run manually by using the arrow keys on the keyboard or we have a grid system setup on our test box and can tell it were to travel too by inputting the x y cords into the program. The second VI is a safety loop, the testing we are doing is dealing with EM fields and detection of them. We have equipment that generates the field inside the test box but we can not allow it to get over a certain watts level. The second program was designed to detect when we reached this level and turn the system off for safety. Both of the programs work just fine. 

 

So here is the problem, we can not run them at the same time which is an issue. Anytime they try and run them together the system bogs down then crashes or they just fail to load and run at the same time.

 

Here is the solution I would like to try and find. What is the best, fastest and simplest way to link both of this programs as a single VI that wouldn't take a lot of programming and knowledge. Basically the programming team that made the VIs is gone now. If needed I an post the VIs. Thanks for any help or input 

0 Kudos
Message 1 of 6
(2,793 Views)

I would guess that your programs are not programmed very efficiently and are running with what are known as greedy loops. That is, the VIs have a loop in them but don't provide any means for LabVIEW to switch between tasks. One, or both, are starving the CPU which causes your execution issues. Even some as simple as adding a Wait(0) to the loop will help to prevent greedy loops from occuring. Additionally, they could have issues with maintaining memory and do things like allowing arrays to grow infinitely large. Without seeing the code though it will be difficult to give you specific advice.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 6
(2,789 Views)

Here are copies of the two different programs that we are trying to use. 

 

The one called translation table runs the arm/probe, the one called relay is the safety shutoff program. If anyone has any ideas or ways to reduce these down and make them run more efficiently I'm open to ideas. Thanks

Download All
0 Kudos
Message 3 of 6
(2,769 Views)

The translation table will get greedy when Start is False and tab is Auto. The Comparison.vi needs a big rewrite, it's full of strange attempts, greedy loops and solutions.

Btw, are you trying to communicate over the same Visa with both programs? That wont work, you'll need to open Visa once and use the same ref in both programs.

 

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 6
(2,755 Views)
The two grad students running the experiment have tried opening one Labview and run both VIs as different projects at the same time, that is when the computer crashes. I figured it was because the programs are over taxing the CPU. The problem we are having is between all the research assistants we have very little knowledge and understanding of Labview. I'm not sure who wrote the program since I've only been with the project for about 3 months. And I don't think anybody here has the knowledge to do a total rewrite of the programs. Is there a way to salvage what we have so we could run both programs ?
Thanks for all the input
0 Kudos
Message 5 of 6
(2,749 Views)

Sure you can mend it, it shouldn't be all too hard. As i mentioned, one vi is a very simple fix, the other needs a little more work, and you'll need to add a common Visa handler to not lock yourself out.

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 6
(2,718 Views)