Please be gentle. I am starting to learn VB 2010 from an entry level text after taking Basic, Cobol, Fortran, etc. back in the mid to late 70's. Hard slog. . .
Being impatient, I am trying to modify the "Stepper-full" sample code in VB for the Phidgets 1063 controller board to run a Phidgets 3301 Bipolar Stepper. Displaying my incompetence, my objective was to set the
velocityTrk.SetRange(-200000,200000)
currentPositionTrk.SetRange(-200000,200000)
parameters to accept variables input from the Form1 such as:
positionTrk.SetRange(-dblSteps, dblSteps)
currentPositionTrk.SetRange(-dblSteps, dblSteps)
I planned to get the variable "dblSteps" by placing "GetSteps()" at the top of the "stepper.Attach" section. dblSteps is generated from inputs and calculation in the Form1 as follows:
Private Sub btnCalcSteps_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalcSteps.Click
'Calculate number of Steps required for number of full rotations
GetSteps()
End Sub
...................................................................
Private Sub GetSteps()
'Dim variables from input box
Dim StrValue As Double
Dim dblWind As Double
Dim dblSteps As Double
'Calculate Steps from Winds Value
StrValue = txtRotationsNumber.Text
dblWind = StrValue
dblSteps = dblWind * 3200
Label15.Text = Format(dblSteps.ToString("n0"))
End Sub
..............................................................
The button click would would take the value entered in txtRotationsNumber and convert it to the required Steps (based on 1.8 degrees - 16 micro steps X 200 Steps = 3,200 Steps for a full rotation).
It didn't work. My questions is how can I accomplish this from entering the desired steps from the result of a calculation in the form?
I appreciate your thoughts as I continue through the entry level VB 2010 text and the other Phidgets documentation. I know it is above my current knowledge, but I'd really like to figure it out and understand a bit better how to do it.
Take Care,
Jim. . .