Example Code

HL Grab Update Property

If you've ever played around with IMAQ properties in MAX during an acquisition, things like Acquisition Window, Voltage Reference levels, Frame Timeouts, you will see everything updating while the acquisition keeps humming along. If you then try to place a property node in a LabVIEW VI to update these things during an acquistion you will see two things:

1.) The property is not actually updating and 2.) you get an error (-1074397151) stating that IMAQ cannot perform the request because the acquisition in currently in progress: Grab update error.png

What gives? Is MAX doing some kind of vudo behind the scenes? Although this would be pretty sweet, in fact it is not. When a user updates a property in MAX during an acquisition it is actually stopping the acquisition, updating the property, and starting the acquisition again.

Here is a VI that allows you to do what MAX is doing. It is a modification of the IMAQ example HL Grab which you can find in LV's Example Finder. There are other ways to do this - maybe you prefer using event structures instead of case structures - either way when you update a property you need to first stop the acquisition and then update.

HL Grab Update Property fp.png

This particular example uses White Reference and Black Reference voltage properties (an analog property) but this principle will work with any IMAQ property. Simply go to the True case of the case structure and change the property to the one of interest.

HL Grab Update Property snippet.png

Wow! It's a code snippet! - if you have LV 2009 give this bad boy a try. Make sure you are using Internet Explorer and drag the snippet onto your block diagram. Amazing!

Note: You may need to click on the image to enlarge it before dragging and dropping.

Also check out this KnowledgeBase for a little more information on updating IMAQ properties:

Why Can't I Update IMAQ Properties During a Grab Acquisition in LabVIEW but I Can in MAX?

--Michelle

National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors