Classes

This is a list of the classes that are available in the Matlab SDK.

These wrap some of the Palmsens .NET internal data structures to make them more accessible in Matlab. Look at the class and method docstrings for further information on the interfaces.

  • EquivalentCircuitFit: Handles the equivalent circuit fitting using the PalmSens.Core.Matlab.dll

  • Measurement: Returns data measured by a device as a variable, message in the command window and/or a plot in a figure.

  • MeasurementGUI: Version of the Measurement.m class that can be used with a Matlab GUIDE user interface.

  • MultiChannelMeasurement: Used for running when connected to multiple instruments simultaneaously, please refer to the MultiChannelMeasurementLoopExample

EquivalentCircuitFit

Fits the equivalent circuit specified with the CDC descriptor code. Optional settings are fixing the value of a parameter, setting the min/max bounds for a parameter, specifying the frequency range to fit, limitting the number of iterations, delta error term or delta parameter term

Properties

  • Parameters – Model parameters

Methods

EquivalentCircuitFit

function [self] = EquivalentCircuitFit(measurement, cdc)

Construct an instance of this class

Input arguments

  • measurement (PalmSens.Measurement) – A reference to the .NET measurement object

  • cdc (string) – The circuit design in the CDC format are required

SetFitOptions

function SetFitOptions(MaxIterations, MinDeltaError, MinParameterStepSize)

Set fitting options for the minimization algorithm

Input arguments

  • MaxIterations (int) – Maximum number of iterations. Minimization terminates once it reaches this number of steps (default = 500).

  • MinDeltaError (float) – Minimum convergence error. Minimization converges if the residual (squared difference) falls below this value (default = 1e-9).

  • MinParameterStepSize (float) – Minimum convergence step. Minimization converges if the difference in parameter values falls below this value (default = 1e-12).

SetFitRange

function SetFitRange(MinHz, MaxHz)

Set the frequency range to fit the circuit over.

Input arguments

  • MinHz (float) – Minimum fitting frequency in Hz.

  • MaxHz (float) – Maximum fitting frequency in Hz."""

FitCircuit

function [result] = FitCircuit()

Fits the equivalent circuit and returns the fit

Output arguments

  • result (struct) – Struct containing results from minimization.

Measurement

The measurement class contains the functions for starting, stopping and storing the data from a measurement.

This class requires the connected PalmSens or Emstat device’s commManager to given in its contstructor (i.e. m = Measurement(CommManager)) Setting the properties dispInCommandWindow or dispInPlot to true respectively displays the results of the measurement in the Command Window or a Plot in Figure 1.

Recording devices idle status: Idle status package can be recorded with the GetIdleData function (i.e. m.GetIdleData()). Recording of idle status can be stopped with the StopIdleData function (i.e. m.StopIdleData())

Measuring: Use the New function in combination with a method in your workspace to start a new measurement (i.e. m.New(method)). The measurement can be aborted at any time with the Abort function (i.e. m.Abort()). The results of the measurement are stored in the measurement properties and can be retreived after the measurement has been completed (measurement = m.measurement).

Measurements: Measurements are converted to structs to improve their compatability with Matlab. Each measurement is stored in its own struct and contains a character array with its name (.name), measurement technique (.type) and date (.date).

The measurement data is stored in one or more curves. Generally a measurement has one curve struct, except for Cyclic Voltammetry and Impedance Spectroscopy. Cyclic Voltammetry measurements have one curve per scan and Impedance Spectroscopy measurements have three curves, 1. Nyquist plot (Zre vs Zim), 2. Bode plot (freq vs Z) and 3. Bode plot (freq vs -phase). Each curve struct contains an array of x and y data (.xData & .yData) and their respective units (.xUnit & .yUnit).

Properties

  • comm – Object containing handle for communication with device

  • measurement – The result of the measurement converted for use in matlab

  • dispInCommandWindow – When set to true the latest readings from the device are displayed in the command window.

  • dispInPlot – When set to true the latest readings from the device are displayed in a new Figure.

  • inMeasurement – Bool indicating whether the device is measuring

  • abortMeasurement – Used by class to indicate when abort function has been used

  • x_array – Array of idle potential readings

  • x_unit – Unit of the data recorded in the x_array.

  • y_array – Array of idle potential readings

  • y_unit – Unit of the data recorded in the y_array.

  • previousMeasurement – The result of the measurement as a .Net object

  • curves – List of .Net curve objects returned by the PalmSens Matlab SDK

Methods

Measurement

function [self] = Measurement(commManager)

Initialize measurement class.

Input arguments

  • commManager (PalmSens.Comm.CommManager) – The comm manager manages the connection with the device.

StopIdleData

function StopIdleData()

Stop recording idle data.

New

function New(method)

Start a new measurement.

Input arguments

  • method (PalmSens.Method) – Method class with technique parameters.

Abort

function Abort()

Abort a running measurement.

GetIdleData

function GetIdleData()

Record idle data.

This will be stopped once a measurement starts. Recording idle data will clear any previously recorded data.

idleListener

function idleListener(eventArgs)

Idle listener callback.

beginListener

function beginListener(eventArgs)

Start listener for measurement data.

endListener

function endListener()

Stop listener for measurement data.

dataListener

function dataListener(eventArgs)

Measurement listener callback.

curveListener

function curveListener(eventArgs)

Curve listener callback.

processMeasurement

function [measurement] = processMeasurement()

Process previous measurement.

Updates the .measurement attribute with Measurement data.

plotDataRealtime

function plotDataRealtime()

Plot data in real time.

processEISMeasurement

function [measurement] = processEISMeasurement()

Process previous EIS measurement.

Updates the .measurement attribute with EIS data and curves.

plotEISDataRealtime

function plotEISDataRealtime()

Plot EIS data in real time.

MultiChannelMeasurement

The measurement class contains the functions for starting, stopping and storing the data from a measurement.

This class requires the connected PalmSens or Emstat device’s commManager to given in its contstructor (i.e. m = Measurement(CommManager)) Setting the properties dispInCommandWindow or dispInPlot to true respectively displays the results of the measurement in the Command Window or a Plot in the specified figure.

Recording devices idle status: Idle status package can be recorded with the GetIdleData function (i.e. m.GetIdleData()). Recording of idle status can be stopped with the StopIdleData function (i.e. m.StopIdleData())

Measuring: Use the New function in combination with a method in your workspace to start a new measurement (i.e. m.New(method)). The measurement can be aborted at any time with the Abort function (i.e. m.Abort()). The results of the measurement are stored in the measurement properties and can be retreived after the measurement has been completed (measurement = m.measurement).

Measurements: Measurements are converted to structs to improve their compatability with Matlab. Each measurement is stored in its own struct and contains a character array with its name (.name), measurement technique (.type) and date (.date).

The measurement data is stored in one or more curves. Generally a measurement has one curve struct, except for Cyclic Voltammetry and Impedance Spectroscopy. Cyclic Voltammetry measurements have one curve per scan and Impedance Spectroscopy measurements have three curves, 1. Nyquist plot (Zre vs Zim), 2. Bode plot (freq vs Z) and 3. Bode plot (freq vs -phase). Each curve struct contains an array of x and y data (.xData & .yData) and their respective units (.xUnit & .yUnit).

Properties

  • comm – Object containing handle for communication with device

  • measurement – The result of the measurement converted for use in matlab

  • dispInCommandWindow – When set to true the latest readings from the device are displayed in the command window.

  • dispInPlot – When set to true the latest readings from the device are displayed in a new Figure.

  • figureForPlot – Figure to display data in

  • plotAxes – axes to plot data in

  • line – animated line to plot the data in

  • nPoints – number of points in plot

  • inMeasurement – Bool indicating whether the device is measuring

  • abortMeasurement – Used by class to indicate when abort function has been used

  • x_array – Array of idle potential readings

  • x_unit – Unit of the data recorded in the x_array.

  • y_array – Array of idle potential readings

  • y_unit – Unit of the data recorded in the y_array.

  • previousMeasurement – The result of the measurement as a .Net object

  • curves – List of .Net curve objects returned by the PalmSens Matlab SDK

Methods

MultiChannelMeasurement

function [self] = MultiChannelMeasurement(commManager, figure)

Initialize measurement class.

Input arguments

  • commManager (PalmSens.Comm.CommManager) – The comm manager manages the connection with the device.

  • figure (int) – Figure to display data in

Abort

function Abort()

Abort a running measurement.

StopIdleData

function StopIdleData()

Stop recording idle data.

GetIdleData

function GetIdleData()

Record idle data.

This will be stopped once a measurement starts. Recording idle data will clear any previously recorded data.

New

function New(method)

Start a new measurement.

Input arguments

  • method (PalmSens.Method) – Method class with technique parameters.

idleListener

function idleListener(eventArgs)

Idle listener callback.

beginListener

function beginListener(eventArgs)

Start listener for measurement data.

endListener

function endListener()

Stop listener for measurement data.

dataListener

function dataListener(eventArgs)

Measurement listener callback.

curveListener

function curveListener(eventArgs)

Curve listener callback.

processEISMeasurement

function [measurement] = processEISMeasurement()

Process previous EIS measurement.

Updates the .measurement attribute with EIS data and curves.

plotDataRealtime

function plotDataRealtime()

Plot data in real time.

processMeasurement

function [measurement] = processMeasurement()

Process previous measurement.

Updates the .measurement attribute with Measurement data. m = self.previousMeasurement;

plotEISDataRealtime

function plotEISDataRealtime()

Plot EIS data in real time.

MeasurementGUI

The measurement class contains the functions for starting, stopping and storing the data from a measurements This is a version of the Measurement class that can be used with a Matlab GUIDE user interface.

Properties

  • comm – Object containing handle for communication with device

  • inMeasurement – Bool indicating whether the device is measuring

Methods

MeasurementGUI

function [self] = MeasurementGUI(hObject, commManager, beginMeasurmentCallback, endMeasurementCallback, receiveCurveCallback, receiveStatusCallback)

Initialize measurement class.

Input arguments

  • hObject (Handle) – Handle to btnConnect

  • commManager (PalmSens.Comm.CommManager) – The comm manager manages the connection with the device.

  • beginMeasurmentCallback (Callable) – Callback for begin measurement event.

  • endMeasurementCallback (Callable) – Callback for end measurement event.

  • receiveCurveCallback (Callable) – Callback for curve event.

  • receiveStatusCallback (Callable) – Callback for status update event.

New

function New(method)

Start a new measurement.

Input arguments

  • method (PalmSens.Method) – Method class with technique parameters.

StopIdleData

function StopIdleData()

Stop recording idle data.

GetIdleData

function GetIdleData()

Record idle data.

This will be stopped once a measurement starts. Recording idle data will clear any previously recorded data.

Abort

function Abort()

Abort a running measurement.

StartDataListener

function StartDataListener(hObject, dataCallback)

Start listener for measurement data.

StopDataListener

function StopDataListener()

Stop listener for measurement data.