4.6

4.6 | 5 ratings Rate this file 9 Downloads (last 30 days) File Size: 3.18 KB File ID: #12727
image thumbnail

ActiveX control of APT Thorlabs positioning stages

by David Krause

 

20 Oct 2006 (Updated 23 Oct 2006)

Use the ActiveX controls to control the APT Thorlabs positioners

| Watch this File

File Information
Description

This code shows how to control the APT Thorlabs positioning system using the third party ActiveX controls. This code also shows how to use ActiveX controls and MATLAB.

It appears that MATLAB modifies the signature of the ActiveX method so that variables originally passed by reference are included in the output of the function. For example:

o the Visual Basic Call to the method GetNumHWUnits is:
MG17System1.GetNumHWUnits USB_NANOTRAK, lngNumNanoTraks

o the equivalent MATLAB call is:
[temp1, temp2] = h_Ctrl.GetNumHWUnits(8, 0);

So, you simply pass a dummy value of 0 into the input argument, and read the output from temp1 and temp2. lngNumNanoTraks gets set to 2 when it is
passed by reference. As expected, temp2 is set to 2 once the line has been evaluated by MATLAB.

At our lab, we have two 6-axis positioning stages. Each axis has a motor control for rough positioning, and piezo control for fine tuning. We also have two NanoTrak modules that let us position four of the axes automatically. The modules are: NanoTrak, Piezo, and Motor controls. In my setup, a fiber is placed on one of the stages and aligned to an optical modulator. Another fiber is placed on the other stage, and is used to measure the output light. The streaming video from out microscope is shown at the bottom right of the screen capture.

MATLAB release MATLAB 7.3 (R2006b)
Other requirements APT Thorlabs NanoTrak, Piezo, Motor ActiveX control. APTServer.GID MG17Core.dll MG17NanoTrak.ocx MG17UIThread.dll APTServer.cnt MG17Logger.ocx MG17Piezo.ocx MG17Utils.dll APTSERVER.HLP MG17Comms.dll MG17Motor.ocx MG17System.ocx
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
12 Dec 2006 rado asd  
20 Dec 2006 Sam Rubin  
02 Jan 2007 Andreas Voelker

Saved me lots of time.

30 Dec 2007 a a  
22 Feb 2011 A

Hi,
I would like to control my ThorLabs stages via Matlab but I do not seem to be able to use your scripts.

Specifically, the APT ActiveX do not seem to be registered or at least I am not able to see them with the Matlab command actxcontrollist.

Could you provide a way of registering APT ActiveX ?

Thank you very much.

27 Apr 2011 AM

Thanks, saved me a lot of time!!!

To register the ActiveXControls, see The MatlabDoku (Using Com Objects from Matlab -> Registering Controls and Servers). To register the Objects using Win7, you need to run the command prompt as administrator.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
hardware driver David Krause 22 Oct 2008 08:44:49
apt thorlabs Cristina McIntire 05 Feb 2009 14:04:20
3rd party Cristina McIntire 05 Feb 2009 14:04:20
activex Cristina McIntire 05 Feb 2009 14:04:20
nanotrak Cristina McIntire 05 Feb 2009 14:04:20
piezo Cristina McIntire 05 Feb 2009 14:04:20
motor Cristina McIntire 05 Feb 2009 14:04:20
visual basic Cristina McIntire 05 Feb 2009 14:04:20
activex Nicole Brönnimann 23 Nov 2009 05:49:52
3rd party Nicole Brönnimann 14 Dec 2009 04:53:16
3rd party Paul Forshey 07 Apr 2010 12:59:37
activex Paul Forshey 07 Apr 2010 13:08:36
3rd party shuncong zhong 16 Apr 2010 04:16:25
motor Rohan Bali 30 Jul 2010 17:06:30
apt thorlabs Vlad Tyzhnevyi 12 May 2011 09:24:26

Contact us at files@mathworks.com