01-08-2015 06:06 AM - edited 01-08-2015 06:08 AM
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.
01-09-2015 08:45 AM
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
01-09-2015 09:13 AM
@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.
01-10-2015 02:00 AM
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!
01-10-2015 02:06 AM
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.
01-12-2015 09:41 AM
Hi!
The next links might be helpful:
http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/using_activex_with_labview/
http://www.ni.com/white-paper/2983/en/
Regards,
AGJ
01-12-2015 11:24 PM - edited 01-12-2015 11:25 PM
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.
01-14-2015 07:58 AM
Hi,
Would you explain that with more detail? Is this settings window on the other program or on LabVIEW?
Regards,
AGJ
01-14-2015 08:48 AM
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.
01-15-2015 12:12 PM
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