06-08-2013 12:11 AM
I made a program in labview 2011 for communication between piezo motor and the translation stage. After a long run of piezo the intake of data and plotting graph is stoped and the graph till that time also fades away without any trace. So can you please help to overcome this problem. If you need the example program i will attach
06-08-2013 12:14 AM
Yes, we need to see the code.
How long is a "long run"?
Is this a chart, a graph or xy graph?
How many data points are in the graph?
06-08-2013 12:32 AM
the code is attched
06-08-2013 02:29 AM - edited 06-08-2013 03:15 AM
You have a funny definition of "runs well". 😄
06-08-2013 03:57 AM
so to avoid this problem what I have to do. Can you add those changes in the attached code, and please help
06-08-2013 09:35 AM
@perumpadapu wrote:
so to avoid this problem what I have to do. Can you add those changes in the attached code, and please help
Have you tried to make thse changes? They are trivial. Here is an example.
I did not address the memory issues. Let's assume that you don't run the VI forever. (Rigth now it add one point about every half second, that's pretty slow).
06-08-2013 03:28 PM - edited 06-08-2013 03:33 PM
I have taken Altenbach's vi and added "First-In-First-Out" logic to the bottom array (in your inner-most case-structure) so that it fills up upto 500 elements and after that it starts adding new data at the end while discarding oldest data - keeping array size to 500. Make sure that you don't add more than one new data point in each loop to the array, otherwise my logic won't work and it will need to be a little bit redesigned.
If you need to increase or decrease the length of array, just change 500 to whatever number that you want in the case structure. If you also do this to your other array, you won't run out of memory.
Hope that helps...
-DP
BatchTest Corp.
NI Alliance Partner
06-08-2013 10:25 PM
but the graph should work minimum for 200 base points while my entire work and it should not delete all old data points. When ever I start the work the program should work from the same point where it stopped. Is these condition will work in your modification.?
06-08-2013 10:56 PM
Ahh - Are you meaning to say that you want to "pause" the VI so that it stops measuring & adding any new data (while remembering all existing array values), and then when you unpause, it should start adding new data to the end of existing array?
If that is the case, you do not want to stop the VI execution at all, but you want to alter the logic (look at attached vi) to simply add a boolean button and a case structure so that the VI simply waits a few milliseconds in each loop rather than taking any new data. This will keep all old value and not wipe out your graph. It will start adding new data to your graph when you resume - I have added a button on your vi for such functionality.
(By the way, your vi does have some other issues that I haven't bothered correcting).
-DP
BatchTest Corp.
NI Alliance Partner
06-09-2013 04:59 AM
i don't wnt like that, the data should not wipe out after one execution.My problem is the wiping out of data at a particular position, whre no graph is plotted but the program execute swell, for that problem what I have to do without much alterations to the present program. Present program is well good but this is only the problem it faces. The present program will start from the point it stopped, so that problem in itself is solved. So can you guide me to overcome the above mentioned problem