Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use SetEventCallback

Solved!
Go to solution

Hello All,

 

I am currently trying (and failing!!) to setup an Event Callback from an Image DIsplay Window in CVI.

 

All I require ais a readback of the Pixel Co-ordinate that has been clicked

 

I am trying to use SetEventCallback but am not sure of how to set up the EventCallback itself (am unable to compile as the EventCallback is not defined).

Can anyone help with setting up the EventCalback part of the function.

 

Have also tried polling with imaqGetlastEvent but this freezess my window and can no longer interact with it.

 

Any help is appreciated!!

 

Thanks

 

0 Kudos
Message 1 of 4
(3,715 Views)
Solution
Accepted by topic author warrenj123

Hi,

 

Would you be able to share your code so I can see the errors you are getting?

The imaqGetLastEvent() with the IMAQ_CLICK_EVENT should work in terms of getting the pixel value at that location so it sounds like a definition error somewhere.

 

Kind Regards, 

Applications Engineer
0 Kudos
Message 2 of 4
(3,665 Views)

Hello

 

I have now solved this issue. It was indeed how I had defined the Callback.

 

Polling was definately not the correct solution

 

Thanks for the help

0 Kudos
Message 3 of 4
(3,647 Views)

Hi,

 

No problems, thanks for letting me know.

All the best with your application!

 

Regards, 

Applications Engineer
0 Kudos
Message 4 of 4
(3,644 Views)