LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Store calculated values in an array

Solved!
Go to solution
Solution
Accepted by Punsach

@Punsach wrote:

@crossrulz wrote:

Your program feels really inside out.  I highly recommend getting rid of the outside loop.  Move the acquisition into the event structure with the Next Pulse event.  Stop the inner loop only with the Program Stop event.

 

But your big issue is that you should only be adding on to the array in very specific cases.  I would assue you only want to add on to the array when you go to the next pulse.  So move that logic into that event somehow.  This will be a fun one with shift registers, but it will make it run a lot better.



Is that the cause of the issues with the repeated 0?

 

And the thing is I need to allow the user a chance to move the cursors in the case they are not positioned correctly, hence the inner and outer loop. 


If you move your acquisition to inside of the event structure, you don't need the outter loop.  I made a quick rework of your code.  See how this works for you.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 11 of 13
(662 Views)

Thank you so much! This works very well! I had to edit it a bit to fix the graph and I had to add time delay, but it works! Do you mind if I use it?

0 Kudos
Message 12 of 13
(656 Views)

@Punsach wrote:

Thank you so much! This works very well! I had to edit it a bit to fix the graph and I had to add time delay, but it works! Do you mind if I use it?


Glad it works for you.  You can use it all you want.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 13 of 13
(651 Views)