03-14-2013 11:56 PM
Hi.. See attached three jpgs, two of a Front Panel IMAQ image indicator (one with and one without pulldown showing options) and a jpg of the code that generated the image and that shows the terminal for the FP indicator. First, I'm new to IMAQ. Second, I don't recall in the moment where I even found this code. Likely from an example. Anyway, when the code runs the image I want to display shows up just fine in the image indicator (note: I didn't show a real image in the indicator but just trust me that that part works fine).
But here's my problem. I've wired the IMAQ image indicator to the connector pane because I next want to be able to bring this image up to the top level vi. On the top level vi, I've made a precise copy (copy and paste) of the image indicator (the one that works) on the pertinent sub-vi. I then pasted that exact copy onto the front panel of the top level vi and wire it to the appropriate connector pane terminal of the contained sub-vi. I've done this often with all sorts of different indicators including in this top level vi. All of the indicators work fine when "ported" if you will up to the top level vi, that is all but this and one other IMAQ image indicator. The sub-vi image indicators populate just fine with a picture of the images I want (there are two of these) but the top level, supposedly identical versions that are wired straight up from the connector pane of the sub-vi sit there completely blank and just simply don't work.
Note, in the jpg of the FP Ind w PullDown that the Properties option at the very bottom is grayed out... Why???
Again, I don't even recall where I found this code to begin with and I don't know if these IMAG image indicators even show up on any standard pallette?? I doubt I've even explained this very well because suffice it to say I'm confused... Any thoughts??? See attached jpgs... thanks... bob...
03-15-2013 06:40 AM
I have very limited experience with IMAQ, but my understanding is that unlike most data types in LV, the IMAQ wire is actually a reference to the image, which is supposed to minimize the number of copies of large images in memory. At the end of the subVI, you call IMAQ Destroy, which destroys the actual image, so there's nothing to show in the indicator. Don't call that and it should probably solve your problem (but you probably will want to destroy the image when you're done with it to avoid having it lying around in memory).
03-17-2013 02:20 PM
You make a good point because when you touch the wire and ask to "create indicator", it creates a reference to the image. I did try what you suggested... I removed the IMAQ Destroy (it's actual name is IMAQ Dispose) and then tried again... Same response... I can make multiple copies of this image display within the same vi and they all populate with an appropriate image. But even with the IMAQ Dispose removed from that same vi, when I try to wire that Reference out of the current vi and send it up to the higher level vi, the image display in the higher level vi remains blank.
Perhaps even more interesting, at the same sub-vi level I put the IMAQ Dispose back in and then intentionally inserted a second instance of IMAQ ReadFile at a place in the code where it clearly was accessed AFTER the reference had been destroyed with IMAQ Dispose. When I ran that code, it created an error --> IMAQ Vision: Not an image. That seems reasonable but why then would I not get the same error when I bring this same reference up to the higher level vi??? Beats me...
Anyway, I'm still wanting to bring this same image up to the higher level vi... Any more idea??? thanks... bob...
03-17-2013 02:58 PM
@paris1_ wrote:
...but why then would I not get the same error when I bring this same reference up to the higher level vi???
Did you use any function which could return such an error? I'm assuming the indicator would simply display a blank canvas, which is what you say you've seen.
As for ideas, I have none specifically other than trying to create the image in the caller and looking at the IMAQ examples to see how it's done like there. Like I said, my experience with IMAQ has been extremely limited and not recent. I would expect that if the IMAQ reference behaves like other references in LV, it wouldn't be destroyed just like that, but maybe it has its own special rules.
03-18-2013 10:31 AM
Hello,
It is strange in that you actually have to think of it as a reference. Create the Image item, and pass that wire into the subVI first. Then when you perform the image operation on the wire in the sub-VI the effects will apper on the display that you want. it can be convenient, as you don't have to reach the terminal in data flow for the image to update, but that difference can interfere with the way you normally think about LabVIEW.
The example "\examples\IMAQ\IMAQ Low Level.llb\LL Grab.vi" shows this, in that you create the image first, pass it into a subVI and then later use the image to create the indicator, and it creates TWO images. First the one grabbed by the device (comparible to the image you are currently creating), and then a separate Display Image, which you are trying to implement. This example shows how the two are updated.
-Mello