FAS_ClearPosition
To set the command position value and actual position value of the motor to '0'
Syntax
int FAS_ClearPosition(
BYTE nPortNo,
BYTE iSlaveNo
);
Parameters
nPortNo
Port number of relevant drive.
iSlaveNo
Slave number of r elevant drive.
Return Value
FMM_OK : Command has been successfully performed.
FMM_NOT_OPEN : The drive has not been connected yet.
FMM_INVALID_PORT_NUM : There is no nPort in the connected ports.
FMM_INVALID_SLAVE_NUM : There is no drive of iSlaveNo in the relevant port.
Remarks
The user sets the position command (pulse output counter ) value.
This function is generally used when the user sets the current position to initial
values.
Example
#include "FAS_EziMOTIONPlusR.h"
void funcClearPosition()
{
BYTE nPortNo = 1; // COMM Port Number
BYTE iSlaveNo = 0; // Slave No (0 ~ 15)
int nRtn;
// Try to connect
if (FAS_Connect(nPortNo, 115200) == FALSE)
{
}
// Initialize Command Position and Actual Position values to 0.
nRtn = FAS_ClearPosition(nPortNo, iSlaveNo);
_ASSERT(nRtn == FMM_OK);
// Disconnect.
FAS_Close(nPortNo);
}
See Also
FAS_SetActualPos
// Connection failed.
// The port is not connected or the baudrate may be wrong.
return;
- 71 -
Library for PC Program
71
Need help?
Do you have a question about the Ezi-Step Plus-R and is the answer not in the manual?