Uploaded September 2021 | Updated September 2026, 2 hours ago
Starting a program and initializing connected devices can be one of the largest hurdles to writing code that remotely controls a device. This tutorial for Thorlabs' Kinesis® software package provides step-by-step instructions for using C# and the .NET framework to create a new Visual Studio® project and initialize connected devices, which in this case is a BBD300 series motor controller connected to a two-axis stage. A basic move sequence is then added to the program and used to test the execution of the code.
The demonstration begins with instructions for creating a new Visual Studio project and adding the required dynamic link libraries (DLLs). In this example there is one connected controller, and the program is written to execute its two-step initialization process, since the controller's chassis and channels must be initialized individually. Each channel corresponds to a different stage axis, and this program initializes one of the controller's two channels (axes). Custom velocity and position settings are specified for the move command, and instructions are included to perform the disconnect shutdown sequence after the move sequence is completed. Try-catch blocks are added to the code to provide instructions to the program in the case that an error is thrown by a method. Command and position status information is made available to the user, and status messages are printed to the PC's console screen.
The C# code demonstrated during this video can be downloaded from Thorlabs' official GitHub account: github.com/Thorlabs/Motion_Control_Examples/blob/main/C%23/Benchtop/BBD302_Init_Move/Program.cs
These steps are used as the foundation of a program described in another Video Insight (youtu.be/CoDlTOEo-4w) that executes a stepped, bidirectional raster scan using the same controller and XY stage.
00:00 - Introduction
00:43 - Create New Visual Studio Project
01:56 - Add Kinesis DLLs to the Project
02:47 - Check the Operation of the Build So Far
03:32 - Add C-Based Dependencies
04:27 - Load and Make Accessible the Available Controllers
05:39 - Confirm and Filter the Connected Devices
07:27 - Check the Operation of the Build So Far
07:44 - Initialize the Controller's Chassis
09:45 - Initialize one of the Controller's Channels
12:21 - Make Position and Status Information Available
13:01 - Enable the Stage
13:23 - Create Example Home Stage Method
16:14 - Create Example Move Stage Method
18:22 - Adjust Velocity and Acceleration Settings
19:15 - Specify Move and Disconnect Sequence
20:33 - Execute the Code as a Test
Components used in this demonstration include:
- Kinesis software package: thorlabs.com/navigation.cfm?guide_id=2191&YVI=15
- Thorlabs' software download page: thorlabs.com/software_pages/ViewSoftwarePage.cfm?Code=Motion_Control&viewtab=0&YVI=15
- BBD302 Two-Axis Brushless DC Motor Controller: thorlabs.com/newgrouppage9.cfm?objectgroup_id=5066&pn=BBD302&YVI=15
- MLS203-1 Fast XY Scanning Stage: thorlabs.com/newgrouppage9.cfm?objectgroup_id=5360&pn=MLS203-1&YVI=15
- MLS203P2: Slide/Petri Dish Holder for Inverted Microscopes: thorlabs.com/newgrouppage9.cfm?objectgroup_id=5360&pn=MLS203P2&YVI=15
For more photonics how-to videos, visit thorlabs.com/newgrouppage9.cfm?objectgroup_id=14062&YVI=15
Starting a program and initializing connected devices can be one of the largest hurdles to writing code that remotely controls a device. This tutorial for Thorlabs' Kinesis® software package provides step-by-step instructions for using C# and the .NET framework to create a new Visual Studio® project and initialize connected devices, which in this case is a BBD300 series motor controller connected to a two-axis stage. A basic move sequence is then added to the program and used to test the execution of the code.
The demonstration begins with instructions for creating a new Visual Studio project and adding the required dynamic link libraries (DLLs). In this example there is one connected controller, and the program is written to execute its two-step initialization process, since the controller's chassis and channels must be initialized individually. Each channel corresponds to a different stage axis, and this program initializes one of the controller's two channels (axes). Custom velocity and position settings are specified for the move command, and instructions are included to perform the disconnect shutdown sequence after the move sequence is completed. Try-catch blocks are added to the code to provide instructions to the program in the case that an error is thrown by a method. Command and position status information is made available to the user, and status messages are printed to the PC's console screen.
The C# code demonstrated during this video can be downloaded from Thorlabs' official GitHub account: github.com/Thorlabs/Motion_Control_Examples/blob/main/C%23/Benchtop/BBD302_Init_Move/Program.cs
These steps are used as the foundation of a program described in another Video Insight (youtu.be/CoDlTOEo-4w) that executes a stepped, bidirectional raster scan using the same controller and XY stage.
00:00 - Introduction
00:43 - Create New Visual Studio Project
01:56 - Add Kinesis DLLs to the Project
02:47 - Check the Operation of the Build So Far
03:32 - Add C-Based Dependencies
04:27 - Load and Make Accessible the Available Controllers
05:39 - Confirm and Filter the Connected Devices
07:27 - Check the Operation of the Build So Far
07:44 - Initialize the Controller's Chassis
09:45 - Initialize one of the Controller's Channels
12:21 - Make Position and Status Information Available
13:01 - Enable the Stage
13:23 - Create Example Home Stage Method
16:14 - Create Example Move Stage Method
18:22 - Adjust Velocity and Acceleration Settings
19:15 - Specify Move and Disconnect Sequence
20:33 - Execute the Code as a Test
Components used in this demonstration include:
- Kinesis software package: thorlabs.com/navigation.cfm?guide_id=2191&YVI=15
- Thorlabs' software download page: thorlabs.com/software_pages/ViewSoftwarePage.cfm?Code=Motion_Control&viewtab=0&YVI=15
- BBD302 Two-Axis Brushless DC Motor Controller: thorlabs.com/newgrouppage9.cfm?objectgroup_id=5066&pn=BBD302&YVI=15
- MLS203-1 Fast XY Scanning Stage: thorlabs.com/newgrouppage9.cfm?objectgroup_id=5360&pn=MLS203-1&YVI=15
- MLS203P2: Slide/Petri Dish Holder for Inverted Microscopes: thorlabs.com/newgrouppage9.cfm?objectgroup_id=5360&pn=MLS203P2&YVI=15
For more photonics how-to videos, visit thorlabs.com/newgrouppage9.cfm?objectgroup_id=14062&YVI=15










