Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.36915.13 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ITC5000_Example", "ITC5000_Example\ITC5000_Example.csproj", "{44C49F98-2FBE-4AF3-B208-2112D42CFF84}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{44C49F98-2FBE-4AF3-B208-2112D42CFF84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{44C49F98-2FBE-4AF3-B208-2112D42CFF84}.Debug|Any CPU.Build.0 = Debug|Any CPU
{44C49F98-2FBE-4AF3-B208-2112D42CFF84}.Debug|x64.ActiveCfg = Debug|x64
{44C49F98-2FBE-4AF3-B208-2112D42CFF84}.Debug|x64.Build.0 = Debug|x64
{44C49F98-2FBE-4AF3-B208-2112D42CFF84}.Release|Any CPU.ActiveCfg = Release|Any CPU
{44C49F98-2FBE-4AF3-B208-2112D42CFF84}.Release|Any CPU.Build.0 = Release|Any CPU
{44C49F98-2FBE-4AF3-B208-2112D42CFF84}.Release|x64.ActiveCfg = Release|x64
{44C49F98-2FBE-4AF3-B208-2112D42CFF84}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3CF30D73-0EF4-403F-A14E-691C3496489F}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{44C49F98-2FBE-4AF3-B208-2112D42CFF84}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>ITC5000_Example</RootNamespace>
<AssemblyName>ITC5000_Example</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="Thorlabs.TL5000_64.Interop, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files\IVI Foundation\VISA\VisaCom64\Primary Interop Assemblies\Thorlabs.TL5000_64.Interop.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
// Title: ITC5000.
// Created Date: 2026 - 06 - 05
// Last modified date: 2026 - 06 - 05
// .NET Framework version: 4.8
// Thorlabs ITC5225 driver version: 1.0
// Notes: This example demonstrates how to initialize the controller, get information about the device and read settings.
// Tested with ITC5225

using System;
using System.Text;
using Thorlabs.TL5000_64.Interop;

namespace ITC5_sample
{
internal class Program

{
private static TL5000 tl5000;
static void Main(string[] args)
{
// Search for connected devices
uint resCnt = 0;
StringBuilder ModelName = new StringBuilder(256);
StringBuilder SerialNumber = new StringBuilder(256);
StringBuilder Manufacurer = new StringBuilder(256);
bool deviceAvailable;
StringBuilder Resource_Name = new StringBuilder(256);
TL5000 searchdevice = new TL5000(new IntPtr());

try
{
searchdevice.findRsrc(out resCnt);
}
catch (Exception ex)
{
Console.WriteLine("Error finding resources: {0}", ex.Message);
return;
}

// Get information about the first device found
int err = searchdevice.getRsrcInfo(resCnt - 1, ModelName, SerialNumber, Manufacurer, out deviceAvailable);
Console.WriteLine("First device found:");
Console.WriteLine("Model Name: {0}", ModelName);
Console.WriteLine("Serial Number: {0}", SerialNumber);
Console.WriteLine("Manufacturer: {0}", Manufacurer);
Console.WriteLine("Device Available: {0}", deviceAvailable);

err = searchdevice.getRsrcName(0, Resource_Name);
Console.WriteLine("Resource Name: {0}", Resource_Name);
searchdevice.Dispose();

// Open the device
tl5000 = new TL5000(Resource_Name.ToString(), true, false);

// Check for errors
int errorCode = 0;
StringBuilder ErrorMessage = new StringBuilder(256);
tl5000.error_query(out errorCode, ErrorMessage);
if (errorCode != 0)
{
Console.WriteLine("Error: {0}", ErrorMessage);
tl5000.Dispose();
return;
}

// Get information about the slots
StringBuilder DeviceName = new StringBuilder(256);
StringBuilder DeviceType = new StringBuilder(256);
StringBuilder FirmwareVersion = new StringBuilder(256);
StringBuilder SlotSerialNumber = new StringBuilder(256);
StringBuilder CalibrationMessage = new StringBuilder(256);
uint Total_Slots;
tl5000.getSlots(out Total_Slots);
Console.WriteLine("\nNumber of slots: {0}", Total_Slots);
for (uint i = 0; i < Total_Slots; i++)
{
tl5000.getSlotInfo(i, DeviceName, DeviceType, FirmwareVersion, SlotSerialNumber, CalibrationMessage);
Console.WriteLine("Slot {0}:", i);
Console.WriteLine("Device Name: {0}", DeviceName);
Console.WriteLine("Device Type: {0}", DeviceType);
Console.WriteLine("Firmware Version: {0}", FirmwareVersion);
Console.WriteLine("Serial Number: {0}", SerialNumber);
Console.WriteLine("Calibration Message: {0}", CalibrationMessage);
}

uint Slot = 2;
uint TemperatureSensorType;
tl5000.getTecTempSensor(Slot, out TemperatureSensorType);
switch (TemperatureSensorType)
{
case 0:
Console.WriteLine("Temperature Sensor Type: AD590");
break;
case 1:
Console.WriteLine("Temperature Sensor Type: Low-range thermistor");
break;
case 2:
Console.WriteLine("Temperature Sensor Type: Mid-range thermistor");
break;
case 3:
Console.WriteLine("Temperature Sensor Type: High-range thermistor");
break;
default:
Console.WriteLine("Temperature Sensor Type: Unknown");
break;
}

// Get LDC operating mode
uint ldOperatingMode;
Slot = 1;
tl5000.getLdcOperatingMode(Slot, out ldOperatingMode);
switch (ldOperatingMode)
{
case 0:
Console.WriteLine("LDC Operating Mode: constant current mode");
break;
case 1:
Console.WriteLine("LDC Operating Mode: constant power mode");
break;
default:
Console.WriteLine("LDC Operating Mode: unknown");
break;
}

// Get LDC current limit and setpoint
double LD_Current_Limit;
double LD_Current_Setpoint;
tl5000.getLdcLdCurrLimit(Slot, 0, out LD_Current_Limit);
Console.WriteLine("LD Current Limit: {0}", LD_Current_Limit);
tl5000.getLdcLdCurrSetpoint(Slot, 0, out LD_Current_Setpoint);
Console.WriteLine("LD Current Setpoint: {0}", LD_Current_Setpoint);

// Get Laser Diode Controller Laser Diode polarity
uint ldPolarity;
tl5000.getLdcLdPolarity(Slot, out ldPolarity);
switch (ldPolarity)
{
case 0:
Console.WriteLine("LD Polarity: anode-grounded");
break;
case 1:
Console.WriteLine("LD Polarity: cathode-grounded");
break;
default:
Console.WriteLine("LD Polarity: unknown");
break;
}

tl5000.Dispose();
Console.WriteLine("\nDevice closed.");


}
}
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
[assembly: AssemblyTitle("ITC5000_Example")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("DCHSCCM01")]
[assembly: AssemblyProduct("ITC5000_Example")]
[assembly: AssemblyCopyright("Copyright © DCHSCCM01 2026")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
[assembly: ComVisible(false)]

// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("44c49f98-2fbe-4af3-b208-2112d42cff84")]

// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>
Loading