From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Control Thorlabs stage (with controller) using LabView

  Hello,

 

My lab bought a Thorlabs High-Speed Motorized XY Scanning Stages and controller for it (this one). Now I'm trying to make a program to control this stage with a keyboard (actually company has a standard software for control it, but it is difficult to use this program due to control with mouse and button on the screen). They have a manual (here) how to do this program, but it seems like I failed 😞 I attached a VI which I made. Also I made a printscreen with the error, but the device is detected by computer and all software installed (software is here).

 

Capture1.PNG

 

Firstly I want to know what the problem is and then how to add a key control (for example A, D is for left and right correspondingly, W and S for forward and back). I have no idea how to do that, could somebody, please, explain me?

 

There is nobody who knows LabView and able to help me in my lab or nearby. If I missed something, ask me.

Download All
0 Kudos
Message 1 of 11
(6,163 Views)

Hi,

I am guessing that you are using an ActiveX component here. Where do you get that error message? Is it when you run your code? Have you tried running a simpler code just to make sure that you are having the right communication with the other software?

You can use keyboard events to detect when those keys are pressed down. Consider the VI attached as an example.

Regards

 

AGJ

0 Kudos
Message 2 of 11
(6,117 Views)

@marie_remy wrote:

  Hello,

 

My lab bought a Thorlabs High-Speed Motorized XY Scanning Stages and controller for it (this one). Now I'm trying to make a program to control this stage with a keyboard (actually company has a standard software for control it, but it is difficult to use this program due to control with mouse and button on the screen). They have a manual (here) how to do this program, but it seems like I failed 😞 I attached a VI which I made. Also I made a printscreen with the error, but the device is detected by computer and all software installed (software is here).

 

 

 

Firstly I want to know what the problem is and then how to add a key control (for example A, D is for left and right correspondingly, W and S for forward and back). I have no idea how to do that, could somebody, please, explain me?

 

There is nobody who knows LabView and able to help me in my lab or nearby. If I missed something, ask me.


Apparently this controller can be controlled by RS232. You might want to look at that manual.

 

This is not something that a complete beginner is going to be able to do.

 

I would suggest that you take some LabVIEW courses.

 

 

0 Kudos
Message 3 of 11
(6,104 Views)

The error was in the wrong serial number, I guess. We have two-dimensions stage, so there is 3 SN: common one and one for each direction. At first I used SN for one of the dimension, but error dissapeared when I changed SN to common. But now I'm confused. How to control different dimension, how program can differ them without SNs?

And I finally found protocol of communication between LabView and controller (page 70).

 

Now I'm trying to make it move. Fortunatly I got some understanding of this process.

Thank you for your reply!

0 Kudos
Message 4 of 11
(6,082 Views)

Unfortunatelly here is no LV courses, and nobody had deal with it. I passed half year LV course in my last university, but there was nothing about ActiveX, nothing similar to my present project.

0 Kudos
Message 5 of 11
(6,081 Views)
0 Kudos
Message 6 of 11
(6,030 Views)

Hi,

 

Actually I've done. But have some problems. I cannot control my stage with keyboard immediately, firstly I have to go to settings (in the down corner of the right side), close it, and only after this manipulation my stage moves when I press key. And I don't know where I'm wrong. 

Download All
0 Kudos
Message 7 of 11
(6,013 Views)

Hi,

Would you explain that with more detail? Is this settings window on the other program or on LabVIEW?

 

Regards,

AGJ

0 Kudos
Message 8 of 11
(5,978 Views)

Hi,

 

It is special terminal from Thorlab, I guess, it appears, when you choose MGMotor in ActiveX Object (For that you probably need to install APT Software). Everything there is ready to use, if you follow this insructions. Home button, jogging buttons are work in this conditions, settings too. But I want to improve it, to customize it to our requirements, adding keyboard control. I realized it in the inner while cycle, using case & event structures (key up, key down; which key). Actually, I don't need this button Settings and its service, I extracted nessesary function, such as velocity and acceleration, out of this system pane. 

 

Commands you can find here, Appendix E (page 70).

 

By the way, if you need to simulate it, you probably need serial number: 83123456 (they recomend it on 41 page of guide).

 

Thank you!

For case I missed something, ask me.

0 Kudos
Message 9 of 11
(5,974 Views)

Hi,

That seems to be specifically related with your other software. Unfortunately, I am not familiar with this software and would take me a really long time to download it and learn to use it. Maybe you can find a command or something like that to close the settings pane programmatically from LabVIEW.

I can tell you that you can use some debug tools in your LabVIEW code to have a better idea on what is going on in “slow motion” using highlight execution.

Debugging Tools in LabVIEW: http://www.ni.com/getting-started/labview-basics/debug

 

Regards,

AGJ

0 Kudos
Message 10 of 11
(5,943 Views)