FAS_MoveSingleAxisA bsPosEx
To move the motor to the absolute coordinate
int FAS_MoveSingleAxisAbsPos (
BYTE nPortNo,
BYTE iSlaveNo,
long lAbsPos,
DWORD lVelocity,
MOTION_OPTION_EX* lpExOption
);
nPortNo
Port number of relevant drive.
iSlaveNo
Slave number of relevant drive.
lAbsPos
Absolute coordinate of position to move
lVelocity
Velocity when the motor moves
lpExOption
Custom option.
FMM_OK : Command has been normally 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.
Refer to MOTION_OPTION_EX struct.
#include "FAS_ EziMOTIONPlusR.h"
void funcMoveEx()
{
BYTE nPortNo = 1; // COMM Port Number
BYTE iSlaveNo = 0; // Slave No (0 ~ 15)
DWORD dwAxisStatus, dwInput;
EZISTEP_AXISSTATUS stAxisStatus;
long lAbsPos, lIncPos, lVelocity;
MOTION_OPTION_EX opt = {0};
int nRtn;
// Try to connect
if (FAS_Connect(nPortNo, 115200) == FALSE)
{
// Connection failed.
// The port number may be wrong, or incorrect Baudrate.
return;
}
// Moving motor with different acc/dec time
lIncPos = 15000;
lVelocity = 30000;