nPortNo
Port number of relevant drive
iSlaveNo
Slave number of relevant drive
lCmdPos
Parameter pointer where command position value will be saved
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 .
#include "FAS_EziMOTIONPlusR.h"
void funcDisplayStatus()
{
BYTE nPortNo = 1; // COMM Port Number
BYTE iSlaveNo = 0; // Slave No (0 ~ 15)
long lValue;
int nRtn;
// Try to connect
if (FAS_Connect(nPortNo, 115200) == FALSE)
{
// Connection failed.
// The port is not connected or the baudrate may be wrong.
return;
}
// Check position information of Ezi -STEP Plus-R.
nRtn = FAS_GetCommandPos(nPortNo, iSlaveNo, &lValue);
_ASSERT(nRtn == FMM_OK);
printf("CMDPOS : %d \n", lValue);
nRtn = FAS_GetActualVel(nPortNo, iSlaveNo, &lValue);
_ASSERT(nRtn == FMM_OK);
printf("ACTVEL : %d \n", lValue);
// Disconnect.
FAS_Close(nPortNo);
}