11-30-2011 10:12 AM
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
11-30-2011 10:18 AM - edited 11-30-2011 10:19 AM
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.
11-30-2011 02:21 PM
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
11-30-2011 03:27 PM
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
11-30-2011 04:15 PM
12-01-2011 03:28 PM
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