Skip to content

Labview Examples for Kinesis Motion Control Products #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
May 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions C++/Integrated Motors/MFF/MFF10x_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ int main()
{
// get device list size
short n = TLI_GetDeviceListSize();
// get BBD serial numbers
// get MFF serial numbers
char serialNos[100];
TLI_GetDeviceListByTypeExt(serialNos, 100, 70);
TLI_GetDeviceListByTypeExt(serialNos, 100, 37);

// output list of matching devices
{
Expand Down Expand Up @@ -89,7 +89,7 @@ int main()
FF_StopPolling(testSerialNo);
// close device
FF_Close(testSerialNo);
// TLI_UnitializeSimulations();
// TLI_UninitializeSimulations();
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions C++/Integrated Motors/MFF/Required DLLs.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Thorlabs.MotionControl.DeviceManager.dll
Thorlabs.MotionControl.KCube.FilterFlipper.dll
Thorlabs.MotionControl.KCube.FilterFlipper.h
Thorlabs.MotionControl.KCube.FilterFlipper.lib
Thorlabs.MotionControl.FilterFlipper.dll
Thorlabs.MotionControl.FilterFlipper.h
Thorlabs.MotionControl.FilterFlipper.lib
Binary file not shown.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but we need to make sure we are initializing a channel for the benchtops as well.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions Labview/Kinesis - BBD30X - Connect Abs Rel Move/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### Thorlabs Hardware: BBD30X - Benchtop 3-Phase Brushless DC Servo Controller
https://www.thorlabs.com/thorproduct.cfm?partnumber=BBD303

# Description:
This VI will enable you to communicate with BBD30X series to control Brushless Stages & Actuators.

# Instructions:
1) Connect your BBD30X device to your PC & power the device, ensuring your stage/actutator is connected. For full device setup, the device product manual can be found on our website.
2) Enter the device serial number as well as channel number below.
3) Click 'Run' in the LabVIEW Toolbar which will attempt a connection, and enable the device.
4) Ensure the device move path is clear for homing, and press Home.
5) Await for device to be be available, and to have finished homing (Home indicator in control panel should be green).
6) Input desired absolute position, and press 'Set Abs Pos' to set that for absolute moves.
7) Similarly input desired direction and step size for relative moves.
8) To end the Program click 'STOP'.
Binary file added Labview/Kinesis - BNT - Connect/Block.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Labview/Kinesis - BNT - Connect/Front.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
12 changes: 12 additions & 0 deletions Labview/Kinesis - BNT - Connect/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Thorlabs Hardware: BNT001/IR
https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=1194&pn=BNT001/IRDescription: This VI will enable you to connect to & safely disconnect to a BNT001 device.

# Description:
This VI will enable you to connect to & safely disconnect to a BNT001 device.

# Instructions:
1) Connect your BNT001 device to your PC & power the device. For full device setup, the device product manual can be found on our website here.
- https://www.thorlabs.com/thorproduct.cfm?partnumber=BNT001/IR
2) Enter the device serial number below.
3) Click 'Run' in the LabVIEW Toolbar.
4) To end the Program, click 'END'.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
14 changes: 14 additions & 0 deletions Labview/Kinesis - BNT - Set Circle Home Position/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### Thorlabs Hardware: BNT001/IR
https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=1194&pn=BNT001/IR

# Description:
This VI will enable you to set the Scanning Circle Home Position, throught the GetCircleHomePosition() method.
Horizontal and Vertical positions can be adjusted in the range of 0 to 10 in NanoTrak Units.

# Instructions:
1) Connect your BNT001 device to your PC & power the device. For full device setup, the device product manual can be found on our website here.
- https://www.thorlabs.com/thorproduct.cfm?partnumber=BNT001/IR
2) Enter the device serial number below.
3) Click 'Run' in the LabVIEW Toolbar.
5) Enter values for Horizontal & Vertical Position (0-10 NT Units).
5) To end the Program, click 'END'.
Binary file added Labview/Kinesis - KBD101 - Connect Jog/Block.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Labview/Kinesis - KBD101 - Connect Jog/Front.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
13 changes: 13 additions & 0 deletions Labview/Kinesis - KBD101 - Connect Jog/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Thorlabs Hardware: KBD - K-Cube Brushless DC Servo Driver
https://www.thorlabs.com/thorproduct.cfm?partnumber=KBD101

Description: This VI will enable you to communicate with KBD101 to control Brushless Stages & Actuators. The VI will first connect and initialize the device, home it, and await user command to move to a specified location.

Instructions:
1) Connect your KBD101 device to your PC & power the device, ensuring your stage/actutator is connected. For full device setup, the device product manual can be found on our website here. -https://www.thorlabs.com/thorproduct.cfm?partnumber=KBD101
2) Enter the device serial number below.
3) Ensure the device move path is clear for homing.
4) Click 'Run' in the LabVIEW Toolbar which will attempt a connection, and send a home command in that order.
5) Await for device to be be available, and to have finished homing.
6) Input desired Jog Direction and step size position, and press 'Jog'.
7) To end the Program click 'STOP'.
Binary file added Labview/Kinesis - KBD101 - Connect Move/Block.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
13 changes: 13 additions & 0 deletions Labview/Kinesis - KBD101 - Connect Move/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Thorlabs Hardware: KBD - K-Cube Brushless DC Servo Driver
https://www.thorlabs.com/thorproduct.cfm?partnumber=KBD101

Description: This VI will enable you to communicate with KBD101 to control Brushless Stages & Actuators. The VI will first connect and initialize the device, home it, and await user command to move to a specified location.

Instructions:
1) Connect your KBD101 device to your PC & power the device, ensuring your stage/actutator is connected. For full device setup, the device product manual can be found on our website here. -https://www.thorlabs.com/thorproduct.cfm?partnumber=KBD101
2) Enter the device serial number below.
3) Ensure the device move path is clear for homing.
4) Click 'Run' in the LabVIEW Toolbar which will attempt a connection, and a home command in that order.
5) Await for device to be be available, and to have finished homing.
6) Input desired movement position, and press 'Move To Position'.
7) To end the Program click 'STOP'.
Binary file added Labview/Kinesis - KIM101 - Set Jog/Block.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Labview/Kinesis - KIM101 - Set Jog/Front.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
13 changes: 13 additions & 0 deletions Labview/Kinesis - KIM101 - Set Jog/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Thorlabs Hardware: KIM101 - K-Cube Inertial Motor Controller
https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=9790&pn=KIM101#9791

This VI will enable you to run the Kinesis Device panel for the KIM101 Intertial Motor Controller.
You will also be able to set Jog Parameters & toggle the Jog Mode, as well as assert control to a particular channel.

Instructions:
1. Connect your KIM101 device to your PC via USB & power your device. See the product manual for details of device setup
https://www.thorlabs.com/thorproduct.cfm?partnumber=KIM101
2. Enter the serial number of the controller into the SerialNumber box below.
3. Run the VI from the LabVIEW Toolbar.
6. To end the program, click 'END'.

Binary file added Labview/Kinesis - KNA - Latch Trak/Block.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Labview/Kinesis - KNA - Latch Trak/Front.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
13 changes: 13 additions & 0 deletions Labview/Kinesis - KNA - Latch Trak/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Thorlabs Hardware: KNA - K-Cube Nanotrak Controller
https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=2877

Description: This VI will enable you to run the Kinesis Device panel for KNA-nnn devices.
You will also be able to set the Operating Mode to Track or Latch.

Track - When tracking, the NanoTrak detects any drop in signal strength resulting from misalignment of the input and output devices, and makes positional adjustments to maintain the maximum signal strength.

Latch - Scanning is disabled and the piezo drives are held at their present position.

1. Connect your KNA-nnn device to your PC via USB & power your device.
2. Enter the serial number of the controller into the SerialNumber box below.
3. Run the VI
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
13 changes: 13 additions & 0 deletions Labview/Kinesis - KNA - Set Circle Diameter/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Thorlabs Hardware: KNA - K-Cube Nanotrak Controller
https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=2877

Description: This VI will enable you to run the Kinesis Device panel for KNA-nnn devices.
You will also be able to set the Operating Mode to Track or Latch.

Track - When tracking, the NanoTrak detects any drop in signal strength resulting from misalignment of the input and output devices, and makes positional adjustments to maintain the maximum signal strength.

Latch - Scanning is disabled and the piezo drives are held at their present position.

1. Connect your KNA-nnn device to your PC via USB & power your device.
2. Enter the serial number of the controller into the SerialNumber box below.
3. Run the VI
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
10 changes: 10 additions & 0 deletions Labview/Kinesis - KST201 - Move Relative/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Thorlabs Hardware: KST201 - K-Cube Brushless DC Servo Motor Controller
https://www.thorlabs.com/thorproduct.cfm?partnumber=KST201

Description: This VI will enable you to communicate with KST101 to control Stepper Motor Stages & Actuators. The VI will allow you to home the device and move it by any valid distance in any direction.

Instructions:
1) Connect your KST101 device to your PC & power the device, ensuring your stage/actutator is connected. For full device setup, the device product manual can be found on our website here. - https://www.thorlabs.com/thorproduct.cfm?partnumber=KST201
2) Enter the device serial number below.
3) Click 'Run' in the LabVIEW Toolbar.
4) To end the Program click the 'STOP' button.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
13 changes: 13 additions & 0 deletions Labview/Kinesis - M30XY - Set Velocity Step/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Thorlabs Hardware: M30XY - 30 mm Motorized XY Translation Stage
https://www.thorlabs.com/thorproduct.cfm?partnumber=M30XY

Description: This VI will enable you to communicate with M30XY series to control Brushless Stages & Actuators.

Instructions:
1) Connect your M30XY device to your PC & power the device, ensuring your stage/actutator is connected. For full device setup, the device product manual can be found on our website.
2) Enter the device serial number.
3) Click 'Run' in the LabVIEW Toolbar which will attempt a connection, and enable the device.
4) Ensure the device move path is clear for homing, and press Home.
5) Await for device to be be available, and to have finished homing (Home indicator in control panel should be green).
6) Input direction and step size for relative move.
7) To end the Program click 'STOP'.
23 changes: 13 additions & 10 deletions Python/Integrated Stages/Cage Rotator/K10CR1_pythonnet.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
"""
K10CR1_pythonnet
Example Title: K10CR1_pythonnet.py
Example Date of Creation(YYYY-MM-DD) 2023-02-23
Example Date of Last Modification on Github 2025-04-09
Version of Python: 3.11
Version of the Thorlabs SDK used: 1.14.52
==================

An example of using the K10CR1 integrated rotation stages with python via pythonnet
Example Description
Using the .NET Dlls
Example runs the K10CR1 or K10CR2 stage. It shows how to initialize, home and move.
Tested with K10CR2
"""

import clr
import os
import time
import sys

# Write in file paths of dlls needed.
clr.AddReference("C:\\Program Files\\Thorlabs\\Kinesis\\Thorlabs.MotionControl.DeviceManagerCLI.dll")
Expand All @@ -26,14 +30,14 @@ def main():
"""The main entry point for the application"""

# Uncomment this line if you are using
# SimulationManager.Instance.InitializeSimulations()
#SimulationManager.Instance.InitializeSimulations()

try:
# Build device list.
DeviceManagerCLI.BuildDeviceList()

# create new device.
serial_no = "55000114" # Replace this line with your device's serial number.
serial_no = "55507804" # Replace this line with your device's serial number.
device = CageRotator.CreateCageRotator(serial_no)

# Connect to device.
Expand All @@ -55,8 +59,7 @@ def main():
print(device_info.Description)

# Load any configuration settings needed by the controller/stage.
device.LoadMotorConfiguration(serial_no, DeviceConfiguration.DeviceSettingsUseOptionType.UseDeviceSettings)
motor_config = device.LoadMotorConfiguration(serial_no)
motor_config=device.LoadMotorConfiguration(serial_no, DeviceConfiguration.DeviceSettingsUseOptionType.UseFileSettings)

# Call device methods.
print("Homing Device")
Expand All @@ -76,7 +79,7 @@ def main():
print(e)

# Uncomment this line if you are using Simulations
# SimulationManager.Instance.UninitializeSimulations()
#SimulationManager.Instance.UninitializeSimulations()


if __name__ == "__main__":
Expand Down
72 changes: 72 additions & 0 deletions Python/TCube/TTC_pythonnet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
"""
TTC_pythonnet Example
Date of Creation(YYYY-MM-DD): 2025-04-28
Date of Last Modification on Github: 2025-04-28
Python Version Used: python 3.11
Kinesis Version Tested: 1.14.52

"""
import time
import clr

# Add References to .NET libraries
clr.AddReference("C:\\Program Files\\Thorlabs\\Kinesis\\Thorlabs.MotionControl.DeviceManagerCLI.dll")
clr.AddReference("C:\\Program Files\\Thorlabs\\Kinesis\\Thorlabs.MotionControl.TCube.TECCLI.dll")
from Thorlabs.MotionControl.DeviceManagerCLI import *
from Thorlabs.MotionControl.TCube.TECCLI import *

from System import Decimal # necessary for real world units

def main():
"""The main entry point for the application"""

# Uncomment this line if you are using a aimulated device
#SimulationManager.Instance.InitializeSimulations()

try:

DeviceManagerCLI.BuildDeviceList()

# create new device
serial_no = "87000001" # Replace this line with your device's serial number
device = TCubeTEC.CreateTCubeTEC(serial_no)

# Connect
device.Connect(serial_no)
time.sleep(0.25) # wait statements are important to allow settings to be sent to the device

# Get Device Information and display description
device_info = device.GetDeviceInfo()
print(device_info.Description)

# Start polling and enable
device.StartPolling(250) #250ms polling rate
time.sleep(0.25)
device.EnableDevice()
time.sleep(0.25) # Wait for device to enable

# Configure device#
device_config = device.GetTECConfiguration(device.DeviceID)

temperature=Decimal(10)
device.SetTemperature(temperature)

for i in range (10):
print(device.GetValueReading())
time.sleep(1)



# Stop Polling and Disconnect
device.StopPolling()
device.Disconnect()
except Exception as e:
print(e)

# Uncomment this line if you are using Simulations
#SimulationManager.Instance.UninitializeSimulations()
...


if __name__ == "__main__":
main()