Comments (3)
Ok, it looks like this is futile since it is not exported by apt.dll...
from thorlabs_apt.
OK. APT.DLL seems to be quite limited and not documented at all. So you
either have to use the ActiveX controls :( or better, the underlying
ftdi protocol. For the latter there is a python library:
https://github.com/freespace/pyAPT
Haven't tried it myself though.
On 02/11/2016 05:55 PM, Matthias Blaicher wrote:
Ok, it looks like this is futile since it is not exported by apt.dll...
—
Reply to this email directly or view it on GitHub
#1 (comment).
from thorlabs_apt.
I got it working with python .net:
import clr
import sys
sys.path.append(r'C:\Program Files\Thorlabs\Kinesis')
clr.AddReference("Thorlabs.MotionControl.DeviceManagerCLI")
clr.AddReference("Thorlabs.MotionControl.GenericNanoTrakCLI")
clr.AddReference("Thorlabs.MotionControl.TCube.NanoTrakCLI")
from Thorlabs.MotionControl.DeviceManagerCLI import DeviceManagerCLI
from Thorlabs.MotionControl.GenericNanoTrakCLI import NanoTrakStatus, TIAReading, TIARangeParameters
from Thorlabs.MotionControl.TCube.NanoTrakCLI import TCubeNanoTrak
class NanoTrak:
def __init__(self, device_id):
DeviceManagerCLI.BuildDeviceList()
if not DeviceManagerCLI.GetDeviceList().Contains(device_id):
raise RuntimeError('Unknown device id')
device = TCubeNanoTrak.CreateTCubeNanoTrak(device_id)
device.Connect(device_id)
if not device.IsSettingsInitialized():
device.WaitForSettingsInitialized(5000)
device.StartPolling(250)
#device.SetTIARangeMode(TIARangeParameters.TIARangeModes.AutoRangeAtSelected, TIARangeParameters.OddOrEven.All);
#nanotrak_settings = device.GetNanoTrakConfiguration(device_id)
self._device = device
def close(self):
if self._device:
self._device.StopPolling()
self._device.Disconnect()
self._device = None
def __del__(self):
self.close()
@property
def tracking(self):
return self._device.GetMode() != NanoTrakStatus.OperatingModes.Latch
@tracking.setter
def tracking(self, enabled):
if enabled:
self._device.SetMode(NanoTrakStatus.OperatingModes.Tracking)
else:
self._device.SetMode(NanoTrakStatus.OperatingModes.Latch)
@property
def power(self):
tia_reading = self._device.GetReading()
# if tia_reading.UnderOrOverRead != TIAReading.UnderOrOver.Within:
# raise ValueError('TIA out of range!')
return tia_reading.AbsoluteReading
@property
def cycle_position(self):
pos = self._device.GetCirclePosition()
return pos.HPosition, pos.VPosition
from thorlabs_apt.
Related Issues (20)
- KCH301 USB Hub, not identifying all motors HOT 1
- Not able to connect to KDC101 HOT 1
- K10CR1 home and fonction problem HOT 1
- moteur position
- control BSC201 HOT 1
- When cleanup is not called, list_available_devices doesn't return
- move_by minimum travel
- Installation Instruction HOT 7
- Opening motors from secondary thread HOT 2
- Thorlabs MPC220 HOT 1
- C++ source code for DLL
- import errors for thorlabs apt motion controller HOT 3
- KBD101 Moving velocity failed exception HOT 1
- Works with KBD101/DDR25!
- Python can't detect Kinesis K-Cube KDC101, but usb.core() can HOT 1
- Support for BSC202
- Movement inaccurate when using KDC101 to Control Z825B
- Updating maximum velocitys
- Stop Abruptly
- Exception: Moving velocity failed: Serial number invalid.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thorlabs_apt.