unit ccapdio;

interface

uses
    Windows;

//======================================================================
//======================================================================
//	API-CAP(W32)
//	CCAPDIO.PAS					CONTEC.CO.,LTD.
//======================================================================
//======================================================================

const
//======================================================================
// Error Code
//======================================================================
DIO_ERR_SUCCESS					=	0;			//I
DIO_ERR_INI_MEMORY				=	3;			//̊蓖ĂɎs܂B
DIO_ERR_INI_REGISTRY			=	4;			//ݒt@C̃ANZXɎs܂B
DIO_ERR_DLL_DEVICE_NAME			=	10000;		//ݒt@Cɓo^ĂȂfoCXw肳܂B
DIO_ERR_DLL_INVALID_ID			=	10001;		//IDw肳܂B
DIO_ERR_DLL_CREATE_FILE			=	10003;		//nh̎擾ɍ쐬Ɏs܂B
DIO_ERR_DLL_CLOSE_FILE			=	10004;		//nh̃N[YɎs܂B
DIO_ERR_ACCESS_RIGHT			=	10005;		//ANZXG[łB
DIO_ERR_DLL_TIMEOUT				=	10006;		//ʐM^CAEg܂B
DIO_ERR_COMPOSITION				=	10007;		//@\G[łB
DIO_ERR_INFO_INVALID_DEVICE		=	10050;		//w肵foCX̂܂BXymFĂB
DIO_ERR_INFO_NOT_FIND_DEVICE	=	10051;		//p\ȃfoCX܂B
DIO_ERR_DLL_BUFF_ADDRESS		=	10100;		//f[^obt@AhXsłB
DIO_ERR_SYS_NOT_SUPPORTED		=	20001;		//̃foCXł͂̊֐͎gpł܂B
DIO_ERR_SYS_PORT_NO				=	20100;		//|[gԍw\͈͂𒴂Ă܂B
DIO_ERR_SYS_PORT_NUM			=	20101;		//|[gw\͈͂𒴂Ă܂B
DIO_ERR_SYS_BIT_NO				=	20102;		//rbgԍw\͈͂𒴂Ă܂B
DIO_ERR_SYS_BIT_NUM				=	20103;		//rbgw\͈͂𒴂Ă܂B
DIO_ERR_SYS_BIT_DATA			=	20104;		//rbgf[^01ȊOłB
DIO_ERR_SYS_DIRECTION			=	20106;		//o͕w͈͊OłB
DIO_ERR_SYS_FILTER				=	20400;		//tB^萔w͈͊OłB

//======================================================================
// Function Prototype
//======================================================================
function	DioInit(Devicename: PChar; Id: PSmallint):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioExit(Id: Smallint):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioGetErrorString(Err: Longint; szMsg: PChar):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioQueryDeviceName(Index: Smallint; GroupID: PSmallint; UnitID: PSmallint; DeviceID: PSmallint; DeviceName: PChar; Device: PChar):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioSetAccessRight(AccsRight: PByte):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioSetDirectMode(Id: Smallint; DirectMode: Smallint):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioSetIOInterval(Interval: Longint):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioGetRemoteStatus(Id: Smallint; Start: PByte; Status: PByte):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioSetDigitalFilter(Id: Smallint; FilterValue: Smallint):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioGetDigitalFilter(Id: Smallint; FilterValue: PSmallint):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioSetIoDirection(Id: Smallint; Dir: Longint):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioGetIoDirection(Id: Smallint; Dir: PLongint):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioInpByte(Id: Smallint; PortNo: Smallint; Data: PByte):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioInpBit(Id: Smallint; BitNo: Smallint; Data: PByte):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioOutByte(Id: Smallint; PortNo: Smallint; Data: Byte):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioOutBit(Id: Smallint; BitNo: Smallint; Data: Byte):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioEchoBackByte(Id: Smallint; PortNo: Smallint; Data: PByte):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioEchoBackBit(Id: Smallint; BitNo: Smallint; Data: PByte):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioInpMultiByte(Id: Smallint; PortNo: PSmallint; PortNum: Smallint; Data: PByte):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioInpMultiBit(Id: Smallint; BitNo: PSmallint; BitNum: Smallint; Data: PByte):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioOutMultiByte(Id: Smallint; PortNo: PSmallint; PortNum: Smallint; Data: PByte):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioOutMultiBit(Id: Smallint; BitNo: PSmallint; BitNum: Smallint; Data: PByte):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioEchoBackMultiByte(Id: Smallint; PortNo: PSmallint; PortNum: Smallint; Data: PByte):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioEchoBackMultiBit(Id: Smallint; BitNo: PSmallint; BitNum: Smallint; Data: PByte):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioGetMaxPorts(Id: Smallint; InPortNum: PSmallint; OutPortNum: PSmallint):Longint;stdcall;external 'CCAPDIO.DLL';
function	DioGetMaxBits(Id: Smallint; InBitNum: PSmallint; OutBitNum: PSmallint):Longint;stdcall;external 'CCAPDIO.DLL';

implementation

end.