07-08-2014 10:33 AM
@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.
07-08-2014 10:49 AM
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?
07-08-2014 11:09 AM
@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.