levylabpitt / AFM-Lithography

BSD 3-Clause "New" or "Revised" License
7 stars 0 forks source link

IMAQ Flicker on Update #28

Closed Monkeymerlot closed 4 years ago

Monkeymerlot commented 4 years ago

IMAQ is by reference, so if you change things using that reference, it will update in real time. This can cause some flicker. See this gif: (edit: you cant see flicker in gif because frame rate is too low, so I removed it)

There are a few ways to resolve this issue. First, is by delaying front panel updates until the entire operation is done. Second, is making a copy of the reference using IMAQ Copy.vi, work using this copied reference, and then at the end update the indicator with the new backend reference. I am not sure which one of these would be best so I am open to ideas and suggestions.

ciozi137 commented 4 years ago

Are you saying that even if the image is updated in an “UI: update” state it will still have flicker, because the imaq image is updated by ref? Delaying front panel updates blight be a good way to go. Would that be driven by the timeout frame?

Monkeymerlot commented 4 years ago

I think the reason it flickers is because we write the background image, then the overlay. So it goes Image + overlay ->image->image + overlay. I did some investigating and I think that it would just be best to create a new reference, work with that, then write it to the imaq indicator, and then close the original reference.

Monkeymerlot commented 4 years ago

I fixed this by working with a "work" reference and then copying over to the IMAQ control, which is in its own state now: image

Refresh Render: image Display Background: image Data Initialize: image