Stepper TargetPosition not set on init

Supporting Visual Studio on Windows
Post Reply
nm17
Phidgeteer!
Posts: 53
Joined: Mon Nov 27, 2017 3:29 am
Contact:

Stepper TargetPosition not set on init

Post by nm17 »

I notice with STC1005 and the latest firmware that if I connect via c# to the stepper but do not set TargetPosition immediately (or before its set) reading the TargetPosition will raise a
"PhidgetException 0x33 (Unknown or Invalid Value) The value is unknown."

I would expect that the driver initializes the TargetValue to whatever is the current Position.

In general, I think a better approach for TargetPosition could be to be set to double.NaN or something like that so users don't have to guard against both legitimate values and exceptions separately. This would save raising exception only in extraordinary circumstances.
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests