RTC
®
5 PC Interface Board
Rev. 1.9 e
10 Commands And Functions
518
Ctrl Command stepper_init
Function initializes a stepper motor.
Call
stepper_init( No, Period, Dir, Pos, Tol, Enable, WaitTime )
Parameters
No
Number of the stepper motor output as an unsigned 32-bit value;
allowed values:
= 1: Stepper motor output 1
= 2: Stepper motor output 2
If the value is invalid, then the command won’t execute (get_last_error return
code:
RTC5_PARAM_ERROR
).
Period
Pulse period of the CLOCK signal as an unsigned 32-bit value.
1bit equals 10µs.
allowed range: [0 … +(2
24
-1)]; larger values will be clipped.
If
Period
= 0, then no reference movement is performed and the function
immediately returns (see comments).
Dir
Direction of stepper motor motion during the reference movement as a
signed 32-bit value; allowed range: [–2
31
…+(2
31
-1)]:
> 0: The DIRECTION signal gets set; during the reference movement the
internal position variable increments.
= 0: The DIRECTION signal gets reset; during the reference movement the
internal position variable decrements.
< 0: The DIRECTION signal remains unchanged, no reference movement is
performed and the function immediately returns.
Pos
New values for position variable and set position in CLOCK pulse units as a
signed 32-bit value (see comments); allowed range: [–2
31
…+(2
31
-1)]
Tol
Tolerance for the reference movement (see comments) as an unsigned 32-bit
value; allowed range: [1 … +(2
32
-1)]
If
Dir
< 0 and/or
Period
= 0, then the value
Tol
= 0 is irrelevant, otherwise
Tol
= 0 causes the command not to execute (get_last_error return code:
RTC5_PARAM_ERROR
).
Enable
ENABLE signal as an unsigned 32-bit value;
allowed range: [0 … +(2
32
-1)]:
= 0: The ENABLE signal will be reset.
> 0: The ENABLE signal will be set.
WaitTime
This parameter (an unsigned 32-bit value) defines when the command, at the
latest, will return (see comments)
1bit equals 1s. Allowed range: [0 … +(2
32
-1)]