LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

the graph stops but the program runs well

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

0 Kudos
Message 1 of 10
(2,492 Views)

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?

0 Kudos
Message 2 of 10
(2,491 Views)
0 Kudos
Message 3 of 10
(2,484 Views)
  1. You probably should initialze both shift registers, also the complex one.
  2. You are growing two arrays forever, so you will run out of memory at one point.
  3. In the inner case where you check the "bytes at port", you need to wire the complex array also across the "0" case, else the array in the shift register will reset to an empty complex array and all earlier data is lost.
  4. Equally important is to wire the visa resource across in the "0" case. In your case you permanently lose the resource whenever that empty case executes and no visa operation will ever work again until you restart the program.
  5. there is probably more, but I did not look very hard.

You have a funny definition of "runs well". 😄

0 Kudos
Message 4 of 10
(2,471 Views)

so to avoid this problem what I have to do. Can you add those changes in the attached code, and please help

 

0 Kudos
Message 5 of 10
(2,457 Views)

@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).

0 Kudos
Message 6 of 10
(2,445 Views)

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

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 7 of 10
(2,430 Views)

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.? 

 

0 Kudos
Message 8 of 10
(2,414 Views)

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

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 9 of 10
(2,405 Views)

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

 

0 Kudos
Message 10 of 10
(2,395 Views)