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.
10-10-2024 12:32 PM - edited 10-10-2024 12:36 PM
oh, sorry I will try to more clear
so I have this Vi, that I called Morgan, so I am currently using as a "saving report", if you see, when he is called it save a pdf and a image of the Vi in the same paste.
So what is it for, the Idea it is that I have a Testes de tração, I gonna send a image just for the contex
So, what happens is that I need this VI (Morgan) to save the report as a PDF. I'll also add the Morgan file I’m using and explain how I use it.
First, I run the tensile test and collect a lot of data from a simple test. Then, I press the "+1" button, which triggers the case structure, closing the Morgan VI. This makes it save the collected data as a PDF, and the test continues. I repeat this process a few times, and then I press Stop, which triggers the case structure in the Morgan VI again, displaying an empty array and saving the PDF again with the name of the test O.S.
So then, what happens is that, I need this .vi(morgan) to save this report as a pdf
So what happend is that first, I use that "teste de tração", and collet a lot of data from a simple teste, and then I press the +1, that make the case structure, shut this (morgan) vi, so then I make it save the data that it coleted, as a pdf, and then the teste continue, so i make it happens sometimes, and then a Press Stop, that trigges the case structure in the morgan.vi, that display the empty array and then save again the pdf in the name of the O.S
( I was in a circle to explain, but i think this was clear, or not( sorry)
So just to be clear, for now I think I solve the problem, so thank you a lot