LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save images displayed on Vision->Image Display, on disk !

Hello,

I have setup a GigE camera in a while loop.

The camera waits for an external TTL signal (there is a built-in hardware trigger receiver) and each time there is a TTL signal I can see the different image in the Vision-->Image Display indicator on the front end of my program.

 

I would like to save those images as they come from the camera (just as they are displayed on the Image Indicator) but every time I try to do this , many images are saved on disk (apparently the same one each time with different name) plus even when the TTL signal is off the images keep being saved on disk.

 

What I would like to do is a way to save the images that appear on the Vision-->Image DIsplay indicator in real time and stop when there is no TTL signal present.

 

Thanks in advance for your help,

 

yannis.

 

ps:please find attached a sample of my code

0 Kudos
Message 1 of 7
(2,707 Views)

Hi Yannis,

 

From what I understand you are having no problems with getting the different frames to appear on the "Image Out" indicator whenever you generate a TTL signal but you are having problems with saving the different images as and when they are captured.  

 

However based on your code, you are only ever displaying one image whenever you run the application and this same image is displayed on the "Image Out" indicator of your Front Panel.  This would then mean that you save the same image to file over and over again.  The reasons for this behaviour are as follows:

 

  • The First Call? function wired to the first case structure at the start of your program means that the code within that structure will only ever run once, since this function will only output a "true" value when the code is first run.  I would suggest removing this function as well as the outer case structure.  Right click on the case structure and select "Remove Case Structure".
  • Furthermore, the true constant wired to the conditional terminal of the inner while loop means that the loop will only ever iterate once and therefore only ever acquire one image to pass on.  You can remove this while loop to ensure you are continuously acquiring images from the camera.

I have attached a VI Snippet of the modified code, which you will be able to drag and drop into a blank VI:

Saving Images Displayed on Vision.png

 

Can I also confirm whether or not you are expecting the Y Resolution output from the IMAQ GetImage Size function to always output a value of 0?  If so, there is no need for this function to be in your code and the image will be saved to file as and when it is acquired.

 

On a side note, if you are using error cluster wires, make sure you include an error handler within your code (normally placed at the end) so that any errors are reported once your code has finished executing.

 

Let me know how these steps work out for you or it you need any further help.

 

Thanks

 

 

Marshall B
Applications Engineer
National Instruments UK & Ireland
Message 2 of 7
(2,694 Views)

Hello Marshall , thanks for your reply,

could you please attach a vi because i am using labview 2010 and i cannot ipmport the one you have posted here !

 

THanks for your help !

0 Kudos
Message 3 of 7
(2,689 Views)

Hi Yannis,

 

No worries - here is the attached modification.

 

Thanks

Marshall B
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 4 of 7
(2,685 Views)

Hello Marsall and sorry for being so needy right now but i have spent days on this one and i am desperate!

 

What I am trying to do is get the camera ready (Triger on , trigger Action : Framestart (get an image on each ttl signal) ) wait in a while loop and get a picture (and save it on disk) everytime i get a TTL Rising Edge.

 

This should go on till i hit the stop button.

 

Could you please point me the correct direction ?

0 Kudos
Message 5 of 7
(2,682 Views)

Hi Yannis,

 

Apologies but the file I attached in my last post was not compatible with LabVIEW version 2010.  I have attached a 2010 compatible file in this post. 

 

Let me know how this works for you.

 

*EDIT*

 

You will also want to take the Open Camera VI outside of the While Loop.

 

Thanks

Marshall B
Applications Engineer
National Instruments UK & Ireland
Message 6 of 7
(2,678 Views)

Hi Yannis

 

Have you had any luck with the code I provided?

 

Thanks

Marshall B
Applications Engineer
National Instruments UK & Ireland
Message 7 of 7
(2,654 Views)