EasyManuals Logo
Home>Fastech>Controller>Ezi-Step Plus-R

Fastech Ezi-Step Plus-R User Manual

Fastech Ezi-Step Plus-R
114 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #36 background imageLoading...
Page #36 background image
- 36 -
36
Library for PC Program
FAS_Connect
FAS_Connect is the function of connection Ezi-STEP Plus-R.
Syntax
BOOL FAS_Connect(
BYTE nPortNo,
DWORD dwBaud
);
Parameters
nPortNo
Select a serial port number to be connected.
dwBaud
Input the Baudrate of the serial port.
Return Value
When it is successfully connected, TRUE will be returned. Otherwise, FALSE will be
returned.
Remarks
Example
#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);

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Fastech Ezi-Step Plus-R and is the answer not in the manual?

Fastech Ezi-Step Plus-R Specifications

General IconGeneral
BrandFastech
ModelEzi-Step Plus-R
CategoryController
LanguageEnglish

Related product manuals