04-20-2016 03:50 AM - edited 04-20-2016 04:11 AM
Dear sir,
I Made a medical application to acquire an image after an extarnal trigger (from light source) and after a short delay (1ms)
I'm using Point grey camera grasshopper3 gs3-u3-51s5m.
The problem is i want to automatically save my images to a folder called "Images" with the name "Test 0" and if it already exist name it "Test 1" and so on....
But can't really find a way to do so.
Hope you can help me out.
Thanks alot!
Chen.
Solved! Go to Solution.
04-20-2016 04:27 AM
If I got it right you want to browse through files inside folder, find the file with the greatest number and save the incoming picture with increment numbering?
This should do the trick
04-20-2016 05:21 AM
@AdamTrojak wrote:If I got it right you want to browse through files inside folder, find the file with the greatest number and save the incoming picture with increment numbering?
This should do the trick
Hey Adam,
Thanks for your quick reply
I added your code to my Vi but i'm getting an error.
Also note that The images folder is empty, so if there is no file named Test no 0.TIFF Create it.
Thanks again,
Chen.
04-20-2016 05:40 AM
You're gettin error because the folder doesn't exists. That's why I added case structure (if doesnt exists - create folder)
If there're files within the folder, or neither is named Test No ... then it will name the file Test No 0
BTW I'm not shure if you need to add extension by yourself (check if it's not duplicated)
04-20-2016 05:56 AM - edited 04-20-2016 05:57 AM
@AdamTrojak wrote:You're gettin error because the folder doesn't exists. That's why I added case structure (if doesnt exists - create folder)
If there're files within the folder, or neither is named Test No ... then it will name the file Test No 0
BTW I'm not shure if you need to add extension by yourself (check if it's not duplicated)
But The "images" folder does exists as you can see.
After I use Check if the folder exists.vi i'm getting a Generic error.
I'm not sure what's wrong this time.
Thanks.
Chen
04-20-2016 05:59 AM - edited 04-20-2016 06:03 AM
Ok, I see:
You need first strip the path form name_of_your_VI.vi
04-20-2016 06:02 AM
@AdamTrojak wrote:What does the error says?
Error 42 occurred at Create Folder in IMAQdxEx - HardwareTriggerLine0 [Labview v12]updated.vi
04-20-2016 06:04 AM
I've edited previous post;)
04-20-2016 06:21 AM
@AdamTrojak wrote:I've edited previous post;)
Thanks alot Adam! i manage to acquire the Images successfully. 🙂
But it seems to create Test No 0 and skip "Test No 1" and goes straight to "Test no 2" and then just keep overwrite Test No 2.
Thanks again,
Chen
04-20-2016 06:39 AM
I've forgotten about extension again... Apologies.
Here's on that should work. I've replaced the Match pattern vi with scan from string. Clearing error is in case there're othter files, that doesn't fullfil the pattern schema;)