05-05-2011 05:00 AM
Hello friends!
I am designing a program for automatic power current measurement in labview! I am actually stuck with a small problem! I want to plot a previous and present plot in one single xy graph. I have attached my labview program. Actually I am able to plot preious plots also but only when the history length is more than the number of loop iterations. But i need just the previous and the present plots i.e the history should only be 2! In that case, the previous plot is being erased after completion of 2 iterations and then only the present graph is plotted and displayed! Please check the logic in the last sequence! If anything is missing please suggest me!
Thanx!
Vinay
05-05-2011 09:01 PM - edited 05-05-2011 09:03 PM
Hello,
I took a quick look at your code, and I have a two somewhat independent thoughts for you. The first applies to LabVIEW programming in general, and the latter is focused on some details of XY graph data.
General LabVIEW Programming Suggestions
I noticed that you're using sequence structures and local variables (and in this case a use case of the bundle array function) where the code would be more efficiently compiled if you went with a different approach.
I don't mean to be super-critical here by any means - it's fairly common when people first begin programming - especially with previous text-based programming experience - to travel similar paths. That and/or not having a chance to get some formal training are not uncommon reasons for this. Without launching into a full code review of sorts, here are a few pointers along those lines based on an admittedly cursory look at your code:
05-10-2011 04:39 AM
Hi! Thank aou so much for such a detailed explanation. But I am sorry that I dint help me solve my problem! If run the program once, a graph is plotted at the end. When I again run the program the previous graph should exist as well as the new graph should be plotted over it. Please correct my program or else please tell me where exactly should the changes be made inorder to achieve the desired result!
Thanks!
Vinay
05-10-2011 09:52 AM - edited 05-10-2011 09:55 AM
Hi Vinay,
It's the multiple runs of your program that is causing the issue here. There is a method for retaining values in LabVIEW across multiple runs of a VI however.
Direct Approach
Additional Structure Approach