mphi wrote:
What are you doing in the main program while the PositionChange is being triggered?
My main program is a Ruby/Tk, so it is in the TkMainLoop waiting for events.
My handler is registered like this:
@sc.on_position_change do |device, stepper, position, obj|
@vars['actual_position'].value = position
end
@vars[] is an array of TkVariables which are tied to some Tk widgets.
@vars['actual_position'] in particular is tied to a slider and a text area.
So when the value of that TkVariable changes, that triggers some Tk action that updates the slider position and text area.
I have wrapped the assignment within a begin/rescue clause, but no exception was triggered. (Not surprising since from the Ruby side, this is just an assignment)
The ruby wrapper documentation does have this warning:
"
As this runs in it's own thread, be sure that all errors are properly handled or the thread will halt and not fire any more."
I assume this is a thread in the phidget library? I don't see anything in the ruby code wrapper that starts a new thread.