Code: Select all
Try
Xstepper = New Phidget22.Stepper
Xstepper.Channel = 0
Xstepper.Open()
Catch ex As PhidgetException
MessageBox.Show(ex.Message)
Application.Exit()
End Try
Try
Ystepper = New Phidget22.Stepper
Ystepper.Channel = 1
Ystepper.Open()
Catch ex As PhidgetException
MessageBox.Show(ex.Message)
Application.Exit()
End Try
What should happen is that I should get a raster-type scan - move N steps in the X direction, move one step in Y, move N steps backwards in the X direction, move one step in Y, etc. this is started with an initial increment to Xstepper.TargetPosition.
The Xstepper.Stopped handler should fire N times, the Ystepper.Stopped handler should fire once, the Xstepper.Stopped handler should fire N times, the Ystepper.Stopped handler should fire once, etc.
What is actually happening is the Xstepper.Stopped handler fires N times, on the last time correctly incrementing Ystepper.TargetPosition; however, while the Y stepper is moving the Xstepper.Stopped handler fires constantly. Once the Ystepper.Stopped handler fires it correctly increments Xstepper.TargetPosition, but while the Xstepper is moving the Ystepper.Stopped handler fires continuously.
Hope this is not too confusing. I assume I am not using the separate channels of the 1062 correctly.