unit ccapaio;

interface

uses
    Windows;

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

//======================================================================
// Range
//======================================================================
PM10			=	0;		//}10V
PM5				=	1;		//}5V
P10				=	50;		//0`10V
P5				=	51;		//0`5V
P20MA			=	100;	//0`20mA

//======================================================================
// Error Code
//======================================================================
AIO_ERR_SUCCESS					=	0;			//I
AIO_ERR_INI_MEMORY				=	3;			//̊蓖ĂɎs܂
AIO_ERR_INI_REGISTRY			=	4;			//ݒt@C̃ANZXɎs܂
AIO_ERR_DLL_DEVICE_NAME			=	10000;		//ݒ胆[eBeBɓo^ĂȂfoCXw肳܂
AIO_ERR_DLL_INVALID_ID			=	10001;		//IDw肳܂
AIO_ERR_DLL_CREATE_FILE			=	10003;		//nh̎擾Ɏs܂
AIO_ERR_DLL_CLOSE_FILE			=	10004;		//nh̃N[YɎs܂
AIO_ERR_INFO_NOT_FIND_DEVICE	=	10006;		//p\ȃfoCX܂
AIO_ERR_PTR_DEVICE_NAME			=	10007;		//DeviceNamẽ|C^NULLł
AIO_ERR_PTR_DEVICE				=	10008;		//Devicẽ|C^NULLł
AIO_ERR_UNKNOWN_DEVICE			=	10013;		//foCX̎ނ𔻕ʂł܂
AIO_ERR_PTR_DEVICE_TYPE			=	10015;		//DeviceTypẽ|C^NULLł
AIO_ERR_INFO_INVALID_DEVICE		=	10050;		//w肵foCX̂܂BXymFĂB
AIO_ERR_NULL_DEVICE				=	10100;		//DeviceNameɃfoCXi[Ă܂
AIO_ERR_PTR_ID					=	10101;		//Id̃|C^NULLł
AIO_ERR_PTR_ERR_STR				=	10180;		//ErrorString̃|C^NULLł
AIO_ERR_PTR_AI_RANGE			=	11051;		//AiRangeNULLł
AIO_ERR_AI_RANGE				=	11060;		//AiRange̒l֐̎w͈͊Oł
AIO_ERR_AI_CHANNEL				=	11420;		//AiChannel̒l֐̎w͈͊Oł
AIO_ERR_PTR_AI_DATA				=	11421;		//AiDatã|C^NULLł
AIO_ERR_PTR_AI_MAX_CHANNELS		=	11720;		//AiMaxChannels̃|C^NULLł
AIO_ERR_PTR_AI_RESOLUTION		=	11740;		//AiResolutioñ|C^NULLł
AIO_ERR_AO_CHANNEL				=	13000;		//AoChannel̒l֐̎w͈͊Oł
AIO_ERR_AO_CHANNELS				=	13020;		//AoChannels̒l֐̎w͈͊Oł
AIO_ERR_PTR_AO_DATA				=	13021;		//AoDatã|C^NULLł
AIO_ERR_PTR_AO_RESOLUTION		=	13040;		//AoResolutioñ|C^NULLł
AIO_ERR_PTR_AO_MAX_CHANNELS		=	13080;		//AoMaxChannels̃|C^NULLł
AIO_ERR_PTR_AO_RANGE			=	13111;		//AoRangẽ|C^NULLł
AIO_ERR_AO_RANGE				=	13120;		//AoRange̒l֐̎w͈͊Oł
AIO_ERR_AP_CHANNEL				=	13500;		//AoChannel̒l֐̎w͈͊Oł
AIO_ERR_SYS_NOT_SUPPORTED		=	20001;		//gpĂfoCXł͂̊֐gp邱Ƃł܂
AIO_ERR_DEVICE_BUSY				=	20002;		//foCX쒆̂ߎsł܂
AIO_ERR_AI_DEVICE_RANGE			=	21060;		//AiRange̒lgpĂfoCX̎w͈͊Oł
AIO_ERR_AI_SET_RANGE			=	21063;		//W̐ݒɎs܂
AIO_ERR_AI_DEVICE_CHANNEL		=	21420;		//AiChannel̒lgpĂfoCX͈̔͊Oł
AIO_ERR_AD_ERROR				=	21421;		//ADϊG[܂
AIO_ERR_AI_CHANNEL_NUM_OVER		=	21441;		//ϊ`lI[o[܂Aő`lŕϊ܂
AIO_ERR_AO_DEVICE_CHANNEL		=	23000;		//AoChannel̒lgpĂfoCX͈̔͊Oł
AIO_ERR_DA_ERROR				=	23001;		//DAϊG[܂
AIO_ERR_AO_DATA_RANGE1			=	23002;		//AoDataɐݒ肷f[^͂0`4095͈̔͂Ŏw肵Ă
AIO_ERR_AO_DATA_RANGE2			=	23003;		//AoDataɐݒ肷f[^͂0`65535͈̔͂Ŏw肵Ă
AIO_ERR_AO_CHANNEL_NUM_OVER		=	23021;		//ϊ`lI[o[܂Bő`lŕϊ܂
AIO_ERR_AO_DEVICE_RANGE			=	23120;		//AoRange̒lgpĂfoCX̎w͈͊Oł
AIO_ERR_AO_SET_RANGE			=	23121;		//W̐ݒɎs܂
AIO_ERR_START_ERROR				=	28001;		//W[NɃG[܂B
AIO_ERR_NOT_START				=	28002;		//foCX͂܂NĂ܂B
AIO_ERR_ACCESS_RIGHT			=	28003;		//ANZXG[łB
AIO_ERR_DLL_TIMEOUT				=	28004;		//ʐM^CAEg܂B
AIO_ERR_COMPOSITION				=	28005;		//@\G[łBO[vID=8ȊO̐ݒłIOAVXgT[o[KvłB

//======================================================================
// Function Prototype
//======================================================================
function	AioInit(Devicename: PChar; Id: PSmallint):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioExit(Id: Smallint):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioGetErrorString(Err: Longint; szMsg: PChar):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioQueryDeviceName(Index: Smallint; GroupID: PSmallint; UnitID: PSmallint; DeviceID: PSmallint; DeviceName:PChar; Device:PChar):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioGetDeviceType(Device: PChar; DeviceType: PSmallint):Longint;stdcall;external 'CCAPAIO.DLL';

function	AioSetAccessRight(AccsRight: PByte):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioSetDirectMode(Id: Smallint; DirectMode: Smallint):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioSetIOInterval(Interval: Longint):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioStartIO(Id: Smallint; Start: Smallint):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioGetRemoteStatus(Id: Smallint; Start: PByte; Status: PByte):Longint;stdcall;external 'CCAPAIO.DLL';

function	AioSingleAi(Id: Smallint; AiChannel: Smallint; AiData: PLongint):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioSingleAiEx(Id: Smallint; AiChannel: Smallint; AiData: PSingle):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioMultiAi(Id: Smallint; AiChannels: Smallint; AiData: PLongint):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioMultiAiEx(Id: Smallint; AiChannels: Smallint; AiData: PSingle):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioGetAiResolution(Id: Smallint; AiResolution: PSmallint):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioGetAiMaxChannels(Id: Smallint; AiMaxChannels: PSmallint):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioSetAiRangeAll(Id: Smallint; AiRange: Smallint):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioGetAiRange(Id: Smallint; AiChannel: Smallint; AiRange: PSmallint):Longint;stdcall;external 'CCAPAIO.DLL';

function	AioSingleAo(Id: Smallint; AoChannel: Smallint; AoData: Longint):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioSingleAoEx(Id: Smallint; AoChannel: Smallint; AoData: Single):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioSingleAoEcho(Id: Smallint; AoChannel: Smallint; AoData: PLongint):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioMultiAo(Id: Smallint; AoChannels: Smallint; AoData: PLongint):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioMultiAoEx(Id: Smallint; AoChannels: Smallint; AoData: PSingle):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioMultiAoEcho(Id: Smallint; AoChannels: Smallint; AoData: PLongint):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioGetAoResolution(Id: Smallint; AoResolution: PSmallint):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioGetAoMaxChannels(Id: Smallint; AoMaxChannels: PSmallint):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioSetAoRangeAll(Id: Smallint; AoRange: Smallint):Longint;stdcall;external 'CCAPAIO.DLL';
function	AioGetAoRange(Id: Smallint; AoChannel: Smallint; AoRange: PSmallint):Longint;stdcall;external 'CCAPAIO.DLL';

implementation

end.