LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to programmatically clear Image Display Control in LabVIEW 2010

Solved!
Go to solution

Hi...  I need to do what I say in the title above...  I went here,

 

http://digital.ni.com/public.nsf/allkb/514FD61A5F1829EA86256DF6004FDE13

 

and endeavored to follow the directions.  I am, by the way, working in the Snapshot mode.  So I followed the directions for clearing the Image Display when working in the Snapshot mode but it didn't work.  Either I'm doing something wrong or perhaps (as the instructions seem to imply) that that example was written for LabVIEW 7.1 and 8, but maybe not for LabVIEW 2010???  Hard to say but can someone help me figure out how to clear the Image Display (IMAQ/Vision).  I just want to be able to clear an existing image before putting up a new one.  How do I do this in LabVIEW 2010???

 

thanks... bob...

0 Kudos
Message 1 of 5
(5,868 Views)

The description will work with LabVIEW 2010. If you upload the code or make a screenshot, I will take a look at it.

--------------------------------
The Enrichment Center is required to remind you that you will be baked, and then there will be cake.

0 Kudos
Message 2 of 5
(5,856 Views)

Here you go...  Find attached a very simple test vi where I have tried to follow the simple directions but am apparently doing something wrong.  See, in fact, the instruction itself for how to programmatically clear an Image Display when using Snapshot (which I AM using) pasted right on to the front panel of the vi I made.  On the block diagram, I display the image in Frame 1 of a sequence structure.  Then I wait 2 seconds so you would have some time to see the image before I clear it (if I was ever successful at doing so which so far I am not).  Then in Frame 2 I attempt to clear the image.  I created a constant and a local variable as I think the instructions suggest.  I even went so far as to make the constant at such a time when I've first opened the vi, the only time I ever see the Image Display actually cleared.  So I made the constant then hoping that would ensure I was making a constant of a CLEARED image (even though I doubt that matters from what I read in the clearing procedure).  Then I write that into a Local Variable of the same display.  At least I think that is what they are saying...  I've also included an simple image of a pot for you to use (or use any image of your choice).  Place this jpg image on your desktop or wherever and change the path to whatever works for you...  And check it out...  

 

The image is cleared when you first start the vi.  But after I run the vi and display a real image, I can never manage to clear it.  Can you???  Let me know...   see attached "Simple Image Clear Test.vi" and "Image.jpg"...   Created in LabVIEW 2010.   thanks... bob...

Download All
0 Kudos
Message 3 of 5
(5,839 Views)
Solution
Accepted by topic author paris1_

Hello Paris1_

 

Make this change:

 

ImageConstant.PNG

You are writing the Source image constant into the Image Display, but the Source image is already displayed.

Select an empty image constant to clear the Image Display.

 

Smiley Happy

--------------------------------
The Enrichment Center is required to remind you that you will be baked, and then there will be cake.

Message 4 of 5
(5,828 Views)

Got it...  Thanks...  That worked...  Obviously I am not knowledgeable of these Image Display controls.  To create a Constant that was NOT coupled to "Source" I found I had to go select a brand new (not even a copy of the other one) Image Display control from the Vision Control Pallette.  Then I created a Constant from the Terminal of that Front Panel control.  THAT then showed it empty like in your example.  I then wired THAT constant to the Local Variable of my real Image Display control and that worked.  I then found that I could also delete that newly created Image Display control that I had used only to create that Constant.  At first I thought the Constant as well might disappear but no, it stayed...  I know you know all that but it's all new to me...  

 

So anyway, that worked...  thanks for your help...  much appreciated...  bob...

0 Kudos
Message 5 of 5
(5,818 Views)