From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass updating Image data from sub-VI to main VI

Solved!
Go to solution


I'm trying to get a sub VI containing a FOR loop to pass updating data to an indicator on the main VI. I've followed this explanation...

http://digital.ni.com/public.nsf/allkb/0F4EA104660C0AF38625726F0069B27E

...and am able replicate the example with a numeric control, but I haven't been able to extend the example to an image output indicator. I suspect I am using the wrong Control Reference, Refnum, or Property. Can anyone suggest corrections?

Details:
I'm using a control reference [ImageControl] for an indicator [Image] from my main VI [Fabrication Center] to the sub-VI [SUB Mask Display].

I placed a Control Refnum on the sub-VI's Front Panel, wired it to a Property Node on the block diagram, selected the property "Value" and wired the image output of a IMAQ VI to this property.

If "Run Images" on the sub VI is FALSE, a static image "test0.jpg" should be returned to the main VI. If "Run Images" is TRUE, a FOR loop is supposed to pass "test0.jpg", "test1.jpg" and so forth to the main VI at timed intervals. Instead, the Image indicator is blank.

0 Kudos
Message 1 of 5
(3,630 Views)
Solution
Accepted by topic author MaryamAli

Hi MaryamAli,

 

I believe you doing everything correctly except you are disposing your image inside of the subVI so the image will never been seen in the main VI. Try removing the IMAQ Dispose VI in both your TRUE and FALSE case and see if that works.

 

Tim O

Applications Engineer
National Instruments
Message 2 of 5
(3,590 Views)

That worked. Thanks!

 

I'm concerned, though, that without IMAQ Dispose my program may end up occupying too much memory. Is there some other point in the program where I should add this VI to free up memory?

0 Kudos
Message 3 of 5
(3,582 Views)

Hi Maryam,

 

I do not think you will run into memory issues with this code since there is just one IMAQ instances that you keep over writing. But if you want to dispose the reference you could try passing the image out of the subVI then wire it to a IMAQ Dispose outside of the Main while loop. This will dispose your image once you finish running the main VI.

 

Tim O

Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,577 Views)
Thanks. I'll try that.
0 Kudos
Message 5 of 5
(3,568 Views)