07-11-2025 02:00 PM
My problem is quite simple, and my solution should be working according to the documentation. I have a program that runs indefinitely within a loop. Using the iteration counter and the Reminder and Quotient function, I can set a delay on my save so that I don't save data at every loop iteration. To do so, I check whether the remainder is =0 to either save or bypass the save for the current iteration. The problem is that, even though I use a shift register to keep track of the file path and ensured that ''Append to file?'' was set to true, the save stops after the second save iteration. No pop-up windows asking for a new file path or any error occurs: the data just stops saving. Is there any additional steps that are required to re-open a file once the write delimited file function has been skipped once? The image below shows an example of my program loop.
07-11-2025 02:43 PM - edited 07-11-2025 02:51 PM
07-11-2025 03:15 PM
07-11-2025 03:23 PM
@altenbach wrote:
- It is pointless to place the path into a shift register because it is loop invariant.
Not true if he's passing in a blank path some or all of the time to use the "Dialog if empty" feature of the Write Delimited File command on the first iteration and pass it to all others after that.
07-11-2025 03:31 PM
@Kyle97330 wrote:
@altenbach wrote:
- It is pointless to place the path into a shift register because it is loop invariant.
Not true if he's passing in a blank path some or all of the time to use the "Dialog if empty" feature of the Write Delimited File command on the first iteration and pass it to all others after that.
Yes, in that edge case. Since the terminal was placed outside, I assumed that they pick a valid path before running, else the first iteration would take much longer than 5 seconds (Assuming a 1s loop rate from the diagram comment), thus invalidating all time points. 😄
07-12-2025 09:45 AM
@LTSB_Student wrote:
The problem is that, even though I use a shift register to keep track of the file path and ensured that ''Append to file?'' was set to true, the save stops after the second save iteration.
Where, precisely do you do that? [Hint -- you might use a second Shift Register ...]
Bob Schor
07-12-2025 10:49 AM - edited 07-12-2025 10:51 AM
@Bob_Schor wrote:
@LTSB_Student wrote:
The problem is that, even though I use a shift register to keep track of the file path and ensured that ''Append to file?'' was set to true, the save stops after the second save iteration.
Where, precisely do you do that? [Hint -- you might use a second Shift Register ...]
As I said, the problem is that the inputs to the Q&R are reversed, so the remainder is only zero exactly twice.
Once the inputs are swapped, you get regularity. 😄