From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Thorlab Kinesis: .Net conatiner able to multithread?

Solved!
Go to solution

Hey, I am controlling two Thorlabs stages (MTS50-Z8 & LTS300) using the Kinesis software provided by Thorlabs (My specs are Kinesis 32-bit, LabVIEW 15 32-bit, Windows 7 64-bit, .NET 4.x). I want to be able to see the current position of the stages even as they are moving. I believe this is a multithreading problem, so here's my question: Does the .NET container allow multithreading? More precisley, can I query the stages while they are running? If so, how? Has anyone got any Kinesis experience?
Cheers in advance.

0 Kudos
Message 1 of 8
(5,433 Views)

Hey bockdoug,

 

LabVIEW does allow multithreading but it would depend on how the .NET is processing the .dll from Thorlabs and this functionality is abstracted away from the user.

As for querying the stages while running I found some documentation from Thorlabs that describes how to "Query the Device Position." On the link attached, this will be on pages 14-17. 

I am not familiar with these Thorlab Stages, but hopefully this will provide you some help on how to query the position while running. Your best resources on how the capabilities of the driver and how to control it will be best directed to Thorlabs I believe. Best of luck!

 

Link:

https://www.thorlabs.com/Software/Motion%20Control/Kinesis/Kinesis-labview.pdf

 

Spencer R.

National Instruments

0 Kudos
Message 2 of 8
(5,374 Views)

Thanks for your reply, Spencer! I should've mentioned that I know of the link you've posted. The example given there does work, however as soon as the flat sequence is modified slightly, everything goes down the drain. Even replacing the method "SetMoveAbsolutePosition" on page 21 to "SetJogStepSize" ruins everything. There seems to be absolutely no documentation for Kinesis at this stage, so debugging is practically impossible... I think it'll be best to leave my vi as it is without updating the position, until Thorlabs dedicates some intern to typing up the docs.

0 Kudos
Message 3 of 8
(5,369 Views)

Actually there is a lot of documentation, it's just written for C# programmers.  You can still get quite a lot of use out of it.  It installed with the rest of the Kinesis software.

 

Unless you installed in a non-standard location, just go here:

C:\Program Files (x86)\Thorlabs\Kinesis\Thorlabs.MotionControl.DotNet_API.chm

 

From that document:

Parameters:

waitTimeout: The wait timeout
If this is value is 0 then the function will return immediately.
If this value is non zero, then the function will wait until the move completes or the timeout elapses, whichever comes first.

 

So you should be able to issue a movement command with a 0 for waitTimeout, then (assuming you have an indexed motion stage) poll the Position property as much as you like.  You may need to run the StartPolling function first.

0 Kudos
Message 4 of 8
(5,363 Views)
Solution
Accepted by topic author bockdoug

This is true, however, LabVIEW does not have some of these methods, and still others have completely different arguments. I've written Thorlabs and they can't really help at this stage, but they acknlowledged that Kinesis still needs further developing.
I've transfered back to the older APT program also provided by Thorlabs which works much better at this stage.

0 Kudos
Message 5 of 8
(5,295 Views)

Hello 

As discussed above, how can I get position of stage while moving. I am using APT software tool of Thorlabs. Earlier I have used Getposition method but this only detects when motion is completed ie final position, I want to plot position vs time of motion, but real time position is not retrieved. Need help in this regard.

0 Kudos
Message 6 of 8
(3,880 Views)

I have an older version (3.5 years ago) that I have not updated because it works fine, and on that one I get the position live with "GetPositionEx_UncalibPosition".  Maybe you can try that if you have that option?

0 Kudos
Message 7 of 8
(3,869 Views)

Thanks for your answer, can you share your program if possible, I would like to see how and where this APT method is suitably placed to get live position. 

 

0 Kudos
Message 8 of 8
(3,853 Views)