Giter Site home page Giter Site logo

zindy / libapt Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 40 KB

An Open Source rewrite of the Thorlabs APT.dll based on the cross-platform libftdi1 library

License: Apache License 2.0

C 40.24% Makefile 0.23% M4 0.52% Jupyter Notebook 59.01%

libapt's Introduction

libapt

An Open Source rewrite in C of the Thorlabs APT.dll based on the APT communication protocol and the libftdi1 library for low-level communication.

What?

The idea is to re-implement all the functions defined in the APTAPI.h protocol file, or at least the ones we need to make the micro-manager ThorlabsAPTStage device adapter work. By using libftdi1 and by re-using the APTAPI.h protocol file, replacing the APT.dll file provided by Thorlabs with the one provided here should be relatively straightforward. APTAPI.h is copyright (c) Thorlabs.

Why?

In micromanager, my ThorlabsAPTStage adapter relies on the APT.dll DLL provided by Thorlabs. The DLL although now available both for 32 bit Windows as well as 64 bit Windows still ties the APT device adapter exclusively to the Windows platform.

Which means:

  • The ThorlabsAPTStage device adapter will only work with a Windows OS.
  • The ThorlabsAPTStage device adapter only works with the TDC001 controller which is now obsolete.
  • The ThorlabsAPTStage device adapter will not work in Linux (32 or 64 bit).
  • The ThorlabsAPTStage device adapter will not work on Mac OSX (32 or 64 bit, either Intel, PowerPC or 68000 CPU).

So where are we at with the opensource adapter?

I got a few of the commands done, but there are still many I'm stuck on. On the TDC001 controller, MGMSG_MOT_REQ_PMDSTAGEAXISPARAMS does not return any information at all, for example. Time to look at some USB traffic with Wireshark methinks...

Still, you should be able to initialize the stage, home it, set positions, etc. The library, although far from being complete already shows some promise.

Other things I still need to look at: I have a very limited understanding of Autoconf. If someone wants to help with that, please send me a pull request. I think I wrote enough code to do a autoreconf -fvi;./configure;make;make install but there are no usable Python SWIG bindings, and I haven't worked-out yet how to reintegrate the main() part of my test_main.c with the libapt library.

As I said before, I'll spare whatever time I can on this project but don't expect too much. For now if you want to test this, you can type (to make libapt.so and install it):

autoreconf -fvi
./configure
make
sudo make install

Then if you want to run the sample application, type:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
gcc -o test_main src/test_main.c -lapt
./test_main

We're getting close everyone! :-)

Contrib files

TL;DR Do you want this fixed and finished? Please contribute. I will gladly accept any pull requests.

Cheers!

libapt's People

Contributors

zindy avatar

Stargazers

 avatar

Watchers

 avatar  avatar

libapt's Issues

Using micro-manager to control KDC101 and MTS25-Z8 focus stage

Hi,

I'm looking to use micro-manager to control a KDC101 controller and an MTS25-Z8 stage. Could you provide me with any examples or instructions on how to set this up in micro-manager?

I've looked online in multiple places, but can't find something with clear instructions.

Thanks,
Chaitanya

Delays

When I execute the code as it is with a TDC001 and a linear stage connected, it executes the code without any errors and prints in the console. However, the homing is not executed on the stage.

I realized that when sending new commands faster than 1 second after the last command, the TDC001 does not react. Also, if I move the stage in one direction, and during movement I change the direction, it takes up to 2 seconds until the new command is executed. Can you confirm that?

Furthermore, execution is aborted at the following line in libapt.c:
ftdi->usb_read_timeout=3000;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.