Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Can you un-register from a Frame Done Event

Solved!
Go to solution

Hi All,

 

I am acquiring form a camera using an architecture very similar to the one posted here. I am registering my camera for the Frame Done event and it is aquiring images with no problems.

 

What I would like to do is stop the acquisition. I have tried to deregister by creating a case where I register for an null reference (similar to how you dynamically unregister for a user or control event) but this threw up an error. I also tried to increase the 'buffer interval' to a huge number - this stopped the acquisition but when I tried to restart it the code hung - perhaps it was waiting for u32 frames to be acquired before acquiring again.

 

Is there anyway I can do this? Or would I be better off putting my code in a larger case structure where I can close the camera and re-open it later?

 

Many thanks in advance,

Dave

 

 

0 Kudos
Message 1 of 8
(3,267 Views)

Hi Dave,

 

When you say stop the acquisition do you mean stop the program from running without error,  or do you want to stop the acquisition and then restart it pragmatically?

 

 

Matt Surridge

National Instruments
0 Kudos
Message 2 of 8
(3,253 Views)

Hi Matt,

 

I'd like to be able to stop and then restart the acquisition programatically. My thought had been to dynamically unregister and then re-register for the frame-done event by using an empty reference. Unfortunately this threw up a camera error when I tried it.

 

Thanks for your help,

Dave

 

 

 

0 Kudos
Message 3 of 8
(3,251 Views)

Hi Dave,

 

Is there any options for triggering with your camera? 

 

Regards

Matt Surridge

National Instruments
0 Kudos
Message 4 of 8
(3,241 Views)

Hi Matt,

 

My plan is the final version will run both in 'live mode' and also with the option of an external TTL trigger. However I am focussing on implementing the live mode first.

 

Regards and thanks,

Dave

 

 

 

0 Kudos
Message 5 of 8
(3,238 Views)
Solution
Accepted by DeltaJ

You can actually just use 'Unregister for Events' to unregister it and then implement the same  'Frame Done' Event to start it up again.

 

Unregister.png

 

 

Reregister.png

 

Randall Pursley
Message 6 of 8
(3,229 Views)

Hi Randall,

 

I'll give that a try - thank you very much,

 

Regards,

Dave

0 Kudos
Message 7 of 8
(3,215 Views)

That worked thank youSmiley Very Happy

0 Kudos
Message 8 of 8
(3,210 Views)