Measuring

Start a measurement by sending method parameters to a PalmSens/EmStat device.

Creating a method

To run a measurement on your instrument, create an instance of a method that defines the parameters for the technique to run. See the .NET api reference for an overview of all techniques and their respective parameters.

To create an instance of a method in LabVIEW add a .NET constructor node to your block diagram.

Add a .NET constructor node

This will open Select .NET Constructor window. Drag the node to your block diagram.

  1. Open the node and click Browse...

  2. Navigate to the PalmSens/Libraries folder included with the SDK and select the PalmSens.Core.dll

  3. Click on OK.

Browse for `PalmSens.Core.dll`

Alternatively you can select the PalmSens.Core Assembly from the dropdown list in the .NET Constructor Window.

Select `PalmSens.Core` Assembly

Then double-click on the PalmSens.Techniques near the bottom of the list to expand it.

Select `PalmSens.Techniques` item

Select the technique you want to run and click on OK. See the .NET API reference and the PSTrace help documentation for more information. For this example we will use the Linear Sweep Voltammetry technique.

Select LinearSweep technique

To define the parameters for a technique right-click on the constructor node, go to Create  Property for PalmSens.Techniques Class  EquilibrationTime or any other parameter you want to set. The .NET API reference lists the relevant parameters for each technique.

Select EquilibrationTime property

Connect the property to the constructor node and change it to write by right click  Change All To Write.

Change all to write

Then create a constant by right-clicking on the node  Create Constant and update the value.

Create constant in context menu
Set value in constant entry

An example of what a configured method looks like.

Example diagram of configured method

Current/Potential Ranges

Current and potential ranges are respectively stored in the Ranging and RangingPotential parameters. To set the minimum, maximum, and starting range you will need to create an instances of the current/potential ranges by adding .NET constructor nodes.

Select .NET constructor
  1. Select the PalmSens.Core(…​) assembly in the Select .NET Constructor window

  2. List the current and potential objects by double-clicking on PalmSens.

Select CurrentRange constructor
  1. Select CurrentRange  CurrentRange(CurrentRanges cr)

  2. Click OK

To define a potential range, press PotentialRange  PotentialRange(PotentialRanges pr) instead.

Set the current range to cr1uA

Add a constant value to the cr/pr node and select the range from the list. These current ranges can then be set to the Ranging/RangingPotential Maximum, Minimum, and Start parameters.

Example diagram after setting current range

Mains Frequency

To eliminate noise induced by other electrical appliances it is highly recommended to set your regional mains frequency (50/60 Hz) in the static property PalmSens.Method.PowerFreq. Add a .NET property node to your Block Diagram.

Select PalmSens.Core in the Select Object From Assembly window
Select Method in the Select Object From Assembly window
  1. Select the PalmSens.Core(…​) assembly in the Select .NET Constructor window

  2. List the current and potential objects by double-clicking on PalmSens.

  3. Select Method

  4. In the Block Diagram, click on the property and select PowerFreq.

  5. Set the value to integer 50 or 60

Select PowerFreq in the method Property context window
Set the value to 50

Running a measurement

To run a measurement you must be connected to an instrument, and need an instance of a method To run a measurent drag and drop the Measure function VI from the PalmSens lvclass into your block diagram and connect it to the PalmSens class.

Add measure function to block diagram

Make sure to connect the method to the input. The output can be stored in an indicator, the easiest way to view the results is to right click on the ouput node and select create indicator. The type of the output is defined in MeasurementResults.ctl, it is a set of x and y values with strings for the name and units.

Similar to PSTrace, a linear sweep voltammetry measurement will give you one set of current and potential values. A cyclic voltammetry measurement will give you multiple sets of current and potential values corresponding to the amount of scans. And, a chronopotentiometry / amperometric detection measurement will give you a set of current and time values. When extra values are also recorded these will return as additional sets of x and y values and the same applies to multiplexer scan results.

The final diagram and front panel of the BasicExample VI.

The final diagram for the example
The front panel for the VI
Blocking behavior of Measure function

The Measure function will block the VI until the measurement is complete, for more information on this refer to API reference and the BasicUIExample VI`.

Live interaction

When a measurement is running the VI or measurement loop will be blocked until the measurement is done. This section and the BasicUIExample VI show how to work around this to plot/process results in real-time and abort a running measurement.

Visualization

The Measure function VI has an input terminal to which you can connect a reference to an indicator of the cluster defined in the LiveCurveResult.ctl type definition. You can add this by dragging and dropping the LiveCurveResult.ctl on to your front panel.

Live curve result front panel
Create and select reference
  1. Go to the indicator for the LiveCurveResult in the block diagram.

  2. Right click on it  Create  Reference. The resulting reference can then be connected to the Measure function VI.

Connect reference to Measure function

The values of the LiveCurveResult will be updated during while the measurement is running and LabVIEW receives a signal for each of these updates. The event block allows you to execute something each time a signal is received. To receive measurement data in real-time the Event Structure should be placed inside a loop.

Select Event Structure
Place event structure inside a loop

The Event Structure has a timeout event setup by default. If you want to use the loop containing the Event Structure for other things, we highly recommended to define the timeout of the Event Structure in the top left corner.

Add event case
Add event on value change
  1. Next you will need to add an Event Case to the Event Structure.

  2. In the Edit Event window, select Event Sources  LiveCurveResult  All Elements

  3. Select Events  Value Change

  4. Click on OK.

Example live curve result loop

The BasicUIExample VI uses this Event Structure to update the plot.

Visualization and Measure functions in different loops

To be able to visualize/process these results the Measure function VI and event structure cannot be in the same loop.

Abort a measurement

To add the functionality of aborting a running measurement, drag and drop the AbortMeasurement function VI from the PalmSens lvclass into your block diagram.

Two different loops for measure and abort

Make sure that the AbortMeasurement function VI and the Measure function VI are placed in separate loops. Otherwise, the most likely scenario will be that LabVIEW will postpone executing the abort command until after the measurement is finished. This also applies applies to the Disconnect and Dispose function VI commands and any other UI or blocks that you want to be able to execute in parallel to a measurement.