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.
The OME-PCI-1002 Toolkit is a collection of DLLs and device-driver for
Windows 95/98/NT/2000/XP applications. These DLLs are 32-bit and can be
called by Visual C++, BC++, Visual BASIC, Delphi and LabVIEW.
The OME-PCI-1002 Toolkit consists of the following DLLs and device
driver:
• P100X.DLL, P100X.LIB Æ for OME-PCI-1002 card
• P100X.VXD Æ OME-PCI-1002 Device driver for Windows 95/98
• P100X.SYS Æ OME-PCI-1002 Device driver for Windows
NT/2000/XP
The DLLs perform a variety of tasks including:
• Read software version
• Initialization
• Digital Input/Output
• A/D conversion
Page 4
OME-PCI-1002 Software Manual for Windows
1.1 Software Installation
Insert the CD ROM included with your OME-PCI-1002 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-1002 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.
Page 5
OME-PCI-1002 Software Manual for Windows
Demo Folder
Contains all demonstration programs including their source code. 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 the NMAKE.EXE to compiling and linking the demo code.
For Example, C:\P1002\DEMO\VC\nmake /f demo.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).
Page 6
OME-PCI-1002 Software Manual for Windows
1.2 References
Please also refer to the following user manuals:
•SoftInst.pdf:
To install the software package under Windows 95/98/NT/2000/XP.
•CallDll.pdf:
To call the DLL functions with Visual C++, Visual Basic, Delphi and
Borland C++.
•ResCheck.pdf:
To check the card resources, that is, I/O Port address, IRQ number
and DMA under Windows.
Page 7
OME-PCI-1002 Software Manual for Windows
2. Declaration Files
Please refer to user manual "CallDLL.pdf".
|--\Driver Å some device driver
| |
| |--\VB Å for Visual Basic
| | |--\P100X.BAS Å Declaration file for Visual Basic
| | |--\P100Xu.BAS Å Functions for Visual Basic
| |
| |--\VC Å for Visual C++
| | |--\P100X.H Å Header file
| | |--\P100X.LIB Å Import library for VC only
| |
| |--\Delphi Å for Delphi
| | |--\P100X.PAS Å Declaration file
| | |--\P100Xu.PAS Å Functions for Delphi
| |
| |--\BCB Å for Borland C++ Builder 3.0
| |--\P100X.H Å Header file
| |--\P100Xu.C Å Functions for BCB
| |--\P100X.LIB Å Import library file for BCB only
EXPORTS float CALLBACK P100X_FloatSub(float fA, float fB);
EXPORTS short CALLBACK P100X_ShortSub(short nA, short nB);
EXPORTS WORD CALLBACK P100X_GetDllVersion(void);
EXPORTS WORD CALLBACK P100X_DriverInit(WORD *wTotalBoards);
EXPORTS void CALLBACK P100X_DriverClose(void);
EXPORTS WORD CALLBACK P100X_GetDriverVersion
(WORD *wDriverVersion);
EXPORTS WORD CALLBACK P100X_GetIrqNo( WORD *IrqNo);
EXPORTS WORD CALLBACK P100X_GetConfigAddressSpace
(WORD wBoardNo, WORD *wAddress0,
WORD *wAddress1, WORD *wAddress2);
EXPORTS WORD CALLBACK P100X_ActiveBoard( WORD wBoardNo );
EXPORTS WORD CALLBACK P100X_WhichBoardActive(void);
Page 9
OME-PCI-1002 Software Manual for Windows
EXPORTS void CALLBACK P100X_SetupTimer
(WORD wChannel, WORD wCoef);
EXPORTS WORD CALLBACK P100X_Delay(WORD wDownCount);
EXPORTS void CALLBACK P100X_Do(WORD wOutData);
EXPORTS WORD CALLBACK P100X_Di(WORD *wDiData);
EXPORTS WORD CALLBACK P100X_SetChannelConfig
(WORD wAdChannel, WORD wConfig);
EXPORTS WORD CALLBACK P100X_Polling(WORD *wAdVal);
EXPORTS WORD CALLBACK P100X_AdPolling(float *fAdVal);
EXPORTS WORD CALLBACK P100X_AdsPolling
(float fAdVal[], WORD wNum);
EXPORTS WORD CALLBACK P100X_AdsPacer
(float fAdVal[], WORD wNum, WORD wSamplingDiv);
EXPORTS WORD CALLBACK P100X_InstallIrq
(HANDLE *hEvent, DWORD dwCount);
EXPORTS WORD CALLBACK P100X_GetBuffer
(DWORD dwNum, WORD wBuf[]);
EXPORTS WORD CALLBACK P100X_GetFloatBuffer
(DWORD dwNum, float fAdVal[]);
EXPORTS WORD CALLBACK P100X_GetIntCount(DWORD *dwVal);
EXPORTS WORD CALLBACK P100X_INT_AdStart
(WORD Ch, WORD Gain, WORD wFreqDiv);
EXPORTS WORD CALLBACK P100X_INT_AdStop();
Page 10
OME-PCI-1002 Software Manual for Windows
2.2 P100Xu.C
#include <math.h>
//*-----------------------------------------------------*
//* Return voltage value or -100.0 if any error occurs *
//* or parameter is out of range. *
//* HiLo : 1 --> High Gain , 0 --> Low Gain *
//* Gain : 0-3 *
//*-----------------------------------------------------*
float P100X_AD2F(Word hex, int HiLo,int Gain )
{
float ZeroBase, VoltageRange, FullRange ;
ZeroBase = 2048.0 ;
FullRange = 2048.0 ;
VoltageRange = 10.0 ;
Gain = Gain % 16 ;
if ( (Gain < 0) || (Gain > 3) )
return -100.0;
' return code
Global Const P100X_NoError = 0
Global Const P100X_DriverHandleError = 1
Global Const P100X_DriverCallError = 2
Global Const P100X_AdControllerError = 3
Global Const P100X_ConfigCodeError = 4
Global Const P100X_DriverNoOpen = 5
Global Const P100X_AdPollingTimeOut = 6
Global Const P100X_FindBoardError = 7
Global Const P100X_AdChannelError = 8
Global Const P100X_DaChannelError = 9
Global Const P100X_InvalidDelay = 10
Global Const P100X_DelayTimeOut = 11
Global Const P100X_InvalidData = 12
Global Const P100X_TimeoutError = 13
Global Const P100X_ExceedBoardNumber = 14
Global Const P100X_NotFoundBoard = 15
Global Const P100X_OpenError = 16
Global Const P100X_FindTwoBoardError = 17
Global Const P100X_GetIntCountError = 18
Global Const P100X_InstallIrqError = 19
Global Const P100X_AllocateMemoryError = 20
' Function of Test
Declare Function P100X_FloatSub Lib "P100X.DLL" _
(ByVal fA As Single, ByVal fB As Single) As Single
Declare Function P100X_ShortSub Lib "P100X.DLL" _
(ByVal nA As Integer, ByVal nB As Integer) As Integer
Declare Function P100X_GetDllVersion Lib "P100X.DLL" () As Integer
' Function of Driver
Declare Function P100X_DriverInit Lib "P100X.DLL" _
(wTotalBoards As Integer) As Integer
Declare Sub P100X_DriverClose Lib "P100X.DLL" ()
Declare Function P100X_GetDriverVersion Lib "P100X.DLL" _
(wDriverVersion As Integer) As Integer
Declare Function P100X_GetIrqNo Lib "P100X.DLL" (IrqNo As Integer) _
As Integer
Declare Function P100X_GetConfigAddressSpace Lib "P100X.DLL" _
(ByVal wBoardNo As Integer, wAddrTimer As Integer, _
wAddrDio As Integer, wAddrAd As Integer) As Integer
Declare Function P100X_ActiveBoard Lib "P100X.DLL" _
(ByVal wBoardNo As Integer) As Integer
Declare Function P100X_WhichBoardActive Lib "P100X.DLL" () As Integer
Page 12
OME-PCI-1002 Software Manual for Windows
Declare Sub P100X_SetupTimer Lib "P100X.DLL" _
(ByVal wChannel As Integer, ByVal wCoef As Integer)
Declare Function P100X_Delay Lib "P100X.DLL" _
(ByVal wDownCount As Integer) As Integer
' Function of DI/DO
Declare Sub P100X_Do Lib "P100X.DLL" (ByVal wOutData As Integer)
Declare Function P100X_Di Lib "P100X.DLL" (wDiData As Integer) As Integer
' Function of AD
Declare Function P100X_SetChannelConfig Lib "P100X.DLL" _
(ByVal wAdChannel As Integer, ByVal wConfig As Integer) As Integer
Declare Function P100X_Polling Lib "P100X.DLL" _
(wAdVal As Integer) As Integer
Declare Function P100X_AdPolling Lib "P100X.DLL" _
(fAdVal As Single) As Integer
Declare Function P100X_AdsPolling Lib "P100X.DLL" _
(fAdVal As Single, ByVal wNum As Integer) As Integer
Declare Function P100X_AdsPacer Lib "P100X.DLL" (fAdVal As Single, _
ByVal wNum As Integer, ByVal wSamplingDiv As Integer) As Integer
' Function of Interrupt
Declare Function P100X_InstallIrq Lib "P100X.DLL" _
(hEvent As Long, ByVal dwCount As Long) As Integer
Declare Function P100X_GetBuffer Lib "P100X.DLL" _
(ByVal dwNum As Long, wBuf As Integer) As Integer
Declare Function P100X_GetFloatBuffer Lib "P100X.DLL" _
(ByVal dwNum As Long, fAdVal As Single) As Integer
Declare Function P100X_INT_AdStart Lib "P100X.DLL" _
(ByVal Ch As Integer, ByVal Gain As Integer, _
ByVal wFreqDiv As Integer) As Integer
Declare Function P100X_INT_AdStop Lib "P100X.DLL" () As Integer
Declare Function P100X_GetIntCount Lib "P100X.DLL" (dwVal As Long) _
As Integer
Page 13
OME-PCI-1002 Software Manual for Windows
2.4 P100Xu.BAS
'*-----------------------------------------------------*
'* Return voltage value or -100.0 if any error occurs *
'* or parameter is out of range. *
'* HiLo : 1 --> High Gain , 0 --> Low Gain *
'* Gain : 0-3 *
'*-----------------------------------------------------*
Function P100X_AD2F(ByVal hex, HiLo, Gain As Integer) As Single
Dim ZeroBase, BullRange, VoltageRange As Single
ZeroBase = 2048#
FullRange = 2048#
VoltageRange = 10#
Gain = Gain Mod 16
If Gain < 0 Or Gain > 3 Then
P100X_AD2F = -100#
Exit Function
End If
If HiLo = 0 Then 'Low-Gain
P100X_AD2F = ((((hex - ZeroBase) / FullRange) * VoltageRange) / (2 ^
Gain))
Else
P100X_AD2F = ((((hex - ZeroBase) / FullRange) * VoltageRange) / (10 ^
Gain))
End If
End Function
// Function of Test
function P100X_FloatSub(fA:Single; fB:Single):Single ; stdCall;
function P100X_ShortSub(nA:SmallInt; nB:SmallInt):SmallInt ; stdCall;
function P100X_GetDllVersion:WORD ; stdCall;
Page 15
Loading...
+ 32 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.