Omega Products OME-PCI-1602 Installation Manual

www.omega.com
e-mail: info@omega.com
User’s Guide
OME-PCI-1602
PCI Data Acquisition Board Windows Software Manual
Shop online at
USA: One Omega Drive, P.O. Box 4047
ISO 9001 Certified Stamford CT 06907-0047
TEL: (203) 359-1660 FAX: (203) 359-7700 e-mail: info@omega.com
Canada: 976 Bergar
Laval (Quebec) H7L 5A1, Canada TEL: (514) 856-6928 FAX: (514) 856-6886 e-mail: info@omega.ca
For immediate technical or application assistance:
USA and Canada: Sales Service: 1-800-826-6342 / 1-800-TC-OMEGA
®
Customer Service: 1-800-622-2378 / 1-800-622-BEST
®
Engineering Service: 1-800-872-9436 / 1-800-USA-WHEN
®
TELEX: 996404 EASYLINK: 62968934 CABLE: OMEGA
Mexico: En Espan˜ol: (001) 203-359-7803 e-mail: espanol@omega.com
FAX: (001) 203-359-7807 info@omega.com.mx
Servicing Europe:
Benelux: Postbus 8034, 1180 LA Amstelveen, The Netherlands
TEL: +31 (0)20 3472121 FAX: +31 (0)20 6434643 Toll Free in Benelux: 0800 0993344 e-mail: sales@omegaeng.nl
Czech Republic: Frystatska 184, 733 01 Karviná, Czech Republic
TEL: +420 (0)59 6311899 FAX: +420 (0)59 6311114 Toll Free: 0800-1-66342 e-mail: info@omegashop.cz
France: 11, rue Jacques Cartier, 78280 Guyancourt, France
TEL: +33 (0)1 61 37 29 00 FAX: +33 (0)1 30 57 54 27 Toll Free in France: 0800 466 342 e-mail: sales@omega.fr
Germany/Austria: Daimlerstrasse 26, D-75392 Deckenpfronn, Germany
TEL: +49 (0)7056 9398-0 FAX: +49 (0)7056 9398-29 Toll Free in Germany: 0800 639 7678 e-mail: info@omega.de
United Kingdom: One Omega Drive, River Bend Technology Centre
ISO 9002 Certified Northbank, Irlam, Manchester
M44 5BD United Kingdom TEL: +44 (0)161 777 6611 FAX: +44 (0)161 777 6622 Toll Free in United Kingdom: 0800-488-488 e-mail: sales@omega.co.uk
OMEGAnet®Online Service Internet e-mail
www.omega.com info@omega.com
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.
The information contained in this document is believed to be correct, but OMEGA Engineering, Inc. accepts no liability for any errors it contains, and reserves the right to alter specifications without notice. WARNING: These products are not designed for use in, and should not be used for, patient-connected applications.
Table of Contents
1. INTRODUCTION ..........................................................................................................................5
1.1 SOFTWARE INSTALLATION ......................................................................................................6
1.2 REFERENCE: ............................................................................................................................7
2. DECLARATION FILES................................................................................................................8
2.1 THE P1602.H ...........................................................................................................................8
2.2 THE P1602.BAS....................................................................................................................12
2.3 THE P1602.PAS ....................................................................................................................16
2.4 LABVIEW CALL DLLS.........................................................................................................22
2.5 DEMO PROGRAM ...................................................................................................................24
3. DESCRIPTION OF FUNCTIONS..............................................................................................29
3.1 THE CONFIGURATION CODE TABLE ......................................................................................31
3.2 THE TEST FUNCTIONS ...........................................................................................................32
3.2.1 P1602_FloatSub2.........................................................................................................32
3.2.2 P1602_ShortSub2.........................................................................................................32
3.2.3 P1602_GetDllVersion...................................................................................................33
3.2.4 P1602_GetDriverVersion.............................................................................................33
3.3 THE M_FUNCTIONS ............................................................................................................34
3.3.1 P1602_M_FUN_1 .........................................................................................................34
3.3.2 P1602_M_FUN_2..........................................................................................................35
3.3.3 P1602_M_FUN_3 .........................................................................................................36
3.4 THE DIO FUNCTIONS ..........................................................................................................38
3.4.1 P1602_Di........................................................................................................................38
3.4.2 P1602_Do.......................................................................................................................38
3.5 THE D/A FUNCTIONS ..........................................................................................................39
3.5.1 P1602_Da.....................................................................................................................39
3.6 THE A/D FIXED-MODE FUNCTIONS.......................................................................................40
3.6.1 P1602_SetChannelConfig ............................................................................................40
3.6.2 P1602_AdPolling .........................................................................................................40
3.6.3 P1602_AdsPolling........................................................................................................41
3.6.4 P1602_AdsPacer..........................................................................................................42
3.7 THE MAGICSCAN FUNCTIONS .............................................................................................43
3.7.1 P1602_ClearScan.........................................................................................................43
3.7.2 P1602_StartScan..........................................................................................................44
3.7.3 P1602_ReadScanStatus................................................................................................45
3
3.7.4 P1602_AddToScan...........................................................................................................46
3.7.5 P1602_SaveScan ..........................................................................................................47
3.7.6 P1602_WaitMagicScanFinish ......................................................................................48
3.8 THE PULG&PLAY FUNCTIONS.............................................................................................49
3.8.1 P1602_DriverInit..........................................................................................................49
3.8.2 P1602_DriverClose......................................................................................................49
3.8.3 P1602_GetConfigAddressSpace...................................................................................50
3.8.4 P1602_WhichBoardActive............................................................................................50
3.8.5 P1602_ActiveBoard......................................................................................................51
3.9 MULTIBOARD BATCH CAPTURE ............................................................................................52
3.9.1 P1602_FunA_Start.......................................................................................................52
3.9.2 P1602_FunA_ReadStatus.............................................................................................54
3.9.3 P1602_FunA_Stop........................................................................................................55
3.9.4 P1602_FunA_Get.........................................................................................................55
3.10 THE SINGLE BOARD BATCH CAPTURE ...................................................................................56
3.10.1 P1602_FunB_Start......................................................................................................56
3.10.2 P1602_FunB_ReadStatus............................................................................................57
3.10.3 P1602_FunB_Stop.......................................................................................................58
3.10.4 P1602_FunB_Get........................................................................................................58
THE CONTINUOUS CAPTURE FUNCTIONS..............................................................................................59
3.10.5 P1602_Card0_StartScan...........................................................................................59
3.10.6 P1602_Card0_ReadStatus.........................................................................................60
3.10.7 P1602_Card0_Stop....................................................................................................60
3.10.8 P1602_Card1_StartScan...........................................................................................61
3.10.9 P1602_Card1_ReadStatus.........................................................................................62
3.10.10 P1602_Card1_Stop....................................................................................................62
3.11 OTHER FUNCTIONS................................................................................................................63
3.11.1 P1602_DelayUs.........................................................................................................63
4. DEMO PROGRAMS....................................................................................................................64
4
1. 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:
z Get software version
z Initialization
z Digital Input/Output
z A/D conversion
z D/A conversion
5
1.1 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). During the installation process, you will also be
prompted to enter the operating system you will be using.
After installation the following folders will be created on your computer.
6
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 languages.
Manual Folder
Contains hardware user manuals, software user manuals and technical notes.
Diag Folder
Contains card diagnostic programs
Inf Folder
Contains tech notes and .INF file for the plug and play installation (only available for operating systems that support plug and play).
1.2 Reference:
Please refer to the following user manuals for more information.
CallDll.pdf:
Calling the DLL with VB5, VC5, Delphi3, and BCB3.
ResCheck.pdf:
How to check the system resources.(IRQ, IO Port, and DMA)
PnPInstall.pdf:
Installing the information file (.inf ) under Windows 95/98/2000/XP with Plug & Play.
SoftInst.pdf:
Installing the software driver (package).
7
2. Declaration files
2.1 The P1602.h
#define EXPORTS extern "C" __declspec (dllimport)
//#define EXPORTS
// 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 InvalidDelay 14
#define DelayTimeOut 15
#define InvalidData 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
8
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);
EXPORTS WORD CALLBACK P1602_ActiveBoard( WORD wBoardNo );
EXPORTS WORD CALLBACK P1602_WhichBoardActive(void);
EXPORTS WORD CALLBACK P1602_M_FUN_1(WORD wDaFrequency, WORD
wDaWave, float fDaAmplitude, WORD wAdClock, WORD wAdNumber, WORD
wAdConfig, float fAdBuf[], float fLowAlarm, float fHighAlarm);
EXPORTS WORD CALLBACK P1602_M_FUN_2(WORD wDaNumber, WORD
wDaWave, WORD wDaBuf[], WORD wAdClock, WORD wAdNumber, WORD
wAdConfig, WORD wAdBuf[]);
EXPORTS WORD CALLBACK P1602_M_FUN_3(WORD wDaFrequency, WORD
wDaWave, float fDaAmplitude, WORD wAdClock, WORD wAdNumber, WORD
wChannelStatus[], WORD wAdConfig[], float fAdBuf[], float fLowAlarm, float
fHighAlarm);
EXPORTS WORD CALLBACK P1602_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 P1602_Di(WORD *wDi);
EXPORTS WORD CALLBACK P1602_Do(WORD wDo);
EXPORTS WORD CALLBACK P1602_Da(WORD wDaChannel, WORD wDaVal);
EXPORTS WORD CALLBACK P1602_SetChannelConfig(WORD wAdChannel,
9
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);
EXPORTS WORD CALLBACK P1602_AddToScan(WORD wAdChannel, WORD
wConfig, WORD wAverage, WORD wLowAlarm, WORD wHighAlarm, WORD
wAlarmType);
EXPORTS WORD CALLBACK P1602_SaveScan(WORD wAdChannel, WORD
wBuf[]);
EXPORTS void CALLBACK P1602_WaitMagicScanFinish(WORD *wStatus,
DWORD *dwLowAlarm, DWORD *dwHighAlarm);
EXPORTS WORD CALLBACK P1602_StopMagicScan();
EXPORTS WORD CALLBACK P1602_DelayUs(WORD wDelayUs);
EXPORTS WORD CALLBACK P1602_Card0_StartScan(WORD wSampleRate,
WORD wChannelStatus[], WORD wChannelConfig[],WORD wCount);
EXPORTS WORD CALLBACK P1602_Card0_ReadStatus(WORD wBuf[], WORD
wBuf2[], DWORD *dwP1, DWORD *dwP2, WORD *wStatus);
EXPORTS void CALLBACK P1602_Card0_Stop(void);
EXPORTS WORD CALLBACK P1602_Card1_StartScan(WORD wSampleRate,
WORD wChannelStatus[], WORD wChannelConfig[],WORD wCount);
EXPORTS WORD CALLBACK P1602_Card1_ReadStatus(WORD wBuf[], WORD
wBuf2[], DWORD *dwP1, DWORD *dwP2, WORD *wStatus);
EXPORTS void CALLBACK P1602_Card1_Stop(void);
EXPORTS WORD CALLBACK P1602_FunA_Start(WORD wClock0Div, WORD
wChannel0[], WORD wConfig0[], WORD *Buffer0, DWORD dwMaxCount0,
WORD wClock1Div, WORD wChannel1[],WORD wConfig1[], WORD *Buffer1,
10
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);
EXPORTS WORD CALLBACK P1602_MemoryStatus(DWORD *dwTotalPhys,
DWORD *dwAvailPhys, DWORD *dwTotalPageFile, DWORD *dwAvailPageFile,
DWORD *dwTotalVirtual, DWORD *dwAvailVirtual);
EXPORTS WORD CALLBACK P1602_AllocateMemory(HGLOBAL *hMem,
WORD *Buffer, DWORD dwSize);
EXPORTS WORD CALLBACK P1602_FreeMemory(HGLOBAL hMem);
EXPORTS WORD CALLBACK P1602_StartScanPostTrg(WORD wSampleRateDiv,
DWORD dwNum, SHORT nPriority);
EXPORTS WORD CALLBACK P1602_StartScanPreTrg(WORD wSampleRateDiv,
DWORD dwNum, SHORT nPriority);
EXPORTS WORD CALLBACK P1602_StartScanMiddleTrg(WORD
wSampleRateDiv, DWORD dwN1, DWORD dwN2, SHORT nPriority);
EXPORTS WORD CALLBACK P1602_StartScanPreTrgVerC(WORD
wSampleRateDiv, DWORD dwNum, SHORT nPriority);
EXPORTS WORD CALLBACK P1602_StartScanMiddleTrgVerC(WORD
wSampleRateDiv, DWORD dwN1, DWORD dwN2, SHORT nPriority);
11
2.2 The P1602.BAS
Attribute VB_Name = "P1602" Option Explicit Global Const NoError = 0 Global Const DriverHandleError = 1 Global Const DriverCallError = 2 Global Const AdControllerError = 3 Global Const M_FunExecError = 4 Global Const ConfigCodeError = 5 Global Const FrequencyComputeError = 6 Global Const HighAlarm = 7 Global Const LowAlarm = 8 Global Const AdPollingTimeOut = 9 Global Const AlarmTypeError = 10 Global Const FindBoardError = 11 Global Const AdChannelError = 12 Global Const DaChannelError = 13 Global Const InvalidDelay = 14 Global Const DelayTimeOut = 15 Global Const InvalidData = 16 Global Const FifoOverflow = 17 Global Const TimeOut = 18 Global Const ExceedBoardNumber = 19 Global Const NotFoundBoard = 20 Global Const OpenError = 21 Global Const FindTwoBoardError = 22 Global Const ThreadCreateError = 23 Global Const StopError = 24 Global Const AllocateMemoryError = 25
12
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" (ByVal wBoardNo As Integer) As Integer Declare Function P1602_WhichBoardActive Lib "P1602.dll" () As Integer
Declare Function P1602_M_FUN_1 Lib "P1602.dll" (ByVal wDaFrequency As Integer, ByVal wDaWave As Integer, ByVal fDaAmplitude As Single, ByVal wAdClock As Integer, ByVal wAdNumber As Integer, ByVal wAdConfig As Integer, fAdBuf As Single, ByVal fLowAlarm As Single, ByVal fHighAlarm As Single) As Integer
Declare Function P1602_M_FUN_2 Lib "P1602.dll" (ByVal wDaNumber As Integer, ByVal wDaWave As Integer, wDaBuf As Integer, ByVal wAdClock As Integer, ByVal wAdNumber As Integer, ByVal wAdConfig As Integer, wAdBuf As Integer) As Integer
Declare Function P1602_M_FUN_3 Lib "P1602.dll" (ByVal wDaFrequency As Integer, ByVal wDaWave As Integer, ByVal fDaAmplitude As Single, ByVal wAdClock As Integer, ByVal wAdNumber As Integer, wChannelStatus As Integer, wAdConfig As Integer, fAdBuf As Single, ByVal fLowAlarm As Single, ByVal fHighAlarm As Single) As Integer
Declare Function P1602_M_FUN_4 Lib "P1602.dll" (ByVal wType As Integer, ByVal wDaFrequency As Integer, ByVal wDaWave As Integer, ByVal fDaAmplitude As Single, ByVal wAdClock As Integer, ByVal wAdNumber As Integer, wChannelStatus As Integer, wAdConfig As Integer, fAdBuf As Single, ByVal fLowAlarm As Single, ByVal fHighAlarm As Single) As Integer
Declare Function P1602_Di Lib "P1602.dll" (wDi As Integer) As Integer Declare Function P1602_Do Lib "P1602.dll" (ByVal wDo As Integer) As Integer
Declare Function P1602_Da Lib "P1602.dll" (ByVal wDaChannel As Integer, ByVal wDaVal As Integer) As Integer Declare Function P1602_SetChannelConfig Lib "P1602.dll" (ByVal wAdChannel As Integer, ByVal wConfig As Integer) As Integer
Declare Function P1602_AdPolling Lib "P1602.dll" (fAdVal As Single) As Integer Declare Function P1602_AdsPolling Lib "P1602.dll" (fAdVal As Single, ByVal
13
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" (wStatus As Integer, dwLowAlarm As Long, dwHighAlarm As Long) Declare Function P1602_AddToScan Lib "P1602.dll" (ByVal wAdChannel As Integer, ByVal wConfig As Integer, ByVal wAverage As Integer, ByVal wLowAlarm As Integer, ByVal wHighAlarm As Integer, ByVal wAlarmType As Integer) As Integer Declare Function P1602_SaveScan Lib "P1602.dll" (ByVal wOridinalOrder As Integer, wBuf As Integer) As Integer Declare Sub P1602_WaitMagicScanFinish Lib "P1602.dll" (wStatus As Integer, wLowAlarm As Integer, _ wHighAlarm As Integer) Declare Function P1602_StopMagicScan Lib "P1602.dll" () As Integer
Declare Function P1602_DelayUs Lib "P1602.dll" (ByVal wDelayUs As Integer) As Integer
'------------------------ FunB series ---------------------------­Declare Function P1602_FunB_Start Lib "P1602.dll" (ByVal wClockDiv As Integer, wChannel As Integer, wConfig As Integer, Buffer As Integer, ByVal dwMaxCount As Long, ByVal nPriority As Integer) As Integer Declare Function P1602_FunB_ReadStatus Lib "P1602.dll" () As Integer Declare Function P1602_FunB_Stop Lib "P1602.dll" () As Integer Declare Function P1602_FunB_Get Lib "P1602.dll" (P0 As Long) As Integer
Declare Function P1602_Card0_StartScan Lib "P1602.dll" (ByVal wSampleRate As Integer, wChannelStatus As Integer, wChannelConfig As Integer, ByVal wCount As Integer) As Integer Declare Function P1602_Card0_ReadStatus Lib "P1602.dll" (wBuf As Integer, wBuf2 As Integer, dwP1 As Long, dwP2 As Long, wStatus As Integer) As Integer Declare Sub P1602_Card0_Stop Lib "P1602.dll" ()
Declare Function P1602_Card1_StartScan Lib "P1602.dll" (ByVal wSampleRate As Integer, wChannelStatus As Integer, wChannelConfig As Integer, ByVal wCount As Integer) As Integer Declare Function P1602_Card1_ReadStatus Lib "P1602.dll" (wBuf As Integer, wBuf2 As Integer, dwP1 As Long, dwP2 As Long, wStatus As Integer) As Integer Declare Sub P1602_Card1_Stop Lib "P1602.dll" ()
Declare Function GetTickCount Lib "kernel32" () As Long Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Global AdBuf(10000) As Single Global Channel(32) As Integer Global ConfigCode(32) As Integer
14
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
15
2.3 The P1602.PAS
unit P1602;
interface
type PSingle=^Single;
type PWord=^Word;
const
// return code
NoError = 0;
DriverHandleError = 1;
DriverCallError = 2;
AdControllerError = 3;
M_FunExecError = 4;
ConfigCodeError = 5;
FrequencyComputeError = 6;
HighAlarm = 7;
LowAlarm = 8;
AdPollingTimeOut = 9;
AlarmTypeError = 10;
FindBoardError = 11;
AdChannelError = 12;
DaChannelError = 13;
InvalidDelay = 14;
DelayTimeOut = 15;
InvalidData = 16;
FifoOverflow = 17;
TimeOut = 18;
ExceedBoardNumber = 19;
NotFoundBoard = 20;
OpenError = 21;
FindTwoBoardError = 22;
ThreadCreateError = 23;
StopError = 24;
16
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; var wAddrDio:Word;
var wAddrAdda:Word):WORD ; stdCall;
function P1602_ActiveBoard(wBoardNo:Word):WORD ; stdCall;
function P1602_WhichBoardActive:WORD ; stdCall;
// Function of M_Fun series
function P1602_M_FUN_1(wDaFrequency:WORD; wDaWave:WORD;
fDaAmplitude:Single; wAdClock:WORD; wAdNumber:WORD; wAdConfig:WORD;
fAdBuf:PSingle; fLowAlarm:Single; fHighAlarm:Single):WORD ; stdCall;
function P1602_M_FUN_2(wDaNumber:WORD; wDaWave:WORD;
wDaBuf:PWord; wAdClock:WORD; wAdNumber:WORD; wAdConfig:WORD;
wAdBuf:PWord):WORD ; stdCall;
function P1602_M_FUN_3(wDaFrequency:WORD; wDaWave:WORD;
fDaAmplitude:Single; wAdClock:WORD; wAdNumber:WORD;
wChannelStatus:PWord; wAdConfig:PWord; fAdBuf:PSingle;
fLowAlarm:Single; fHighAlarm:Single):WORD ; stdCall;
function P1602_M_FUN_4(wType:WORD; wDaFrequency:WORD;
wDaWave:WORD; fDaAmplitude:Single; wAdClock:WORD; wAdNumber:WORD;
wChannelStatus:PWord; wAdConfig:PWord; fAdBuf:PSingle; fLowAlarm:Single;
fHighAlarm:Single):WORD ; stdCall;
// Function of DI/DO
17
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 ; stdCall;
function P1602_StartScan(wSampleRateDiv:WORD; dwNum:LongInt;
nPriority:SmallInt):WORD ; stdCall;
procedure P1602_ReadScanStatus(var wStatus:WORD; var dwLowAlarm:LongInt;
var dwHighAlarm:LongInt); stdCall;
function P1602_AddToScan(wAdChannel:WORD; wConfig:WORD;
wAverage:WORD; wLowAlarm:WORD; wHighAlarm:WORD;
wAlarmType:WORD):WORD ; stdCall;
function P1602_SaveScan(wAdChannel:WORD; wBuf:PWord):WORD ; stdCall;
procedure P1602_WaitMagicScanFinish(var wStatus:WORD; var
dwLowAlarm:LongInt; var dwHighAlarm:LongInt); stdCall;
function P1602_StopMagicScan:WORD ; stdCall;
//*******************
function P1602_DelayUs(wDelayUs:WORD):WORD ; stdCall;
//*******************
//function P1602_Card0_StartScan( wSampleRate:WORD; wChannelStatus:PWORD;
// wChannelConfig:PWORD; wCount:WORD):WORD ; stdCall;
function P1602_Card0_StartScan( wSampleRate:WORD; wChannelStatus:PWORD;
wChannelConfig:PWORD; wCount:WORD):WORD ; stdCall;
function P1602_Card0_ReadStatus(wBuf:PWORD; wBuf2:PWORD;
var dwP1:LongInt; var dwP2:LongInt;
var wStatus:WORD):WORD ; stdCall;
procedure P1602_Card0_Stop; stdCall;
18
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 ; stdCall;
function P1602_FunA_Get(var P0:LongInt; var P1:LongInt):WORD ; stdCall;
//*******************
function P1602_FunB_Start( wClock0Div:WORD; wChannel0:PWord;
wConfig0:PWord; Buffer0:PWord; dwMaxCount0:LongInt;
nPriority:SmallInt):WORD ; stdCall;
function P1602_FunB_ReadStatus:WORD ; stdCall;
function P1602_FunB_Stop:WORD ; stdCall;
function P1602_FunB_Get(var P0:LongInt):WORD ; stdCall;
//********************************************************************/
/*********************************************************************
implementation
function P1602_FloatSub2; external 'P1602.DLL' name 'P1602_FloatSub2';
function P1602_ShortSub2; external 'P1602.DLL' name 'P1602_ShortSub2';
function P1602_GetDllVersion; external 'P1602.DLL' name 'P1602_GetDllVersion';
function P1602_GetDriverVersion; external 'P1602.DLL' name
'P1602_GetDriverVersion';
19
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; external 'P1602.DLL' name 'P1602_M_FUN_2';
function P1602_M_FUN_3; external 'P1602.DLL' name 'P1602_M_FUN_3';
function P1602_M_FUN_4; external 'P1602.DLL' name 'P1602_M_FUN_4';
function P1602_Do; external 'P1602.DLL' name 'P1602_Do';
function P1602_Di; external 'P1602.DLL' name 'P1602_Di';
function P1602_Da; external 'P1602.DLL' name 'P1602_Da';
function P1602_SetChannelConfig;
external 'P1602.DLL' name 'P1602_SetChannelConfig';
function P1602_AdPolling; external 'P1602.DLL' name 'P1602_AdPolling';
function P1602_AdsPolling; external 'P1602.DLL' name 'P1602_AdsPolling';
function P1602_AdsPacer; external 'P1602.DLL' name 'P1602_AdsPacer';
//*********************
function P1602_ClearScan; external 'P1602.DLL' name 'P1602_ClearScan';
function P1602_StartScan; external 'P1602.DLL' name 'P1602_StartScan';
procedure P1602_ReadScanStatus; external 'P1602.DLL' name
'P1602_ReadScanStatus';
function P1602_AddToScan; external 'P1602.DLL' name 'P1602_AddToScan';
function P1602_SaveScan; external 'P1602.DLL' name 'P1602_SaveScan';
procedure P1602_WaitMagicScanFinish; external 'P1602.DLL' name
'P1602_WaitMagicScanFinish';
function P1602_StopMagicScan; external 'P1602.DLL' name
'P1602_StopMagicScan';
//*********************
20
Loading...
+ 46 hidden pages