API Reference

Classes

MTIDevice

class MTIDevice

CREATION AND TERMINATION

Constructor and Destructor of the MTIDevice class

MTIDevice()
~MTIDevice()
void DeleteDevice()

Deletes the device object from the memory.

SEARCH AND CONNECTION

Open the COM port and connect to the addressed device.

void ConnectDevice(char *portName)

Opens the COM port and connects to the addressed device.

void ConnectDevice(MTISerialIO *socket)

Connects to device at a previously connected MTISerialIO socket.

void ConnectDevice(void)

Opens the first available serial device and connects to the device.

void DisconnectDevice()

Stops communication and closes the COM port.

MTIAvailableDevices *GetAvailableDevices()

Searches for available devices to connect to at the host and returns the devices with port settings. It tests for the maximum possible connection speed.

void ListAvailableDevices(MTIAvailableDevices *table)

Lists all available devices on COM Ports.

Parameters
  • [in] table: The MTIAvailableDevices* object returned by GetAvailableDevices.

OPERATION

Methods involved in operating the MEMS device

void StopDataStream()

Stops the data output operation of the device. Sampling stops and object obtains info about the last sample output.

void SendDataStream(float *x, float *y, unsigned char *m, unsigned int numSamples, unsigned int delaySamples = 0, bool minimizeJump = true)

SendDataStream sends (X,Y) coordinates, modulation data, and additional settings for the output operation to the Controller.

By default, the device will start outputting the data after everything is received.

Parameters
  • [in] x[in] y: The (X,Y) Cartesian coordinates, with range of -1 to 1

  • [in] m: The modulation data, with range of 0-255

  • [in] numSamples: Number of samples to be sent to the Controller. Range is from 1 to the length of the passed X/Y/M arrays (or maximum buffer size for the Controller).

  • [in] delaySamples: delaySamples is a parameter that allows user to adjust output timing of the digital output with respect to the X,Y outputs by delaying the digital output by a number of samples. delaySamples should be a value between 0 and numSamples-1 which is maximum amount of m-samples rotation possible. When value is 0, there is internal delay added to compensate for the hardware filter’s group delay regardless, so this compensation can be increased by this parameter.

  • [in] minimizeJump: A true/false value that dictates whether the function will rotate the data stream so that the distance between the first sample in the new stream is closest to the last sample of the previously sent stream. This is done to minimize the jump and, in turn, any excitation of resonance when transitioning from one stream to next.

void StartDataStream(int repeatCount = -1, bool confirmOnComplete = true)

Starts the output operation of the device.

Parameters
  • repeatCount: The number of times the Controller should output the data stream. If repeatCount is 0 or less, the Controller will output the data stream infinitely until stopped.

  • confirmOnComplete: If confirmOnComplete = false, the function will not wait for a receipt from the device that the data stream was outputted. confirmOnComplete is only useful when repeatCount is not -1.

void ResetDevicePosition()

Resets the MEMS device position back to its origin. It is a special case of GoToDevicePosition with (X, Y) = (0, 0) ResetDevicePosition function also resets any output offsets to (0, 0) For more details see GoToDevicePosition

void GoToDevicePosition(float x, float y, unsigned char m, unsigned int mSec = 5)

MEMS device will be stopped and position will be changed from stopped position (XStop, YStop) to new (X, Y) with a step of a specific duration of time, specified by user in as (mSec) in milliseconds.

It should be noted that the step happens after approx. 100-200ms of communication and processing. If step time parameter (mSec) is omitted in the function call, the function will use a default value of 5ms. Note that the actual step time of the device from stopped position to new position is ultimately a function of both the stated (mSec) parameter and the bandwidth setting of the hardware filters or HardwareFilterBw which may additionally increase the step time.

Parameters
  • [in] x[in] y: The (X,Y) Cartesian coordinates, with range of -1 to 1

  • [in] m: The modulation data, with range of 0-255

  • [in] mSec: The duration of the step between (XStop, YStop) and new (X, Y). Range of mSec is 1 to 5000 except in special case where 0 is accetable. Use mSec=0 to move the device with minimal step time. In the case of mSec=0, only a single step is streamed and mirror will step in the time limited only by the HardwareFilterBw - therefore this can be potentially damage or destroy the device if hardware filter bandwidth is not set to recommended or reasonbly low limit.

Furthermore, if the requested step time is too short for a given MEMS mirror design, and HardwareBandwidthBw is too high, the device may take a longer time to settle into new position while overshooting and ringing about the position.

void SetRGBData(unsigned int *rgbData, unsigned int numSamples)

Set MTIDevice::m_iRGBData array to an array of RGB values provided by this function

Each rgbData unsigned int has 4 bytes with the format 0x00RRGGBB (most significant byte is not used, then 1 byte of red, 1 byte of green and 1 byte of blue) Each color’s byte is a value from 0 to 255 The RGBData will not be sent to the Controller until

MTIDevice::SendDataStream is called.
Parameters
  • [in] rgbData: The array of RGB samples to be set in MTIDevice object’s RGBData array

  • [in] numSamples: The number of samples from provided array to be copied to MTIDevice::m_iRGBData Typically the length of the prepared data.

void SetRGBData(unsigned int rgbColor, unsigned int numSamples = 0)

Populate MTIDevice::m_iRGBData member with a single RGB color value provided by this function

Each rgbData unsigned int has 4 bytes with the format 0x00RRGGBB (most significant byte is not used, then 1 byte of red, 1 byte of green and 1 byte of blue) Each color’s byte is a value from 0 to 255 The RGBData will not be sent to the Controller until

MTIDevice::SendDataStream is called.
Parameters
  • [in] rgbColor: The single RGB value to populate the MTIDevice’s RGBData array

  • [in] numSamples: The number of samples from provided array to be copied to MTIDevice::m_iRGBData Typically the length of the prepared data.

void SetRGBDriverParameters(unsigned char redOffset, unsigned char redGain, unsigned char greenOffset, unsigned char greenGain, unsigned char blueOffset, unsigned char blueGain)
MTIRGBDriverParams *GetRGBDriverParameters()
void SetRGBGammas(float gamma_R, float gamma_G, float gamma_B)

Apply gamma corrections to the m_iRGBData array. Gamma correction is only applied once SendDataStream is called and only to the RGB samples sent to the Controller. The m_iRGBData array will NOT be altered to reflect the gamma correction.

void GetRGBData(unsigned int *rgbData, unsigned int numSamples)

Get MTIDevice object’s RGBData array

Each rgbData unsigned int has 4 bytes with the format 0x00RRGGBB (most significant byte is not used, then 1 byte of red, 1 byte of green and 1 byte of blue) Each color’s byte is a value from 0 to 255

Parameters
  • [out] rgbData: The pre-allocated array for the method to return values in the MTIDevice’s RGBData array

  • [in] numSamples: The length of samples in the MTIDevice’s RGBData array to get

void SaveToFlash(MTIFlash flashsave)

Sends settings to the target to save params, data, or both to flash memory.

CONTROL AND STATUS

Resetting and querying the Controller for status

void ClearInputBuffer()

Clears the input buffer of the device.

void SendSerialReset()

Clears the SerialIO buffers and resets the communication.

void ResetDevice()

Resets the device parameters to its default settings. Keeps all data in the device memory.

float GetXStop()

After StopDataStream(), returns the last outputted X point where the device stopped.

float GetYStop()

After StopDataStream(), returns the last outputted Y point where the device stopped.

unsigned char GetMStop()

After StopDataStream(), returns the last outputted digital output where the device stopped.

unsigned int GetIStop()

After StopDataStream(), returns the memory address where the device stopped.

bool IsDeviceConnected()

Verifies if a device socket is non-NULL - should be true when serial socket is connected.

bool IsDeviceResponding()

Verifies if a device is responding to serial commands - a ping of the Controller.

bool IsDeviceRunning()

Verifies if the output operation is presently running and generating samples.

bool IsTrackingSupported()

Verifies if the Controller’s firmware supports tracking functionality.

MTIError GetLastError()

Returns the last error. Called after each communication with the device to verify correct transfer.

void SetDefaultDeviceName(char *text, const std::string &pass)

DEVICE PARAMS

Methods for getting and setting Controller parameters

MTIDeviceParams *GetDeviceParams()

Get all device parametes from the device (Writable settings and read only firmware values).

void SetDeviceParams(MTIDeviceParams *params)

Sends the complete device parameter structure to the device (including all settings).

float GetDeviceParam(MTIParam param, int paramID = 0)

Gets a single parameter from the device.

void SetDeviceParam(MTIParam param, float paramValue1, float paramValue2 = 0.f)

Sets a single parameter on the device.

MTIDeviceParams *LoadDeviceParams(const char *fileName)

Loads a single or multiple device parameters in the parameter structure from a file (by default “mtidevice.ini”).

void SaveDeviceParams(char *fileName)

Saves the complete parameter structure into a file.

char *GetEnumString(const char *enumName, int enumValue)

TRACK PARAMS

Methods for getting and setting Controller tracking parameters

MTITrackParams *GetTrackParams()

Get the device’s tracking parameter structure from the device (requires tracking functionality).

void SetTrackParams(MTITrackParams *params)

Sends the complete device tracking parameter structure to the device (requires tracking functionality).

void GetTrackIntegrals(int &TrackIntegralX, int &TrackIntegralY)

Get back the integration values for tuning parameters.

MTITrackStatus *GetTrackStatus()

ANALOG INPUTS

Methods for handling Analog Input

float GetAnalogInputValue(unsigned int ChannelNumber)

Samples immediately one value from Analog Input Channel 0 or 1.

float GetPhotoDetectorValue()

Samples immediately one value from Analog Input Channel 0, demodulated over one sample. For proper function SyncMode should be OutputSampleClock, so laser will modulate on/off in each sample

void GetAnalogInputBuffer(float *AI0, float *AI1, unsigned int DataLength)

Gets the sampled values from channel 1 or 2. (Obtained before via MTIDataMode parameter).

unsigned int GetAnalogInputStream(float *AI0, float *AI1, unsigned int DataLength = 0)

Gets the sampled values from channel 1 or 2 as they stream. Get as many as are available, return how many were obtained.

unsigned int GetSamplesRemaining()

Gets the samples remaining in data buffer.

MTIDataGenerator

Note

Class not available in SDK-Matlab

class MTIDataGenerator

Creation and Termination

Constructor and Destructor of the MTIDataGenerator class

MTIDataGenerator()
~MTIDataGenerator()

Transforms

Transform data for content generation

void BoundingBox(float *xData, float *yData, unsigned int numPoints, float &xMin, float &xMax, float &yMin, float &yMax)
unsigned int NormalizeData(float *xData, float *yData, unsigned int numPoints, float amplitude, float theta, float &xMin, float &xMax, float &yMin, float &yMax)
unsigned int AffineTransformData(float *xData, float *yData, unsigned int numPoints, float amplitude, float theta, float xof, float yof)
void InitProjectiveTransformMatrix(float *x, float *y, bool inverse)
unsigned int ProjectiveTransformData(float *xData, float *yData, unsigned int numPoints)
unsigned int TangentialTransformData(float *xData, float *yData, unsigned int numPoints, float thetaMax)
void InitRadialTransformMult(bool inverse)
unsigned int RadialTransformData(float *xData, float *yData, unsigned int numPoints, float k)
unsigned int TransformData(float *xData, float *yData, unsigned int numPoints, float amplitude, float theta, float xof, float yof, bool projXfm, float tanXfmTheta, float barXfmK)

Utilities

Utilities for content generation

int gcd(int a, int b)
float saw(float theta)
unsigned int AnimationRotate(float *xData, float *yData, unsigned char *mData, unsigned int numPoints, unsigned int numFrames)
unsigned int AnimationRotate(float *xData, float *yData, unsigned char *mData, unsigned int *rgbData, unsigned int numPoints, unsigned int numFrames)
unsigned int AnimationScroll(float *xData, float *yData, unsigned char *mData, unsigned int numPoints, unsigned int numFrames)
unsigned int AnimationScroll(float *xData, float *yData, unsigned char *mData, unsigned int *rgbData, unsigned int numPoints, unsigned int numFrames)
unsigned int AnimationBounce(float *xData, float *yData, unsigned char *mData, unsigned int numPoints, unsigned int numFrames, float theta)
unsigned int AnimationBounce(float *xData, float *yData, unsigned char *mData, unsigned int *rgbData, unsigned int numPoints, unsigned int numFrames, float theta)
unsigned int CloseCurve(float *xData, float *yData, unsigned char *mData, unsigned int numPoints, unsigned int closePoints, bool retrace = false)
unsigned int CloseCurve(float *xData, float *yData, unsigned char *mData, unsigned int *rgbData, unsigned int numPoints, unsigned int closePoints, bool retrace = false)

Waveforms

Useful waveforms for content generation

unsigned int SineWaveform(float *xData, float *yData, unsigned char *mData, unsigned int numPoints, float amplitude, unsigned int frequency, float phase)
unsigned int SawtoothWaveform(float *xData, float *yData, unsigned char *mData, unsigned int numPoints, float amplitude, unsigned int frequency, float width, float phase)
unsigned int SquareWaveform(float *xData, float *yData, unsigned char *mData, unsigned int numPoints, float amplitude, unsigned int frequency, float width, float phase)
unsigned int NoiseWaveform(float *xData, unsigned int numPoints, float amplitude)
unsigned int RQWaveform(float *xData, float *yData, unsigned char *mData, unsigned int &sps, bool sawtoothOnY, float xAmplitude, float yAmplitude, unsigned int xFrequency, float numPeriods, float dutyCycle, float yBandwidth)

Curves

Curves for content generation

unsigned int SpiralCurve(float *xData, float *yData, unsigned char *mData, unsigned int numPoints, float xAmplitude, float yAmplitude, unsigned int frequency, float phase)
unsigned int PolygonCurve(float *xData, float *yData, unsigned char *mData, unsigned int numPoints, float amplitude, unsigned int frequency, float phase)
unsigned int SpirographCurve(float *xData, float *yData, unsigned char *mData, unsigned int numPoints, unsigned int curveType, unsigned int waveType, float amplitude, int p1, int p2, int p3)
unsigned int LissajousCurve(float *xData, float *yData, unsigned char *mData, unsigned int numPoints, unsigned int waveType, float amplitude, unsigned int xFreq, unsigned int yFreq, float phase, unsigned int modType, float modAmplitude, unsigned int modFreq, float modPhase)
unsigned int AnalogClockCurve(float *xData, float *yData, unsigned char *mData, unsigned int hrs, unsigned int min, unsigned int sec, float amplitude)
unsigned int DigitalClockCurve(float *xData, float *yData, unsigned char *mData, unsigned int hrs, unsigned int min, unsigned int sec, unsigned int fontIndex, float amplitude, float theta, bool retrace)
unsigned int DynamicsCurve(float *xData, float *yData, unsigned char *mData, unsigned int numPoints, float x0, float y0, float xVel, float yVel, float xAcc, float yAcc, float fRatio)

ILDA Text

Tools to generate ILDA text

void ClearIldaData()
void LoadIldaFile(const char *filename)
unsigned int IldaFrameType()
unsigned int IldaNumFrames()
unsigned int IldaNumMaxPoints()
unsigned int IldaNumTotalPoints()
unsigned int IldaFrameSize(unsigned int frameId)
unsigned int IldaAnimSize(unsigned int *frameIds, unsigned int numFrames)
unsigned int IldaDataStream(float *xData, float *yData, unsigned char *mData, unsigned int *frameIds, unsigned int numFrames, float amplitude, float theta, float theta1, float theta2, bool retrace)
unsigned int IldaDataStream(float *xData, float *yData, unsigned char *mData, unsigned int *rgbData, unsigned int *frameIds, unsigned int numFrames, float amplitude, float theta, float theta1, float theta2, bool retrace)

Hershey Text

Tools to generate Hershey text

void ClearHersheyData()
void LoadHersheyFile(const char *filename)
unsigned int HersheyNumMath()
unsigned int HersheyNumSym()
unsigned int HersheyNumOR()
unsigned int HersheyNumOC()
unsigned int HersheyIndexMath(unsigned int i)
unsigned int HersheyIndexSym(unsigned int i)
unsigned int HersheyIndexFont(unsigned int i, unsigned int j)
unsigned int HersheyDataSize(unsigned int *frameIds, unsigned int numFrames, bool ocMode)
unsigned int HersheyDataSize(const char *text, unsigned int numChars, unsigned int fontIndex)
unsigned int HersheyDataStream(float *xData, float *yData, unsigned char *mData, unsigned int *charIds, unsigned int numChars, bool ocMode, float amplitude, float theta, bool retrace)
unsigned int HersheyDataStream(float *xData, float *yData, unsigned char *mData, const char *text, unsigned int numChars, unsigned int fontIndex, float amplitude, float theta, bool retrace)

Point Files

Point files have 3 columns, for X data (-1 to 1), Y data (-1 to 1), and M data (0-255 for digital output) File may specify sample per second rate SPS in the first line

void ClearPointFileData()
void AllocPointFileData(unsigned int numPoints)
unsigned int LoadPointFile(const char *filename)
unsigned int PointFileDataStream(float *xData, float *yData, unsigned char *mData)
unsigned int GetPointFileSize()
unsigned int GetPointFileSps()
void ExportFile(const char *filename, float *xData, float *yData, unsigned char *mData, unsigned int numPoints, unsigned int sps)
float ReadFileParameter(const char *filename, const char *paramName, float paramValue = 0.f)

Point-Time Files - Files

Point-Time files have 4 columns, for X data (-1 to 1 float), Y data (-1 to 1 float), M data (0-255 for digital output), and T data (0 to 1 float) for time duration at specified XYM values File may specify sample per second rate SPS in the first line

void ClearPointTimeFileData()
void AllocPointTimeFileData(unsigned int numPoints)
unsigned int LoadPointTimeFile(const char *filename)
unsigned int PointTimeFileDataStream(float *xData, float *yData, unsigned char *mData, float *tData)
unsigned int GetPointTimeFileSize()
unsigned int GetPointTimeFileSps()

Interpolation

Functions for interpolating data using various interpolation methodologies

void ClearInterpData()
void AllocInterpData(unsigned int numKeyPoints, unsigned int numSamplePoints)
unsigned int InterpolateData(float *xKey, float *yKey, unsigned char *mKey, float *xSample, float *ySample, unsigned char *mSample, unsigned int numKeyPoints, unsigned int numSamplePoints, float ooRatio = 2.5, float onFrac = 0.1, float offFrac = 0.5)
unsigned int InterpolateDataLinear(float *xKey, float *yKey, unsigned char *mKey, float *xSample, float *ySample, unsigned char *mSample, unsigned int numKeyPoints, unsigned int numSamplePoints, float ooRatio = 2.5)
unsigned int InterpolateDataTrapezoidal(float *xKey, float *yKey, unsigned char *mKey, float *xSample, float *ySample, unsigned char *mSample, unsigned int numKeyPoints, unsigned int numSamplePoints, float ooRatio = 2.5, float onFrac = 0.1, float offFrac = 0.5)
unsigned int InterpolateDataOptimized(float *xKey, float *yKey, unsigned char *mKey, unsigned int *rgbKey, float *xSample, float *ySample, unsigned char *mSample, unsigned int *rgbSample, unsigned int numKeyPoints, unsigned int numSamplePoints)
unsigned int InterpolateDataOptimized(float *xKey, float *yKey, unsigned char *mKey, float *xSample, float *ySample, unsigned char *mSample, unsigned int numKeyPoints, unsigned int numSamplePoints)
unsigned int OptimizeKeypoints(float *xKey, float *yKey, unsigned char *mKey, unsigned int numKeyPoints, unsigned int targetNumKeyPoints = 0)
unsigned int OptimizeKeypoints(float *xKey, float *yKey, unsigned char *mKey, unsigned int *rgbKey, unsigned int numKeyPoints, unsigned int targetNumKeyPoints = 0)

Filtering

Functions for filtering data

void LoadIIRFilterParams(const char *filename)
unsigned int GetIIRFilterOrder()
unsigned int GetIIRFilterSps()
void SetupSoftwareFilter(unsigned int type, unsigned int order, float cutoffFreq, float sampleFreq, bool twoChannel = true)
void FilterData(float *xData, float *yData, float *xFilt, float *yFilt, unsigned int numPoints, bool zeroPhase = true)
void FilterData(float *xData, float *xFilt, unsigned int numPoints, bool zeroPhase = true)

Scan Patterns

Functions to generate various scan patterns

unsigned int LinearRasterPattern(float *xData, float *yData, unsigned char *mData, float xAmp, float yAmp, unsigned int numLines, unsigned int numPixels, float lineTime, bool ppMode, bool retrace, int triggerShift, float theta, unsigned int &sps, int spsMin, int spsMax)
unsigned int LinearRasterPatternImaging(float *xData, float *yData, unsigned char *mData, float xAmp, float yAmp, unsigned int numLines, unsigned int numPixels, float lineTime, bool ppMode, bool retrace, int triggerShift, float theta, unsigned int &sps, int spsMin, int spsMax)
unsigned int PointToPointPattern(float *xData, float *yData, unsigned char *mData, float *xPoints, float *yPoints, unsigned char *mPoints, float *tPoints, int nSamples, float stepTime, unsigned int &sps, int spsMin, int spsMax)
void LaserWriterInterpData(int inCount, int outCount, unsigned char *inM, float *inX, float *inY, unsigned char *outM, float *outX, float *outY, float DON, float DOFF, int closed_trajectory)
void LaserWriterInterpData1Seg(int inCount, int outCount, float *inX, float *outX, float DON)

MirrorcleDraw Wrappers

MirrorcleDraw Wrappers

unsigned int CurvesDataSize(unsigned int curveType, unsigned int sps, float rr, unsigned int animType, float atime, bool retrace, unsigned int fileType, unsigned int m1, unsigned int m2, float p2, float p3, float p4, const char *txt, unsigned int numChars)
unsigned int GenerateAnimations(float *xSample, float *ySample, unsigned char *mSample, unsigned int animType, unsigned int numSamplePoints, unsigned int numAnimFrames)
unsigned int GenerateAnimations(float *xSample, float *ySample, unsigned char *mSample, unsigned int *rgbSample, unsigned int animType, unsigned int numSamplePoints, unsigned int numAnimFrames)
void GenerateWaveformData(float *xKey, float *yKey, unsigned char *mKey, float *xSample, float *ySample, unsigned char *mSample, unsigned int &numKeyPoints, unsigned int &numSamplePoints, unsigned int sps, float rr, bool retrace, float oor, float onFrac, unsigned int animType, float atime, unsigned int filtType, unsigned int m1, float p1, float p2, float p3, float p4, float theta, float xof, float yof, bool projXfm, float tanXfmTheta, float barXfmK)
void GenerateSpirographData(float *xKey, float *yKey, unsigned char *mKey, float *xSample, float *ySample, unsigned char *mSample, unsigned int &numKeyPoints, unsigned int &numSamplePoints, unsigned int sps, float rr, bool retrace, float oor, float onFrac, unsigned int animType, float atime, unsigned int filtType, unsigned int m1, unsigned int m2, float p1, float p2, float p3, float p4, float theta, float xof, float yof, bool projXfm, float tanXfmTheta, float barXfmK)
void GenerateLissajousData(float *xKey, float *yKey, unsigned char *mKey, float *xSample, float *ySample, unsigned char *mSample, unsigned int &numKeyPoints, unsigned int &numSamplePoints, unsigned int sps, float rr, bool retrace, float oor, float onFrac, unsigned int animType, float atime, unsigned int filtType, unsigned int m1, unsigned int m2, float p1, float p2, float p3, float p4, float p5, float p6, float p7, float theta, float xof, float yof, bool projXfm, float tanXfmTheta, float barXfmK)
void GenerateImportFileData(float *xKey, float *yKey, unsigned char *mKey, float *xSample, float *ySample, unsigned char *mSample, unsigned int &numKeyPoints, unsigned int &numSamplePoints, unsigned int sps, float rr, bool interpILDA, bool retrace, float oor, float onFrac, unsigned int animType, float atime, unsigned int filtType, unsigned int fileType, float Amplitude, float p2, float p3, float p4, float theta, float xof, float yof, bool projXfm, float tanXfmTheta, float barXfmK)
void GenerateImportFileData(float *xKey, float *yKey, unsigned char *mKey, unsigned int *rgbKey, float *xSample, float *ySample, unsigned char *mSample, unsigned int *rgbSample, unsigned int &numKeyPoints, unsigned int &numSamplePoints, unsigned int sps, float rr, bool interpILDA, bool retrace, float oor, float onFrac, unsigned int animType, float atime, unsigned int filtType, unsigned int fileType, float Amplitude, float p2, float p3, float p4, float theta, float xof, float yof, bool projXfm, float tanXfmTheta, float barXfmK)
void GenerateTextData(float *xKey, float *yKey, unsigned char *mKey, float *xSample, float *ySample, unsigned char *mSample, unsigned int &numKeyPoints, unsigned int &numSamplePoints, unsigned int sps, float rr, bool retrace, float oor, float onFrac, unsigned int animType, float atime, unsigned int filtType, unsigned int TextMode, unsigned int TextFont, float Amplitude, float CharID, const char *txt, unsigned int numChars, float theta, float xof, float yof, bool projXfm, float tanXfmTheta, float barXfmK)
void GenerateScanData(float *xKey, float *yKey, unsigned char *mKey, float *xSample, float *ySample, unsigned char *mSample, unsigned int &numKeyPoints, unsigned int &numSamplePoints, unsigned int &sps, float rr, bool retrace, float oor, float onFrac, unsigned int animType, float atime, unsigned int filtType, unsigned int m1, unsigned int m2, float p1, float p2, float p3, float p4, float e1, float e2, unsigned int bwc, void *pImage, unsigned int spsMin, unsigned int spsMax, float theta, float xof, float yof, bool projXfm, float tanXfmTheta, float barXfmK)
void GenerateClockData(float *xKey, float *yKey, unsigned char *mKey, float *xSample, float *ySample, unsigned char *mSample, unsigned int &numKeyPoints, unsigned int &numSamplePoints, unsigned int sps, float rr, bool retrace, float oor, float onFrac, unsigned int animType, float atime, unsigned int filtType, unsigned int hrs, unsigned int min, unsigned int sec, unsigned int ClockType, unsigned int TextFont, float Amplitude, float theta, float xof, float yof, bool projXfm, float tanXfmTheta, float barXfmK)
void GenerateSignalData(float *xKey, float *yKey, unsigned char *mKey, float *xSample, float *ySample, unsigned char *mSample, unsigned int &numKeyPoints, unsigned int &numSamplePoints, unsigned int &sps, unsigned int sigType, unsigned int m1, unsigned int m2, float p1, float p2, float p3, float p4, float p5, float p6, float p7, float xof, float yof)

MTIDeviceParams

class MTIDeviceParams

Public Members

bool Success
char DeviceName[32]
char FirmwareName[16]
char CommType[16]
char BluetoothMAC[16]
unsigned int HardwareFilterOn
float VmaxMEMSDriver
unsigned int DeviceState
unsigned int DeviceErrorRegister
unsigned int USARTBaudRate
unsigned int SampleRate
unsigned int HardwareFilterBw
float VdifferenceMax
float Vbias
float XOffset
float YOffset
float DataScale
float DataRotation
unsigned int MEMSDriverEnable
unsigned int DigitalOutputEnable
unsigned int LaserModulationEnable
unsigned int BufferOffset
MTIAxes DeviceAxes
MTIBoot BootSetting
MTIDataMode DataMode
MTISync SyncMode
MTIDataFormat DataFormat
unsigned int SampleRate_Min
unsigned int SampleRate_Max
unsigned int SamplesPerFrame_Min
unsigned int SamplesPerFrame_Max
unsigned int HardwareFilterBw_Min
unsigned int HardwareFilterBw_Max
unsigned int FramesPerSecond_Min
unsigned int FramesPerSecond_Max
unsigned int VdifferenceMax_Min
unsigned int VdifferenceMax_Max
unsigned int Vbias_Min
unsigned int Vbias_Max
struct MTIDeviceParams::[anonymous] DeviceLimits

MTIAvailableDevices

class MTIAvailableDevices

Public Members

char DeviceName[MTI_MAXDEVICES][32]
char FirmwareName[MTI_MAXDEVICES][16]
char CommType[MTI_MAXDEVICES][16]
unsigned int USARTBaudRate[MTI_MAXDEVICES]
unsigned int CommPortNumber[MTI_MAXDEVICES]
char CommPortName[MTI_MAXDEVICES][10]
float VmaxMEMSDriver[MTI_MAXDEVICES]
unsigned int NumDevices

MTITrackParams

class MTITrackParams

Public Members

bool Success
float Threshold
int NormalGain
int TangentialGain
unsigned int BufferDelay
float HitRatio
unsigned int EnableSearch
unsigned int EnableOffsetStreaming
unsigned int EnableTrack

MTITrackStatus

class MTITrackStatus

Public Members

bool Success
bool TrackLocked
float XOffset
float YOffset
unsigned int HitCount

MTIRGBDriverParams

class MTIRGBDriverParams

Public Members

bool Success
unsigned char RedOffset
unsigned char RedGain
unsigned char GreenOffset
unsigned char GreenGain
unsigned char BlueOffset
unsigned char BlueGain

Enums

MTIParam

enum MTIParam

Values:

HardwareFilterOn

Hardware Filter Available on Driver (Read only)

VmaxMEMSDriver

Maximum Voltage range of MEMS driver (Read only)

DeviceState

16-Bit register with various device states and flags (Read only)

DeviceErrorRegister

Register for device error states (Read only)

USARTBaudRate

USART communication Baud Rate - Default of 460kBaud.

SampleRate

Sample Rate of the controller to update MEMS position, DOut, read AIs, etc.

HardwareFilterBw

Hardware filter cut-off frequency - Recommended by MEMS Datasheet.

VdifferenceMax

Maximum differential voltage - Recommended by MEMS Datasheet.

Vbias

Bias Voltage for the MEMS - Recommended by MEMS Datasheet.

OutputOffsets

Offsets for MEMS driver output, Normalized value from -1 to +1.

DataScale

Normalized scale of VdifferenceMax MEMS output from 0.0 to 1.0.

DataRotation

Rotation of MEMS output in radians.

MEMSDriverEnable

Enable/ disable MEMS driver.

DigitalOutputEnable

Enable/ disable digital outputs.

LaserModulationEnable

Enable/ disable laser modulation at 2x sample rate (for Tracking)

BufferOffset

Offset memory buffer.

DeviceAxes

Device Axes orientation (Device Parameter Structure)

BootSetting

Device startup settings (Device Parameter Structure)

DataMode

Defines the data mode for operation (Device Parameter Structure)

SyncMode

Defines the sync port operation (Device Parameter Structure)

DataFormat

The format of the data sent to the Controller. Should align with the Controller’s firmware.

FramesPerSecond
InterpolationType
WaveformType

MTIError

enum MTIError

Values:

MTI_SUCCESS

Last operation/ communication was succesful.

MTI_ERR_INVALID_HANDLE

Handle is not existing.

MTI_ERR_INVALID_DEVICEID

No or wrong device ID.

MTI_ERR_GENERAL

General error.

MTI_ERR_SERIALCOMM

Communication error ocurred.

MTI_ERR_SERIALCOMM_READ_TIMEOUT

Communication timed out.

MTI_ERR_SERIALCOMM_SERIAL_RESET_FAIL

Reset of the communication failed.

MTI_ERR_INCORRECT_TARGET_RESPONSE

Incorrect response received from target device.

MTI_ERR_PARAMETER_OUT_OF_RANGE

Parameter value out of range.

MTI_ERR_SOME_PARAMETERS_CANNOT_BE_SET

Some parameters can not be set in the device.

MTI_ERR_INVALID_PARAMETER_NAME

Invalid parameter name.

MTI_ERR_CONNECTDEVICE_INVALID_PORTNAME

Invalid port name.

MTI_ERR_CONNECTDEVICE_PORT_NOT_AVAILABLE

Port not available.

MTI_ERR_LOADDEVICEPARAMS_FILE_NOT_FOUND

INI file not found.

MTIDeviceLimits

enum MTIDeviceLimits

Values:

SampleRate_Min

Minimum sample rate (Read only firmware)

SampleRate_Max

Maximum sample rate (Read only firmware)

SamplesPerFrame_Min

Minimum samples per frame (Read only firmware)

SamplesPerFrame_Max

Maximum samples per frame (Read only firmware)

HardwareFilterBw_Min

Minimum hardware filter bandwidth (Read only firmware)

HardwareFilterBw_Max

Maximum hardware filter bandwidth (Read only firmware)

FramesPerSecond_Min

Minimum frames per second (Read only firmware)

FramesPerSecond_Max

Maximum frames per second (Read only firmware)

VdifferenceMax_Min

Minimum differential voltage (Read only firmware)

VdifferenceMax_Max

Maximum differential voltage (Read only firmware)

Vbias_Min

Minimum bias voltage (Read only firmware)

Vbias_Max

Maximum bias voltage (Read only firmware)

MTIDataMode

enum MTIDataMode

Values:

Sample_Output = 0

Output mode at sample rate (default) (Continuous Run)

Sample_And_Analog_Input_Buffer = 1

Output mode for sampling analog input signals into buffer while outputting samples (Single Run)

Keypoint = 2

Output mode keypoints.

Text = 3

Output mode text.

Waveform = 4

Output mode waveforms.

Analog_Input_To_Output = 5

Output mode passing analog inputs (+/-10V) to MEMS driver.

Sample_And_Analog_Input_Stream = 6

Output mode for streaming analog inputs while outputting samples.

Sample_And_Analog_Input_Track = 7

Output mode for streaming analog inputs and streaming samples.

Auto_Track = 8

Automatic tracking.

MTISync

enum MTISync

Values:

Output_DOut0 = 0

Default digital output levels at pin 0.

Output_Inverted_DOut0 = 1

Inverted digital output levels at pin 0.

Output_Sample_Clock = 2

Output a clock signal at sync connector.

Output_Start_Trigger = 3

Output a trigger signal at sync connector.

External_Sample_Clock = 4

Input a external clock signal at sync connector.

External_Start_Trigger = 5

Input a start trigger signal at sync connector.

External_Frame_Trigger = 6

Input an external trigger signal at sync connector to start single scan of frame.

MTIAxes

enum MTIAxes

Values:

Normal = 0

Normal X,Y Axes Definition.

FlipXY = 1

Flip both axes.

MirrorY = 2

Mirror Y axis.

MirrorY_FlipXY = 3

Mirror Y, flip X with Y axis.

MirrorX = 4

Mirror X axis.

MirrorX_FlipXY = 5

Mirror X, flip X with Y axis.

MirrorX_MirrorY = 6

Mirror X,Y axes.

MirrorX_MirrorY_FlipXY = 7

Mirror and flip both axes.

MTIFlash

enum MTIFlash

Values:

Device_Params

Store device parameters in flash.

Data_In_Buffer

Store data in buffer in flash.

MTIBoot

enum MTIBoot

Values:

Boot_With_Factory_Defaults = 0

Boot with factory settings (default)

Boot_With_Flash_Device_Params = 1

Boot with (customized) device parameters from flash.

Boot_With_Flash_Data_And_Autorun = 2

Boot with (customized) device parameters and data from flash and auto run.

Boot_With_Flash_Data_No_Autorun = 3

Boot with (customized) device parameters and data from flash and wait for commands.

MTITrack

enum MTITrack

Values:

Threshold

Analog input voltage threshold to trigger tracking.

NormalGain

Tracking gain to follow target - corrections toward the estimated center of the target. Actual gain is applied in the Controller as 2^NormalGain, and therefore NormalGain is often a negative value.

TangentialGain

Tracking gain to move along the perimeter of target (Positive is clockwise and negative is counterclockwise). Corrections perpendicular to the estimated vector from current position to the center of the target.

BufferDelay

Tracking setting which corrects the time-correlation of XY MEMS positions and the M Digital Output, due to the fact that XY MEMS positions are delayed by filtering.

HitRatio

The ratio of the MEMS scan (nutation) that should hit/cover the target. (e.g. 1 to fully cover the target, 0.5 to cover half of the target).

EnableSearch

Toggle to enable / disable the search feature. When all points are below threshold, system can start a search raster pattern or stay in the same position depending on this setting.

EnableOffsetStreaming

Toggle to enable / disable offset streaming feature. When on, Controller will continuously stream current X and Y offset positions - during tracking this provides real time azimuth and elevation data about the target location. The other option is to disable this feature and asynchronously poll the positions using the GetDeviceParam( MTIParam::OutputOffsets, n)

EnableTrack

Toggle to enable / disable the track feature. When disabled, position will not be updated based on one nutation cycle. When enabled, offsets are updated to improve centering on the target, at each end of frame/buffer.

MTIBlockingMode

enum MTIBlockingMode

Values:

MTI_BLOCKING_MODE_ERR = -1
MTI_BLOCKING_MODE_OFF = 0
MTI_BLOCKING_MODE_ON = 1