Problem of imaq image control events

Hi,
I use CVI 2010 and NI Vision 2010 to develop a motion and machine vision system.
I got a problem of using the imagecontrol, I can not capture the EVENT_KEYUP,EVENT_KEYPRESS and EVENT_LEFT_CLICK, EVENT_LEFT_CLICK_UP in the image control's callback.
I also tried to use the function of InstallWinMsgCallback (g_hMainPnlHdl,WM_KEYUP,KeyupCallback,VAL_MODE_INT​ERCEPT,NULL,&hKeyupCbHdl) to install the WM_KEYUP event, the message is captured when the mouse pointer is outside of the image control,but when the mouse pointer entering the image control, the WM_KEYUP  event is missing. I think the image control has intercepted and blocked these messages.
Anyone can help me? Thank you very much!
Awen

It seems to work for me.  I just tested EVENT_LEFT_CLICK and had the event increment a numeric each time it fired.  I just configured a callback function called "ImageCallback" in the Image control properties, then created a callback function.  I have attached the whole project below.
www.movimed.com - Custom Imaging Solutions
Attachments:
Image Control Callback.zip ‏553 KB

Similar Messages

  • Using IMAQ Image controls in LabVIEW steps

    Hi guys
    So far, I was using TestStand 4.0 together with LabVIEW 8.5 and Vision Development Module 8.5 with no problems. Recently, I've updated to LV 8.6 and VDM 8.6. I've started to experience weird problems when using LabVIEW steps with inputs/outputs containing IMAQ Image controls. When I try to click on such a step in seq editor, or try to insert a new step into the sequence, the step initialization takes a very long time (tens of seconds) or freezes completely. I've also tried to upgrade TS to version 4.1, but no difference. Also, my colleague experiences very similar symptoms on the same software setup. The only difference is that on his machine, it takes only a few seconds when you click on the vision step. However, the steps not containing an IMAQ Image control behave normally, i.e. you can't experience any "initialization time" when clicking on them in the sequence.
    To illustrate, I'm attaching a simple VI containing nothing more that a single IMAQ Image control. If you don't link it to the connector pane, the VI works fine when inserted as a TS step. If the IMAQ Image control is linked to the connector pane, TS freezes when inserting such a step.
    Vladimir
    Solved!
    Go to Solution.
    Attachments:
    ft5.vi ‏5 KB

    Hello Vladimir,
    Thank you for posting on the NI Discussion Forums. This was reported to R&D (#123249) for further investigation. The only workaround I can offer for now is to work with the VIs from version 8.5 of LabVIEW if they have vision controls linked to the connector pane. Thanks for the feedback!
    Chris_G
    Sr Test Engineer
    Medtronic, Inc.

  • Imaq image control (Delete default Value)

    I have a problem with the vision imaq image control.
    I have defined for a "imaq image control" a default image for the development.
    Now the default image is no longer need and i want to remove the default value an reset the Control to an empty image.
    How can i reset the default Value from the "imaq image control" to an empty image?
    Solved!
    Go to Solution.
    Attachments:
    imaq_image.vi ‏2726 KB

    Cardinal1664 wrote:
    I have about 20 Vi's with imaq image controls with default images!
    I don't want to too that progmaticaly!?
    Another possible way is to automate this task, something like this:
    Just obtain list of VIs where Vision Control should be resetted to default, then run snippet above in the cycle.
    Andrey.
    Attachments:
    Empty Images.vi ‏17 KB

  • Flickering problem with live viewing with IMAQ Image Display

    Hi everyone,
    I am trying to write a program to do live imaging with Andor camera. I am using some examples from Andor. The images are acquired in sequence and send into IMAQ Image Display and also Intensity Graph. There is minimal flickering issue in the Intensity Graph but there is very bad flickering problem in IMAQ Image Display. Perhaps I misunderstand how to optimize the vision tools. Does anyone know how to overcome this issue? I have attached the code that I am testing. Thanks in advance.
    Best regards,
    Han Yen
    Solved!
    Go to Solution.
    Attachments:
    iXonRTA_live_0.0.1.vi ‏70 KB

    You can use Vision Assistant to test our vision functions. Vision Assistant is really meant to prototype - it does not have all teh functionality of Vision Development Module and is not as flexible as we don't allow you access to all the settings for every function.
    I recommend starting in Vision Assistant and then porting over to LabVIEW or C (whatever you are most comfortable with)...this is built-in functionality. There is nothing wrong with using Vision Assistant to do live imaging, just that you run into limitations and you will only be able to use this code on computers that have Vision Assistant.
    Hope this helps.
    --Michelle
    Instrument Control R&D
    National Instruments
    Instrument Control
    Machine Vision

  • How can I use or convert a imaq image to plot images back on waveform graph

    Hi
    I am currently opening and manipulating (rotate and resize) a PNG image using IMAQ Vision in LabView 8.2.1 This works well and I can display the Image on the front panel using a IMAQ Image Control.
    In addition to this I would now like to display the image as a background on waveformgraph. I can do this with the original PNG file by reading it and then flatten it to a pixmap ie make it a Picture but this is of little use as I need to use the manipulated IMAQ image.
    Therefor I would like to know how to convert the manipulted IMAQ Image to right Picture Format (without resaving) in order to use it on the PlotImages.Back property node of a wavefrom graph.
    I very much welcome your suggestions as I feel it should be easy yet can not seem to solve it. Thank you for your time!!!

    Hi Randall
    Apologies for replying somewhat late but I have been out of the office for a few days.
    Your suggestions and code helped me greatly and led to solving my query so thank you for that.
    There is one more thing (well many many more but I will place new posts for those  however that you might be able to answer for me.
    Following your suggestion to use the image to array function I searched through more examples and found the code that did exactly what I wanted to do. Please see attached.
    In this code a For loop is used to add 65793 to the color table. It works very well but I do not know why it is used exactly. Can you exlplain? I also realize I never made it clear that I use grayscale PNG files rather then color images.
    Thanks again for your excellent help, it is much appreciated.
    Attachments:
    IMAQ_8-bit_to_picture v1.vi ‏15 KB
    Test Image.png ‏42 KB

  • Image control runtime creation issue

    I am having problems getting the Image control to actually
    display the image I specify in the source property. The Image
    control is created in actionscript at runtime based on XML returned
    by an HTTPService request. I have a canvas that I want to populate
    with Label, Text, Image, LinkButton, etc. controls based on the
    contents of the XML file that is read in, so I have to create all
    the components on the fly and use something like this:
    var newImage:Image = new Image();
    newImage.setStyle("source", "images/myImageFile.jpg");
    myCanvas.addChild(newImage);
    After I get all the newly created components added as
    children to the canvas I go back through and do positioning
    (something like this):
    for each (var child:DisplayObject in myCanvas.getChildren())
    //set the y property of each component to the y of the
    previous child plus
    //the height of the previous child plus 10 px margin
    Wherever there is an image in my XML it inserts the 10px
    margin for that component, so I know it's creating it and that it
    gets added as a child, but for some reason the image is not
    displaying and so the height of the component is 0. I even tried
    hardcoding the height of each Image control in case the image was
    there but it just wasn't sizing right, but it puts in the space
    without displaying the image.
    What I'm wondering is if there is some method that will force
    the Image controls to either load the image or render it. When I
    add an Image in mxml and use the exact same source data it displays
    just fine, so the file path is correct. I also have the same images
    being read in from XML off the HTTPService that are showing up just
    fine in a TileList where my itemRenderer component has an image
    with the source set to the same path as I'm trying to use in the
    runtime-generated Image controls.
    Also, as a side question, does anyone know why a lot of the
    properties/methods available from mxml specified comonents aren't
    available when you create variables of the same type in
    actionscript? For example, if I have
    <mx:Image id"img"/>
    I can go back in actionscript and reference img.source just
    fine. On the other hand, if I declare an Image in actionscript,
    thus:
    private var asImg:Image = new Image();
    and then try to refer to the source property like so:
    asImg.source
    it doesn't show up in the code hinting and it also throws an
    error on compile (reference to a possibly undefined property source
    for bla bla bla)
    Actually, I've noticed that a lot of the properties and
    methods of various components aren't available when they are
    actionscript rather than mxml. I didn't see much in the
    documentation on the difference or what could be done to work
    around it.
    Thanks much anyone who has input.

    Ok, got it.
    I figured that since the <mx:Image> renders just fine
    and that the ActionScript Image object doesn't that I'd just create
    a custom mxml component with Image as the base element and with
    nothing else in it. Then I add an instance of my custom image
    component in AS whenever the XML specifies one. The layout was a
    bit of an issue, but I just added the image dimensions as
    attributes in my XML and size the CustomImage component based on
    those.
    Must be some subtle difference between the mxml and AS Image
    classes that isn't documented very well.

  • Don't understand IMAQ image behavior

    Hi there,
         I have several image controls in my application.  When I assign image A to image B (in my wiring diagram), and then close image B, image A is no longer valid!  When I try to crop image A after closing image B, I get a "not an image" error.  If I do not assign image A to image B, I don't get the error.  If I do not close image B after assigning image A, I don't get the error.
         I am new to IMAQ and don't understand this behavior at all.  It looks like when I try to give the value of image A to image B, it somehow links the two rather than just copying the information over.  Is this a pointer and reference vs. value assignment issue? 
         Regardless, these IMAQ image controls behave differently than any other control in the labview palette.  I hope someone can explain what I am seeing to me so that I that I can learn when I can assign one image to another, and when I can close, and how I can avoid extremely confusing and difficult to debug results.
    Thanks,
    Eric

    Hi,
    You must create each of Image A and Image B separately using IMAQ Create and then copy content of image A to image B using IMAQ Copy.
    Image Display control in Labview does not create an image and does not reserve memory for it. It just displays content of the image it is wired to. I suspect that when you "assign" image A to image B in your program,  you just wire the same image to 2 Image Display controls. No wonder they show identical image. When you "close image B", you actually closing the only image you have, memory space allocated fot that image is released and reference is no longer valid. After that any attempt to modify/change that image will return "not an image" error.
    I recommend you to look into Vision examples shipped with Labview - see for example "Extract Example.vi" in "C:\Program Files\National Instruments\LabVIEW 7.1\examples\Vision\2. Functions\Image Management". In the path above you should change LabVIEW 7.1 to your version of LabVIEW.

  • Using IMAQ Image Display control vs IMAQ WindDraw for large image files

    Hello All;
    I am designing an application that is currently using IMAQ Image Display control to view large images (5K x 3K and larger).  My problem is that these images take 10-20 seconds to load and display, whereas if I use IMAQ WindDraw to display my image in a separate window, it only takes a couple of seconds.  My application is designed such that I am making use of the Subpanels in LabVIEW 8.0, and to make it pleasant for the user, the interface is such that my line profile, histograph and image viewer displays are contained within the same GUI (panel).
    I read the National Instruments application note regarding displaying of large images, and it did not seem to make a difference.  For example, I switched the 'modern' IMAQ Image Display control with the classic Image Display control, since the 'classic' does not contain any of the 3D rendering tools which might slow the process down.
    Why is there such a huge difference in loading times if I am trying to do exactly the same thing with both methods?  How can I bring the IMAQ Image Display control up to the same speed as the IMAQ WindDraw tool?
    I am currently using LabVIEW 8.0 with the latest IMAQ/NI Vision package from NI (IMAQ v7.1?).  Thanks.
    DJH

    Use a property node and select 16 bit image mapping. You can create a control for this or whatever you need. If you select the individual elements, you can get enumerated controls.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • How to use an Event Structure responding to an image control that belongs to a parent VI.

    Hi
    I am loading a subpanel vi by pressing a button located in the user interface of the main vi which also contains an image display. Subpanel vi opens up on the side and doesn't hide the image display of the main vi. Subpanel vi contains an event structure that needs to respond to user clicking on the image display of main vi.
    Since the bug that occured while creating an image reference control isn't fixed, I am passing the main vi pane reference onto the subpanel vi. From that point I've tried to edit event structure and have it respond to the image control/pane that belongs to main vi but I don't know how.
    Any help would be appreciated.
    Thanks

    Post a screenshot of your subVI code where you register the events.
    André
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • Vision Builder 7.0(IMAQ) : Using fxs in subVIs with references to image control

    When using IMAQ fxs (such as 'Write File') in subVIs, if one wanted to use references to an image control, what property or method would be used to feed into the image terminal in the imaq fx on the subVI? Is this possible?
    What did work: I was able to directly use the image control on the main feeding an image control on the subvi panel (which is then fed directly to imaq fx)
    What did not work: From a refnum control for the image on the main, I used (within the subVI) the value property fed to a 'Variant to Data' with type as image control, then feeding the output of this into imaq fx.

    Typically you would update an Image Display control from a subVI using the Value property nodes. However, this method does not currently work with LabVIEW 7 and Vision 7, but the issue will be resolved in the next release of LabVIEW and Vision.
    In the meantime, in addition to the solution you found you could also use a global variable to pass images from one VI to another. Using a global variable works, but not in the same way as a reference or property node would. With a reference or property node, you can pass a reference of the control to a subVI and have the subVI update the control's image. Using global variables, the subVI will update the global variable with the new images, but you need a loop monitoring the global variable in your top level VI.
    I hope this
    helps! Best wishes.
    Regards,
    Dawna P.
    Applications Engineer
    National Instruments

  • Can't find image display in the IMAQ Vision control palette

    Hi
    I am trying to display an image on the front panel. But i cannot find the image display vi .. according to the manual, it is available from the IMAQ Vision control palette. I have the academic version of LabVIEW 7 express. Does my version have the vi? Thank you
    rsa..

    Hello,
    The IMAQ Display control is a part of the NI-IMAQ driver. This driver is free of charge and can be downloaded from our website by going to www.ni.com/download. Here is a URL directly to the current version of IMAQ: "http://digital.ni.com/softlib.nsf/websearch/CD7EAFE90E9E47398625703000754A12?opendocument&node=132060_US". If you plan on using that control, I would recommend just installing the driver for it on whatever computer you want to use it on.
    Regards,
    Aaron B.
    National Instruments

  • Image control mouse move event updates

    I would like to drag the ROI around in the Image control (holding down the left mouse button) and continually read out the ROI coordinates. I can't find a way to do this: the mouse move event does not seem to fire if I hold the left mouse button down. I assumed that I would have
    1. Mouse down when I click and hold.
    2. Mouse move when I move the ROI around.
    3. Mouse up when I release the left mouse button.
    This does not seem to be the case.
    I've done a simple workaround which is
    1. Use the key up event to check that the space bar has been pressed.
    2. Use this to toggle a "lock" boolean which locks the target to the mouse coordinates.
    3. Use the mouse move event to return the Image Control Mouse Coordinates property.
    4. Unlcok the target from the mouse coordinates by pressing the space bar again.
    This kind of works, but it is much less intuitive than the standard windows "click and drag".
    Any comments appreciated.
    Thanks.
    PS The Image Control is excellent, it has saved me lots of development time. Also, the ROI tools are hugely useful.

    If you filter the mouse down event (MOUSE DOWN?) then the coordinated are always returned on mouse move event weather the mouse is down or not.  I did get the coordinates when the left button was down anyway it was just when the right button was down which the move event was not handled (due to the popup menu consuming the event first?)  I thing there is a good way to do this with dynamic event registration, and NI has a similar example of drag and drop of controls, but I am not at my LV machine to look for it right now.  If I am wrong I am sorry it is early and my coffee is not brewed yet.
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • Error-1074396120 Not an image, problem with IMAQ Learn multiple geometric patterns

    Error-1074396120 Not an image, problem with IMAQ Learn multiple geometric patterns
    Hi!
    I've tried to modify the example of  "multiple geometric patterns matching" , and just use two patterns, but when I run the VI this error appear and I doon't know how to solve it! , the error appears in the "IMAQ Learn multiple geometric patterns" block.
    Running on:
    - labview 32 bits
    - windows 7 64 bits
    - usb camera 2.0
    Any sugestion would be helpful..... !  Regards
    Attachments:
    template_12.png ‏150 KB
    template_11.png ‏123 KB
    vision_multiple_pattern_matching.vi ‏127 KB

    thanks all for your replies, the problem was on my template images, I had to give them information about the pattern matching, and I did it with NI Vision Template Editor, within Vision utilities, and I chose template with Feature Based. 
    Thank you again and Regards!

  • Imaq Image Display Control - Zoom tool - zoom factor changes slowly

    Hi at all,
    we have a strange behavior with the zoom factor of the Image Display Control in an Labview executable.
    Ususally by clicking into the image with the zoom tool activated, the zoom factor changes from 1,2,4,8,16, ... ("x2")
    Now we have one PC, where it changes from 1,2,3,4,5,... ("+1")
    Has anyone an idea on which windows setting this behavior depends on? The PC runs with Windows XP SP3, the LV-Exe was built
    with LabVIEW 8.5.1 and the Vision Development Module 8.5.0. Is there any regsitry setting where I can adjust the "click intensity" or
    something like that? Or can I set a property of the image control to force a specific behavior?
    Actually I have never seen this behavior before, I only know the half/double mode. 
    In the software the operator has to search for fiducials on PCBs what means he has to click several times into the image.
    Changing in the Mode "+1" instead of "x2" is not acceptable for him.
    Thanks for your help!
    Stefan

    Hello Stefan,
    thank you for posting at the National Instruments forum. The "Zoom Behaviour" was changed due to customer requests. I totally agree with you, that it is not the best solution to click 24-times to get the desired region of interest.
    I created a small example for LabVIEW 2010, which uses a property node and event structure, to perform the zoom programmatically.
    Best regards
    MarianO
    Attachments:
    Calculate Zoomfactor.vi ‏21 KB
    Image Example.vi ‏63 KB

  • Why does moving the mouse over an IMAQ image display slow the GUI down so much?

    I have a large application with several vi's running simultaneously under labview 8.6.1.  When I mouse over an image display control in one of the vi's, everything slows down a shocking amount in all the other vi's.  The windows task manager does not show a large increase in CPU use.  My pc is has a quad cpu with 4GB of RAM, and the CPU and memory loads do not appear to be terribly taxing to the system.  However, many of my vi's apparently come almost to a standstill if I just move the mouse in a circle around my image control.
    This looks like it is largely a GUI display issue.  If I make a new vi and put a while loop in it that only displays the iteration loop number to an indicator, I can see the iterating occurring, then stopping totally when I mouse inside the image display control.  When I stop moving the mouse inside the control, or when I move it outside the control, the interation loop number jumps up, as if it had been incrementing behind the scenes the whole time.  So only display of the interating was halted.
    This problem occurs even if the vi with the image control is not executing.  If the vi with the image control is open but not running, and I mouse over the image on it, the other guis all come to a screeching halt.
    Does mousing in the image display control really utterly crush all other guis in all other labview windows?  Is this an issue inherent to the image display control?  If so, is there anything I can do about this? 
    Also, this issue is not entirely limited to display.  I started looking at it in greater detail because this issue also exposed what I think is a race condition in my code.  I have a vi that acquires an image from a ccd and puts it into an IMAQ image.ctl.  This image then gets passed up to a vi up the call chain, and is put on a queue and sent over to be de-queued by a vi that has the image display control.  Here's the kicker:  when I mouse over the image display control, the image successfully gets acquired inside the subvi, and if I probe the wire leading to the output IMAQ image display.ctl, I see the image.  If I simultaneously probe the wire coming out of the subvi one level up the call chain, the image gets lost about half the time.  This only happens if I am mousing in the image display control IN A TOTALLY DIFFERENT AND SEPARATE VI.  If I bump up the priority of the ccd image acquisition vi to 'highest priority', the problem only happens about 1% of the time, and I really have to mouse around to make it happen.  Still, it's disturbing that mousing in the GUI in one window results in a failure of a separate subvi to simply pass an image up the call chain.  I understand that IMAQ images are referenced rather than passed by value, but I don't see why there should be a failure to pass the image up the call chain.  I've looked for a race condition, but can't find one.
    Eric

    I have finally been able to replicate the behavior that you are seeing on another computer once the image was large enough.  Here are a few notes about this behavior:
    First. The UI only slows down when the images are large, 16 bit images.  The reason why this is unique to 16 bit images is that they can only be displayed on the front panel as 8 bit images.  The workaround that Weiyuan suggested to change the 16 bit display mapping hints towards the root of the problem...that any time a mouse runs over the indicator, Windows asks the entire image to re-draw (having a separate indicator overlapping the image will create the same behavior).  With a 16 bit image, not only does the image have to re-draw on the screen but the 16 bit pixels need to be mapped to 8 bits.  When setting the 16 bit display mapping to Full Dynamic, this requires mor computation/pixel than 90% dynamic or one of the other mapping schemes.
    This is expected behavior if your program is running and you're trying to display a large 16 bit image.  To fix this behavior there are a couple options:
    Change the 16 bit display mapping to something other than full dynamic.  You can choose which 8 bits to display or if you want to map the bits. 
    Resize the image just for viewing purposes on your front panel (since you aren't going to view every single pixel of you image on the screen). You can use the IMAQ Resample.vi to do this.  This will allow you to take your 1500x1500 pixel image and only display a 500x500 pixel version.
    If you are interested in viewing small details of the large image, consider just displaying a smaller region of interest at a time.
    Let me know if any of these solutions work for you.  Good luck on your application.
    Zach C.
    Field Engineer
    Greater Los Angeles

Maybe you are looking for