Communication with data acquisition device is done via dll plugins.
Exported function set is declared inside MiniscopeDevice.h
. This file is (or should be) shared by miniscope and input dll projects. Dll function adresses are loaded dynamically at runtime. Not all functions are essential - if for example device has no sampling period setting it's dll doesn't have to implement SetSamplingPeriod function.
Libraries must be placed in application /device subdir. Libraries placed in this directory are added to list at program startup.
After selecting library used by program restart is required.
There are currently two device libraries available
- wavein.dll (data input based on sound card and WAVE IN interface)
- armscope.dll (interface to AT91SAM7S based oscilloscope you can find at http://tomeko.net/miniscope_v2.php)
- take a look at wavein.dll; this could be good start point for you source code,
- library project should include MiniscopeDevice.h and MiniscopeDeviceCapabilities.h (shared with miniscope project to keep interface consistent)
- put _EXPORTING macro before including MiniscopeDevice.h in your c/cpp file
- your dll doesn't have to implement every function declared inside MiniscopeDevice.h; look into DeviceInterface::Load() to check for required function
- describe your device capabilities (struct S_SCOPE_CAPABILITIES); if your device has i.e. only single sensitivity range this mean you do not have to put SetSensitivity function inside library
Miniscope can generate and use calibration data for device. This is especially usefull if analog front-end of device has no calibration capabilities and/or was made out of componets with poor tolerance and/or components had no exact values (well, this is precise description of my AT91SAM7S device).
Dll can export functions StoreCalibration and GetCalibration to allow storing calibration data.
Each calibration record applies to single sensitivity range (each sensitivity range can be calibrated by itself). Calibration record has two components:
- zero offset - actual data value corresponding to 0V level,
- sensitivity gain - real sensitivity divided by sensitivity reported by capabilities. To generate calibration data you need to supply to device test signal. Test signal should allow to recognize 0V level and other voltage level, preferably near full scale range. Square wave is a good test signal.
Capture test signal frame with oscilloscope and carefully place plot cursors. Cursor from RMB (right mouse button, blue color by default) should be placed at 0V level, cursor from LMB at known voltage level near full scale. Use calibration dialog to calculate and store calibration data.
Preferred place to store device calibration data by device library should be device itself (i.e. internal EEPROM).