07-11-2016 04:41 AM
Good Morning:
First of all thanks a lot for reading this post and being able to help.
I have made an application which has to take 4 photos and process them in about 0.5 seconds and my application is too slow becouse it does that in about 0.8 -1 second.
So now, I thought about make 4 whiles, each to make the shot and treating each photo, which when running in parallel it will faster. Then put a fifth 'while' where I will process some data measuring of each photo.
So what i have to do is:
First: Execute the 4 whiles where I take photos and process them.
Second: once I hace the measurements of each 4 whiles, run the fifth while to process these datas.
My question is how to make this synchronization, ie once 4 whiles are executed (I mean 1 iteration per while) and thus akready having measurement data, run the fifth 'while' to treat these data.
Thanks a lot
07-11-2016 06:13 AM
Can you please post your current approach (VI)? I am not sure if I understand the difference between loop 1-4 and the 5th one....
Norbert
07-11-2016 06:19 AM
yes, 1-4 take data from 4 images, and 5 has to do math operations with those datas. So first I need to have data from 'whiles' 1-4 and then execute 'while' 5
Can you understand now?
I do not if I am explaining well.
thanks!!!
07-11-2016 06:40 AM
Did you already benchmark your code? If acquisition of the images is the major part, it is possible that your system cannot achieve the requirement.....
Norbert
PS: Code explains usually more than words what you are doing. However, it is possible that the code doesn't tell us what you WANT to do... 🙂
07-11-2016 06:42 AM - edited 07-11-2016 06:43 AM
Cant you aquire all four images in a siglngle while loop and then transfer the images using Queue to process in anothe loop. any way the processing loop will take time even all four loops provides images also so aquire images in a single loop and then transfer the data using queue and in the processing Loop dequeue the data and process one by one
Sharing the original code will explain better
07-11-2016 07:06 AM
Post your code, making sure to attach VIs, not pictures. We need to be able to examine the VI and even to execute it.
It is curious that you are having a problem doing what sounds very simple (but probably isn't, both because you are not skilled at explaining it to us, and because we can't figure it out from looking at the code you have not posted). For example, I take videos at 30 frames per second, do some processing on each frame, and stream this to disk, plus I do this with 24 camera simultaneously.
Among other details that we do not know, but probably could learn from code, is important information such as:
If you are an experienced LabVIEW developer, then you have numerous sub-VIs and have everything organized in a LabVIEW Project. So much the better -- take the (Windows) Folder that contains the Project, compress it (in Windows), and attach the resulting .ZIP file, telling us which is the Top Level VI and which is the one with the Image Processing.
Don't bother to reply if you are not prepared to show us the code -- we cannot help you if we don't know the nature of the problem.
Bob Schor
07-12-2016 02:22 AM
Yes, the acquisition image is the major part, because I am using a RS232 communication with a PLC which send a signal to trigger the camera, and this communication is too slow.. so for that reason I thought about four whiles.
07-12-2016 02:25 AM
Yes also I thought about that.
But the problem is that the major part is the acquisition images because I am using a RS232 communication with a PLC.
I have an encoder from 0 to 500 ms, and camera has to trigger for example in 10, 60, 90, 150. And I think that the communication is too slow so for that reason I cant achieve my propose....
Any ideas to iimprove communication or to do that?
For that reason I had thought about 4 whiles, 1 for each encoder signal.
07-12-2016 02:31 AM
Any problem in sharing code?
Code will give better understanding than explaining the sceanrio
07-12-2016 02:32 AM
Hello, the problem is the communication that I have explained in the last post.
·I am using a GigE camera (Basler)
·I am using Snaps.
·I am trying to measure 5 ROIs in each image.
·I am using specially Snap, Clamp rake VIs.
Could you help me in the communication to improve it?
When I tidy my code up I will upload.
Thank you very much.