10-29-2018 10:12 AM
Hello,
My VI is a case structure and the picture I have attached is the part that takes data. Each time this part of the VI is running the file dialog prompts me to “choose or enter path or folder” store the data even though I have specified a file path using a path constant. If I remove the file dialog and wire directly to the path constant the prompts stop, but the old data is overwritten by the new one. I need help to get the VI to do one of the following:
Solved! Go to Solution.
10-29-2018 10:56 AM
When I move the file dialog and the path constant out of the loop as in the attached picture, I'm only prompted once to select a folder. But the data old is overwritten each time new one is taken. What I'm I doing wrong? Please I need help.
10-29-2018 10:57 AM
I forgot to attach the picture.
10-29-2018 11:13 AM - edited 10-29-2018 11:15 AM
It is easier to help if you attach code as opposed to pictures.
What do the other cases of the event structure do? Is the shift register wired through in all cases? Are you perhaps losing the values this way?
What do you mean it's overwriting? How many files does it create? 1? 20?
10-29-2018 11:20 AM
@Intaris wrote:
It is easier to help if you attach code as opposed to pictures.
What do the other cases of the event structure do? Is the shift register wired through in all cases? Are you perhaps losing the values this way?
What do you mean it's overwriting? How many files does it create? 1? 20?
Hello,
This is the code. Each run create 100 images in the form of text file. By overwriting, I mean the new data replaces the old one which is then lost forever. Thanks.
10-29-2018 11:34 AM
Move the image number to the outer most while loop, where the Initialize State constant is. Use a shift register and make sure you wire through all states.
What is happen now you take 100 images, then when you take then next 100 images the shift register Image number starts at 0 again because it is in the inner loop.
mcduff
10-29-2018 11:45 AM
Hi Petmar,
It looks to me like you have the right idea with the section of code that generates the file names in your for loop (reattached below). I think the trouble you might be facing is when you go to the "next position" state, one of the position states, and then back to the "TakeData" state. I can't run the full code on the machine I have right now but it looks like the same set of file names is going to be generated every time you go back to the "TakeData" state. If you can come up with a method of adding the camera position to your file name, or something else unique, for each pass through the "TakeData" state I think this will solve your override problem and you can go back to specifying your base path with a constant.
-Robert
10-29-2018 11:51 AM
@mcduff wrote:
Move the image number to the outer most while loop, where the Initialize State constant is. Use a shift register and make sure you wire through all states.
What is happen now you take 100 images, then when you take then next 100 images the shift register Image number starts at 0 again because it is in the inner loop.
mcduff
Hello mcduff,
It is still overwriting. I don't know if I did it right.
10-29-2018 11:56 AM
Is this what you did?
10-29-2018 12:01 PM
@rbj wrote:
Hi Petmar,
It looks to me like you have the right idea with the section of code that generates the file names in your for loop (reattached below). I think the trouble you might be facing is when you go to the "next position" state, one of the position states, and then back to the "TakeData" state. I can't run the full code on the machine I have right now but it looks like the same set of file names is going to be generated every time you go back to the "TakeData" state. If you can come up with a method of adding the camera position to your file name, or something else unique, for each pass through the "TakeData" state I think this will solve your override problem and you can go back to specifying your base path with a constant.
-Robert
Hello Robert,
The camera position is fixed. Its is only the sample that moves and it 5mm intervals. I honestly have no idea of doing what you're suggesting.