LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Syncronitation between whiles.

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

0 Kudos
Message 1 of 11
(4,348 Views)

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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 11
(4,329 Views)

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!!!

0 Kudos
Message 3 of 11
(4,326 Views)

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... 🙂

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 11
(4,317 Views)

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

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 11
(4,314 Views)

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:

  • What kind of camera are you using?
  • Are you doing "Snaps" (single images) or "Grabs" (video at some possibly slow frame rate)?
  • What are you trying to do with the images?
  • What IMAQ (or IMAQdx) functions are you using?
  • What is your LabVIEW experience (which we would "guess" based on the appearance of your code)?

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

0 Kudos
Message 6 of 11
(4,304 Views)

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.

0 Kudos
Message 7 of 11
(4,245 Views)

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.

0 Kudos
Message 8 of 11
(4,243 Views)

Any problem in sharing code?

Code will give better understanding than explaining the sceanrio

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 9 of 11
(4,240 Views)

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.

0 Kudos
Message 10 of 11
(4,238 Views)