Dataman 570 User Manual

Development kit for DATAMAN 570
Programmer’s Guide
C#.NET
Version 1.00
Copyright © 2004-2008 Dataman Programmers Ltd
Development kit for DATAMAN 570 series Programmer’s Guide
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 570 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
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..............................................................................................14
3.3. Functions, that set the data acquisition parameters...........................................15
3.3.1. SetTimeBase..............................................................................................15
3.3.2. SetRange....................................................................................................15
3.3.3. SetCoupling................................................................................................16
3.3.4. SetVert .......................................................................................................16
3.3.5. SetTriggerLevel .........................................................................................16
3.3.6. SetTriggerCount.........................................................................................17
3.3.7. SetTriggerLength.......................................................................................17
3.3.8. SetTriggerMode.........................................................................................17
3.3.9. SetAfterTriggerLength...............................................................................17
3.3.10. SetHoldOff...............................................................................................18
3.3.11. SetTriggerSource .....................................................................................18
3.3.12. SetTriggerEdge........................................................................................18
3.3.13. SetProbe...................................................................................................19
3.3.14. SetMemorySize........................................................................................19
3.3.15. SetCompensationGenerator .....................................................................19
3.3.16. SetGround................................................................................................20
3.3.17. SetDigitalShielding..................................................................................20
3.4. Data acqusition functions..................................................................................20
3.4.1. StartMeasurement......................................................................................20
3.4.2. IsDataReady...............................................................................................21
3.4.3. GetReconstructionPercentage....................................................................21
3.4.4. GetData......................................................................................................21
- 3 -
Development kit for DATAMAN 570 series Programmer’s Guide
3.5. Other functions..................................................................................................22
3.5.1. GroundPositionToShift..............................................................................22
- 4 -
Development kit for DATAMAN 570 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 570 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 m570drvdk.dll and m570drv.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 570 oscilloscope drivers installed. The m570drv.cs header file contains the cm570drv class, which encapsulates all DK functions and constants. Add this file to project to gain access to the cm570drv class. The m570drvdk.dll and m570drv.dll must be present in the same directory as .exe file (bin\debug) during debugging.

1.3. Application deployment

The m570drvdk.dll and m570drv.dll libraries must be distributed together with your application. The drivers for the DATAMAN 570 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 570 series Programmer’s Guide

2. Controlling the device

2.1. Device initialization

First of all, it is necessary to load the driver using thr function LoadDriver.
cm570drv.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; cm570drv.InitHardware(out calibok);

2.2. Error handling

In case the 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 = cm570drv.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).
cm570drv.ResetDKError();

2.3. Data acquisition loop

The data acquisition process can be started by calling StartMeasurement function.
cm570drv.StartMeasurement();
After the data acqusition starts, the software must wait until the data is ready in the device. Use IsDataReady function to check the acquisition status.
if (cm570drv.IsDataReady() == cm570drv.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; cm570drv.GetData(out data[0], out lng);
- 7 -
Loading...
+ 15 hidden pages