Omega Products OME-PIO-DA16 Installation Manual

www.omega.com
e-mail: info@omega.com
User’s Guide
OME-PIO-DA16/DA8/DA4 PCI-Bus Analog Output
Board
Software Manual
Servicing North America:
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.
OME-PIO-DA Software Manual [Win 95/98/NT/2000]
OME-PIO-DA
Software Manual
[For Windows 95/98/NT/2000]
Date Mar-15-2000 Ver 2.10.00 Page 1
OME-PIO-DA Software Manual [Win 95/98/NT/2000]
Table of Contents
1. INTRODUCTION......................................................................................................................... 4
2. DECLARATION FILES ..............................................................................................................5
2.1 PIODA.H............................................................................................................................... 6
2.2 PIODA.BAS.......................................................................................................................... 9
2.3 PIODA.PAS ........................................................................................................................13
3. DEMO RESULT ......................................................................................................................... 19
4. FUNCTION DESCRIPTIONS .................................................................................................. 22
4.1 TEST FUNCTIONS.................................................................................................................. 23
4.1.1 PIODA_GetDllVersion...............................................................................................23
4.1.2 PIODA_ShortSub ....................................................................................................... 23
4.1.3 PIODA_FloatSub........................................................................................................ 25
4.2 I/O FUNCTIONS .................................................................................................................... 26
4.2.1 PIODA_OutputByte ...................................................................................................26
4.2.2 PIODA_InputByte ...................................................................................................... 26
4.2.3 PIODA_OutputWord .................................................................................................. 28
4.2.4 PIODA_InputWord.....................................................................................................28
4.2.5 PIODA_DO................................................................................................................. 30
4.2.6 PIODA_DI.................................................................................................................. 30
4.3 DRIVER FUNCTIONS ............................................................................................................. 32
4.3.1 PIODA_GetDriverVersion.......................................................................................... 32
4.3.2 PIODA_DriverInit...................................................................................................... 32
4.3.3 PIODA_DriverClose................................................................................................... 34
4.3.4 PIODA_GetConfigAddressSpace............................................................................... 34
4.3.5 PIODA_GetBaseAddress............................................................................................ 36
4.3.6 PIODA_SearchCard ...................................................................................................36
4.3.7 PIODA_SetCounter ....................................................................................................37
4.4 EEPROM FUNCTIONS.......................................................................................................... 38
4.4.1 PIODA_EEP_Read..................................................................................................... 38
4.4.2 PIODA_EEP_Write.................................................................................................... 38
4.4.3 PIODA_EEP_WR_EN................................................................................................ 40
4.4.4 PIODA_EEP_WR_DIS .............................................................................................. 40
4.5 DA FUNCTIONS .................................................................................................................... 41
4.5.1 PIODA_Voltage.......................................................................................................... 41
Date Mar-15-2000 Ver 2.10.00 Page 2
OME-PIO-DA Software Manual [Win 95/98/NT/2000]
4.5.2 PIODA_Current.......................................................................................................... 41
4.5.3 PIODA_CalVoltage..................................................................................................... 43
4.5.4 PIODA_CalCurrent .................................................................................................... 43
4.6 INTERRUPT FUNCTIONS ........................................................................................................ 44
4.6.1 PIODA_IntInstall........................................................................................................ 44
4.6.2 PIODA_IntRemove .................................................................................................... 45
4.6.3 PIODA_IntGetCount ..................................................................................................46
4.6.4 PIODA_IntResetCount............................................................................................... 46
4.6.5 Architecture of Interrupt mode.................................................................................... 47
5. PROGRAM ARCHITECTURE................................................................................................ 49
6. CONTACT US ............................................................................................................................ 50
Date Mar-15-2000 Ver 2.10.00 Page 3
OME-PIO-DA Software Manual [Win 95/98/NT/2000]
1. Introduction
The software is a collection of digital I/O subroutines for the OME-PIO­DIO series add-on cards for Windows 95/98/NT/2000 applications. These subroutines are written with C language and perform a variety of digital I/O operations.
The subroutines in PIODA.DLL are user friendly. It provides powerful, easy-to-use subroutine for developing your data acquisition application. Your program can call these DLL functions by VC++, VB, Delphi, and BORLAND C++ Builder easily. To speed-up your developing process, some demonstration source program are provided.
Please refer to the following user manuals:
PnPInstall.pdf:
To install the PnP (Plug and Play) driver for PCI card under Windows
95/98.
SoftInst.pdf:
To install the software package under Windows 95/98/NT/2000.
CallDll.pdf:
To call the DLL functions with VC++5, VB5, Delphi3 and Borland C++
Builder 3.
ResCheck.pdf:
To check the resources I/O Port address, IRQ number and DMA
number for add-on cards under Windows 95/98/NT/2000.
OME-PIO-DAHW.pdf:
OME-PIO-DA16/DA8/DA4 Hardware manual.
Date Mar-15-2000 Ver 2.10.00 Page 4
OME-PIO-DA Software Manual [Win 95/98/NT/2000]
2. Declaration Files
|--\Driver Å some device driver |--\BCB3 Å for Borland C++ Builder 3 | |--\PIODA.H Å Header file | +--\PIODA.LIB Å Linkage library for BCB3 only | |--\Delphi3 Å for Delphi 3 | +--\PIODA.PAS Å Declaration file
| |--\VB5 Å for Visual Basic 5 | +--\PIODA.BAS Å Declaration file
| +--\VC5 Å for Visual C++ 5 |--\PIODA.H Å Header file +--\PIODA.LIB Å Linkage library for VC5 only
Date Mar-15-2000 Ver 2.10.00 Page 5
OME-PIO-DA Software Manual [Win 95/98/NT/2000]
2.1 PIODA.H
#ifdef __cplusplus #define EXPORTS extern "C" __declspec (dllimport) #else #define EXPORTS #endif
// return code #define PIODA_NoError 0 #define PIODA_DriverOpenError 1 #define PIODA_DriverNoOpen 2 #define PIODA_GetDriverVersionError 3 #define PIODA_InstallIrqError 4 #define PIODA_ClearIntCountError 5 #define PIODA_GetIntCountError 6 #define PIODA_RegisterApcError 7 #define PIODA_RemoveIrqError 8 #define PIODA_FindBoardError 9 #define PIODA_ExceedBoardNumber 10 #define PIODA_ResetError 11
#define PIODA_EEPROMDataError 12 #define PIODA_EEPROMWriteError 13
// to trigger a interrupt when high -> low #define PIODA_ActiveLow 0 // to trigger a interrupt when low -> high #define PIODA_ActiveHigh 1
// ID #define PIO_DA 0x800400
// Test functions EXPORTS float CALLBACK PIODA_FloatSub(float fA, float fB);
Date Mar-15-2000 Ver 2.10.00 Page 6
OME-PIO-DA Software Manual [Win 95/98/NT/2000]
EXPORTS short CALLBACK PIODA_ShortSub(short nA, short nB); EXPORTS WORD CALLBACK PIODA_GetDllVersion(void);
// Driver functions EXPORTS WORD CALLBACK PIODA_DriverInit(void); EXPORTS void CALLBACK PIODA_DriverClose(void); EXPORTS WORD CALLBACK PIODA_SearchCard (WORD *wBoards, DWORD dwPIOCardID); EXPORTS WORD CALLBACK PIODA_GetDriverVersion
(WORD *wDriverVersion); EXPORTS WORD CALLBACK PIODA_GetConfigAddressSpace (WORD wBoardNo, DWORD *wAddrBase, WORD *wIrqNo, WORD *wSubVendor, WORD *wSubDevice, WORD *wSubAux, WORD *wSlotBus, WORD *wSlotDevice ); EXPORTS WORD CALLBACK PIODA_ActiveBoard( WORD wBoardNo ); EXPORTS WORD CALLBACK PIODA_WhichBoardActive(void); EXPORTS WORD CALLBACK PIODA_SetCounter(WORD wBoardNo, WORD wWhichCounter, WORD bConfig, DWORD wValue); EXPORTS DWORD CALLBACK PIODA_GetBaseAddress
(WORD wBoardNo);
// EEPROM functions EXPORTS WORD CALLBACK PIODA_EEP_READ (WORD wBoardNo, WORD wOffset, WORD *bHi, WORD *bLo); EXPORTS WORD CALLBACK PIODA_EEP_WR_EN(WORD wBoardNo); EXPORTS WORD CALLBACK PIODA_EEP_WR_DIS(WORD wBoardNo); EXPORTS WORD CALLBACK PIODA_EEP_WRITE (WORD wBoardNo, WORD wOffset, WORD HI, WORD LO);
// DA functions EXPORTS WORD CALLBACK PIODA_Voltage (WORD wBoardNo, WORD wChannel, float fValue); EXPORTS WORD CALLBACK PIODA_Current (WORD wBoardNo, WORD wChannel, float fValue); EXPORTS WORD CALLBACK PIODA_CalVoltage (WORD wBoardNo, WORD wChannel, float fValue); EXPORTS WORD CALLBACK PIODA_CalCurrent (WORD wBoardNo, WORD wChannel, float fValue);
Date Mar-15-2000 Ver 2.10.00 Page 7
OME-PIO-DA Software Manual [Win 95/98/NT/2000]
// DIO functions EXPORTS void CALLBACK PIODA_OutputWord (DWORD wBaseAddress, DWORD wOutData); EXPORTS void CALLBACK PIODA_OutputByte (DWORD wBaseAddress, WORD bOutputValue); EXPORTS DWORD CALLBACK PIODA_InputWord
(DWORD wBaseAddress); EXPORTS WORD CALLBACK PIODA_InputByte(DWORD wBaseAddress); EXPORTS WORD CALLBACK PIODA_DI
(WORD wBoardNo, DWORD *wVal); EXPORTS WORD CALLBACK PIODA_DO
(WORD wBoardNo, DWORD wDO);
// Interrupt functions EXPORTS WORD CALLBACK PIODA_IntInstall (WORD wBoardNo, HANDLE *hEvent, WORD wInterruptSource, WORD wActiveMode); EXPORTS WORD CALLBACK PIODA_IntRemove(void); EXPORTS WORD CALLBACK PIODA_IntResetCount(void); EXPORTS WORD CALLBACK PIODA_IntGetCount(DWORD *dwIntCount);
Date Mar-15-2000 Ver 2.10.00 Page 8
OME-PIO-DA Software Manual [Win 95/98/NT/2000]
2.2 PIODA.BAS
Attribute VB_Name = "PIODA"
Global Const PIODA_NoError = 0 Global Const PIODA_DriverOpenError = 1 Global Const PIODA_DriverNoOpen = 2 Global Const PIODA_GetDriverVersionError = 3 Global Const PIODA_InstallIrqError = 4 Global Const PIODA_ClearIntCountError = 5 Global Const PIODA_GetIntCountError = 6 Global Const PIODA_RegisterApcError = 7 Global Const PIODA_RemoveIrqError = 8 Global Const PIODA_FindBoardError = 9 Global Const PIODA_ExceedBoardNumber = 10 Global Const PIODA_ResetError = 11
Global Const PIODA_EEPROMDataError = 12 Global Const PIODA_EEPROMWriteError = 13
' to trigger a interrupt when high -> low Global Const PIODA_ActiveLow = 0 ' to trigger a interrupt when low -> high Global Const PIODA_ActiveHigh = 1
' ID Global Const PIO_DA = &H800400 ' OME-PIO-DA16/DA8/DA4
' The Test functions Declare Function PIODA_ShortSub Lib "PIODA.dll" _ (ByVal a As Integer, ByVal b As Integer) As Integer Declare Function PIODA_FloatSub Lib "PIODA.dll" _ (ByVal a As Single, ByVal b As Single) As Single Declare Function PIODA_GetDllVersion Lib "PIODA.dll" () As Integer
Date Mar-15-2000 Ver 2.10.00 Page 9
OME-PIO-DA Software Manual [Win 95/98/NT/2000]
' The Driver functions Declare Function PIODA_DriverInit Lib "PIODA.dll" () As Integer Declare Sub PIODA_DriverClose Lib "PIODA.dll" () Declare Function PIODA_SearchCard Lib "PIODA.dll" _ (wBoards As Integer, ByVal dwPIOPISOCardID As Long) As Integer Declare Function PIODA_GetDriverVersion Lib "PIODA.dll" _ (wDriverVersion As Integer) As Integer Declare Function PIODA_GetConfigAddressSpace Lib "PIODA.dll" ( _ ByVal wBoardNo As Integer, wAddrBase As Long, wIrqNo As Integer, _ wSubVendor As Integer, wSubDevice As Integer, wSubAux As Integer, _ wSlotBus As Integer, wSlotDevice As Integer) As Integer
Declare Function PIODA_ActiveBoard Lib "PIODA.dll" _ (ByVal wBoardNo As Integer) As Integer Declare Function PIODA_WhichBoardActive Lib "PIODA.dll" () As Integer Declare Function PIODA_SetCounter Lib "PIODA.dll" _ (ByVal wBoardNo As Integer, ByVal wWhichCounter As Integer, _ ByVal bConfig As Integer, ByVal wValue As Long) As Long Declare Function PIODA_GetBaseAddress Lib "PIODA.dll" _ (ByVal wBoardNo As Integer) As Long
' EEPROM functions Declare Function PIODA_EEP_READ Lib "PIODA.dll" _ (ByVal wBoardNo As Integer, ByVal wOffset As Integer, _ bHi As Integer, bLo As Integer) As Integer Declare Function PIODA_EEP_WR_EN Lib "PIODA.dll" _ (ByVal wBoardNo As Integer) As Integer Declare Function PIODA_EEP_WR_DIS Lib "PIODA.dll" _ (ByVal wBoardNo As Integer) As Integer Declare Function PIODA_EEP_WRITE Lib "PIODA.dll" _ (ByVal wBoardNo As Integer, ByVal wOffset As Integer, _ ByVal HI As Integer, ByVal LO As Integer) As Integer
' DA functions Declare Function PIODA_Voltage Lib "PIODA.dll" _ (ByVal wBoardNo As Integer, ByVal wChannel As Integer, _ ByVal fValue As Single) As Integer
Date Mar-15-2000 Ver 2.10.00 Page 10
OME-PIO-DA Software Manual [Win 95/98/NT/2000]
Declare Function PIODA_Current Lib "PIODA.dll" _ (ByVal wBoardNo As Integer, ByVal wChannel As Integer, _ ByVal fValue As Single) As Integer Declare Function PIODA_CalVoltage Lib "PIODA.dll" _ (ByVal wBoardNo As Integer, ByVal wChannel As Integer, _ ByVal fValue As Single) As Integer Declare Function PIODA_CalCurrent Lib "PIODA.dll" _ (ByVal wBoardNo As Integer, ByVal wChannel As Integer, _ ByVal fValue As Single) As Integer
Date Mar-15-2000 Ver 2.10.00 Page 11
OME-PIO-DA Software Manual [Win 95/98/NT/2000]
' DIO functions Declare Sub PIODA_OutputByte Lib "PIODA.dll" _ (ByVal wBaseAddress As Long, ByVal dataout As Integer) Declare Sub PIODA_OutputWord Lib "PIODA.dll" _ (ByVal wBaseAddress As Long, ByVal dataout As Long) Declare Function PIODA_InputByte Lib "PIODA.dll" _ (ByVal wBaseAddress As Long) As Integer Declare Function PIODA_InputWord Lib "PIODA.dll" _ (ByVal wBaseAddress As Long) As Long Declare Function PIODA_DI Lib "PIODA.dll" _ (ByVal wBoardNo As Integer, wVal As Long) As Integer Declare Function PIODA_DO Lib "PIODA.dll" _ (ByVal wBoardNo As Integer, ByVal wDO As Long) As Integer
' Interrupt functions Declare Function PIODA_IntInstall Lib "PIODA.dll" _ (ByVal wBoard As Integer, hEvent As Long, _ ByVal wInterruptSource As Integer, _ ByVal wActiveMode As Integer) As Integer Declare Function PIODA_IntRemove Lib "PIODA.dll" () As Integer Declare Function PIODA_IntResetCount Lib "PIODA.dll" () As Integer Declare Function PIODA_IntGetCount Lib "PIODA.dll" _ (dwIntCount As Long) As Integer
Date Mar-15-2000 Ver 2.10.00 Page 12
OME-PIO-DA Software Manual [Win 95/98/NT/2000]
2.3 PIODA.PAS
unit PIODA; { PIODA.dll interface unit }
interface
const PIODA_NoError =0; PIODA_DriverOpenError =1; PIODA_DriverNoOpen =2; PIODA_GetDriverVersionError =3; PIODA_InstallIrqError =4; PIODA_ClearIntCountError =5; PIODA_GetIntCountError =6; PIODA_RegisterApcError =7; PIODA_RemoveIrqError =8; PIODA_FindBoardError =9; PIODA_ExceedBoardNumber =10; PIODA_ResetError =11;
PIODA_EEPROMDataError =12; PIODA_EEPROMWriteError =13;
// to trigger a interrupt when high -> low PIODA_ActiveLow =0; // to trigger a interrupt when low -> high PIODA_ActiveHigh =1;
// ID PIO_DA = $800400; // PIO-DA16/DA8/DA4
// Test functions function PIODA_ShortSub(nA : smallint; nB : smallint) :smallint; StdCall; function PIODA_FloatSub(fA : single; fB : single) :single; StdCall; function PIODA_GetDllVersion : word; StdCall;
Date Mar-15-2000 Ver 2.10.00 Page 13
OME-PIO-DA Software Manual [Win 95/98/NT/2000]
// Driver functions function PIODA_DriverInit : word; StdCall; procedure PIODA_DriverClose ; StdCall; function PIODA_SearchCard (var wBoards:WORD; dwPIOPISOCardID:LongInt):WORD; StdCall; function PIODA_GetDriverVersion(var wDriverVer: word):WORD; StdCall; function PIODA_GetConfigAddressSpace (wBoardNo:word; var wAddrBase:LongInt; var wIrqNo:word; var wSubVerdor:word; var wSubDevice:word; var wSubAux:word; var wSlotBus:word; var wSlotDevice:word ): word; StdCall; function PIODA_ActiveBoard(wBoardNo:Word) :WORD; StdCall; function PIODA_WhichBoardActive :WORD; StdCall; function PIODA_SetCounter(wBoardNo:WORD; wWhichCounter:WORD; bConfig:WORD; wValue:LongInt): WORD; StdCall; function PIODA_GetBaseAddress(wBoardNo:WORD):LongInt; StdCall;
// EEPROM functions function PIODA_EEP_READ(wBoardNo:WORD; wOffset:WORD; var bHi:WORD; var bLo:WORD):WORD; StdCall; function PIODA_EEP_WR_EN(wBoardNo:WORD):WORD; StdCall; function PIODA_EEP_WR_DIS(wBoardNo:WORD):WORD; StdCall; function PIODA_EEP_WRITE( wBoardNo:WORD; wOffset:WORD; HI:WORD; LO:WORD):WORD; StdCall;
// DA functions function PIODA_Voltage (wBoardNo:WORD; wChannel:WORD; fValue:Single):WORD; StdCall; function PIODA_Current (wBoardNo:WORD; wChannel:WORD; fValue:Single):WORD; StdCall; function PIODA_CalVoltage (wBoardNo:WORD; wChannel:WORD; fValue:Single):WORD; StdCall; function PIODA_CalCurrent (wBoardNo:WORD; wChannel:WORD; fValue:Single):WORD; StdCall;
// DIO functions procedure PIODA_OutputByte (wBaseAddress :LongInt; bOutputVal :Word); StdCall;
Date Mar-15-2000 Ver 2.10.00 Page 14
OME-PIO-DA Software Manual [Win 95/98/NT/2000]
procedure PIODA_OutputWord (wBaseAddress :LongInt; wOutputVal :LongInt); StdCall; function PIODA_InputByte(wBaseAddress :LongInt ) :word; StdCall; function PIODA_InputWord(wBaseAddress :LongInt ) :LongInt; StdCall; function PIODA_DI(wBoardNo:WORD; var wVal:LongInt) :word; StdCall; function PIODA_DO(wBoardNo:WORD; wDO:LongInt) :word; StdCall;
Date Mar-15-2000 Ver 2.10.00 Page 15
Loading...
+ 37 hidden pages