Page 1
User’ s Guide Shop online at www.omega.com e-mail: info@omega.com OME-PCI-1602 PCI Data Acquisition Board Windows Software Manual...
Page 2
Toll Free in United Kingdom: 0800-488-488 e-mail: sales@omega.co.uk It is the policy of OMEGA to comply with all worldwide safety and EMC/EMI regulations that apply. OMEGA is constantly pursuing certification of its products to the European New Approach Directives. OMEGA will add the CE mark to every appropriate device upon certification.
Introduction The driver is a collection of DLLs for Windows 95/98/NT/2000/XP applications. These DLLs are standard Win32 DLLs (32 bits) and can be called from Visual C/C++, BC++, Visual BASIC, Delphi, BCB and LabVIEW. These DLLs can perform a variety of data acquisition operations including: Get software version Initialization Digital Input/Output...
Software Installation Insert the CD ROM included with your OME-PCI-1602 board and the following installation screen should auto-start. Follow the instructions on the screen to complete the software installation. The software is designed to support the entire OME family of data acquisition hardware, so during the installation, you will be asked to specify your particular hardware (OME- PCI-1602 board in this case).
Demo Folder Contains all demonstration programs including their source codes. Examples are provided for Visual C++, Borland C++, Visual Basic and Delphi. Please note: The VC++ demos are developed with VC++ 4.0. After setting up the environment, use NMAKE.EXE to compiling and link the demo code. For example, C:\P1602\DEMO\VC\nmake /f demo1.mak Driver Folder Contains software drivers, include files and definition files for the programming...
Page 9
EXPORTS float CALLBACK P1602_FloatSub2(float fA, float fB); EXPORTS short CALLBACK P1602_ShortSub2(short nA, short nB); EXPORTS WORD CALLBACK P1602_GetDllVersion(void); EXPORTS WORD CALLBACK P1602_DriverInit(WORD *wTotalBoards); EXPORTS void CALLBACK P1602_DriverClose(void); EXPORTS WORD CALLBACK P1602_GetDriverVersion(WORD *wVxdVersion); EXPORTS WORD CALLBACK P1602_GetConfigAddressSpace(WORD wBoardNo, WORD *wAddrTimer,WORD *wAddrCtrl, WORD *wAddrDio, WORD *wAddrAdda);...
Page 10
WORD wConfig); EXPORTS WORD CALLBACK P1602_AdPolling(float *fAdVal); EXPORTS WORD CALLBACK P1602_AdsPolling(float fAdVal[], WORD wNum); EXPORTS WORD CALLBACK P1602_AdsPacer(float fAdVal[], WORD wNum, WORD wSample); EXPORTS WORD CALLBACK P1602_ClearScan(void); EXPORTS WORD CALLBACK P1602_StartScan(WORD wSampleRateDiv, DWORD dwNum, SHORT nPriority); EXPORTS void CALLBACK P1602_ReadScanStatus(WORD *wStatus, DWORD *dwLowAlarm, DWORD *dwHighAlarm);...
Page 11
DWORD dwMaxCount1, SHORT nPriority); EXPORTS WORD CALLBACK P1602_FunA_ReadStatus(void); EXPORTS WORD CALLBACK P1602_FunA_Stop(void); EXPORTS WORD CALLBACK P1602_FunA_Get(DWORD *P0, DWORD *P1); EXPORTS WORD CALLBACK P1602_FunB_Start(WORD wClock0Div, WORD wChannel0[], WORD wConfig0[], WORD *Buffer0, DWORD dwMaxCount0, SHORT nPriority); EXPORTS WORD CALLBACK P1602_FunB_ReadStatus(void); EXPORTS WORD CALLBACK P1602_FunB_Stop(void); EXPORTS WORD CALLBACK P1602_FunB_Get(DWORD *P0);...
2.2 The P1602.BAS Attribute VB_Name = "P1602" Option Explicit Global Const NoError Global Const DriverHandleError Global Const DriverCallError Global Const AdControllerError Global Const M_FunExecError Global Const ConfigCodeError Global Const FrequencyComputeError = 6 Global Const HighAlarm Global Const LowAlarm Global Const AdPollingTimeOut Global Const AlarmTypeError = 10 Global Const FindBoardError...
Page 13
Declare Function P1602_DriverInit Lib "P1602.dll" (wTotalBoards As Integer) As Integer Declare Sub P1602_DriverClose Lib "P1602.dll" () Declare Function P1602_GetDriverVersion Lib "P1602.dll" (wVxdVersion As Integer) As Integer Declare Function P1602_GetConfigAddressSpace Lib "P1602.dll" (ByVal wBoardNo As Integer, wAddrTimer As Integer, wAddrCtrl As Integer, wAddrDio As Integer, wAddrAdda As Integer) As Integer Declare Function P1602_ActiveBoard Lib "P1602.dll"...
Page 14
wNum As Integer) As Integer Declare Function P1602_AdsPacer Lib "P1602.dll" (fAdVal As Single, ByVal wNum As Integer, ByVal wSample As Integer) As Integer Declare Function P1602_ClearScan Lib "P1602.dll" () As Integer Declare Function P1602_StartScan Lib "P1602.dll" (ByVal wSampleRate As Integer, ByVal dwNum As Long, ByVal nPriority As Integer) As Integer Declare Sub P1602_ReadScanStatus Lib "P1602.dll"...
Page 15
Global Buf(10000) As Integer Global Buf1(10000) As Integer Global Buf2(10000) As Integer Global Card0Buf0(10000) As Integer Global Card0Buf1(10000) As Integer Global Card1Buf0(10000) As Integer Global Card1Buf1(10000) As Integer Global AdNumber As Integer Global CR Global LF...
Page 17
AllocateMemoryError = 25; // Function of Test function P1602_FloatSub2(fA:Single; fB:Single):Single ; stdCall; function P1602_ShortSub2(nA:SmallInt; nB:SmallInt):SmallInt ; stdCall; function P1602_GetDllVersion:WORD ; stdCall; // Function of Driver function P1602_DriverInit(Var wTotalBoards:Word):WORD ; stdCall; procedure P1602_DriverClose; stdCall; function P1602_GetDriverVersion(var wDriverVersion:Word):WORD ; stdCall; function P1602_GetConfigAddressSpace(wBoardNo:Word;var wAddrTimer:Word; var wAddrCtrl:Word;...
Page 18
function P1602_Do(wOutData:Word):Word; stdCall; function P1602_Di(var wDiData:Word):WORD ; stdCall; // Function of AD/DA function P1602_Da(wDaChannel:Word; wDaVal:Word):WORD ; stdCall; function P1602_SetChannelConfig(wAdChannel:Word; wConfig:Word):WORD ; stdCall; function P1602_AdPolling(var fAdVal:Single):WORD ; stdCall; function P1602_AdsPolling(fAdVal:PSingle; wNum:Word):WORD ; stdCall; function P1602_AdsPacer(fAdVal:PSingle; wNum:Word; wSamplingDiv:Word ):WORD ; stdCall; //******************* function P1602_ClearScan:WORD ;...
Page 19
function P1602_Card1_StartScan(wSampleRate:WORD; wChannelStatus:PWORD; wChannelConfig:PWORD; wCount:WORD):WORD ; stdCall; function P1602_Card1_ReadStatus(wBuf:PWORD; wBuf2:PWORD; var dwP1:LongInt; var dwP2:LongInt; var wStatus:WORD):WORD ; stdCall; procedure P1602_Card1_Stop; stdCall; //******************* function P1602_FunA_Start( wClock0Div:WORD; wChannel0:PWord; wConfig0:PWord; Buffer0:PWord; dwMaxCount0:LongInt; wClock1Div:WORD; wChannel1:PWord; wConfig1:PWord; Buffer1:PWord; dwMaxCount1:LongInt; nPriority:SmallInt):WORD ; stdCall; function P1602_FunA_ReadStatus:WORD ; stdCall; function P1602_FunA_Stop:WORD ;...
Page 20
function P1602_DriverInit; external 'P1602.DLL' name 'P1602_DriverInit'; procedure P1602_DriverClose; external 'P1602.DLL' name 'P1602_DriverClose'; function P1602_GetConfigAddressSpace; external 'P1602.DLL' name 'P1602_GetConfigAddressSpace'; function P1602_ActiveBoard; external 'P1602.DLL' name 'P1602_ActiveBoard'; function P1602_WhichBoardActive; external 'P1602.DLL' name 'P1602_WhichBoardActive'; // Function of M_Fun series function P1602_M_FUN_1; external 'P1602.DLL' name 'P1602_M_FUN_1'; function P1602_M_FUN_2;...
Page 21
function P1602_DelayUs; external 'P1602.DLL' name 'P1602_DelayUs'; //******************* function P1602_Card0_StartScan; external 'P1602.DLL' name 'P1602_Card0_StartScan'; function P1602_Card0_ReadStatus; external 'P1602.DLL' name 'P1602_Card0_ReadStatus'; procedure P1602_Card0_Stop; external 'P1602.DLL' name 'P1602_Card0_Stop'; function P1602_Card1_StartScan; external 'P1602.DLL' name 'P1602_Card1_StartScan'; function P1602_Card1_ReadStatus; external 'P1602.DLL' name 'P1602_Card1_ReadStatus'; procedure P1602_Card1_Stop; external 'P1602.DLL' name 'P1602_Card1_Stop'; //******************* function P1602_FunA_Start;...
LabVIEW Call DLLs LabVIEW is an industrial graphical programming system developed by National Instruments. With LabVIEW, the user can quickly design a user interface and application program as a block diagram. NAPPCI\Win\VIEW\P1602.Dll DLLs NAPPCI\Win\VIEW\DEMO1.VI Demo VI NAPPCI\Win\VIEW\MFUN1.VI Driver VI NOTE: 1.
Page 23
Fig 9. The connection diagram for DEMO1.VI (call MFUN1.VI) Fig 10. The connection diagram for MFUN1.VI (call DLL M_FUN_1)
Demo Program A common demo program is used for all P1602.dll examples. The demo program will accept wDaFreq and wAdClk and call the different driver functions for demonstration purposes. #include <windows.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> #include "P1602.H" /********************************************************************/ DEMO1 program for one P1602 cards in the PC system.
Page 26
ShowCaret(hwnd); return 0; case WM_KILLFOCUS : HideCaret(hwnd); DestroyCaret(); return 0; case WM_CHAR : // user press KEYBOARD for (i = 0 ; i < (int) LOWORD(lParam) ; i++) switch (wParam) case '\b' : // backspace pressed if (xCaret > 0) xCaret-- ;...
Page 27
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, &ps); return 0; case WM_DESTROY : /**************************************************************/ /* NOTICE: call P1602_DriverClose() to close the driver. /**************************************************************/ P1602_DriverClose(); // close the driver PostQuitMessage(0); return 0 ; return DefWindowProc(hwnd, iMsg, wParam, lParam); /* ------------------------------------------------------------------- - */ /* [0][1][2][3][4]=wII, [6][7][8][9]=dwAdClk...
Page 28
fix format The READ_COM only accepts command. The command format is given as below: space key Enter key wDaFreq wAdClk Enter key accept current setting of wDaFreq and wAdClk The steps to compile and link the demo program are described in Sec. 1.3. All demo programs share similar setup code as above.
Description of Functions The DLL functions are divided the following groups: 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 A/D batch capture functions The Plug &...
Page 30
• The multiboard batch capture functions are as follows: 1. P1602_FunA_Start 2. P1602_FunA_ReadStatus 3. P1602_FunA_Stop 4. P1602_FunA_Get • The single board batch capture functions are as follows: 1. P1602_FunB_Start 2. P1602_FunB_ReadStatus 3. P1602_FunB_Stop 4. P1602_FunB_Get • The continuous capture functions are as following: 1.
The Configuration Code Table OME-PCI-1602 Configuration Code Table Bipolar/Unipolar Input Signal Range Gain Settling Time Configuration Code Bipolar +/- 10V 10 us Bipolar +/- 5V 10 us Bipolar +/- 2.5V 10 us Bipolar +/- 1.25V 10 us OME-PCI-1602F Configuration Code Table...
The Test Functions 3.2.1 P1602_FloatSub2 Description: Calculates C=A-B in float format, float=4 bytes floating point number. This function is provided to test DLL linkage. • Syntax: float P1602_FloatSub2(float fA, float fB); Input Parameter : fA : 4 bytes floating point value fB : 4 bytes floating point value Return Value : return=fA-fB...
3.2.3 P1602_GetDllVersion Description : Reads the version of the P1602.DLL. Syntax : WORD P1602_GetDllVersion(void); Input Parameter : void Return Value : return=0x200 Version 2.0 Demo Program : DEMO1.C 3.2.4 P1602_GetDriverVersion Description : This function will read the software version number of Nappci.VxD for Windows 95/98 or Napwnt.SYS for Windows NT.
The M_Functions 3.3.1 P1602_M_FUN_1 Description : The P1602_M_FUN_1 will calculate the waveform image automatically. (Refer to the “OME-PCI-1602 Hardware Manual” chapter-5 for details) (input=A/D channel_0, output=D/A channel_0) • Syntax : WORD P1602_M_FUN_1(WORD wDaFrequency, WORD wDaWave, float fDaAmplitude, WORD wAdClock, WORD wAdNumber, WORD wAdConfig,...
3.3.2 P1602_M_FUN_2 Description : The P1602_M_FUN_2 will compute the waveform image automatically. (Refer to “OME-PCI-1602 Hardware Manual” chapter-5 for details) (input=A/D channel_0, output=D/A channel_0) • Syntax : WORD P1602_M_FUN_2(WORD wDaNumber, WORD wDaWave, WORD wDaBuf[], WORD wAdClock, WORD wAdNumber, WORD wAdConfig, WORD wAdBuf[]);...
The P1602_M_FUN_3 will calculate the waveform image automatically. (Refer to “OME-PCI-1602 Hardware Manual” chapter-5 for details) (input=programable channels, output=D/A channel_0) This function will refer to the current active OME-PCI-1602 board. Use the P1602_ActiveBoard(….) to select the active board. Refer to Sec. 2.4.2 for more information.
3.4.2 P1602_Do Description : This function will write the 16 bit data to the digital output(D/O) port. This function will refer to the current active OME-PCI-1602 board. Use the P1602_ActiveBoard(….) to select the active board. Syntax : WORD P1602_Do(WORD wDo);...
3.5.1 P1602_Da Description: This function will write the 12 bit data to D/A port. This function will refer to the current active OME-PCI-1602 board. Use the P1602_ActiveBoard(….) to select the active board. Syntax : WORD P1602_Da(WORD wChannel, WORD wDaVal); Input Parameter : wChannel : 0 for channel_0 D/A, 1 for channel_1 D/A wDaVal : 12 bit data sent to D/A port.
This function will set the A/D channel’s configuration code. This function will set the active A/D channel for P1602_AdPolling, P1602_AdsPolling and P1602_AdsPacer functions. This function will refer to the current active OME-PCI-1602 board. Use the P1602_ActiveBoard(….) to select the active board.
P1602_SetChannelConfig function can be used to change the channel or configuration code used by the P1602_AdsPolling function. This function will refer to the current active OME-PCI-1602 board. Use the P1602_ActiveBoard(….) to select the active board. Syntax : WORD P1602_AdsPolling(float fAdVal[], WORD wNum);...
The MagicScan Functions 3.7.1 P1602_ClearScan Description : This function will initialize the MagicScan controller. This function will refer to the current active OME-PCI-1602 board. Use the P1602_ActiveBoard(….) to select the active board. Syntax : WORD P1602_ClearScan(); Input Parameter : void...
MagicScan operation finishes. The user can use the P1602_WaitMagicScanFinish(…) function or the P1602_ReadScanStatus(…) function to check the state of MagicScan operation. This function will refer to the current active OME-PCI-1602 board. Use the P1602_ActiveBoard(….) to select the active board. Syntax : WORD P1602_StartScan(WORD wSampleRate, WORD wNum);...
3.7.3 P1602_ReadScanStatus Description : This function will read the status of the MagicScan operation. This function will refer to the current active OME-PCI-1602 board. Use the P1602_ActiveBoard(….) to select the active board. Syntax : void P1602_ReadScanStatus(WORD *wStatus, WORD *wLowAlarm, WORD *wHighAlarm);...
P1602_AddToScan Description : This function will add one channel to the MagicScan circular queue. This function will refer to the current active OME-PCI-1602 board. Use the P1602_ActiveBoard(….) function to select the active board. Syntax : word P1602_AddToScan(WORD wAdChannel, WORD wConfig, WORD wAverage, WORD wLowAlarm, WORD wHighAlarm, WORD wAlarmType);...
: starting address of the A/D data buffer for the channel specified in wAdChannel Return Value NoError : Ok ExceedBoardNumber: invalid board number FindBoardError : cannot find the OME-PCI-1602 board AdChannelError : invalid A/D channel Demo Program : .DEMO11.C •...
3.7.6 P1602_WaitMagicScanFinish Description : This function will delay until the MagicScan operation is finished. This function will refer to the current active OME-PCI-1602 board. Use the P1602_ActiveBoard(….) to select the active board. Syntax : void P1602_WaitMagicScanFinish(WORD *wStatus, WORD *wLowAlarm, WORD *wHighAlarm);...
The Pulg&Play Functions 3.8.1 P1602_DriverInit Description: This function will detect all of the OME-PCI-1602 boards installed in the system. This function must be called once before any other function is called. Syntax : WORD P1602_DriverInit(WORD *wTotalBoard); Input Parameter : *wTotalBoard: address of wTotalBoard...
3.8.3 P1602_GetConfigAddressSpace Description: Gets the I/O address of OME-PCI-1602 board n. This function is for debugging purposes only. It is not necessary to call this function. Syntax : WORD P1602_GetConfigAddressSpace(WORD wBoardNo, WORD *wAddrTimer,WORD *wAddrCtrl, WORD *wAddrDio, WORD *wAddrAdda); Input Parameter : wBoardNo: OME-PCI-1602 board number wAddrTimer, wAddrCtrl, wAddrDio, wAddrAdda: refer to the “OME-PCI-1602...
3.8.5 P1602_ActiveBoard Description: This function will make active one of the OME-PCI-1602 boards installed in the system. This function must call once before the D/I/O, A/D, D/A functions are called. Syntax: WORD P1602_ActiveBoard(WORD wBoardNo); Input Parameter: wBoardNo: board number Return Value :...
3.9 Multiboard Batch Capture (Two boards operating simultaneously) 3.9.1 P1602_FunA_Start Description: This function will start the batch capture process for two boards operating simultaneously. Syntax : WORD P1602_FunA_Start(WORD wClockDiv0, WORD wChannel0[], WORD wConfig0[], WORD *Buffer0, DWORD dwMaxCount0, WORD wClockDiv1, WORD wChannel1[], WORD wConfig1[], WORD *Buffer1, DWORD dwMaxCount1 Short nPriority);...
Page 53
A/D thread priority. The value of nPriority range from: THREAD_PRIORITY_LOWEST THREAD_PRIORITY_BELOW_NORMAL THREAD_PRIORITY_NORMAL THREAD_PRIORITY_ABOVE_NORMAL THREAD_PRIORITY_HIGHEST Other: THREAD_PRIORITY_NORMAL Return Value : NoError : OK FindTwoBoardError : cannot find out two OME-PCI-1602 boards Demo Program : DEMO20.C...
3.9.2 P1602_FunA_ReadStatus Description : This function will read the status of the batch capture process. Syntax : WORD P1602_FunA_ReadStatus( void ); Input Parameter : void; Return Value : 0: data is ready 1: data not ready Demo Program : DEMO20.C...
3.9.3 P1602_FunA_Stop Description: This function will stop the batch capture function. Syntax: word P1602_FunA_Stop(void); Input Parameter: void Return Value : NoError : OK StopError : Stop Error Demo Program : DEMO20.C 3.9.4 P1602_FunA_Get Description: This function will retrieve the number A/D samples acquired. Syntax: word P1602_FunA_Get(DWORD *P0, DWORD *P1);...
3.10.2 P1602_FunB_ReadStatus Description : This function provides the status of the batch capture. Syntax : WORD P1602_FunB_ReadStatus( void ); Input Parameter : void; Return Value : 0: data is ready 1: data not ready Demo Program : DEMO21.C...
3.10.3 P1602_FunB_Stop Description: This function will stop the batch capture function. Syntax: word P1602_FunB_Stop(void); Input Parameter: void Return Value : NoError : OK StopError : Stop Error Demo Program : DEMO21.C 3.10.4 P1602_FunB_Get Description: This function will retrieve the number of A/D samples that have been acquired.
0. The continuous capture functions are best suited for low speed, long duration collection. Although computer dependent, sample rates should generally be kept under 40kHz. Refer to the OME-PCI-1602 Hardware User Manual, for additional details on this function. Syntax : WORD P1602_Card0_StartScan(WORD wSampleRate, WORD wChannelStatus[], WORD wChanelConfig[], WORD wCount);...
3.10.6 P1602_Card0_ReadStatus Description : This function will read the data collected by the continuous capture function. Syntax : P1602_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….) dwP1: reserved dwP2: reserved wStatus: 1=thread start, 2=TimeOut, 8=FIFO overflow, 0x80=thread finish...
1. The continuous capture functions are best suited for low speed, long duration collection. Although computer dependent, sample rates should generally be kept under 40kHz. Refer to the OME-PCI-1602 Hardware User Manual, for additional details on this function. Syntax : WORD P1602_Card1_StartScan(WORD wSampleRate, WORD wChannelStatus[], WORD wChanelConfig[], WORD wCount);...
3.10.9 P1602_Card1_ReadStatus Description: This function will read the data collected by the continuous capture function. Syntax: P1602_Card1_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….) dwP1: reserved dwP2: reserved wStatus: 1=thread start, 2=TimeOut, 8=FIFO overflow, 0x80=thread finish Return Value:...
This is a machine independent timer This function can be used to create the settling time delay or used as a general purpose machine independent timer. This function will refer to the current active OME-PCI-1602 board. Use the P1602_ActiveBoard(….) to select the active board. Syntax: word P1602_DelayUs(WORD wDelayUs);...
Demo Programs The following demonstration programs are provided on the included CD: demo1: one board, D/I/O test, D/A test, A/D polling & pacer trigger test, general test demo2: two boards, same as demo1 demo3: one board, all 32 channels of A/D by software trigger(by polling) demo4: two boards, same as demo3 demo5: one board, M_function_1 demo demo6: two boards, same as demo5...
Page 65
Department will issue an Authorized Return (AR) number immediately upon phone or written request. Upon examination by OMEGA, if the unit is found to be defective, it will be repaired or replaced at no charge. OMEGA’s WARRANTY does not apply to defects resulting from any action of the purchaser, includ- ing but not limited to mishandling, improper interfacing, operation outside of design limits, improper repair, or unauthorized modification.
Page 66
Where Do I Find Everything I Need for Process Measurement and Control? OMEGA…Of Course! Shop online at www.omega.com TEMPERATURE Thermocouple, RTD & Thermistor Probes, Connectors, Panels & Assemblies Wire: Thermocouple, RTD & Thermistor Calibrators & Ice Point References Recorders, Controllers & Process Monitors...