Create an Account  |   Log In

View All »Matching Part Numbers

Your Shopping Cart is Empty

Kinesis® with LabVIEW

Kinesis® with LabVIEW
  • Use Kinesis with LabVIEW
  • Download Example Virtual Instruments

KDC101 WinForm User Interface in LabVIEW

MAX301 3-Axis Flexure Stage with a Stepper Motor, Thumbscrew, and Differential Actuator Attached to the X, Y, and Z Axes, Respectively


DC Servo Motor Controller


50 mm DC Servo Translation Stage

Please Wait

LabVIEW is a graphical programming interface which can be used to communicate with any Thorlabs Kinesis®-compatible controller through the use of component Kinesis .NET controls. These .NET controls are a part of the Kinesis Motion Control software package.

This tutorial contains annotated LabVIEW VI examples for interfacing with Thorlabs’ Kinesis software. These examples make use of the Controls.dll file included with the Kinesis software installation package. This dynamic link library (DLL) assembly includes a collection of WinForms controls that hosts the Kinesis User Interface elements and underlying device functionality. These controls provide a straightforward way to start working with Thorlabs’ Kinesis software in LabVIEW.

Section Tab Contents:

  • LabVIEW: Overview of Basic Information to Consider When Using Kinesis with LabVIEW
  • Getting Started: Instructions on Software Installation Prior to Using the Example VIs
  • Example VIs: Sample Code for a Selection of Thorlabs Controllers
  • DLLs: Information on Loading Additional DLLs for Increased Functionality
  • Other Programs: Tutorial and Sample Code for Interfacing Kinesis with C#

A comprehensive guide to using Kinesis with LabVIEW can be downloaded here or by clicking the button to the right. It provides step-by-step instructions to create a custom Kinesis .NET control VI in LabVIEW.

Click to Enlarge

Figure 1: A Kinesis Device Panel UI ‘View’ Can Be Hosted in the LabVIEW Front Panel
Click to Enlarge

Figure 2: A Basic Block Diagram VI for Initializing and Closing Communication with a 
Kinesis Compatible Device
Click to Enlarge

Figure 3: For Multi-Channel Device Types, the ‘Channel Number’ Property Must Be 
Assigned in the Block Diagram to Correctly Initialize Each Device Channel


LabVIEW can be used to communicate with any Thorlabs Kinesis® compatible controller via Kinesis .NET dlls. Of the numerous dynamic link libraries (.dlls) included, the ‘Controls.dll’ provides a collection of .NET WinForms User Controls which can host the device user interface (UI) elements and provide access to the device methods and properties.

For example, the Kinesis graphical user interface (GUI) for the KDC101 K-Cube DC Servo controller is shown in Figure 1. This ‘View’ (UI), as seen in the Kinesis.exe application, can be hosted in the LabVIEW front panel, while providing the user access to back-end Kinesis .NET methods and properties in the LabVIEW block diagram.

By inserting the .NET ‘Controls.dll’ into the LabVIEW front panel, the user will be able to load a user interface for any Kinesis compatible device. Considering the example of a KDC101 K-Cube DC Servo controller, this device UI can be initialized by providing the serial number of the device and selecting CreateDevice(), as illustrated in Figure 2. This will create the device connection and display the UI seen in Figure 1.

Controllers that have a multi-channel architecture, such as the BSC202 Benchtop Controller and the MPZ601 Rack Module Controller, must also have the Channel Number specified. In the example shown in Figure 3, two separate UI panels are created (one for each channel) which can be operated independently of one another.

A range of downloadable, annotated example VIs can be found in the Example Vis tab. The examples provided are related to specific controllers and are organized by hardware type (i.e. Motor, Piezo and Piezo Motor, and Strain Gauge Reader). A Simulator VI is also provided which will enable connection to the Kinesis Simulator Application. The examples are saved as LabVIEW 2012 compatible examples.

For tips on building your own VIs with Thorlabs Motion Control Hardware, please see our comprehensive Kinesis LabVIEW Guide.

For any questions or comments about these examples, please contact Tech Support.


Click to Enlarge

Figure 6: The Device ‘View’ Hosted in the Front Panel
Click to Enlarge

Figure 5: Select the .NET Control Based on the 
Device Type You Are Using
Click to Enlarge

Figure 4: Insert the
.NET Container into the
LabVIEW Front Panel

Inserting a .NET Control

  1. Right-click on the front panel, then select '.NET container' and place the container on the front panel (Figure 4).
  2. Right-click on the .NET container and select 'Insert .NET control...'.
  3. In the 'Select .NET Control' window, click 'Browse...'.
  4. Browse for and select 'Thorlabs.MotionControl.Controls.dll', located in the user's LabVIEW project folder.
  5. In the 'Controls' list, select the controller that will be used (Figure 5).
  6. The LabVIEW front panel will now display the Kinesis device's user interface (Figure 6). The device methods and properties can now be accessed via the block diagram. Please note that the device UI will appear as ‘Disconnected’ until the VI is running and the control has been initialized.


Click to Enlarge

Figure 9: Insert Properties and
Methods via the Functions Palette

Accessing a Property or Method

The Control reference node provides access to the Control methods and properties, such as CreateDevice() and CloseDevice(). Right-clicking the node will enable you to initialize or close communications with the device. CloseDevice() will close communications, shut down the .NET library, and reset the UI when the session terminates.

The Device methods and properties can be accessed through the Device property reference, as shown in Figure 7. In the case of T-cube and K-cube type devices, this property is 'Device'. In the case of Rack Module and Benchtop type hardware, device properties and methods can be accessed from the device type specific property label, i.e. 'ModularPiezo' or 'BenchtopStepperMotor', as shown in Figure 8.

Alternatively, LabVIEW .NET connectivity functions allow you to create and interact with the Kinesis .NET SDK. Through the Functions Palette, select "Connectivity > .NET" to access all functions used to interact with .NET objects (Figure 9).

For more information on LabVIEW .NET connectivity, please refer to the Kinesis LabVIEW guide.

Click to Enlarge

Figure 7: Access Properties and Methods via the Device Property
Click to Enlarge

Figure 8: Accessing Properties and Methods from K-Cube,
Modular Rack and Benchtop Device Formats


Figure 10: Register Events Such as MotorStateUpdate in the Front Panel

Working with Events

An Event Callback VI is created using the Register Event Callback Function in LabVIEW. This will cause a VI to be called under specified conditions. Some basic events include Motor Status Updates (Figure 10), Connection Change Events, Settings Update Events, or Error Update Events. These events are detailed further in the Kinesis .NET API. An example of this is provided in the KDC101 Motor Status Changed tutorial where a programmed response appears when the Motor State changes.

The Kinesis DLLs (such as those contained in the partial list above) must be copied into your LabVIEW project folder.

Getting Started

Complete the following steps before using the example virtual instruments in the Example VIs tab:

  1. Install the Kinesis software. Ensure that the version of Kinesis/component DLLs is of the correct bit type, depending on the version of LabVIEW and the operating system. The included examples were built using Thorlabs' Motion Control Software v1.14.12.
  2. For the example VIs to run successfully, manually copy the component DLLs from the Kinesis install folder to the “Kinesis LabVIEW Examples” folder. The Controls.dll will typically require all Kinesis DLLs to be copied into the project folder.
  3. Open the VI through the 'LabVIEW Project Explorer' to correctly load the User Interface from the Thorlabs.MotionControl.Controls.dll.


Example VIs - Front Panel Overview

A LabVIEW VI contains two windows for building applications; a Front Panel and Block Diagram. The LabVIEW Front Panel contains the front end User Interface components of the VI. The Front Panel of each Example VI has been formatted to contain instructions and features which make these VIs easy-to-use. An overview of these features along with some of the key interface features of the LabVIEW Front Panel are outlined below.


  1. LabVIEW Toolbar, Where the VI is Run
  2. Name of Device the Example Utilizes, Along with Webpage Link
  3. Introduction and Step-by-Step Instructions for the Example VI
  4. Functioning Front Panel Controls and Indicators (Please note that the device UI will appear as ‘Disconnected’ until the your VI is running and the control has been initialized.)
  5. Tips to Consider When Running the Example VI


LabVIEW Sample VIs

Click here or on the button to the left to download the Kinesis LabVIEW example VIs. The examples are saved as LabVIEW 2012 compatible VIs.

Please note: The Kinesis LabVIEW VI examples are intended to be used to rapidly connect and control key Thorlabs devices. They are not intended to be a demonstration of good programming practices. Many programming techniques are omitted for the sake of simplicity, such as setting directories and error handling.

Example VIs
Item #, Type Example Name Description
Motor Controllers
K-Cube, Brushed DC Servo
Build Device List The example VIs require you to enter the serial number of your device manually. This VI, however, will build a list of connected devices and wait until the user has selected the serialized device to control.
Connect Demonstrates how to initialize communication with and then disconnect from the KDC101 in order to control DC brushed stages and actuators.
Get Position Get Position will poll the device position through the GetPositionCounter() method which will output the stage position in device units. This can be converted from device units (encoder counts) to real world units (mm) by considering encoder counts per revolution of the motor, gearbox ratios and leadscrew pitch.
Motor Status Changed This VI enables you to make use of motor events. These events include motor status updates, connection change events, settings update events, and error update events. This VI utilizes the motor status update. An event callback sub-VI is built using the register event callback function in LabVIEW.
Move Absolute This VI will allow you to home the device and move it to a chosen position.
No Front Panel This VI shows how to communicate with Thorlabs Motion Control devices outside of the provided WinForms UI controls contained in the Thorlabs.MotionControl.Controls.dll. This VI focuses on the wider range of generic and device-specific component DLLs included with your Kinesis installation.
K-Cube, Brushless DC Servo
Get Status Bits This VI will poll status bits through use of the GetStatusBits method.
Set Trigger Parameters Enables exploration of the trigger parameters available to all Thorlabs K-Cube devices.
Set Velocity Parameters This VI monitors and sets the current velocity parameters of the connected device.
Benchtop, Brushless DC Servo
Two-Axis Scan This VI will perform a 2D square raster scan, moving in a forward direction from a user defined start position. The user can set the number of steps and step size, as well as how long the stage rests at a scanned position.
K-Cube, Stepper
Move Relative This VI allows homing of the device and moving forward (clockwise) or backward (counterclockwise) at any valid distance from the homing position.
Piezo / Piezo Motor Controllers
K-Cube, Piezo Controller
Connect Demonstrates how to connect with and disconnect from the KPZ101 Piezo Controller.
Waveform LUT Enables use of the LUTWave functionality available to piezo-actuated devices not included within the Controls.dll. Taking advantage of the built-in Sine Waveform.VI of LabVIEW, the device can output a sine waveform with a scalable amplitude. Details of this functionality are outlined in the LUTWaveParams() structure within the .NET API.
KPZ101 w/ KSG101
K-Cube, Piezo Controller and Strain Gauge Reader
Set Position Demonstrates open- and closed-loop operation of the KPZ101 Piezo controller when used with the KSG101 Strain Gauge controller. When in open-loop mode, the user can adjust the voltage of the piezo stack. When in closed-loop mode, the position can be set by using the SetPercentageTravel() function.
Benchtop, 1 Channel Piezo Controller
Connect Demonstrates how to connect with and then disconnect from the BPC301 controller.
Waveform LUT Enables use of the LUTWave functionality available to piezo-actuated devices not included within the Controls.dll. Taking advantage of the built-in Sine Waveform.VI of LabVIEW, the device can output a sine waveform with a scalable amplitude. Details of this functionality are outlined in the LUTWaveParams() structure within the .NET API.
Benchtop, 3 Channel Piezo Controller
Two-Axis Scan Perform a 2D square raster scan for pre-selected channels on a BPC303 unit. This VI also includes the error handling cluster, which prints error messages and their corresponding codes.
Rack, Modular 2 Channel Piezo Controller
Connect Demonstrates how to connect to and safely disconnect from the MPZ601 controller.
PPC001, PPC102a
Benchtop, Precision Piezo Controller
Continuous Scan This VI will enable you to connect to devices and linearly increment the piezo position at a user specified delay and step size. This VI will step the stage forward 5000 steps, and then backward 5000 steps. This example applies to the PFM450E, and LPS710Ea.
K-Cube, Inertial Piezo Controller
Set Jog Set Jog enables the user to set Jog parameters and toggle the Jog mode, as well as assert control over a particular channel of the KIM101 controller.
Strain Gauge Reader
K-Cube, Strain Gauge Reader
Get Max Travel Range This VI enables the user to retrieve the maximum travel for the connected strain gauge controller.
Get Reading Get Reading sets the current display mode to either position, force, or voltage mode, and acquires a reading based on the selected mode.
Nanotrak® Auto-Alignment Controllers
K-Cube, Nanotrak Controller
Latch Trak This VI enables the user to set the operating mode to track or latch.
Set Circle Diameter This VI enables the user to set the scan circle diameter in the range of 0 to 10 NT units.
Set Loop Gain This VI enables the user to set and get the loop gain. This can be set between 0 and 32767.
Set Phase Component This VI enables the user to set the H- and V-components of the phase compensation or angle of the circle path.
Benchtop, Nanotrak Controller
Connect Demonstrates connecting to and safely disconnecting from a BNT001 device.
Set Circle Home Position This VI enables the user to set the scanning circle home position, through the GetCircleHomePosition() method.
MNA601 w/ MST602
Rack, Nanotrak Controller with Stepper Motor Controller
Two-Axis Scan Demonstrates connecting to an MNA601 and an MST602 conroller for an automated fiber alignment setup. When paired with a stepper actuated flexure stage, such as the MAX381, this system provides users with automated fiber alignment control. This VI will initiate a simple 2D raster scan of the MPZ601 piezo outputs. This will stop once the MNA601 has detected a sufficient photocurrent.
Two-Axis Revector Demonstrates connecting to an MNA601 and an MST602 conroller for an automated fiber alignment setup. When paired with a stepper actuated flexure stage, such as the MAX381, this system provides users with automated fiber alignment control. This VI will initiate a simple 2D raster scan of the MPZ601 piezo outputs. This will stop once the MNA601 has detected a sufficient photocurrent.
MNA601 w/ MPZ601
Rack, Nanotrak Controller
Two-Axis Scan Demonstrates connecting to an MNA601 and an MST602 conroller for an automated fiber alignment setup. When paired with a stepper actuated flexure stage, such as the MAX381, this system provides users with automated fiber alignment control. This VI will initiate a simple 2D raster scan of the MPZ601 piezo outputs. This will stop once the MNA601 has detected a sufficient photocurrent.
Solenoid Controller
K-Cube, Solenoid Controller
Set Operating Mode This VI will set the device to 'Auto' mode. In this mode, the solenoid will open and close continuously after the top panel wheel is moved up (primed). You are able to alter the settings of this mode by using the 'Set Operating Mode' button. The progam will poll for updates to the 'Set Operating Mode' button controlling a case structure in the block diagram. If initiated, the parameters of 'Auto' mode entered into the below controls will cause the device settings to be updated accordingly.
Laser Sources
K-Cube, Laser Sources
Set Power Demonstrates setting the laser output On/Off, as well as setting the output power of the laser source.
Simulated Hardware
- This simulation enables you to insert a VI and make use of simulated hardware via the Kinesis simulator application.
  • These controllers are included with our PFM450E Objective Scanner and LPS710E(/M) Z-Axis Translation Stage.

While the focus of this tutorial is using the WinForms User Controls library (Controls.dll) as a straightforward way to load a UI panel and utilize Thorlabs' Kinesis hardware, it is possible to access the more advanced functionality contained within other .NET DLLs included with the Kinesis software installation. This functionality is outlined in detail within the Kinesis .NET API help file.

The following examples from the Example Vis tab make use of functionality outside of the Controls.dll library:

  • KDC101 - No Front Panel
  • BPC301 - Waveform LUT
  • KPZ101 - Waveform LUT
  • KPZ101 w/ KSG101 - Set Position
The BuildDeviceList method can be accessed by dropping in a DeviceManagerCLI Constructor Node.
Accessing Methods within the "KCube.DCServo.dll" Directly

Thorlabs' Kinesis® software features .NET controls which can be used by 3rd party developers working in the C#, Visual Basic, LabVIEW™, or .NET compatible languages to create custom applications. This software supports our new line of Kinesis devices, as well as our APT™ products. All Kinesis controllers are supported by unified graphical user interfaces (GUIs) and programming APIs that enable the creation of custom applications. The included USB connectivity provides easy 'Plug-and-Play' PC-controlled operation, making it easy to link multiple units together to realize a multi-axis motion control solution.

Examples that utilize C# to communicate with Thorlabs' Kinesis software are found below.


This programming language is designed to allow multiple programming paradigms, or languages, to be used, thus allowing for complex problems to be solved in a simple or efficient manner. It encompasses typing, imperative, declarative, functional, generic, object-oriented, and component-oriented programming. By providing functionality with this common software platform, Thorlabs has ensured that users can easily mix and match any of the Kinesis controllers in a single application, while only requiring knowledge of a single set of software tools. In this way, it is feasible to combine any of the controllers from the low-powered, single-axis to the high-powered, multi-axis systems and control all from a single, PC-based unified software interface.

The Kinesis System Software allows two methods of usage: graphical user interface (GUI) utilities for direct interaction and control of the controllers 'out of the box', and a set of programming interfaces that allow custom-integrated positioning and alignment solutions to be easily programmed in the development language of choice.

For a collection of example projects that can be compiled and run to demonstrate the different ways in which developers can build on the Kinesis motion control libraries, click on the links below. Please note that a separate integrated development environment (IDE) (e.g., Microsoft Visual Studio) is required to execute the Quick Start examples. The C# example projects can be executed using the included .NET controls in the Kinesis software package (see the Kinesis Software tab for details).

C Sharp Icon Click Here for C# Example Projects
Click Here for Quick Start Device Control Examples
C Sharp Icon

Posted Comments:
Paul Konings  (posted 2020-08-31 05:13:19.067)
Hi, I'm trying to control a LTS from LabVIEW. I'm experiencing an "system.I0.FileNotFoundException" when I try to load the code from another project than the original one. I've created a project that contains the LV code that contains the .Net calls so that these can be used by other projects. It appears that the .Net dll's need to be besides the project before all dll's are loaded. If I inspect the loaded .net assemblies in LV then the expected ones are loaded (the ones that I actually use). It also appears that some dll try's to load another DLL and does that relative to th e project file and not the already loaded Dll's. To be clear, I can get the code to run if all the DLL's are located besides the project file. This however limits the re-use possibilities of the code. How can I have only 1 set of DLL's and use the code in multiple LV projects?
cwright  (posted 2020-09-02 10:12:28.0)
Response from Charles at Thorlabs: Hello and thank you for your query. Unfortunately our .dll files do require that they be copied into the same folder as the project calling them, as described in the Kinesis LabVIEW Guide which can be found on our site at the following link.
Tianyi Guo  (posted 2020-07-27 14:44:31.61)
We have two kinds of controller, kcube and tcube. I also installed the correct versions of the APT and Kinesis software. However, for tcube, I have error of loading dll (kinesis) using LabView. For kcube, we have problem of connecting to LabView using APT. We would like to control both cubes using the same program by controlling the velocity, acceleration, and stepping distance/rotation.
cwright  (posted 2020-07-28 11:22:12.0)
Response from Charles at Thorlabs: Thank you for your query. We will contact you directly to help diagnose the issue, however a common reason for receiving an error when loading dll's is due to using incompatible bit versions of Kinesis and LabVIEW. The Kinesis bit version should match that of your LabVIEW bit version. We provide 32-bit and 64-bit versions of Kinesis as well as a 32-bit for 64-bit Windows version for those running 32-bit LabVIEW on 64-bit Windows.
user  (posted 2020-07-20 07:20:58.43)
Examples using callback are version over 2012. So I cannot see that VI and example project file provided.
DJayasuriya  (posted 2020-07-24 06:56:00.0)
Thank you for your inquiry. I will get in touch with you directly to resolve your issue.
DJayasuriya  (posted 2020-07-24 06:56:00.0)
Thank you for your inquiry. I will get in touch with you directly to resolve your issue.
Joanna Oracz  (posted 2020-06-09 12:42:13.36)
Dear Labview Team, I am trying to program yours Cage Rotator K10CR1/M with Labview 2014. I started with Kinesis software & NET programing. However, I cannot load the dlls (Step 6 of your Kinesis Lsbview Guide). I also cannot load any of your examples as they are not compatible with my Labview version... Do you have maybe some dlls compatible with labview 14? Sincerely, Joanna
cwright  (posted 2020-06-11 08:08:15.0)
Response from Charles at Thorlabs: Hello Joanna and thank you for your query. The Dll’s should be compatible with your version as long as the bit type is correct so I will reach out to you directly to diagnose your issue.
Jakob Weber  (posted 2020-03-09 06:24:57.53)
Our K-Cube Laser Diode Controller does work with the Thorlabs.MotionControl.Kinesis.exe very well. But if i try to start a own (like your "getting started") Labview crashes at method: "CreateDevice".
cwright  (posted 2020-03-11 10:09:00.0)
Response from Charles at Thorlabs: Hello Jakob, thank you for letting us know you are having this issue. We will look into this and reach out to you directly with further troubleshooting and support.
Chris Purves  (posted 2019-12-13 13:32:40.68)
I was able to determine that the problem was I had the .dlls 2 subdirectories below the LabVIEW project file. Moving the directory containing the dlls to the same directory as the project file allowed LabVIEW to find the dependencies.
DJayasuriya  (posted 2019-12-16 08:08:17.0)
Response from Dinuka at Thorlabs: Thanks for your query I'm happy you were able to resolve the issue. If you have any further questions feel free to contact us directly on
Chris Purves  (posted 2019-12-13 10:57:04.18)
Having trouble getting Kinesis driver to work with LabVIEW. After copying .dlls to project subdirectory and creating .NET container, when I try to insert .NET control to container I get the following error: Error inserting ActiveX or .NET object: Error creating instance of BenchtopPiezoControl in assembly Thorlabs.MotionControl.Controls.BenchtopPiezoControl, Thorlabs.MotionControl.Controls, Version=, Culture= neutral, PublicKeyToken=c7ec6d6d6e243Se7, (System.Windows.Markup.XamlParseException: Set property 'System.Windows.ResourceDictionary.Source' threw an exception. Inner Exception: System.lO.FileNotFoundException: Could not load file or assembly 'Thorlabs.MotionControl.Tools.WPF.UI, Culture= neutral' or one of its dependencies. The system cannot find the file specified.) System.I0.FileNotFoundExceptionOf course, the WPF.UI is present in the directory containing all the .dlls.
DJayasuriya  (posted 2020-01-27 11:11:35.0)
Response from Dinuka at Thorlabs: Thanks for your query. I will contact you directly to have a look at your VI to see if we can replicate the issue and solve it.
user 0  (posted 2019-09-26 15:57:17.603)
Good afternoon. I make a diagram in the lab clearly according to the instructions. But when the device is connected to the computer via yusb in the lab, it is not visible. That is, a window pops up without buttons for adjusting the speed and position of the slide and others. At this time, everything works in the kinesis program itself. What could be the problem?
AManickavasagam  (posted 2019-09-27 11:30:09.0)
Response from Arunthathi at Thorlabs: Thanks for your query. I have contacted you directly for further details.
Log In  |   My Account  |   Contact Us  |   Careers  |   Privacy Policy  |   Home  |   FAQ  |   Site Index
Regional Websites: West Coast US | Europe | Asia | China | Japan
Copyright © 1999-2020 Thorlabs, Inc.
Sales: 1-973-300-3000
Technical Support: 1-973-300-3000

High Quality Thorlabs Logo 1000px:Save this Image