To read I/O Assign Map. For more information, refer to ‘1-1-5. Frame Type and Data
Configuration’.
int FAS_GetIOAssignMap(
BYTE nPortNo,
BYTE iSlaveNo,
BYTE iIOPinNo,
DWORD* dwIOLogicMask,
BYTE* bLevel
);
nPortNo
Port number of relevant drive.
iSlaveNo
Slave number of relevant drive.
iIOPinNo
I/O pin number to be read
dwIOLogicMask
Parameter pointer where the logic mask value assigned to a relevant pin will be
saved
bLevel
Parameter pointer where the active level of relevant logic 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 .
For dwIOLogicMask, refer to ‘Motion_define.h’ .
#include "FAS_EziMOTIONPlusR.h"
void funcIOAssign()
{
BYTE nPortNo = 1; // COMM Port Number
BYTE iSlaveNo = 0; // Slave No (0 ~ 15)
BYTE iPinNo;
DWORD dwLogicMask;
BYTE bLevel;
BYTE i;
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 assigned information of input pin.