10-10-2024 08:58 AM
uhh Hello,
So I was trying to figure this out on my own, but I ran into an issue. I’ve managed to save and retrieve some points, and it works perfectly through a loop, but now I’ve hit a roadblock. Remember that I mentioned I would use this as a .vi, and now that I’m trying to use it, the loop either keeps running indefinitely or it just kills the process.
The problem is that every time I need to exit the loop to process the next value, I lose the previous one. Everything works fine while the loop is running, but when I stop the loop (by hitting the stop button), the VI stops completely, and I can’t save the previous record.
I’m not sure how to handle this, so I can keep the values I’ve already saved and still process new ones without having to restart the entire VI.
10-10-2024 09:16 AM - edited 10-10-2024 09:22 AM
@MarcusP. wrote:
So I was trying to figure this out on my own, but I ran into an issue. I’ve managed to save and retrieve some points, and it works perfectly through a loop, but now I’ve hit a roadblock. Remember that I mentioned I would use this as a .vi, and now that I’m trying to use it, the loop either keeps running indefinitely or it just kills the process.
The problem is that every time I need to exit the loop to process the next value, I lose the previous one. Everything works fine while the loop is running, but when I stop the loop (by hitting the stop button), the VI stops completely, and I can’t save the previous record.
I’m not sure how to handle this, so I can keep the values I’ve already saved and still process new ones without having to restart the entire VI.
If you have a problem with "corrected" code, you need to show us the code. (all parts: Caller, SubVI, etc.)
I have the feeling that your shift register is not anchored in the right outermost loop. Why would you need to "exit the loop" (sic)? The toplevel loop should only exit once the program is done. if this is handled in a subVI, you need to implement a proper action engine and leave the shift register unwired.
While dataflow is a very simple concept, you seem to have problems understanding the logic. Have you done any beginner tutorials? Once it clicks, you'll be fine!
10-10-2024 09:39 AM
Make sure you keep the file reference open so it continues to write instead of starting from the beginning each time.
10-10-2024 09:48 AM
@Yamaeda wrote:
Make sure you keep the file reference open so it continues to write instead of starting from the beginning each time.
I don't understand how a "file reference" is part of this discussion, but maybe I misunderstand your point.
10-10-2024 12:02 PM
Aaah, I understand now.
So, I did this: I used an "if" with a 0 array. What happens is, when I want to make a record and then another one after that, I have one block of "+1", and when I use it, it simply adds the value and keeps it there. I also added a "stop" button, and when I press it, it triggers the true case of a conditional structure, which then displays a 0 array to clear the data.
10-10-2024 12:11 PM
@MarcusP. wrote:
Aaah, I understand now.
So, I did this: I used an "if" with a 0 array. What happens is, when I want to make a record and then another one after that, I have one block of "+1", and when I use it, it simply adds the value and keeps it there. I also added a "stop" button, and when I press it, it triggers the true case of a conditional structure, which then displays a 0 array to clear the data.
But we don't understand without seeing the actual VI.