12-17-2016 05:34 AM - edited 12-17-2016 05:36 AM
Hi All,
I want to do some processing a subVI and update the frontpanel imaq image.ctl
(I am using LabVIEW 2016 PRofessional Development System with Vision Development Module 2016)
In such an instance, I usually create a reference and then create a control for the reference so that I can pass information to the subvi.
When I click create control, it does nothing, (no error, just nothing). I tried creating a subvi of the propert node in the attached and again nothing.
Any ideas what is going on?
Rgds,
Seán
Solved! Go to Solution.
12-17-2016 05:36 AM
Hi SeanJ,
Can you print a screen shot of your VI or make compatible your VI to the version 14. I cannotopen it.
12-17-2016 06:03 AM - edited 12-17-2016 06:04 AM
Thanks for looking dhans,
I've just saved it as 2013, (note: you need the NI Vision toolkit)
Rgds,
Seán
12-17-2016 03:16 PM
@SeanJ wrote:
Any ideas what is going on?
Yes. You are getting confused between an "Image", meaning an indicator (as shown on your Front Panel) that can be used to display an IMAQ (or IMAQdx) Image, and an "Image", a pointer to an area of memory that IMAQdx uses to store an image (note the lower case "i" -- I'm using "image" to mean "an idea of a picture, a collection of pixels, something that you get from a camera, something that you can display and view).
In order to have an "image" (a Picture) appear on an Image (Indicator, such as the one shown on your Front Panel), you need to create an Image (an IMAQ construct, the output of IMAQ Create Image), wire it to some IMAQdx functions so that you do a Grab or Snap from a Camera, then wire the Image Out to your Image (again, the Front Panel Indicator). Clear, isn't it?
So what you need to do to "fake" an Image Control is to create an Image Wire, right-click it, and choose Create Control. This, then, you can paste into a sub-VI to form something you can wire an Image Wire into. Here's a Snippet:
When I right-clicked the Image Wire (created by dropping the IMAQ Create Image function and wiring it to your Image indicator) and said "Create Control", the Control shown as "New Image" popped up. Notice that it is attached to a TypeDef (probably buried somewhere within vi.lib). This will put its associated Control, shown below, on your Front Panel.
Bob Schor
12-18-2016 07:39 AM
Hi, SeanJ,
Here is a snippet for your need. As Bob Schor said, you are confused between indicator and control. Just use IMAQ create VI to create a fake control for your image indicator. Using that image control you can create sub VI with connector pane and can pass data. Just create VI like here in this snippet, create sub vi from this code and select a seesion for webcam. Run it. You will find an answer.
Hope it helps!
12-19-2016 07:09 AM
Hi Bob/dhans,
Thanks for the feedback.
Things seem to be getting confused.
I need a reference to the image indicator. If I use the new control this will pass data but not update the main image indicator.
Controls and Indicators are both saved as .ctl files, the 'control' file is IMAQImage.ctl
Is there anyway I can creat a reference for the top level IMAQImage.ctl indicator so that it can be updated in a subvi?
Rgds,
Seán
12-19-2016 10:31 AM
I have a colleague who asks me LabVIEW Questions ("How do I create a Control for an IMAQ Image?"), and I say "Let's not discuss how to do such-and-such, but what it is that you want to do". What is it that you are trying to accomplish?
I've got a monitoring application where I have 24 cameras recording videos at 30 fps, and I want to monitor them. My Main routine has an Image on its Front Panel, and I want to say "Show me the images coming in from Camera 15". I do not pass a reference to the Image in, but rather pass the Camera Number (15) to an Action Engine that holds references to all of the cameras and outputs the Image Stream from the selected Camera.
Bob Schor
12-19-2016 12:32 PM
Hi, SeanJ,
I didn't get your point. Indicators can only be used for showing display in your requirement. In addition, just connecting an indicator of the output of the Sub is enough to show updated data. That so called data updating via control is also a image data. You need not to have sperate image reference of indicator to be updated in every execution of sub vi.
12-19-2016 03:29 PM
Bob,
I am trying to use the IMAQ Image Control to display video. I want the processing (overlays, compression, etc. to be done in a subVI in order to keep the code tidy.
If there is another method you can suggest of updating the top level VI with the video stream, I am happy to use it.
12-19-2016 03:45 PM
@SeanJ wrote:
I am trying to use the IMAQ Image Control to display video. I want the processing (overlays, compression, etc. to be done in a subVI in order to keep the code tidy.
That's absolutely the right way to go. You've done 95% of the work already by putting all of the processing into a sub-VI. IMAQ routines work with a data structure called an "Image", created by IMAQ Create Image, that can be the output from a Camera, and can be the input and output to your processing sub-VIs. You want to keep using these "abstract images" until you have one that you want to actually visualize. You export this final "ready-to-view" Image from the last sub-VI and wire it to an IMAQ Image Indicator on your Front Panel, where it shows up in glorious RGB, Greyscale, whatever you've programmed.
Look at any of the IMAQ functions -- they often have one (or two) Image inputs and an Image output, all referring to what I called the "Abstract Image", this pointer to memory where LabVIEW "fiddles with the bits". To actually visualize it, you put on a Front Panel what LabVIEW calls an "Image Display". Note that the Front Panel Object that LabVIEW calls an "IMAQ Image" is the Front Panel representation of the Abstract Image, used to pass Image information between sub-VIs, from Cameras, and to IMAQ Displays.
I hope this is clear ...
Bob Schor