LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MoveComplete with Thorlabs translation stage?

Solved!
Go to solution

Problem:

I want to move a certain distance on the x-axis (working fine), but I want to know when this completes so I know when to start AND stop data acquisition.  I've been using method calls to repeatedly get the current position of the motor and making sure that falls within my bounds of travel, but it seems cludgy and overcomplicated.  I did some searching and found that I can use something called "MoveComplete", which notifies me when the motor is done moving.  I'm pretty new to labview and I'm clueless how to access this functionality.  I figured it would be a method provided by a node, but it is not.  I've been doing a lot of searching and reading and I'm guessing I need to set up an event (with handler, etc.)?  I've looked at the event with excel example and I'm still lost.  Again very clueless how to do this.  Anyone who has some advice or a working example would be GREATLY appreciated.  Thanks.

 

 

 

 

p.s.

I'm working with a Thorlabs TDC001 servo translation stage

0 Kudos
Message 1 of 10
(9,160 Views)
Are you using ni motion, a 3rd party driver or a more low level approach (steo and direction, pulse width modulation ...)
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 10
(9,156 Views)
I'm using drivers provided by Thorlabs, but I'm open to using anything so long as it works.
0 Kudos
Message 3 of 10
(9,147 Views)
I have not used this particular driver which appears to be an active X control, chances are there is a property that indicates if a move is completed.  If you were using ni motion (ehis only wiors with NI cards which are not needed since you have the hardware) there is a vi to determine if a move operation is complete.  Sorry I dont have any additional info without the driver api doccuments.
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 10
(9,123 Views)
Hi,  Could you elaborate a little more about your setup.  You have told us what kind of stage you have.  Do you have a motor drive (amplifier).  Is there some kind of motion control PCI card in your computer, or is the whole thing self contained.  If so, what interface do you use to communicate with the stage.
Chris Bakker
SET Americas
CEO

0 Kudos
Message 5 of 10
(9,102 Views)

Thanks for the replies everyone.  I think I got it figured out, setting up the event and callback (see attached-1), but I'm questioning how I'm stopping my data acquisition loop.  Currently in the callback vi I'm setting a global variable's boolean value to stop my loop (see attached-2), but I'm wondering if there is a better way? 

 

 

 

 

The translation stage is the MTS50 by thorlabs  (http://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=3002&pn=MTS50-z8)
Download All
0 Kudos
Message 6 of 10
(9,089 Views)

You can also query the status register with a method created from the ActiveX control. The ActiveX control changes the register status among other values such as direction, limit switch hit and motor stop. I typically program a motor move in a loop and stay in the loop until the motor stop value returns to zero.  I mask the register value and look for the change to take place. This way no other move (or method) takes place until this move is completed.

 

0 Kudos
Message 7 of 10
(9,069 Views)
Solution
Accepted by topic author jstaley

For help in using the event callbacks in LabView with Thorlabs APT software there is an example loctaed on the latest APT CD (v2.9.0) at the following location;

 

root:Support\Developer Support\LabView\Basic Examples\Projects\Motor\TL Motor MoveComplete.vi

 

Setting the correct serial number for a motor controller within this VI and running it shows a call back routine for the move complete event. Run the VI and press the "jog button" on the front panel Active-X Motor control. Each time a move completes a message is displayed.

 

Should you not have the latest CD it can be downloaded from the Thorlabs website.

 

http://www.thorlabs.de/software_pages/ViewSoftwarePage.cfm?Code=APT

 

0 Kudos
Message 8 of 10
(9,038 Views)

StopThorlabs.PNG

I think you can use the statusbits to detect if the stage is moving or not.

This is a picture of another Thorlabs stage, but the principle would be the same. 

 

plStatusBits is a Byte that is converted into 8 bits. Each bit is a statusbit. Bit 4 determines if the stage is moving or not (True or False). 

Message Edited by Heinen on 09-17-2009 02:12 AM
--------------------------------
The Enrichment Center is required to remind you that you will be baked, and then there will be cake.

Message 9 of 10
(9,033 Views)

@ Mark,

Thanks for the reply, but I actually found that after I had already come to the solution after some digging around.  I only had v2.8 not v2.9, and didn't come across the example.

 

 

@ Heinen,

That looks more like what I want to accomplish, as I don't really need a callback vi, just want to know when the motor stops.  I didn't realize I could access reg bits through these active X controls and LabView.

 

 

Now I just need to figure out how to get my acquisition rate constant across my bounds of interest.  I'm always randomly +/- 1 off.  I guess the way that I'm checking my threshold distances isn't very accurate, thus sometimes collecting 200 acquistions from my DAQ and other times 201, etc. 

0 Kudos
Message 10 of 10
(8,996 Views)