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.
1.3 USING WITH VISUAL C++..................................................................................................................................... 11
1.4 USING WITH MFC................................................................................................................................................. 12
1.5 USING WITH BC++............................................................................................................................................... 13
1.6 USING WITH VISUAL BASIC .................................................................................................................................. 14
1.6.1 The Demo1 Result:..................................................................................................................................... 14
1.6.2 The P180X.BAS.......................................................................................................................................... 15
SING WITH DELPH .............................................................................................................................................. 21
HE M_FUNCTIONS .............................................................................................................................................. 44
HE DIOFUNCTIONS ........................................................................................................................................... 50
HE D/AFUNCTIONS............................................................................................................................................ 52
HE MAGICSCAN FUNCTIONS .............................................................................................................................. 57
The PCI-180x toolkit is a collection of DLLs for Windows 95/NT/2000/XP applications.
The DLLs are 32 bit and can be called by Visual C/C++, BC++, Visual BASIC, Delphi, and
LabVIEW.
These DLLs can perform a variety of data acquisition operations such as:
z Get software version
z Initialize data acquisition hardware
z Digital Input/Output
z A/D conversion
z D/A conversion
Page 5
OME-PCI-180x Software Manual
1.1 SOFTWARE INSTALLATION
Insert the CD ROM included with your OME-PCI-180x 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-180x 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 6
OME-PCI-180x Software Manual
Demo Folder
Contains all demonstration programs including the 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:\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).
Page 7
OME-PCI-180x Software Manual
1.2 PLUG & PLAY
Then the p180X.inf provides all information needed to complete the Plug & Play
installation. After the installation, the Windows will reserve the resources and populate the registry. The Plug & Play information is shown in Figure 1. Figure 2 shows
the resources that are reserved. If the user executes “c:\WINNT\regedit.exe”, the
registration information of the PCI-180XH/L will be located under “My Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\P180x” as in
Figure 3. Figure 4 shows the registration items in detail.
Fig 1. The Plug & Play information
Page 8
OME-PCI-180x Software Manual
Fig 2. The allocated resources for this PCI-180X.
Fig 3. The registry path
Page 9
OME-PCI-180x Software Manual
Fig 4. Registry item details
Page 10
OME-PCI-180x Software Manual
1.3 Using With Visual C++
All demo programs were created with Visual C++5.and tested under Windows 95/NT.
Key issues are given below:
1. Make sure the PATH includes the Visual C++ compiler
2. Execute the \MSDEV\BIN\VCVARS32.BAT to setup the environment. The
VCVARS32.BAT is provided by Visual C++.
3. The source program must include “P180X.H”
4. Copy the P180X.LIB, import library, to the same directory as the source program.
5. Copy the P180X.DLL, to the same directory as the source program
6. Edit the source program (refer to Demo\VC5\DEMO1.C)
7. Edit the NMAKE file (refer to Demo\VC5\DEMO1.MAK)
8. NMAKE /f DEMO1.MAK
9. Execute DEMO1.EXE
NOTE: The P180X.lib is used while linking and the P180X.DLL is used at run time.
Page 11
OME-PCI-180x Software Manual
1.4 Using With MFC
Using the PCI-180x toolkit with MFC is similar as using it with Visual C++. Key issues
are given below:
1. Use MFC wizard to create the source code
2. The source program must include “P180X.H”
3. Copy the P180X.LIB, import library, to the same directory as the source program
4. Copy the P180X.DLL, to the same directory as the source program
5. Select Build/Settings/Link and key “P180X.lib” in the object/library modules
field
NOTE: The P180X.lib is used while linking and the P180X.DLL is used in run time.
Page 12
OME-PCI-180x Software Manual
1.5 Using With BC++
The DLL was created in Visual C++ 5.0. The P180X.H and P180X.lib are also
designed for use with Visual C/C++. BC++ can not use these two files. The following
modifications are necessary.
NOTE : 1. Tested under Windows 95/NT and VB 4.0 (32 bit)
1.6.1 The Demo1 Result:
Page 14
OME-PCI-180x Software Manual
1.6.2 The P180X.BAS
Attribute VB_Name = "Module1"
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 FrequencyCalculateError = 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
Declare Function P180X_DriverInit Lib "P180X.dll" (wTotalBoards As Integer) As Integer
Declare Sub P180X_DriverClose Lib "P180X.dll" ()
Declare Function P180X_GetDriverVersion Lib "P180X.dll" (wVxdVersion As Integer) As Integer
Declare Function P180X_GetConfigAddressSpace Lib "P180X.dll" (ByVal wBoardNo As Integer, _
wAddrTimer As Integer, wAddrCtrl As Integer, wAddrDio As Integer, _
wAddrAdda As Integer) As Integer
Declare Function P180X_ActiveBoard Lib "P180X.dll" (ByVal wBoardNo As Integer) As Integer
Declare Function P180X_WhichBoardActive Lib "P180X.dll" () As Integer
Declare Function P180X_M_FUN_1 Lib "P180X.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 P180X_M_FUN_2 Lib "P180X.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
Page 15
OME-PCI-180x Software Manual
Declare Function P180X_M_FUN_3 Lib "P180X.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 P180X_M_FUN_4 Lib "P180X.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 P180X_Di Lib "P180X.dll" (wDi As Integer) As Integer
Declare Function P180X_Do Lib "P180X.dll" (ByVal wDo As Integer) As Integer
Declare Function P180X_Da Lib "P180X.dll" (ByVal wDaChannel As Integer, _
ByVal wDaVal As Integer) As Integer
Declare Function P180X_SetChannelConfig Lib "P180X.dll" (ByVal wAdChannel As Integer, _
ByVal wConfig As Integer) As Integer
Declare Function P180X_AdPolling Lib "P180X.dll" (fAdVal As Single) As Integer
Declare Function P180X_AdsPolling Lib "P180X.dll" (fAdVal As Single, ByVal wNum As Integer) _
As Integer
Declare Function P180X_AdsPacer Lib "P180X.dll" (fAdVal As Single, ByVal wNum As Integer, _
ByVal wSample As Integer) As Integer
Declare Function P180X_ClearScan Lib "P180X.dll" () As Integer
Declare Function P180X_StartScan Lib "P180X.dll" (ByVal wSampleRate As Integer, _
ByVal dwNum As Long, ByVal nPriority As Integer) As Integer
Declare Sub P180X_ReadScanStatus Lib "P180X.dll" (wStatus As Integer, dwLowAlarm As Long, _
dwHighAlarm As Long)
Declare Function P180X_AddToScan Lib "P180X.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 P180X_SaveScan Lib "P180X.dll" (ByVal wOridinalOrder As Integer, _
wBuf As Integer) As Integer
Declare Sub P180X_WaitMagicScanFinish Lib "P180X.dll" (wStatus As Integer, _
wLowAlarm As Integer, _ wHighAlarm As Integer)
Declare Function P180X_StopMagicScan Lib "P180X.dll" () As Integer
Declare Function P180X_DelayUs Lib "P180X.dll" (ByVal wDelayUs As Integer) As Integer
'------------------------ FunA series ----------------------------
'------------------------ FunB series ---------------------------Declare Function P180X_FunB_Start Lib "P180X.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 P180X_FunB_ReadStatus Lib "P180X.dll" () As Integer
Declare Function P180X_FunB_Stop Lib "P180X.dll" () As Integer
Declare Function P180X_FunB_Get Lib "P180X.dll" (P0 As Long) As Integer
Declare Function P180X_Card0_StartScan Lib "P180X.dll" (ByVal wSampleRate As Integer, _
wChannelStatus As Integer, wChannelConfig As Integer, ByVal wCount As Integer) As Integer
Declare Function P180X_Card0_ReadStatus Lib "P180X.dll" (wBuf As Integer, wBuf2 As Integer, _
dwP1 As Long, dwP2 As Long, wStatus As Integer) As Integer
Declare Sub P180X_Card0_Stop Lib "P180X.dll" ()
Page 16
OME-PCI-180x Software Manual
Declare Function P180X_Card1_StartScan Lib "P180X.dll" (ByVal wSampleRate As Integer, _
wChannelStatus As Integer, wChannelConfig As Integer, _
ByVal wCount As Integer) As Integer
Declare Function P180X_Card1_ReadStatus Lib "P180X.dll" (wBuf As Integer, wBuf2 As Integer, _
dwP1 As Long, dwP2 As Long, wStatus As Integer) As Integer
Declare Sub P180X_Card1_Stop Lib "P180X.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
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
OME-PCI-180x Software Manual
1.6.3 DEMO1.FRM
Public Sub ShowWave()
Dim a(1000), yc, xc, xl, yt As Single
Dim ii As Integer
Dim tmpstr$
// Function of Test
function P180X_FloatSub2(fA:Single; fB:Single):Single ; stdCall;
function P180X_ShortSub2(nA:SmallInt; nB:SmallInt):SmallInt ; stdCall;
function P180X_GetDllVersion:WORD ; stdCall;
// Function of Driver
function P180X_DriverInit(Var wTotalBoards:Word):WORD ; stdCall;
procedure P180X_DriverClose; stdCall;
function P180X_GetDriverVersion(var wDriverVersion:Word):WORD ; stdCall;
function P180X_GetConfigAddressSpace(wBoardNo:Word;
var wAddrTimer:Word; var wAddrCtrl:Word; var wAddrDio:Word;
var wAddrAdda:Word):WORD ; stdCall;
function P180X_ActiveBoard(wBoardNo:Word):WORD ; stdCall;
function P180X_WhichBoardActive:WORD ; stdCall;
// Function of M_Fun series
function P180X_M_FUN_1(wDaFrequency:WORD; wDaWave:WORD;
wCount:WORD):WORD ; stdCall;
function P180X_Card0_ReadStatus(wBuf:PWORD; wBuf2:PWORD;
var dwP1:LongInt; var dwP2:LongInt; var wStatus:WORD):WORD ; stdCall;
procedure P180X_Card0_Stop; stdCall;
function P180X_Card1_StartScan(wSampleRate:WORD;
wChannelStatus:PWORD; wChannelConfig:PWORD;
wCount:WORD):WORD ; stdCall;
function P180X_Card1_ReadStatus(wBuf:PWORD; wBuf2:PWORD;
var dwP1:LongInt; var dwP2:LongInt;
var wStatus:WORD):WORD ; stdCall;
procedure P180X_Card1_Stop; stdCall;
//*******************
function P180X_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 P180X_FunA_ReadStatus:WORD ; stdCall;
function P180X_FunA_Stop:WORD ; stdCall;
function P180X_FunA_Get(var P0:LongInt; var P1:LongInt):WORD ; stdCall;
//*******************
function P180X_FunB_Start( wClock0Div:WORD; wChannel0:PWord;
wConfig0:PWord; Buffer0:PWord;
dwMaxCount0:LongInt; nPriority:SmallInt):WORD ; stdCall;
function P180X_FunB_ReadStatus:WORD ; stdCall;
function P180X_FunB_Stop:WORD ; stdCall;
function P180X_FunB_Get(var P0:LongInt):WORD ; stdCall;
function P180X_FloatSub2; external 'P180X.DLL' name 'P180X_FloatSub2';
function P180X_ShortSub2; external 'P180X.DLL' name 'P180X_ShortSub2';
function P180X_GetDllVersion;
external 'P180X.DLL' name 'P180X_GetDllVersion';
function P180X_GetDriverVersion;
external 'P180X.DLL' name 'P180X_GetDriverVersion';
function P180X_DriverInit; external 'P180X.DLL' name 'P180X_DriverInit';
procedure P180X_DriverClose; external 'P180X.DLL' name 'P180X_DriverClose';
function P180X_GetConfigAddressSpace;
external 'P180X.DLL' name 'P180X_GetConfigAddressSpace';
function P180X_ActiveBoard; external 'P180X.DLL' name 'P180X_ActiveBoard';
function P180X_WhichBoardActive;
external 'P180X.DLL' name 'P180X_WhichBoardActive';
// Function of M_Fun series
function P180X_M_FUN_1; external 'P180X.DLL' name 'P180X_M_FUN_1';
function P180X_M_FUN_2; external 'P180X.DLL' name 'P180X_M_FUN_2';
function P180X_M_FUN_3; external 'P180X.DLL' name 'P180X_M_FUN_3';
function P180X_M_FUN_4; external 'P180X.DLL' name 'P180X_M_FUN_4';
function P180X_Do; external 'P180X.DLL' name 'P180X_Do';
function P180X_Di; external 'P180X.DLL' name 'P180X_Di';
function P180X_Da; external 'P180X.DLL' name 'P180X_Da';
function P180X_SetChannelConfig;
external 'P180X.DLL' name 'P180X_SetChannelConfig';
function P180X_AdPolling; external 'P180X.DLL' name 'P180X_AdPolling';
function P180X_AdsPolling; external 'P180X.DLL' name 'P180X_AdsPolling';
Page 25
Loading...
+ 57 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.