#include "FAS_EziMOTIONPlusR.h"
void funcInit()
{
BYTE nPortNo = 1; // COMM Port Number
DWORD dwBaudrate = 115200; // Baudrate. (Be variable by setting)
BYTE iSlaveNo = 0; // Slave No (0 ~ 15)
char lpBuff[256];
int nBuffSize = 256;
BYTE nType;
int nRtn;
// Try to connect
if (FAS_Connect(nPortNo, dwBaudrate) == FALSE)
{
// Connection failed.
// The port is not connected or the baudrate may be wrong.
return;
}
if (FAS_IsSlaveExist(nPortNo, i SlaveNo) == FALSE)
{
// There is no relevant slave number.
// Check the slave number of Ezi -STEP Plus-R.
return;
}
nRtn = FAS_GetSlaveInfo(nPortNo, iSlaveNo, &nType, lpBuff, nBuffSize);
if (nRtn != FMM_OK)
{
// Command has not been performed properly.
// Refer to ReturnCodes_Define.h.
}
printf("Port : %d (Slave %d) \n", nPortNo, iSlaveNo);
printf("\tType : %d \n", nType);
printf("\tVersion : %d \n", lpBuff);