Closed BDImagingLab closed 8 months ago
This is python code that I use.
import os import time import sys import clr
clr.AddReference("C:\Program Files\Thorlabs\Kinesis\Thorlabs.MotionControl.DeviceManagerCLI.dll") clr.AddReference("C:\Program Files\Thorlabs\Kinesis\Thorlabs.MotionControl.GenericMotorCLI.dll") clr.AddReference("C:\Program Files\Thorlabs\Kinesis\ThorLabs.MotionControl.KCube.PiezoCLI.dll") from Thorlabs.MotionControl.DeviceManagerCLI import from Thorlabs.MotionControl.GenericMotorCLI import from Thorlabs.MotionControl.KCube.PiezoCLI import * from System import Decimal # necessary for real world units
DeviceManagerCLI.BuildDeviceList()
serial_no = "29501195" # Replace this line with your device's serial number
device = KCubePiezo.CreateKCubePiezo(serial_no)
device_info = device.GetDeviceInfo() print(device_info.Description)
Hi!
Are you simulating the device or is it a physical one? At least to me, InitializeSimulations() only works when the Kinesis GUI is closed. Apparently the Kinesis server can only take up to one "pipe", so either Python is connected or the GUI is connected. You can see these log messages on the Kinesis Simlulator app.
[FIXED] Now, I am also running into an issue when calling TLI_GetHardwareInfo, which is similar to .NET GetDeviceInfo(). Whenever I run this function, my kernel crashes xD
Solution: I has some mistake on the pointer arguments. The crashing probably came from an invalid memory access.
Hope this gives you some more clue as to what might be wrong!
Hi, Our apologies for the late response, but if you are still having issues with this error please reach out to our support team at techsupport@thorlabs.com to speak with one of our engineers directly.
When using this code to control the KPZ101, it shows up an error message: Meanwhile, I can connect and control the stage with Kinesis software. When running python, it is disconnected in Kinesis.