DapiStepperCommand - DapiStepperCommand_GoRefswitch
Description
The motor goes to the referece position.
Definition
DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_GO_REFSWITCH, par1, par2, par3, 0);
Parameters
Values for par1: (if multiple are needed, the individual must be added)
DAPI_STEPPER_GO_REFSWITCH_PAR_REF1
DAPI_STEPPER_GO_REFSWITCH_PAR_REF2
DAPI_STEPPER_GO_REFSWITCH_PAR_REF_LEFT
DAPI_STEPPER_GO_REFSWITCH_PAR_REF_RIGHT
DAPI_STEPPER_GO_REFSWITCH_PAR_REF_GO_POSITIVE
DAPI_STEPPER_GO_REFSWITCH_PAR_REF_GO_NEGATIVE
DAPI_STEPPER_GO_REFSWITCH_PAR_SET_POS_0
par2=Motorpositionsoffset (1/16 Full-step)
par3=Timeout [ms]
Remark
Go to the referenceswitch
At first the motor goes to referenceposition 1 or 2 (see par1).
Therefore, you can specify, whether the motor goes to referenceswitch 1 (DAPI_STEPPER_GO_REFSWITCH_PAR_REF1) or to referenceswitch 2 (DAPI_STEPPER_GO_REFSWITCH_PAR_REF2).
You can select the direction in which the motor starts. With the parameter DAPI_STEPPER_GO_REFSWITCH_PAR_REF_GO_NEGATIVE the motor starts to the left and with the parameter
DAPI_STEPPER_GO_REFSWITCH_PAR_REF_GO_POSITIVE it starts to the right.
Therefore the speed (GOREFERENCEFREQUENCY_TOENDSWITCH is used for (see DapiStepperCommand_SetMotorcharacteristic).
Go out of the referenceswitch
After this the motor goes with the speed GOREFERENCEFREQUENCY_AFTERENDSWITCH out of the referenceposition.
Therefor, you can specify, whether the motor goes to the right or to the left border of the referenceswtich. With the parameter DAPI_STEPPER_GO_REFSWITCH_PAR_REF_LEFT the motor goes to the left border and with the parameter DAPI_STEPPER_GO_REFSWITCH_PAR_REF_RIGHT it goes to the right border.
Go to an optional offset
After the motor goes out of the referenceswitch, it can go to an offset. If this parameter is not = 0 (par2), the motor goes to that offset with the speed GOREFERENCEFREQUENCY_TOOFFSET.
Zeroize the position of the motor
With the parameter DAPI_STEPPER_GO_REFSWITCH_PAR_SET_0, you can additionaly set, whether the motor gets the position 0.
Example program
DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_GO_REFSWITCH, DAPI_STEPPER_GO_REFSWITCH_PAR_REF1 + DAPI_STEPPER_GO_REFSWITCH_PAR_REF_LEFT + DAPI_STEPPER_GO_REFSWITCH_PAR_REF_GO_POSITIVE + DAPI_STEPPER_GO_REFSWITCH_PAR_SET_POS_0, 0, 15000, 0);
|