United Kingdom:One Omega Drive, River Bend Technology Centre
ISO 9002 CertifiedNorthbank, Irlam, Manchester
M44 5BD United Kingdom
TEL: +44 (0)161 777 6611FAX: +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.
4.6.5Architecture 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-PIODIO 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
// 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);
(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
// 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
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.