MTIDevice 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.

void GetAvailableDevices(MTIAvailableDevices *table)

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.

MTIAvailableDevices *GetAvailableDevices()

DEPRECATED. 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.

std::string GetAPIVersion()

Returns string for the MTIDevice API version number in x.y.z.w format.

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) positional coordinates, 8-bit Digital Output numbers, and additional settings for the output operation to the Controller.

By default, the device will start outputting the data after everything is received. To prevent this, preface this function with a call to

StopDataStream().
Parameters
  • [in] x: The array of X positional coordinates (Cartesian) to be sent with range of -1 to 1

  • [in] y: The array of Y positional coordinates (Cartesian) to be sent with range of -1 to 1

  • [in] m: The array of 8-bit Digital Output numbers (unsigned) to be sent 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 acceptable. 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 reasonably 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 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 SetLaserBoostEnable(unsigned int laserBoostEnable = 0)

For monochrome projectors with laser boost option in standard modes, boost of optical power can be enabled

Parameters
  • [in] laserBoostEnable: 1 to enable the higher laser power, 0 to disable

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

void GetDeviceParams(MTIDeviceParams *params)

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

MTIDeviceParams *GetDeviceParams()

DEPRECATED. Get all device parameters 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.

void LoadDeviceParams(MTIDeviceParams *params, const char *fileName)

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

MTIDeviceParams *LoadDeviceParams(const char *fileName)

DEPRECATED. 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

void GetTrackParams(MTITrackParams *params)

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

MTITrackParams *GetTrackParams()

DEPRECATED. 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.

void GetTrackStatus(MTITrackStatus *trackStatus)
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 GetSyMPL1Stream(float *distanceStream, float distanceLimit, unsigned int frameSize)
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()

While running, provides the number of samples that remain to be read from the buffer. Equal to (length of the data buffer - the index position + 1) at the requested moment in time

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 Files

Tools to load and display ILDA files

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)

LinearRasterPattern constructs a linear raster scan pattern based on the given parameters.

Returns the number of points in the constructed scan pattern

Parameters
  • [inout] xData: X position output container with pre-allocated length (recommended 100,000 points)

  • [inout] yData: Y position output container with pre-allocated length (recommended 100,000 points)

  • [inout] mData: 8-bit Digital Output number output container with pre-allocated length (recommended 100,000 points) Bit 0: On during the “active” portion of line Bit 1: On during the pixel portion of line Bit 2: Pulsed at the beginning of the frame Bit 3: Indicated Y-Axis direction

  • [in] xAmp: Amplitude of X-axis of the raster scan (normalized from 0.0 to 1.0)

  • [in] yAmp: Amplitude of Y-axis of the raster scan (normalized from 0.0 to 1.0)

  • [in] numLines: Total number of raster lines. During each line scan there is a high output on DOut0, and during each turn-around there is a low output on DOut0.

  • [in] numPixels: When ppMode = true, numPixels corresponds to the number of stop-and-go locations (“pixels”) along a line. In both ppMode = false and ppMode = true, numPixels corresponds to the number of equally spaced Digital Output pulses along a line, contained in Bit 1 of mData.

  • [in] lineTime: Duration of time allocated to each raster line in seconds. The time is specifically allocated to the ‘active’ portion of each line. The actual scan along one line will include a small additional percentage of time for turn-around.

  • [in] ppMode: ppMode = 1 corresponds to point-to-point raster with near stopping at each point. ppMode = 0 corresponds to a uniform velocity line raster.

  • [in] retrace: Toggles between bi-directional writing on (1) and off (0)

  • [in] triggerShift: Number of samples the synchronous digital output should be rotated with respect to the MEMS Driver X, Y output (can be negative or positive). User may want to differently align the locations of the TTL pulses on DOut0-3 and can therefore rotate forward or backward a number of samples.

  • [in] theta: Rotation angle for the raster pattern (looking toward display surface) in radians. Passing 0 results in vertical lines.

  • [inout] sps: Sample rate of raster scan. The user can pre-set this sample rate, however the function will likely override and return a rate based on the numLines and numPixels input to best match the desired scan

  • [in] spsMin: The MEMS Controller’s min sample rate used in ensuring the function does not output a sample rate less than the minimum

  • [in] spsMax: The MEMS Controller’s max sample rate used in ensuring the function does not output a sample rate more than the maximum

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

Enums

MTIParam

enum MTIParam

Values:

enumerator HardwareFilterOn

Hardware Filter Available on Driver (Read only)

enumerator VmaxMEMSDriver

Maximum Voltage range of MEMS driver (Read only)

enumerator DeviceState

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

enumerator DeviceErrorRegister

Register for device error states (Read only)

enumerator USARTBaudRate

USART communication Baud Rate - Default of 460kBaud.

enumerator SampleRate

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

enumerator HardwareFilterBw

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

enumerator VdifferenceMax

Maximum differential voltage - Recommended by MEMS Datasheet.

enumerator Vbias

Bias Voltage for the MEMS - Recommended by MEMS Datasheet.

enumerator OutputOffsets

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

enumerator DataScale

Normalized scale of VdifferenceMax MEMS output from 0.0 to 1.0.

enumerator DataRotation

Rotation of MEMS output in radians.

enumerator MEMSDriverEnable

Enable/ disable MEMS driver.

enumerator DigitalOutputEnable

Enable/ disable digital outputs.

enumerator LaserModulationEnable

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

enumerator BufferOffset

Offset memory buffer.

enumerator DeviceAxes

Device Axes orientation (Device Parameter Structure)

enumerator BootSetting

Device startup settings (Device Parameter Structure)

enumerator DataMode

Defines the data mode for operation (Device Parameter Structure)

enumerator SyncMode

Defines the sync port operation (Device Parameter Structure)

enumerator DataFormat

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

enumerator FramesPerSecond
enumerator InterpolationType
enumerator WaveformType

MTIError

enum MTIError

Values:

enumerator MTI_SUCCESS

Last operation/ communication was succesful.

enumerator MTI_ERR_INVALID_HANDLE

Handle is not existing.

enumerator MTI_ERR_INVALID_DEVICEID

No or wrong device ID.

enumerator MTI_ERR_GENERAL

General error.

enumerator MTI_ERR_SERIALCOMM

Communication error ocurred.

enumerator MTI_ERR_SERIALCOMM_READ_TIMEOUT

Communication timed out.

enumerator MTI_ERR_SERIALCOMM_SERIAL_RESET_FAIL

Reset of the communication failed.

enumerator MTI_ERR_INCORRECT_TARGET_RESPONSE

Incorrect response received from target device.

enumerator MTI_ERR_PARAMETER_OUT_OF_RANGE

Parameter value out of range.

enumerator MTI_ERR_SOME_PARAMETERS_CANNOT_BE_SET

Some parameters can not be set in the device.

enumerator MTI_ERR_INVALID_PARAMETER_NAME

Invalid parameter name.

enumerator MTI_ERR_CONNECTDEVICE_INVALID_PORTNAME

Invalid port name.

enumerator MTI_ERR_CONNECTDEVICE_PORT_NOT_AVAILABLE

Port not available.

enumerator MTI_ERR_LOADDEVICEPARAMS_FILE_NOT_FOUND

INI file not found.

MTIDeviceLimits

enum MTIDeviceLimits

Values:

enumerator SampleRate_Min

Minimum sample rate (Read only firmware)

enumerator SampleRate_Max

Maximum sample rate (Read only firmware)

enumerator SamplesPerFrame_Min

Minimum samples per frame (Read only firmware)

enumerator SamplesPerFrame_Max

Maximum samples per frame (Read only firmware)

enumerator HardwareFilterBw_Min

Minimum hardware filter bandwidth (Read only firmware)

enumerator HardwareFilterBw_Max

Maximum hardware filter bandwidth (Read only firmware)

enumerator FramesPerSecond_Min

Minimum frames per second (Read only firmware)

enumerator FramesPerSecond_Max

Maximum frames per second (Read only firmware)

enumerator VdifferenceMax_Min

Minimum differential voltage (Read only firmware)

enumerator VdifferenceMax_Max

Maximum differential voltage (Read only firmware)

enumerator Vbias_Min

Minimum bias voltage (Read only firmware)

enumerator Vbias_Max

Maximum bias voltage (Read only firmware)

MTIDataMode

enum MTIDataMode

Values:

enumerator Sample_Output = 0

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

enumerator Sample_And_Analog_Input_Buffer = 1

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

enumerator Keypoint = 2

Output mode keypoints.

enumerator Text = 3

Output mode text.

enumerator Waveform = 4

Output mode waveforms.

enumerator Analog_Input_To_Output = 5

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

enumerator Sample_And_Analog_Input_Stream = 6

Output mode for streaming analog inputs while outputting samples.

enumerator Sample_And_Analog_Input_Track = 7

Output mode for streaming analog inputs and streaming samples.

enumerator Auto_Track = 8

Automatic tracking.

enumerator Sample_And_SyMPL1_Stream = 9

Output mode for streaming distances with SyMPL1 lidar architecture.

MTISync

enum MTISync

Values:

enumerator Output_DOut0 = 0

Default digital output levels at pin 0.

enumerator Output_Inverted_DOut0 = 1

Inverted digital output levels at pin 0.

enumerator Output_Sample_Clock = 2

Output a clock signal at sync connector.

enumerator Output_Start_Trigger = 3

Output a trigger signal at sync connector.

enumerator External_Sample_Clock = 4

Input a external clock signal at sync connector.

enumerator External_Start_Trigger = 5

Input a start trigger signal at sync connector.

enumerator External_Frame_Trigger = 6

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

MTIAxes

enum MTIAxes

Values:

enumerator Normal = 0

Normal X,Y Axes Definition.

enumerator FlipXY = 1

Flip both axes.

enumerator MirrorY = 2

Mirror Y axis.

enumerator MirrorY_FlipXY = 3

Mirror Y, flip X with Y axis.

enumerator MirrorX = 4

Mirror X axis.

enumerator MirrorX_FlipXY = 5

Mirror X, flip X with Y axis.

enumerator MirrorX_MirrorY = 6

Mirror X,Y axes.

enumerator MirrorX_MirrorY_FlipXY = 7

Mirror and flip both axes.

MTIFlash

enum MTIFlash

Values:

enumerator Device_Params

Store device parameters in flash.

enumerator Data_In_Buffer

Store data in buffer in flash.

MTIBoot

enum MTIBoot

Values:

enumerator Boot_With_Factory_Defaults = 0

Boot with factory settings (default)

enumerator Boot_With_Flash_Device_Params = 1

Boot with (customized) device parameters from flash.

enumerator Boot_With_Flash_Data_And_Autorun = 2

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

enumerator Boot_With_Flash_Data_No_Autorun = 3

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

MTITrack

enum MTITrack

Values:

enumerator Threshold

Analog input voltage threshold to trigger tracking.

enumerator 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.

enumerator 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.

enumerator 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.

enumerator 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).

enumerator 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.

enumerator 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)

enumerator 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:

enumerator MTI_BLOCKING_MODE_ERR = -1
enumerator MTI_BLOCKING_MODE_OFF = 0
enumerator MTI_BLOCKING_MODE_ON = 1