Development kit for DATAMAN 770 series Programmer’s Guide
Thank you for choosing the Dataman 770 Series Oscilloscope with Development Kit.
We are confident, that it will meet your expectations.
For any further information or consultations, please contact us via phone or preferably
e-mail on the following address:
Address:
Dataman Programmers Ltd
Station Road
Maiden Newton
Dorset
DT2 0AE
United Kingdom
Phone:
Sales/General information: +44 (0) 1300 320719
Technical support: +44 (0) 1300 322903
Fax:
All Enquiries: +44 (0) 1300 321012
Internet:
URL: http://www.dataman.com/
e-mail: support@dataman.com - technical support
sales@dataman.com - sales
info@dataman.com - other information
- 2 -
Development kit for DATAMAN 770 series Programmer’s Guide
Contents
1. Basic information.......................................................................................................6
1.1. Development kit contents ...................................................................................6
1.2. DK usage.............................................................................................................6
1.3. Application deployment......................................................................................6
2. Controlling the device................................................................................................7
2.1. Device initialization............................................................................................7
2.2. Error handling.....................................................................................................7
2.3. Data acquisition loop ..........................................................................................7
2.4. Acquired data allocation.....................................................................................8
2.5. Measurement in the sampling mode...................................................................8
2.5.1. Random sampling method ...........................................................................8
2.5.2. Measurement in sampling mode................................................................10
2.6. Using more 770 devices....................................................................................10
3. Reference .................................................................................................................11
3.1. Functions, that returns information about device .............................................12
3.1.1. GetDKError................................................................................................12
3.1.2. ResetDKError ............................................................................................12
3.1.3. GetDeviceID..............................................................................................12
3.1.4. GetDeviceSerialNumber............................................................................13
3.1.5. GetDKVersion ...........................................................................................13
3.1.6. GetTimeBaseList .......................................................................................13
3.1.7. GetRangeList .............................................................................................14
3.2. Initialization functions......................................................................................14
3.2.1. LoadDriver.................................................................................................14
3.2.2. InitHardware..............................................................................................15
3.2.3. GetDeviceList............................................................................................15
3.2.4. InitHardwareFromList ...............................................................................15
3.2.5. UseDevice..................................................................................................16
3.3. Functions, that set the data acquisition parameters...........................................16
3.3.1. SetTimeBase..............................................................................................16
3.3.2. SetRange....................................................................................................16
3.3.3. SetCoupling................................................................................................17
3.3.4. SetVert .......................................................................................................17
3.3.5. SetTriggerLevel .........................................................................................17
3.3.6. SetTriggerCount.........................................................................................18
3.3.7. SetTriggerLength.......................................................................................18
3.3.8. SetTriggerMode.........................................................................................18
3.3.9. SetAfterTriggerLength...............................................................................19
3.3.10. SetHoldOff...............................................................................................19
3.3.11. SetTriggerSource .....................................................................................19
3.3.12. SetTriggerEdge........................................................................................19
3.3.13. SetProbe...................................................................................................20
3.3.14. SetMemorySize........................................................................................20
3.3.15. SetCompensationGenerator .....................................................................20
3.3.16. SetGround................................................................................................21
3.3.17. SetDigitalShielding..................................................................................21
3.4. Data acqusition functions..................................................................................21
- 3 -
Development kit for DATAMAN 770 series Programmer’s Guide
3.4.1. StartMeasurement......................................................................................21
3.4.2. IsDataReady...............................................................................................22
3.4.3. GetReconstructionPercentage....................................................................22
3.4.4. GetData......................................................................................................22
3.5. Other functions..................................................................................................23
3.5.1. GroundPositionToShift..............................................................................23
- 4 -
Development kit for DATAMAN 770 series Programmer’s Guide
Figures and tables
Table 1.1. –Development kit (DK) contents..................................................................6
Fig. 2.4.1. – Data allocation in the array........................................................................8
Fig. 2.5.1.1. – Random sampling principle....................................................................9
- 5 -
Development kit for DATAMAN 770 series Programmer’s Guide
1. Basic information
1.1. Development kit contents
All development kit (DK) parts are located in the installation directory.
Directory Contents
Examples\C#.NET C#.NET example
Examples\VB.NET Visual Basic .NET example
Examples\VB Visual Basic 6.0 example
Examples\Delphi Delphi example
Examples\CBuilder C++ Builder example
Examples\VC Visual C++ example
Include\C#.NET C#.NET header files
Include\VB.NET Visual Basic .NET header files
Include\VB Visual Basic 6.0 header files
Include\Delphi Delphi header files
Include\CBuilder C++ Builder header files
Include\VC Visual C++ 6.0 header files
Bin M770drvdk.dll and m770drv.dll libraries
Table 1.1. –Development kit (DK) contents
1.2. DK usage
In order to make the DK work properly, it is necessary to have the DATAMAN 770
oscilloscope drivers installed. The m770drv.cs header file contains the cm770drv
class, which encapsulates all DK functions and constants. Add this file to project to
gain access to the cm770drv class. The m770drvdk.dll and m770drv.dll must be
present in the same directory as .exe file (bin\debug) during debugging.
1.3. Application deployment
The m770drvdk.dll and m770drv.dll libraries must be distributed together with your
application. The drivers for the DATAMAN 770 oscilloscope must be installed in the
system in order to communicate with the device. The application will work with every
device with an activated DK.
- 6 -
Development kit for DATAMAN 770 series Programmer’s Guide
2. Controlling the device
2.1. Device initialization
First of all, it is necessary to load the driver using the function LoadDriver.
cm770drv.LoadDriver();
After the driver is loaded it is possible to initialize the device using the function
InitHardware. This function also returns the information for the calibration data.
byte calibok;
cm770drv.InitHardware(out calibok);
2.2. Error handling
In case an error occurs all subsequent calls of functions will fail. Therefore it is
necessary to check if the operations were successful (for example check if the
initialization was successful). Use GetDKError to obtain the error code.
int res;
res = cm770drv.GetDKError();
In case of an error it is necessary to reset the error flag (to indicate to the DK, that the
error has been handled). Use ResetDKError function to do so (otherwise no other
function will be successful).
cm770drv.ResetDKError();
2.3. Data acquisition loop
The data acquisition process can be started by calling StartMeasurement function.
cm770drv.StartMeasurement();
After the data acquisition starts the software must wait until the data is ready in the
device. Use IsDataReady function to check the acquisition status.
if (cm770drv.IsDataReady() == cm770drv.DATA_READY)
{
}
When the data is ready for transfer to the computer (return value DATA_READY), it
is possible to transfer them to the computer using GetData function.
Sample[] data = new Sample[1024*1024];
int lng;
cm770drv.GetData(out data[0], out lng);
- 7 -