#define GLINK_MODE_DLL 0
#define GLINK_MODE_DSP 1
#define GLINK_MODE_DLL_MAINTAIN_DO 2
#define GLINK_MODE_DSP_MAINTAIN_DO 3
#define GLINK_MODE_DLL_CONFIG_AIO 4
#define GLINK_MODE_DSP_CONFIG_AIO 5

typedef struct 
{
	unsigned char onlineSlaveNum	;
	unsigned char initSlaveNum;
    unsigned char commStatus;
    unsigned char dump[13];
}GLINK_COMM_STS;

GT_API GT_SetGLinkDo(short slaveno,unsigned short offset,unsigned char *pData,unsigned short bytelength);
GT_API GT_GetGLinkDo(short slaveno,unsigned short offset,unsigned char *pData,unsigned short bytelength);
GT_API GT_GetGLinkDi(short slaveno,unsigned short offset,unsigned char *pData,unsigned short bytelength);
GT_API GT_SetGLinkDoBit(short slaveno,short doIndex,unsigned char value);
GT_API GT_GetGLinkDiBit(short slaveno,short diIndex,unsigned char *pValue);
GT_API GT_SetGLinkAo(short slaveno,unsigned short channel,short *pData,unsigned short count);
GT_API GT_GetGLinkAo(short slaveno,unsigned short channel,short *pData,unsigned short count);
GT_API GT_GetGLinkAi(short slaveno,unsigned short channel,short *pData,unsigned short count);
GT_API GT_GetGLinkOnlineSlaveNum(unsigned char *slavenum);
GT_API GT_SetGLinkModuleConfig(char *pFile);
GT_API GT_GLinkInit(short cardNum);
GT_API GT_GLinkInitEx(short cardNum,short opMode =GLINK_MODE_DSP);
GT_API GT_GLinkDeInit(unsigned long Param=0);
GT_API GT_GetGLinkDiEx(short slaveno,unsigned char *pData,unsigned short count);	//slaveno：起始站号；count：站个数
//获取所有Glink从站信息，slavenum在线从站数量，slavetype 1DIO16 2AIO0606 4DI32  dilength dolength 长度 字节
GT_API GT_GetGLinkModulesInfo(unsigned char *slavenum,unsigned char *slavetype,unsigned char *subslavetype,unsigned char *dilength,unsigned char *dolength);
GT_API GT_GetGLinkModulesInfoEx( unsigned char *slavenum,unsigned char *slavetype,unsigned char *subslavetype,unsigned char *dilength,unsigned char *dolength,unsigned long *date);
GT_API GT_GetGLinkCommStatus(GLINK_COMM_STS *commSts);
GT_API GT_RelateGlinkToMcGpiBit(short gpi,short slaveno,short bitoffset,short byteOffset);
GT_API GT_RelateGlinkToMcGpoBit(short gpo,short slaveno,short bitoffset,short byteOffset);
