PCI-DIO12 API Programming (Rev 1.0) Windows, Windows2000, Windows NT and Windows XP are trademarks of Microsoft. We acknowledge that the trademarks or service names of all other organizations mentioned in this document as their own property. Information furnished by DAQ system is believed to be accurate and reliable. However, no responsibility is assumed by DAQ system for its use, nor for any infringements of patents or other rights of third parties which may result from its use. No license is granted by implication or otherwise under any patent or copyrights of DAQ system. The information in this document is subject to change without notice and no part of this document may be copied or reproduced without the prior written consent. Copyrights 2010 DAQ system, All rights reserved.
API 설명 PCI-DIO12 보드를사용하기위한 API(Application Programming Interface) 를설명한다. 현재지원하는 API 는다음과같다.
Board Level APIs Overview INT OpenDAQDevice(void) ResetBoard(int nboard) CloseDAQDevice(void) OpenDAQDevice 디바이스를 Open 한다. 프로그램에서초기에반드시한번함수를호출하여디바이스를 Open 하여야한다. INT OpenDAQDevice(void) 디바이스 Open에성공할경우현재시스템 (PC) 에장착된디바이스의개수를 return한다. 실패할경우 -1 을 return한다. ResetBoard 현재시스템 (PC) 에장착된디바이스를초기화한다. ResetBoard(int nboard) nboard : 현재시스템에장착되어있는보드번호를알려준다. 보드번호는보드의 DIP 스위치를이용하여설정한다. 함수호출에실패할경우 FALSE 성공일경우 TRUE 을리턴함. CloseDAQDevice 오픈된모든 PCI-AIO 시리즈디바이스를 Close 한다. 장치의사용이끝나게되면, 반드시장 치를 Close 하여다른프로그램에서사용할수있도록한다. CloseDAQDevice(void) 없음 함수호출에실패할경우 FALSE 성공일경우 TRUE 을리턴함.
Power Level APIs Overview PowerEnable(int npower, benable) PowerEnable 전원을선택한다. PowerEnable(int npower, benable) npower : 0 이면 5V, 1 이면 LCD 전원 (2.8V), 2 이면 I/O 전원 (1.8V) benable : ON : True, OFF : False. Voltage Function Level APIs Overview Init_Voltage(void) Set_Voltage(int nnum, float fval) Get_Voltage(int nnum, float *fval) Set_VoltageHex(int nnum, BYTE byval) Init_Voltage 현재시스템 (PC) 에장착된디바이스의전압을초기화한다. Init_Voltage(void)
Set_Voltage 현재시스템 (PC) 에장착된디바이스의전압값을지정한다. Set_Voltage(int nnum, float fval) nnum : 0 이면 LCD voltage이고, 1 이면 I/O voltage이다. fval : voltage 값. Get_Voltage 현재시스템 (PC) 에장착된디바이스의전압값을읽어온다. Get_Voltage(int nnum, float *fval) nnum : 0 이면 LCD voltage이고, 1 이면 I/O voltage이다. fval : voltage 값의포인터이다.. Set_VoltageHex 현재시스템 (PC) 에장착된디바이스를지정한다. Set_VoltageHex(int nnum, Byte byval) nnum : 0 이면 LCD voltage이고, 1 이면 I/O voltage이다. byval : 현재시스템의전압의 Hex 값
Logic Level APIs Overview Logic_Init(void) Logic_Reset(void) Logic_Start(DWORD ngenerationsize, brepeat) Logic_CheckEnd(void) Logic_GetRepeatSize(DWORD* nrepeatsize) Logic_Stop(void) Logic_SetData(DWORD* ncnt, unsigned char* buf, DWORD noffset) Logic_GetData(DWORD* ncnt, unsigned char* buf, DWORD noffset) Logic_SetPort(DWORD* nport) Logic_GetPortData(DWORD* ncnt, unsigned char* buf) Logic_SetTrigger( benable) Logic_Update(DWORD ngenerationsize) Logic_Init PCI-DIO12 보드의로직을초기화한다. Logic_Init(void) Logic_Reset 현재시스템 (PC) 의로직을재설정한다. Logic_Reset(void)
Logic_Start Data 출력을시작한다. Logic_Start(DWORD ngeneration, brepeat) ngeneration : 반복횟수 brepeat : 0 이면 false, 1 이면 true Logic_CheckEnd Logic 시작후현재시스템 (PC) 의로직을조사한다. Logic_CheckEnd(void) Logic_Get RepeatSize Data 출력을시작한다. Logic_GetRepeatSize(DWORD* nrepeatsize) brepeatsize : 반복횟수 Logic_Stop 데이터출력을정지한다. Logic_Stop(void)
Logic_SetData 프레임데이터를저장한다. Logic_SetData(DWORD* ncnt, unsigned char* buf, DWORD noffset) ncnt : 쓸메모리번지지정 buf : 버퍼사이즈 noffset : write offset 값 Logic_Get Data 프레임을읽어온다. Logic_GetData(DWORD* ncnt, unsigned char* buf, DWORD noffset) ncnt : 읽어올메모리번지지정 buf : 버퍼사이즈 noffset : read offset 값 Logic_SetPort 어떤 Port Mode 를선택할지결정한다. Logic_SetPort(DWORD* nport) nport : A, B, C Port
Logic_Get PortData Port Data 출력을가져온다. Logic_GetPortData(DWORD* ncnt, unsigned char* buf) ncnt : 8K byte 버퍼의메모리번지 buf : 8K byte 버퍼의값 Logic_SetTrigger Trigger 를 enable 시킨다. Logic_SetTrigger( benable) benable : 0 이면 false, 1 이면 true Logic_Update Logic 을업데이트시킨다. Logic_Update(DWORD ngenerationsize) ngenerationsize :
Clock Level APIs Overview Init_Clock(void) Get_Clock(Void) Set_Clock(DWORD val) Init_Clock Port A 의 clock 을초기화한다. Init_Clock(void) Get_Clock Port A 의 clock 값을읽어온다. Get_Clock(void) 없음 Set_Clock Port A 의 clock 값을지정한다. Set_Clock(DWORD val) val : clock 값. ( 초기값 20000000)
PortC Level APIs Overview PortC_Init(void) PortC_Reset(Void) PortC_Close(void) PortC_Stop(Void) PortC_CheckEnd(Void) PortC_Start(DWORD ngeneration, brepeat) PortC_SetData(DWORD* ncnt, unsigned char* buf, DWORD noffset) PortC_SetTrigger( benable) PortC_Init Port C 를초기화한다. PortC_Init(void) PortC_Reset Port C 를재설정한다. PortC_Reset(void) 없음
PortC_Close Port C 를 close 한다. PortC_Close(void) 없음 PortC_Stop Port C 를정지한다. PortC_Stop(void) 없음 PortC_Check Port C 를 check 한다. PortC_Check(void) 없음 PortC_Start Port C 를정해진수만큼실행한다. PortC_Start(DWORD ngeneration, brepeat) ngeneration : 반복횟수 brepeat : 0 이면 false, 1 이면 true
PortC_SetData Port C 를읽어온다. PortC_SetData(DWORD* ncnt, unsigned char* buf, DWORD noffset) ncnt : 읽어올메모리번지지정 buf : 버퍼사이즈 noffset : read offset 값 PortC_SetTrigger Port C 의 Trigger 를 enable 시킨다. PortC_SetTrigger( benable) benable : 0 이면 false, 1 이면 true
PortC Clock Level APIs Overview Init_Clock2(void) Get_Clock2(void) Set_Clock2(DWORD val) Init_Clock2 Port C 의 clock 을초기화한다. Init_Clock2(void) Get_Clock2 Port C 의 clock 값을읽어온다. ( 초기값 10000000) Get_Clock2(void) 없음 Set_Clock2 Port C 의 clock 값을지정한다. Set_Clock2(DWORD val) val : clock 값.