Home
NAPPCI/win & NAPPCI/wnt User Manual for PCI-1202
Contents
1. 2 10 1 P1202 CardO StartScan e Description This subroutine will start the continuous capture function Refer to PCI 1800 1802 Hardware User Manual chapter 6 for details e Syntax WORD P1202 CardO StartScan WORD wSampleRate WORD wChannelStatus WORD wChanelConfig WORD wCount e Input Parameter wSampleRate AD sampling rate 8M wSampleRate wSampleRate 24 gt sampling rate 8M 24 333K gt maximum wSampleRate 80 gt sampling rate 8M 80 100K wChannelStatus 02no scan 1 scan for each channel wChannelConfig configuration code for each channel wCount number of A D data for each scan channel e Return Value NoError OK FindBoardError cannot find the PCI 1800 1802 board AdControllerError MagicScan controller hardware handshake error e Demo Program DEMO13 C NAPPCI win amp NAPPCI wnt User Manual Version 2 0 47 2 10 2 P1202 CardO ReadStatus Description This subroutine will read the data of continuous capture function Syntax P1202 _Card0_ReadStatus WORD wBuf WORD wBuf2 DWORD dwP1 DWORD dwP2 WORD wStatus Input Parameter wBuf in scan sequence order 012 N012 N 012 N wBuf2 in channel sequence order 00000 11111 22222 NNNNN dwPl reserved dwP2 reserved wStatus 1 thread start 2 TimeOut 8 FIFO overflow Ox80 thread finish Return Value 0 data is ready 1 data not ready Demo Program DEMO13 C 2 10 3 P1202 Ca
2. po BE p gu fos FIRMUM UN ae po Bp HN T o Bipolar 005v fioo 4ou or Bipolar 0005V 1000 j300u M3 10V os p3us Qxl4 us av e e pa 01V 50 i40us_ pxl O6 Bipolar 001v soo 300m A7 iu Z a T Ru NAPPCI win amp NAPPCI wnt User Manual Version 2 0 24 2 2 P1202 H define EXPORTS extern C __ declspec dllimport Usage for Allpication tdefine EXPORTS Usage for DLL priority setting constant Il THREAD_PRIORITY_LOWEST THREAD PRIORITY BELOW NORMAL THREAD PRIORITY NORMAL Il THREAD PRIORITY ABOVE NORMAL THREAD_PRIORITY_HIGHEST Il priority setting constant return code define NoError 0 define DriverHandleError 1 define DriverCallError 2 define AdControllerError 3 define M_FunExecError 4 define ConfigCodeError 5 define FrequencyComputeError 6 define HighAlarm 7 define LowAlarm 8 define AdPollingTimeOut 9 define AlarmTypeError 10 define FindBoardError 11 define AdChannelError 12 define DaChannelError 13 define InvalidateDelay 14 define DelayTimeOut 15 define InvalidateData 16 define FifoOverflow 17 define TimeOut 18 define ExceedBoardNumber 19 define NotFoundBoard 20 define OpenError 21 define FindTwoBoardError 22 define ThreadCreateError 23 define StopError 24 define AllocateMemoryError 25 EXPORTS fl
3. hdc xCaret cxChar yCaret cyChar cBuf xCaret 1 ShowCaret hwnd ReleaseDC hwnd hdc xCaret break SetCaretPos xCaret cxChar yCaret cyChar return 0 case WM_PAINT clr and show HELP InvalidateRect hwnd NULL TRUE hdc BeginPaint hwnd amp ps SelectObject hdc GetStockObject SYSTEM FIXED FONT sprintf cBuf Press any key to continue TextOut hdc 0 0 cBuf strlen cBuf xCaret 0 yCaret 1 SetCaretPos 0 yCaret cyChar EndPaint hwnd amp ps return 0 case WM_DESTROY NAPPCI win amp NAPPCI wnt User Manual Version 2 0 19 P ok ok ok ok oko ok o Ck oko oko oko oko ok ok oko oko NA NOTICE call P1202 DriverClose to close the driver El KK oko oko oko oko oko oko ok ok oko oko oko oko RR RRA eoe e e x x P1202 DriverClose close the driver PostQuitMessage 0 return 0 return DefWindowProc hwnd iMsg wParam lParam es k 01 1 21 3 4 wII 6 7 8 9 dwAdC1k void READ CMD char szCmd DWORD nT1 nT2 nT3 nT4 nT5 if szCmd 0 0 return only press Enter nT1 ASCII TO HEX szCmd 0 HEX format nT2 ASCII TO HEX szCmd 1 nT3 ASCII TO HEX szCmd 2 nT4 ASCII TO HEX szCmd 3 nT5 ASCII TO HEX szCmd 4 dwDaNum nT1 10000 nT2 1000 nT3 100 nT4 10 nT5 nT1 ASCII TO HEX szCm
4. to the directory same as source program Copy the P1202 DLL to the directory same as source program Select Build Settings Link and key P1202 lib in the object library modules field The P1202 lib is used in linking time and the P1202 DLL is used in run time NAPPCI win k NAPPCI wnt User Manual Version 2 0 11 1 5 BC Call NAPPCI The NAPPCI is created by Visual C 4 0 The P1202 H and P1202 lib are also designed for Visual C C The BC can not use this two file The modification part is given below include lt conio h gt include lt windows h gt HINSTANCE hDLLLib Step 1 declare a functionpointer float CALLBACK FloatSub2 float fA float fB main Step 2 load dll hDIILib LoadLibrary P1202 dll if RDLLLib Step 3 get the function address FloatSub2 FARPROC GetProcAddress hDLLLib P1202_FloatSub2 if FloatSub2 Step 4 call function j else printf get P1202 FloatSub2 function address error Step 5 free library FreeLibrary hDLLib else printf load P1202 dll error getch This usage can be divided into 5 steps listing above Using this modification and P1202 DLL the user can use BC to call NAPPCI NAPPCI win amp NAPPCI wnt User Manual Version 2 0 12 1 6 VB Call NAPPCI NAPPCI Win VB P1202 DLL gt DLLs NAPPCI Win VB FROM1 FRM gt form and source file NAPPCI Win VB MODULE1 BAS gt declare file NAPPCI Win VB PROJECT1 VBP
5. gt project file NAPPCI Wnt VB P1202 DLL gt DLLs NAPPCI Wnt VB FROM1 FRM gt form and source file NAPPCIWntVBWMODULEI BAS declare file NAPPCI Wnt VB PROJECT1 VBP gt project file NOTE 1 Testing under Windows 95 NT and VB 4 0 32 bits 2 The MODULEI BAS is designed for demo purpose and the MODULE1 BAS now only support P1202 ShortSub2 A B The user can modify this file to support all NAPPCI DLLs Module1 BAS Attribute VB Name Modulel Declare Function P1202 ShortSub2 Lib a NAPPCI win vb P1202 dll ByVal a As Integer ByVal b As Integer As Integer FORMI FRM partial Private Sub Commandl Click Dim a As Integer b As Integer c As Integer a Val Textl Text b Val Text2 Text c P1802 ShortSub2 a b Text3 Text c NAPPCI win amp NAPPCI wnt User Manual Version 2 0 13 1 7 Delphi Call NAPPCI NAPPCI Win DELPHIP1202 PAS NAPPCI Win DELPHIP1202 DLL NAPPCI Win DELPHTUNIT1 PAS NAPPCI Win DELPHTNUNIT1 DFM NAPPCI Win DELPHI PROJECT1 DPR NAPPCI Wnt DELPHI P1202 PAS NAPPCI Wnt DELPHI P1202 DLL NAPPCI Wnt DELPHI UNIT1 PAS NAPPCI Wnt DELPHI UNIT1 DFM NAPPCI Wnt DELPHI PROJECT1 DPR gt unit file gt DLLs gt demo source file gt form file gt project file gt unit file gt DLLs gt demo source file gt form file gt project file NOTE 1 testing under Windows 95 NT and Delphi 2 0 32 bits 2 The P1202 PAS is designed for demo purpose and the P1202 PAS
6. ibat 11 1 6 MEC CALIZANADPPCE IUIS ee Ente el ld 11 177 BET CALLNAPPRET oo gine t 12 1 8 VB CALGNAPPCET ine fae ei le ePi dae 13 1 9 DEEPHIECALE NAPPCYT ihre En RE ERE TRE zu sob nov 14 1 10 LABVIEW CALENAPPCL s ian ote ie e ette e e tee ene ie est 15 1 11 DEMO PROGRAM oscila ecd ee eec 17 2 DLLS FOR WINDOWS 95 NT ee eeeeee eese nete ene rne rata snos tasa estne ts th sse ts tasses than ets neo Ree neon none 22 2 1 THE CONFIGURATION CODE TABLE use entente entente entente ee neon o entere 24 2 2 P1802 HT aue ete EE O IE 25 2 3 THE TESTING FUNCTIONS dai 28 24 THEM EUNCTIONS iieri eter dip eee RII 30 2 5 THE DIO FUNCTIONS ds 33 2 6 THEDA P NCTIONS E tn o A Dp odd 34 2 7 THE AD FIXED MODE FUNCTIONS eese eene trennen eren ehe KRK RK RA ARR R ARR Raat snas 35 2 8 THEM AGICSCAN EUNCTIONS chance Aaa add din 38 29 THE PULGSPLAY FUNCTIONS es nee te e pi oie ea 44 2 10 THE CONTINUOUS CAPTURE FUNCTIONS esse 47 2411 THE OTHER FUNCTIONS 53 ee pee ete Ee einer pie a Rabe Pepe bebe daca tope eet e Mpeg 51 3 DEMO PROGRAM C M 52 NAPPCI win k NAPPCI wnt User Manual Version 2 0 2 1 Introduction The NAPPCI win is a collection of DLLs for Windows 95 application and the NAPPCI wnt is for Windows NT 3 51 4 0 These DLLs are 32 bits and can be called by Visual C C BC Visual BASIC Delphi and LabVIEW The NAPPCI win consists of these DLLs and device driver that supports the following p
7. now only support P1802 ShortSub2 A B support all NAPPCI DLLs unit P1202 interface The user can modify this file to P1802 PAS function P1202 ShortSub2 a smallint b smallint smallint StdCall implementation function P1802 ShortSub2 external P1202 DLL name P1202 ShortSub2 end procedure TForm1 Button1Click Sender TObject var a b c smallint begin a StrToInt Edit1 text b StrTolnt Edit2 text c P1802 ShortSub2 a b Edit3 text IntToStr c end end UNITI PAS partial NAPPCI win amp NAPPCI wnt User Manual Version 2 0 14 1 8 LabVIEW Call NAPPCI LabVIEW is a industrial s graphical programming system developed by National Instruments With LabVIEW the user can quickly design the user interface and control program as a block diagram NAPPCI Win VIEW P1202 DII gt DLLs NAPPCI Win VIEW DEMO1 VI gt Demo VI NAPPCI Win VIEW MEUNI VI gt Driver VI NOTE 1 Testing under Windows 95 NT and LabVIEW 4 0 2 The demol VI will call MFUNI VI to perform M Functions The M Functions can send out the arbitrary wave form to the D A output port and perform A D operation at the same time If connect the D A channel 0 to A D channel 0 the D A output can be measured back by M Functions The output response is shown in Fig 8 and the connecting diagram of demol VI is given in Fig 9 3 The NAPVIEW can support a variety of VIs designed for LabVIEW 4 0 Call th
8. the 16 bits data to DO port This function will refer to the current active PCI 1800 1802 board Use the P1202 ActiveBoard to select the active board Syntax WORD P1202 Do WORD wDo Input Parameter wDo the 16 bits data sent to DO port Return Value NoError OK ExceedBoardNumber invalidate board number FindBoardError cannot find the PCI 1800 1802 board Demo Program DEMO1 C NAPPCI win amp NAPPCI wnt User Manual Version 2 0 33 2 6 The DA Functions 2 6 1 P1202 Da Description This subroutine will send the 12 bits data to DA port This function will refer to the current active PCI 1202 board Use the P1202 ActiveBoard to select the active board e Syntax WORD P1202 Da WORD wChannel WORD wDaVal e Input Parameter wChannel 0 for channel 0 DA 1 for channel 1 DA wDaVal 12 bits data sent to DA port O minimum and 4095 maximum The DA output can be SV or 10V setting by hardware JP1 The software can t detect the state of JP1 So 4095 maybe 5V or 10V depend on JP1 e Return Value NoError OK FindBoardError cannot find the PCI 1800 1802 board ExceedBoardNumber invalidate board number DaChannelError channel number must be 0 or 1 e Demo Program DEMOI C NAPPCI win amp NAPPCI wnt User Manual Version 2 0 34 2 The AD Fixed mode Functions 2 7 1 P1202 SetChannelConfig Description This subroutine will set the AD channel s configuration co
9. wDi EXPORTS WORD CALLBACK P1202 Do WORD wDo EXPORTS WORD CALLBACK P1202 Da WORD wDaChannel WORD wDaVal EXPORTS WORD CALLBACK P1202 SetChannelConfig WORD wAdChannel WORD wConfig EXPORTS WORD CALLBACK P1202 AdPolling float fAdVal EXPORTS WORD CALLBACK P1202 AdsPolling float fAdVal WORD wNum EXPORTS WORD CALLBACK P1202 AdsPacer float fAdVal WORD wNum WORD wSample EXPORTS WORD CALLBACK P1202 ClearScan void EXPORTS WORD CALLBACK P1202 StartScan WORD wSampleRateDiv DWORD dwNum SHORT nPriority EXPORTS void CALLBACK P1202 ReadScanStatus WORD wStatus DWORD dwLowAlarm DWORD dwHighAlarm EXPORTS WORD CALLBACK P1202 AddToScan WORD wAdChannel WORD wConfig WORD wAverage WORD wLowAlarm WORD wHighAlarm WORD wAlarmType EXPORTS WORD CALLBACK P1202 SaveScan WORD wAdChannel WORD wBuf EXPORTS void CALLBACK P1202 WaitMagicScanFinish WORD wStatus DWORD dwLowAlarm DWORD dwHighAlarm EXPORTS WORD CALLBACK P1202 StopMagicScan EXPORTS WORD CALLBACK P1202 DelayUs WORD wDelayUs EXPORTS WORD CALLBACK P1202 CardO StartScan WORD wSampleRate WORD wChannelStatus WORD wChannelConfig WORD wCount EXPORTS WORD CALLBACK P1202 Card0 ReadStatus WORD wBuf WORD wBuf2 DWORD dwP1 DWORD dwP2 WORD wStatus EXPORTS void CALLBACK P1202 CardO Stop void NAPPCI win amp NAPPCI wnt User Manual Version 2 0 26 EXPORTS WORD CALLBACK P1202 Cardl Start can WORD wSampleRate WORD wChannel
10. 1202 the following functions must be used 7 P1202 DriverInit initial the driver P1202 DriverClose close the driver Kk kk kk kk kk kA Kk kk kk kk kk KCKCKCKCKCKCKCKCKCKCKCKCKCKCKCKCKCKCKCKCKCKCKCKCKCK KCKCKCK Ck Ck Ck ck Ck ck ck ck ck ck ck kc k kk short nDMA 1 nIRQ 1 not used WORD wBase 0x220 wAdBuf 510 wFlag 0 wAddrCtrl int iLine DWORD dwDaNum 90 dwAdC1k 24 WORD wTotalBoard wInitialCode void READ CMD char short ASCII TO HEX char void TEST CMD HWND int int int int LRESULT CALLBACK WndProc HWND UINT WPARAM LPARAM void SHOW WAVE HWND hwnd JE El int WINAPI WinMain HINSTANCE hInstance HINSTANCE hPrevInstance PSTR szCmdLine int iCmdShow static char szAppName P1202 Demol HWND hwnd MSG msg WNDCLASSEX wndclass wndclass cbSize sizeof wndclass wndclass style CS_HREDRAW CS_VREDRAW wndclass lpfnWndProc WndProc wndclass cbClsExtra 0 wndclass cbWndExtra 0 wndclass hInstance hInstance wndclass hIcon LoadIcon NULL IDI APPLICATION wndclass hCursor LoadCursor NULL IDC ARROW wndclass hbrBackground HBRUSH GetStockObject WHITE BRUSH wndclass lpszMenuName NULL wndclass lpszClassName szAppName wndclass hIconSm LoadIcon NULL IDI APPLICATION NAPPCI win amp NAPPCI wnt User Manual Version 2 0 17 RegisterClassEx amp wndclas
11. 1802 board number wAddrTimer wAddrCtrl wAddrDio wAddrAdda refer to PCI 1800 1802 Hardware manual chapter 3 for details Return Value NoError OK FindBoardError handshake check error ExceedBoardError wBoardNo is invalidate Demo Program DEMO1 C 2 9 4 P1202 WhichBoardActive Description Return the board number of the active board Syntax WORD P1202_WhichBoardActive void Input Parameter void Return Value board number of the active board Demo Program DEMO1 C NAPPCI win amp NAPPCI wnt User Manual Version 2 0 45 2 9 5 P1202 ActiveBoard e Description This function will active one of the PCI 1800 1802 boards installed in the system This function must call once before the D I O A D D A functions are called e Syntax WORD P1202 ActiveBoard WORD wBoardNo e Input Parameter wBoardNo board number e Return Value NoError OK ExceedBoardError wBoardNo is invalidate e Demo Program All DEMO program The P1202 ActiveBoard will take effect on all functions except the following P1202 FloatSub2 P1202 ShortSub2 P1202 GetDriverVersion P1202 Drivelnit P1202 DriveClose P1202 GetConfigAddressSpace P1202 CardO StartScan P1202 Card0 ReadData P1202 CardO Stop P1202 Cardl StartScan 11 P1202 Cardl ReadData 12 P1202 Cardl Stop M2 1000 cb ON ON xc dua DY ven NAPPCI win k NAPPCI wnt User Manual Version 2 0 46 2 10 The Continuous Capture Functions
12. 268 hard doc lt the hardware manual readme txt lt this file NAPPCI win amp NAPPCI wnt User Manual Version 2 0 5 1 2 Plug amp Play Installation for Windows 95 The Windows 95 support Plug amp Play feature The system will automatic detect the PCI series cards in the first installation and request for Plug amp Play information as shown in Fig 1 The steps for installation are given as following Step 1 Place the companion floppy disk into floppy driver A Step 2 Select the second item in Fig 1 and select OK Step 3 Select the a install p1802 inf as in Fig 2 Step 4 Select the unique model number as in Fig 3 Then the p1802 inf will provide all information needed to complete the installation After the installation the Windows 95 will reserve the resource and build up the registry The Plug amp Play information is shown in Fig 4 The Fig 5 shows the resource reserved If the user execute the c windows regedit exe the registration information of the PCI 1802H L will be placed under HKEY_LOCAL_MACHINE System CurrentControlSet Service Class Unknown 0000 as in Fig 6 The Fig 7 shows the registration items in detail HEAD NE HE aA Bele Sh Wee aA JR En fa zt Windows ARTIE CN C FERRERA Windows M T ARTIED C NACER ASES A Fig 1 system request the Plug amp Play information NAPPCI win amp NAPPCI wnt User Manual Version 2 0 6 DUE J TE te fear A
13. CI win k NAPPCI wnt User Manual Version 2 0 35 2 7 3 P1202 AdsPolling Description This subroutine will perform multiple AD conversions by polling The P1202 SetChannelConfig subroutine can be used to change channel or configuration code and the P1202 AdsPolling will refer to that condition in later operation This function will refer to the current active PCI 1202 board Use the P1202 ActiveBoard to select the active board Syntax WORD P1202 AdsPolling float fAdVal WORD wNum Input Parameter fAdVal starting address of AD data buffer these data will be automatically computed based on the setting of P1202 SetChannelConfig wNum number of AD conversions will be performed Return Value NoError OK ExceedBoardNumber invalidate board number FindBoardError cannot find the PCI 1800 1802 board AdPollingTimeOut hardware timeout error Demo Program DEMO1 C NAPPCI win amp NAPPCI wnt User Manual Version 2 0 36 2 7 4 P1202 AdsPacer Description This subroutine will perform multiple AD conversions by pacer trigger The P1202 SetChannelConfig subroutine can be used to change channel or configuration code and the P1202 AdsPacer will refer to that condition in later operation The hardware pacer will generate trigger signal to AD converter periodically So these AD data can be used to reconstruct the wave form of analog input The P1202 AdsPolling is controlled by software polling so the AD c
14. NAPPC Iwin e NAPPCLhwa User Manual for PCI 1202 Warranty All products manufactured by ICP DAS are warranted against defective materials for a period of one year from the date of delivery to the original purchaser Warning ICP DAS assumes no liability for damage consequent to the use of this product ICP DAS reserves the right to change this manual at any time without notice The information furnished by ICP DAS is believed to be accurate and reliable However no responsibility is assumed by ICP DAS for its use nor for any infringements of patents or other rights of third parties resulting from its use Copyright Copyright 1998 by ICP DAS All rights are reserved Trademark The names used for identification only maybe registered trademarks of their respective companies License The user can use modify and backup this software ON A single machine The user may not reproduce transfer or distribute this software or any copy in whole or in part NAPPCI win k NAPPCI wnt User Manual Version 2 0 1 Table of Contents 1 INTRODUCTION rr sd ad oa 3 1 1 SOFTWARE INSTALA TON cian 4 1 2 REGISTRATION FOR WINDOWS NT ooo ERROR BOOKMARK NOT DEFINED 1 3 PLUG amp PLAY INSTALLATION FOR WINDOWS NT ERROR BOOKMARK NOT DEFINED 1 4 PLUG amp PLAY INSTALLATION FOR WINDOWS 95 enne nene nnne netten enter innen nente enne 6 1 5 C CALL NAPPCI 5 coin tee ee eee ere rca cr be ere e eere
15. Status WORD wChannelConfig WORD wCount EXPORTS WORD CALLBACK P1202 Cardl ReadStatus WORD wBuf WORD wBuf2 DWORD dwP1 DWORD dwP2 WORD wStatus EXPORTS void CALLBACK P1202 Cardl Stop void EXPORTS WORD CALLBACK P1202 FunA Start WORD wClockODiv WORD wChannel0 WORD wConfigO WORD Buffer0 DWORD dwMaxCountO WORD wClock1Div WORD wChannel1 WORD wConfigl WORD Bufferl DWORD dwMaxCountl SHORT nPriority EXPORTS WORD CALLBACK P1202 FunA ReadStatus void EXPORTS WORD CALLBACK P1202 FunA Stop void EXPORTS WORD CALLBACK P1202 FunA Get DWORD P0 DWORD P1 EXPORTS WORD CALLBACK P1202 FunB Start WORD wClock0Div WORD wChanneloO WORD wConfigO WORD Buffer0 DWORD dwMaxCount0 SHORT nPriority EXPORTS WORD CALLBACK P1202 FunB ReadStatus void EXPORTS WORD CALLBACK P1202 FunB Stop void EXPORTS WORD CALLBACK P1202 FunB Get DWORD P0 EXPORTS WORD CALLBACK P1202 MemoryStatus DWORD dwTotalPhys DWORD dwAvailPhys DWORD dwTotalPageFile DWORD dwAvailPageFile DWORD dwTotalVirtual DWORD dwAvail Virtual EXPORTS WORD CALLBACK P1202 AllocateMemory HGLOBAL hMem WORD Buffer DWORD dwSize EXPORTS WORD CALLBACK P1202_FreeMemory HGLOBAL hMem EXPORTS WORD CALLBACK P1202 StartScanPostTrg WORD wSampleRateDiv DWORD dwNum SHORT nPriority EXPORTS WORD CALLBACK P1202 StartScanPreTrg WORD wSampleRateDiv DWORD dwNum SHORT nPriority EXPORTS WORD CALLBACK P1202 StartScanMiddleTrg WORD wSampleRateDi
16. TAN p1802 inf iae RC Da Fig 2 Select the A install p1802 inf HADAS Sim PCI Mass Storage Controller e UNO ae p HK CE mu Op el ae l CLASE B PCI 1802H L Fig 3 Select the unique model number NAPPCI win k NAPPCI wnt User Manual Version 2 0 7 System Properties Computer fi CDROM amp Disk drives mj Display adapters amp Floppy disk controllers amp Hard disk controllers Keyboard B Modem Monitor Fig 4 The Plug amp Play information ICP DAS PCI 1202 series PCI 1202 Properties nterrupt Request Fig 5 The resource reserved NAPPCI win amp NAPPCI wnt User Manual Version 2 0 8 F E My Computer HKEY CLASSES ROOT HKEY CURRENT USER J E HKEY LOCAL MACHINE Enum Ga hardware get Network Ea Security H E SOFTWARE ee System m CurrentControlSet a control E Services Ca Arbitrators C3 Class En MSNP32 En NWNP32 En RemoteAccess En 0 ge Winsock WinTrust r ea a uem anene o Fig 6 The path of registration information NAPPCI win amp NAPPCI wnt User Manual Version 2 0 9 Registry Editor E NetTrans 3 nodriver value not set Ca OtherDevices NAPPCI vxd Ex PCMCIA i 8 6 1998 C3 Ports Dri ICP DAS PCI 1202 series PCI 202 M Printer ICPDAS 3 INF C3 PrinterUpgrade j i dew install H E SCSIAdapter ee System ee Unknown F NWNP32 29 RemoteAcces
17. anual Version 2 0 43 2 9 The Pulg amp Play Functions 2 9 1 P1202 Driverlnit Description Return all resources to system This function must be called once before program is terminated Syntax WORD P1202 DriverInittWORD wTotalBoard Input Parameter wTotalBoard address of wTotalBoard wTotalBoard 1 gt one PCI 1800 1802 card in the system wTotalBoard n gt n PCI 1800 1802 cards in the system Return Value NoError OK NoFoundBoard detect no PCI 1800 1802 FindBoardError handshake check error DriverHandleError the NAPPCI VxD open error for Windows 95 the NAPPCI SYS open error for Windows NT DriverCallError call NAPPCI VxD return error call NAPPCI SYS return error Demo Program All DEMO program 2 9 2 P1202 DriverClose Description This function will detect all the PCI 1800 1802 boards installed in the system This function must be called once before the other functions are called Syntax void P1202 DriverClose void Input Parameter void Return Value void Demo Program All DEMO program NAPPCI win amp NAPPCI wnt User Manual Version 2 0 44 2 9 3 P1202 GetConfigAddressSpace Description Get the I O address of PCI 1800 1802 board n This function is for debug It is not necessary to call this function Syntax WORD P1202 GetConfigAddressSpace WORD wBoardNo WORD wAddrTimer WORD wAddrCtrl WORD wAddrDio WORD wAddrAdda Input Parameter wBoardNo PCI 1800
18. aram cxBuffer max 1 cxClient cxChar window size in characters cyBuffer max 1 cyClient cyChar return 0 WM SETFOCUS CreateCaret hwnd NULL cxChar cyChar SetCaretPos xCaret cxChar yCaret cyChar ShowCaret hwnd return 0 WM KILLFOCUS HideCaret hwnd DestroyCaret return 0 NAPPCI win amp NAPPCI wnt User Manual Version 2 0 18 case WM CHAR user press KEYBOARD for i 0 i lt int LOWORD lParam i Switch wParam case Nb backspace pressed if xCaret gt 0 xCaret cBuf xCaret HideCaret hwnd hdc GetDC hwnd SelectObject hdc GetStockObject SYSTEM FIXED FONT TextOut hdc xCaret cxChar yCaret cyChar cBuf xCaret 1 ShowCaret hwnd ReleaseDC hwnd hdc break case Nr carriage return pressed if wFlag 1 InvalidateRect hwnd NULL TRUE wFlag 0 break wFlag 1 cBuf xCaret 0 if xCaret 0 xCaret 0 yCaret READ CMD cBuf EST_CMD hwnd xCaret cxChar yCaret cyChar H xCaret 0 yCaret t iLine if yCaret gt cyBuffer InvalidateRect hwnd NULL TRU break case x1B escape pressed InvalidateRect hwnd NULL TRUE xCaret yCaret 0 eo break default other KEY pressed cBuf xCaret char wParam HideCaret hwnd hdc GetDC hwnd SelectObject hdc GetStockObject SYSTEM FIXED FONT TextOut
19. d 6 HEX format nT2 ASCII TO HEX szCmd 7 nT3 ASCII TO HEX szCmd 8 nT4 ASCII TO HEX szCmd 9 dwAdClk DWORD nT1 1000 nT2 100 nT3 10 nT4 short ASCII_TO_HEX char cChar if cChar lt 9 return cChar 0 else if cChar lt F return cChar A 10 else return cChar a 10 void TEST_CMD HWND hwnd int x int dx int y int dy Separate testing subroutine is putting here The READ_COM only accept fix format command The command format is given as below KRASNA wAdCIk NAPPCI win k NAPPCI wnt User Manual Version 2 0 20 e if Lo Enter key gt accept current setting of wDaFreq and wAdClk The steps to compile and link the demo program are described in Sec 1 3 AII the demo program share the similar interface The separate testing subroutines are putting in TEST CMDY So only the TEST CMD is listing in user manual NAPPCI win amp NAPPCI wnt User Manual Version 2 0 21 2 function description These function in DLL are divided into several groups as following The test functions The M Functions function The D I O functions The D A function The A D fixed mode functions The A D MagicScan mode functions The A D continuous capture functions The Plug amp Play functions The Continuous Capture functions The Continuous Capture functions with storing data to main memory The other functions The functions of fixed channel m
20. de This subroutine will set the active AD channel for P1202 AdPolling P1202 AdsPolling and P1202 AdsPacer This function will refer to the current active PCI 1202 board Use the P1202 ActiveBoard to select the active board Syntax WORD P1202 SetChannelConfig WORD wChannel WORD wConfig Input Parameter wChannel AD channel number wConfig Configuration code Refer to PCI 1800 1802 Hardware Manual for details Return Value NoError OK ExceedBoardNumber invalidate board number FindBoardError cannot find the PCI 1800 1802 board AdControllerError MagicScan controller hardware handshake error Demo Program DEMO1 C 2 7 2 P1202 AdPolling Description lt This subroutine will perform the AD conversion by polling one time The P1202 SetChannelConfig subroutine can be used to change channel or configuration code and the P1202 AdPolling will refer to that condition in later operation This function will refer to the current active PCI 1202 board Use the P1202 ActiveBoard to select the active board Syntax WORD P1202 AdPolling float fAdVal Input Parameter fAdVal address of fAdVal which store the AD data this data is automatically computed based on the setting of P1202 SetChannelConfig Return Value NoError OK ExceedBoardNumber invalidate board number FindBoardError cannot find the PCI 1800 1802 board AdPollingTimeOut hardware timeout error Demo Program DEMO1 C NAPP
21. e local dealer for details gt demol vi File Edit Operate Project Windows Help sb 60 70 eo 90 100 Wes QF MER al I S E Revs BY Microsoft Wor H MS DOS fst LabVIEW Euntited 1 Disg S Untitled 1 S emot vi AM 11 02 Fig 8 The output of DEMOI VI call M FUN 1 NAPPCI win amp NAPPCI wnt User Manual Version 2 0 15 gt demol vi Diagram File Edit Operate Project Windows Help ETSI TI este Fr ole dwDaFrequency s e 21e GR soo a File Edit Operate Project Windows Help gt SL GI obese oa pe ied wDaFrequency SREB EY Microsoft Wor lbs pos Hist LabVIEW United 1 Mint vi S Muni vi Di mm Fig 10 The connecting diagram of MFUNI VI call DLL M FUN 1 NAPPCI win amp NAPPCI wnt User Manual Version 2 0 16 1 9 Demo Program We use a common demo program for all p1202 dll demonstration This demo program will accept the wDaFreq and wAdCIk and call the different function for usage demonstration include windows h include lt stdlib h gt include lt stdio h gt include lt conio h gt include P1202 H KK KK kk kk kk kk kk kk kk kk kk kk kk kk k k k AA DEMO1 program for one P1202 card in the PC system 7 Please turn the resolution of your monitor at least 1024 768 KK kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk k A First Card some P1202 function call demo For the proper operation the P
22. er 00000 11111 22222 NNNNN dwP1 reserved dwP2 reserved wStatus 1 thread start 22 TimeOut 8 FIFO overflow 0x80 thread finish Return Value 0 data is ready 1 data not ready Demo Program DEMO14 C 2 10 6 P1202 Card Stop Description This subroutine will stop the continuous capture function Syntax lt void P1202 Cardl Stop void Input Parameter void Return Value void Demo Program DEMO14 C NAPPCI win k NAPPCI wnt User Manual Version 2 0 50 2 11 The Other Functions 2 11 1 P1202 DelayUs e Description This isa machine independent timer This function can be used to delay the Settling time or used as a general purposed machine independent timer This function will refer to the current active PCI 1800 1802 board Use the P1202 ActiveBoard to select the active board e Syntax void P1202 DelayUs WORD wDelayUs e Input Parameter wDelayUs number of us to delay 8191 Max wDelayUs 1 gt delay 1 us wDelayUs 1000 gt delay 1000 us 1 ms wDelayUs 8191 delay 8191 us 8 191 ms maximum delay wDelayUs 8192 gt invalidate delay will return error e Return Value NoError OK ExceedBoardNumber invalidate board number FindBoardError cannot find the PCI 1800 1802 board InvalidateDelay dwDelayUs gt 8191 e Demo Program DEMO1 C e Long Time Delay WORD DelayMs WORD wDelayMs maximum delay 4294967 295 sec WORD wDelay wRetVal wRetVal 0 f
23. h e Description gt This subroutine will wait until the MagicScan operation is finished This function will refer to the current active PCI 1800 1802 board Use the P1202 ActiveBoard to select the active board e Syntax lt void P1202 WaitMagicScanFinish WORD wStatus WORD wLowAlarm WORD wHighAlarm e Input Parameter wStatus address of wStatus which store the MagicScan status wLowAlarm address of wLowAlarm which store the MagicScan alarm status dwHighAlarm address of wHighAlarm which store the MagicScan alarm status e Return Value void e Demo Program DEMO11 C wStatus 0x00 0x01 0x02 0x04 0x08 0x80 MagicScan initial condition idle state MagicScan start to operation MagicScan stage 1 controller timeout MagicScan stage 2 controller timeout MagicScan FIFO overflow gt gt gt gt gt gt MagicScan function OK wLowAlarm gt 32 bits corresponding to 32 channels gt 0 no low alarm gt 1 is low alarm wLowAlarm 0 gt all channels OK no low alarm wLowAlarm 1 gt channel 0 is low alarm others are OK wLowAlarm 3 gt channel 0 and channel 1 are low alarm others are OK wHighAlarm 32 bits corresponding to 32 channels gt 0 no high alarm gt 1 is high alarm wHighAlarm 0 gt all channels OK no high alarm wHighAlarm 1 gt channel 0 is high alarm others are OK wHighAlarm 3 channel 0 and channel 1 are high alarm others are OK NAPPCI win amp NAPPCI wnt User M
24. ighAlarm gt HighAlarm e Return Value NoError OK DriverHandleError Invalidate VxD SYS handle DriverCallError VxD SYS function call error ExceedBoardNumber invalidate board number FindBoardError no PCI 1800 1802 board AdControllerError embedded controller handshake error M FunExecError M Functions return code error ConfigCodeError wAdConfig configuration code error HighAlarm fAdBuf gt fHighAlarm LowAlarm fAdBuf fLowAlarm e Demo Program DEMOs C NAPPCI win amp NAPPCI wnt User Manual Version 2 0 30 2 4 2 P1202 M FUN 2 e Description The P1202 M FUN 2 will not compute the wave form image automatically Refer to PCI 1800 1802 Hardware Manual chapter 5 for details input AD channel 0 output DA channel 0 Syntax WORD P1202 M FUN 2 WORD wDaNumber WORD wDaWave WORD wDaBuf WORD wAdClock WORD wAdNumber WORD wAdConfig WORD wAdBuf e Input Parameter wDaNumber number of D A samples in one wave form wDaWave Number of DA wave form to be output wDaBuf The array store the D A wave form image wAdClock AD sampling clock 8000000 wAdClock samples sec wAdNumber Number of AD data to be read wAdConfig A D input range configuration code wAdBuf the starting address of fAdBuf which store the A D data e Return Value NoError OK DriverHandleError Invalidate VxD SYS handle DriverCallError VxD SYS function call error ExceedBoardNumber invalidate board number Fi
25. nStatus WORD wStatus WORD wLowAlarm WORD wHighAlarm Input Parameter wStatus address of wStatus which store the MagicScan status wLowAlarm address of wLowAlarm which store the MagicScan alarm status wHighAlarm address of wHighAlarm which store the MagicScan alarm status Return Value void Demo Program DEMO11 C wStatus 0x00 0x01 0x02 0x04 0x08 0x80 MagicScan initial condition idle state MagicScan start to operation MagicScan stage 1 controller timeout MagicScan stage 2 controller timeout MagicScan FIFO overflow gt gt gt gt gt gt MagicScan function OK wLowAlarm gt 32 bits corresponding to 32 channels gt 0 no low alarm gt 1 is low alarm wLowAlarm 0 gt all channels OK no low alarm wLowAlarm 1 gt channel 0 is low alarm others are OK wLowAlarm 3 gt channel 0 and channel 1 are low alarm others are OK wHighAlarm 32 bits corresponding to 32 channels gt 0 no high alarm gt 1 is high alarm wHighAlarm 0 gt all channels OK no high alarm wHighAlarm 1 gt channel 0 is high alarm others are OK wHighAlarm 3 channel 0 and channel 1 are high alarm others are NAPPCI win amp NAPPCI wnt User Manual Version 2 0 40 2 8 4 P1202 AddToScan Description This subroutine will add one channel to the MagicScan circular queue This function will refer to the current active PCI 1800 1802 board Use the P1202 ActiveBoard to select the acti
26. ndBoardError no PCI 1800 1802 board AdControllererror embedded controller handshake error M FunExecError M Functions return code error ConfigCodeError wAdConfig configuration code error e Demo Program DEMO7 C The DA output wave form generator is a machine dependent function The DA output frequency 1 8M wDaNumber is machine dependent The testing results are given as follows DA output frequency 1 8M dwDaNumber for pentium 120 DA output frequency 2 0M dwDaNumber for pentium 133 The user must test this value before using M FUN 1 M FUN 2 and M FUN 3 NAPPCI win k NAPPCI wnt User Manual Version 2 0 31 2 43 P1202 M FUN 3 e Description The P1202 M FUN 3 will compute the wave form image automatically Refer to PCI 1800 1802 Hardware Manual chapter 5 for details input programable channels output DA channel O This function will refer to the current active PCI 1800 1802 board Use the P1202 ActiveBoard to select the active board Refer to Sec 2 4 2 for more information e Syntax WORD P1202 M FUN 3 WORD wDaFrequencey WORD wDaWave float fDaAmplitude WORD wAdClock WORD wAdNumber WORD wChannelStatus WORD wAdConfig float fAdBuf float fLowAlarm float fHighAlarm e Input Parameter wDaFrequency DA output frequency 1 8M wDaFrequency pentium 120 wDaWave Number of DA wave form to be output fDaAmplitude Amplitude of DA output NOTE the hardware J1 must select 10V wAdCl
27. oard number FindBoardError cannot find the PCI 1202 board AdControllerError MagicScan controller hardware handshake error Demo Program DEMO11 C NAPPCI win amp NAPPCI wnt User Manual Version 2 0 36 2 8 2 P1202 StartScan Description This subroutine will start the MagicScan operation This subroutine will return to the caller before the MagicScan operation finished The user can use P1202 WaitMagicScanFisish or P1202 ReadScanStatus to check the state of MagicScan operation This function will refer to the current active PCI 1202 board Use the P1202 ActiveBoard to select the active board Syntax WORD P1202 StartScan WORD wSampleRate WORD wNum Input Parameter wSampleRate AD sampling rate 8M wSampleRate wSampleRate 24 gt sampling rate 8M 24 333K gt maximum wSampleRate 80 gt sampling rate 8M 80 100K wNum Number of MagicScan cycle to perform Return Value NoError OK ExceedBoardNumber invalidate board number FindBoardError cannot find the PCI 1202 board AdControllerError MagicScan controller hardware handshake error Demo Program DEMO11 C NAPPCI win k NAPPCI wnt User Manual Version 2 0 39 2 8 3 P1202 ReadScanStatus Description This subroutine will read the status of the MagicScan operation This function will refer to the current active PCI 1202 board Use the P1202 ActiveBoard to select the active board Syntax lt void P1202 ReadSca
28. oat CALLBACK P1202_FloatSub2 float fA float fB EXPORTS short CALLBACK P1202_ShortSub2 short nA short nB EXPORTS WORD CALLBACK P1202 GetDIIVersion void EXPORTS WORD CALLBACK P1202 DriverInit WORD wTotalBoards EXPORTS void CALLBACK P1202 DriverClose void EXPORTS WORD CALLBACK P1202_GetDriver Version WORD wVxdVersion EXPORTS WORD CALLBACK P1202 GetConfigAddressSpace WORD wBoardNo WORD wAddrTimer WORD wAddrCtrl WORD wAddrDio WORD wAddrAdda EXPORTS WORD CALLBACK P1202 ActiveBoard WORD wBoardNo NAPPCI win amp NAPPCI wnt User Manual Version 2 0 25 EXPORTS WORD CALLBACK P1202 WhichBoardActive void EXPORTS WORD CALLBACK P1202 M FUN 1 WORD wDaFreguency WORD wDaWave float fDaAmplitude WORD wAdClock WORD wAdNumber WORD wAdConfig float fAdBufT float fLowAlarm float fHighAlarm EXPORTS WORD CALLBACK P1202 M FUN 2 WORD wDaNumber WORD wDaWave WORD wDaBuf WORD wAdClock WORD wAdNumber WORD wAdConfig WORD wAdBuf EXPORTS WORD CALLBACK P1202 M FUN 3 WORD wDaFreguency WORD wDaWave float fDaAmplitude WORD wAdClock WORD wAdNumber WORD wChannelStatus WORD wAdConfig float fAdBuf float fLowAlarm float fHighAlarm EXPORTS WORD CALLBACK P1202 M FUN 4 WORD wType WORD wDaFrequency WORD wDaWave float fDaAmplitude WORD wAdClock WORD wAdNumber WORD wChannelStatus WORD wAdConfig float fAdBuf float fLowAlarm float fHighAlarm EXPORTS WORD CALLBACK P1202 Di WORD
29. ock AD sampling clock 8000000 wAdClock samples sec wAdNumber Number of AD data to be read wAdChannel 1 scan O no scan wAdConfig configuration code fAdBuf the starting address of fAdBuf which store the A D data fLowAlarm low alarm limit if fAdBuf fLowAlarm gt LowAlarm fHighAlarm high alarm limit if fAdBuf fHighAlarm gt HighAlarm e Return Value NoError OK DriverHandleError Invalidate VxD SYS handle DriverCallError VxD SYS function call error ExceedBoardNumber invalidate board number FindBoardError no PCI 1800 1802 board AdControllerError embedded controller handshake error M FunExecError M Functions return code error ConfigCodeError wAdConfig configuration code error HighAlarm fAdBuf gt fHighAlarm LowAlarm fAdBuf fLowAlarm e Demo Program DEMO9 C NAPPCI win amp NAPPCI wnt User Manual Version 2 0 32 2 5 The DIO Functions 2 5 1 P1202 Di Description This subroutine will read the 16 bits data from DI port This function will refer to the current active PCI 1202 Use the P1202 ActiveBoard to select the active board Syntax WORD P1202 Di WORD wDi Input Parameter wDi address of wDi which store the 16 bits DI data Return Value NoError OK FindBoardError cannot find the PCI 1800 1802 board ExceedBoardNumber invalidate board number Demo Program DEMO1 C 2 5 2 P1202 Do Description lt This subroutine will send
30. ode listing as follows P1202 SetChannelConfig P1202 AdsPolling P1202 AdsPacer The functions of MagicScan mode listing as follows P1202 ClearScan P1202 StartScan P1202 AddToScan P1202 SaveScan P1202 ReadMagicScanResult The functions of M functions listing as follows 1 P1202 M FUN I 2 P1202 M FUN 2 3 P1202 M FUN 3 NAPPCI win amp NAPPCI wnt User Manual Version 2 0 22 The functions of continuous capture with storing data to main memory listing as follows two board operating simultaneously 1 P180X FunA Start 2 P180X FunA ReadStatus 3 P180X FunA Stop 4 P180X FunA Get The functions of continuous capture with storing data to main memory listing as follows single board operating P180X FunB Start P180X FunB ReadStatus P180X FunB Stop P180X FunB Get The functions of continuous capture are given as following P180X CardO StartScan P180X CardO ReadStatus P180X CardO StopScan Group 0 for card 0 continuous capture function P180X Cardl StartScan P180X Cardl ReadStatus Group 1 for card 1 continuous capture function P180X Cardl StopScan NAPPCI win amp NAPPCI wnt User Manual Version 2 0 23 2 4 The Configuration Code Table PCI 1200L 1202L Configuration Code Table Bipolar Unipolar Input Signal Range Settling Time Configuration Code Bipolar w 5V h Bu pxo0 Bie 25V eba Bipolar e 0 6950 Rope pe a 10v os pue
31. onversion operation will be interrupted by system OS It is recommended to use PI 202 AdsP acer if the input wave form reconstruction is needed This function will refer to the current active PCI 1202 board Use the P1202 ActiveBoard to select the active board Syntax WORD P1202 AdsPacer float fAdVal WORD wNum WORD wSample Input Parameter fAdVal starting address of AD data buffer these data will be automatically computed based on the setting of P1202 SetChannelConfig wNum number of AD conversions will be performed wSample AD sampling rate 8M wSample wSample 24 gt sampling rate 8M 24 333K gt maximum wSample 80 gt sampling rate 8M 80 100K Return Value NoError OK ExceedBoardNumber invalidate board number FindBoardError cannot find the PCI 1202 board AdPollingTimeOut hardware timeout error Demo Program DEMO1 C P1202 SetChannelConfig P1202 AdPolling P1202 AdsPollng lt m Fix channel AD conversion mode P1202 AdsPacer NAPPCI win amp NAPPCI wnt User Manual Version 2 0 37 2 8 The MagicScan Functions 2 8 1 P1202 ClearScan Description This subroutine will initialize the MagicScan controller to the Initial state This function will refer to the current active PCI 1202 board Use the P1202 ActiveBoard to select the active board Syntax WORD P1202 ClearScan Input Parameter void Return Value NoError OK ExceedBoardNumber invalidate b
32. or wDelay 0 wDelay lt wDelayMs wDelay wRetVal P1202_DelayUs 1000 return wRetVal NAPPCI win amp NAPPCI wnt User Manual Version 2 0 51 3 Demo Program There demol demo2 demo3 demo4 demo5 demo6 demo7 demo8 demo9 are about 20 demo program given as following one board D I O test D A test A D polling amp pacer trigger test general test two board same as demol one board all 32 channels of A D by software trigger by polling two board same as demo3 one board M function 1 demo two board same as demo5 one board M function 2 demo two board same as demo7 one board M function 3 demo demol0 two board same as demo9 demol 1 one board MagicScan demo demo12 two board same as demol1 demo13 one board continuous capture demo demo14 two board continuous capture demo Windows 95 NT only demol5 all installed board D I O test for board number identification demol6 one board performance evaluation demo demo17 one board MagicScan demo scan sequence 4935 demo18 one board MagicScan demo scan 32 channel show channel 0 1 15 16 17 demol9 one board A D calibration Refer to the company floppy disk for details NAPPCI win k NAPPCI wnt User Manual Version 2 0 52
33. or NAPPCI SYS of Windows NT Syntax WORD P1202 GetDriverVersion Q WORD wDriverVersion Input Parameter wDriverVersion address of wDriverVersion wDriverVersion 0x200 gt Version 2 0 Return Value NoError OK DriverHandleError the NAPPCI VxD open error for Windows 95 the NAPPCI SYS open error for Windows NT DriverCallError call NAPPCI VxD return error call NAPPCI SYS return error Demo Program DEMO1 C NAPPCI win amp NAPPCI wnt User Manual Version 2 0 29 2 4 TheM Functions 2 41 P1202 M FUN 1 e Description The P1202 M FUN 1 will compute the wave form image automatically Refer to PCI 1800 1802 Hardware Manual chapter 5 for details input AD channel 0 output DA channel 0 Syntax WORD P1202 M FUN I WORD wDaFreguency WORD wDaWave float fDaAmplitude WORD wAdClock WORD wAdNumber WORD wAdConfig float fAdBuf float fLowAlarm float fHighAlarm e Input Parameter wDaFrequency DA output frequency 1 8M wDaFrequency pentium 120 wDaWave Number of DA wave form to be output fDaAmplitude Amplitude of DA output NOTE the hardware J1 must select 10V wAdClock AD sampling clock 8000000 wAdClock samples sec wAdNumber Number of AD data to be read wAdConfig A D input range configuration code fAdBuf the starting address of fAdBuf which store the A D data fLowAlarm low alarm limit if fAdBuf fLowAlarm gt LowAlarm fHighAlarm high alarm limit if fAdBuf fH
34. r installing the A626 DLL will be copied into C WINNT S YSTEM32 and the NAPWNT SYS into C WINNT S YSTEM32 DRIVERS C After installed the sub directoried tree as fillows Base Directory the directory you selected to setup l Demos FY Visual Basic lt demo code of Visual Basic A A626 lt VB demo code for A626 Lprojectl prj VB project file A628 VB demo code for A628 Lprojectl prj VB project file IA Visual C lt demo code of Visual C lMemol c lt demo source code A626 0 to SV testing lMemol mak lt make file Imkdemol bat lt batch file lMemo2 c demo source code A626 5V to 5V testing lMemo2 mak make file NAPPCI win k NAPPCI wnt User Manual Version 2 0 4 mkdemo2 bat lt batch file lMemo3 c demo source code A628 0 to SV testing lMemo3 mak lt make file mkdemo3 bat lt batch file lMemo4 c demo source code A628 5V to SV testing lMemo4 mak make file mkdemo4 bat lt batch file Driver lt some device driver 1 a626 dil lt dynamic linking library for A626 A628 board 1a626 lib lt import library for dio dll a626 h include file napwnt sys lt kernel mode device driver napwnt ini lt setting information file regini exe lt registry program Manual a6268 soft doc lt the software manual a6
35. rdO Stop Description This subroutine will stop the continuous capture function Syntax void P1202 CardO Stop void Input Parameter void Return Value void Demo Program DEMO13 C NAPPCI win amp NAPPCI wnt User Manual Version 2 0 46 2 10 4 P1202 Card1 StartScan Description This subroutine will start the continuous capture function Refer to PCI 1800 1802 Hardware User Manual chapter 6 for details Syntax WORD P1202 Cardl StartScan WORD wSampleRate WORD wChannelStatus WORD wChanelConfig WORD wCount Input Parameter wSampleRate AD sampling rate 8M wSampleRate wSampleRate 24 gt sampling rate 8M 24 333K gt maximum wSampleRate 80 gt sampling rate 8M 80 100K wChannelStatus 02no scan 1 scan for each channel wChannelConfig configuration code for each channel wCount number of A D data for each scan channel Return Value NoError OK FindBoardError cannot find the PCI 1800 1802 board AdControllerError MagicScan controller hardware handshake error Demo Program DEMO14 C NAPPCI win amp NAPPCI wnt User Manual Version 2 0 49 2 10 5 P1202 Card ReadStatus Description This subroutine will read the data of continuous capture function Syntax P1202 _Card0_ReadStatus WORD wBuf WORD wBuf2 DWORD dwP1 DWORD dwP2 WORD wStatus Input Parameter wBuf in scan sequence order 012 N012 N 012 N wBuf2 in channel sequence ord
36. roduct P1202 dll nappci vxd for PCI 1800 PCI 1802 card p1602 dll nappci vxd for PCI 1602 card p1202 dll nappci vxd for PCI 1202 card e e 51002 dll nappci vxd for PCI 1002 card e e p16r16 dll nappci vxd for PCI P16R16 PCI P8R8 card Lo 4 4 4 4 d pcid144 dll nappci vxd for PCI 144 card The NAPPCI wnt consists of these DLLs and device driver that supports the following product P1202 dll napwnt sys for PCI 1800 PCT 1802 card p1602 dll napwnt sys for PCI 1602 card p1202 dll napwnt sys for PCI 1202 card for PCI 1002 card for PCI P16R16 PCI P8R8 card pl r16 dll napwnt sys e e 51002 dll napwnt sys e e pcid144 dll napwnt sys for PCI 144 card These DLLs can perform a variety of data acquisition operations as follows Get software version Initialization Digital Input Output A D conversion D A conversion NAPPCI win amp NAPPCI wnt User Manual Version 2 0 3 1 1 Software Installation A The Disk Contents I README TXT This file LA SETUP sub directory l Setup exe the Setup program B Installation Steps step 1 Insert A626 628 for NT disk into floppy drive either A or B step 2 clicking Start Run in the task Bar step 3 enter the path as A SETUP SETUP EXE if floopy drive is A B SETUP SETUP EXE if floopy drive is B step 4 Following those instructions in installation process to complete it Afte
37. s hwnd CreateWindow szAppName P1202 Demol Program WS OVERLAPPEDWINDOW CW USEDEFAULT CW USEDEFAULT CW USEDEFAULT CW USEDEFAULT NULL NULL hInstance NULL ShowWindow hwnd SW SHOWMAXIMIZED UpdateWindow hwnd while GetMessage amp msg NULL 0 0 TranslateMessage amp msg DispatchMessage amp msg return msg wParam ESULT CALLBACK WndProc HWND hwnd UINT iMsg WPARAM wParam LPARAM lParam static int cxChar cyChar cxClient cyClient cxBuffer cyBuffer xCaret yCaret static char cBuf 80 HDC hdc TEXTMETRIC tm PAINTSTRUCT ps int AE switch iMsg case case case case WM_CREATE window initial 7 KK KK A A Ck oko oko oko oko NA NOTICE call P1202 DriverInit to initialize the driver KK ok ok oko oko oko oko oko oko ok o ok oko oko oko NA Initial the device driver and return the board number in the PC wInitialCode P1202 DriverInit swTotalBoard if wInitialCode NoError essageBox hwnd No P1202 card in this system P1202 Card Error MB OK hdc GetDC hwnd SelectObject hdc GetStockObject SYSTEM FIXED FONT GetTextMetrics hdc amp tm cxChar tm tmAveCharWidth cyChar tm tmHeight ReleaseDC hwnd hdc return 0 WM SIZE cxClient LOWORD lParam window size in pixels cyClient HIWORD lP
38. s 4 VD Ea Winsock Ga WinTrust En HKEY_USERS H E HKEY_CURRENT_CONFIG 2 HKEY_DYN_DATA Fig 7 The detail value of registration items NAPPCI win amp NAPPCI wnt User Manual Version 2 0 10 1 3 C Call NAPPCI All the demo program given in the companion floppy disk are designed with C language It is testing under Windows 95 NT and Visual C 4 0 compiler The key points are given as below l 2 Dy oe a Make sure the PATH include the Visual C compiler Execute the MSDEV BIN VCVARS32 BAT to setup the environment The VCVARS32 BAT is provided by Visual C The source program must include P1202 H Copy the P1202 LIB import library to the directory where same as source program Copy the P1202 DLL to the directory where same as source program Edit the source program refer to NAPPCINWin VC Demo DEMO1 C refer to NAPPCNWnt VC Demo DEMO1 C Edit the NMAKE file refer to NAPPCI Win VC Demo DEMO1 MAK refer to NAPPCI Wnt VC Demo DEMO1 MAK 8 NMAKE f DEMOI MAK 9 Execute DEMOI EXE NOTE 1 4 The P1202 lib is used in linking time and the P1202 DLL is used in run time MFC Call NAPPCI The usage of NAPPCI for MFC user is very similar to that for C user It tests OK under Windows 95 NT and Visual C 4 0 The key points are given as below SA om I E NOTE Use MFC wizard to create source code The source program must include P1202 H Copy the P1202 LIB import library
39. v DWORD dwN1 DWORD dwN2 SHORT nPriority EXPORTS WORD CALLBACK P1202_StartScanPreTrgVerC WORD wSampleRateDiv DWORD dwNum SHORT nPriority EXPORTS WORD CALLBACK P1202_StartScanMiddleTrgVerC WORD wSampleRateDiv DWORD dwN 1 DWORD dwN2 SHORT nPriority NAPPCI win amp NAPPCI wnt User Manual Version 2 0 27 2 3 The Testing Functions 2 3 1 P1202 FloatSub2 e Description Compute C A B in float format float 4 bytes floating point number This function is provided to test DLL linkage e Syntax float P1202 FloatSub2 float fA float fB e Input Parameter fA 4 bytes floating point value fB 4 bytes floating point value e Return Value return fA fB e Demo Program DEMOI C 2 3 2 P1202 ShortSub2 e Description Compute C A B in SHORT format SHORT 16 bits signed number This function is provided to test DLL linkage Syntax short P1202_ShortSub2 Short nA Short nB Input Parameter nA 16 bits value nB 16 bits value Return Value retum nA nB Demo Program DEMO1 C NAPPCI win amp NAPPCI wnt User Manual Version 2 0 28 2 3 3 P1202 GetDllVersion Description Read the DLL version number of the P1202 DLL Syntax WORD P1202 GetDllVersion void Input Parameter void Return Value return 0x200 gt Version 2 0 Demo Program DEMO1 C 2 3 4 P1202 GetDriverVersion Description This subroutine will read the software version number of NAPPCI VxD of Windows 95
40. ve board Syntax lt void P1202 AddToScan QWORD wAdChannel WORD wConfig WORD wAverage WORD wLowAlarm WORD wHighAlarm WORD wAlarmType Input Parameter wAdChannel AD channel number wConfig the configuration code wAverage the factor of digital average filter wLowAlarm 12 bits low alarm data wHighAlarm 12 bits high alarm data wAlarmType Ozno alarm 1 high alarm 2 low alarm 3 in alarm 4 out alarm Return Value void NoError Ok ExceedBoardNumber invalidate board number FindBoardError cannot find the PCI 1800 1802 board AdChannelError invalidate AD channel AlarmTypeError only 0 1 2 3 4 are validate AdControllerError MagicScan controller hardware handshake error e Demo Program DEMO11 C NAPPCI win k NAPPCI wnt User Manual Version 2 0 41 2 8 5 P1202 SaveScan Description This subroutine will specify the starting address of AD data buffer for MagicScan Syntax void P1202 SaveScan WORD wAdChannel WORD wBuf Input Parameter wAdChannel Scan number in the scan queue Note not the A D channel number wBuf starting address of AD data buffer for channel specified in wAdChannel Return Value NoError Ok ExceedBoardNumber invalidate board number FindBoardError cannot find the PCI 1800 1802 board AdChannelError invalidate AD channel Demo Program DEMO11 C NAPPCI win amp NAPPCI wnt User Manual Version 2 0 42 2 8 6 P1202 WaitMagicScanFinis
Download Pdf Manuals
Related Search
Related Contents
informations pour des discussions entre parents et enfants O885 Manual EN SW101+ Terminal User Manual DC1-0096A Service Manual Copyright © All rights reserved.
Failed to retrieve file