04-05-2021 07:46 AM - edited 04-05-2021 07:49 AM
@PDE46 wrote:
Hi RavensFan,
So you are basically suggesting to have two while loops with in the main loop? One that would open the relay at index 1000 (1s) and then at index 2000 to close the relay at 2s. How would I index the acquisition loop? Thanks.
No. I'm saying have one loop period.
I wouldn't use an index number on the loop. Use Elapsed Time Express VI (one of the few Express VI's I'll use from time to time) to determine if it is time to flip the boolean
But in reality, since your acquisition is set to read 1000 samples at 1000 Hz, when the DAQ returns data, you know 1 second as passed. So so flip the boolean on the next iteration.
I don't know what you mean by "index the acquisition loop".
04-05-2021 11:49 AM
Hello JimB,
Thank you for your response. This clarifies a lot.
First off, I have not tried watching the code with highlight execution on, that sounds like it would be helpful.
To answer your question regarding what I want to do. Yes, when I press the save button I want to begin saving the two voltage data and also time the opening and closing of the relay based on the timing of when the data saving started. The timing I would like to use for now is the relay opens 1s (1000 samples) after pressing the start button and then the relay closes 2s (2000 samples) after pressing the start button. Setting it to stop after 3000 samples would be a bonus but not necessary.
I hope that answers your question.