I am new to Labview. I am trying to create a custom program for control of a Thorlabs APT DC Servo motor controller. I created an Active X window using the Thorlabs software in Labview. It works fine , but to rotate the motor I have to press the buttons in the front panel.I want to customize it so that when I run the vi , it rotates by a specified angle. Can anyone give me an idea of how to do it. I have attached the current program that I have.
I took a look at your code. The only button I see on your front panel is the stop button, as I do not have the Thorlabs software. Is this the button you are speaking of? Maybe posting screen shots of the front panel and block diagram would be helpful to since many of us will not have the Thorlabs API installed. Also, does the motor continue rotating until the stop button is pressed? If so, you can stop the rotation programmatically by comparing the position to some max rotation value and cause the loop to stop when they are equal. Feel free to post more details.
I hope this helps!
Hi thanks for the reply. I have attached two sreenshots one of the front panel and the other of the block diagram.My code makes the ActiveX window alive when I press the run button. After that I can control the motor using the ActiveX window in the front panel.But I want the motor to run when I press the run button without need to press the jog button in the front panel.
I see the button you are talking about now. Unfortunately, my abilities here are limited without the driver for the controller. I suggest looking for methods that allow you to programmatically jog, then wire a constant or logic to the input terminal. Is there somewhere i can download a trial version of the drive?
Is there an API that explains the functions/methods? "MoveJog" looks promising, but I could find anything with descriptions of what the MoveJog method actually does.
I think you are on the right track. What you have done is import the ActiveX control into your application. This is always a must for any ActiveX control to operate. When you imported the control you also created all the methods that are available for that control. Using the methods is the tricky part. You can always use the motor control as a sanity check to see if the hardware works. Otherwise you can hide it and just display your application. What you have to do now is program the methods according to your application needs. Go to control properties and look at all the methods. Choose an appropriate one for your application and you will see the methods appear in your wire/gui panel. You may want to look athe LabView tutorials we have created on our website. There are quite a few of these to get you started. There are also three LabView programs on the CDROM of levels of complexity. They should also help.
Senior R&D Application Engineer
Thorlabs, Inc. Newton NJ
I have recently tried to control an APT OptoDCDriver S/N63001724 motor according to the instructions in the previous posts, the vi looks very similar to what is described and at times the motor even responds. However, the action of the motor is not constant, sometimes the motor moves and doesn't stop or it doesn't move at all. I have tried to change the vi in various ways but have not succeeded. Is there something I am missing in the vi? My goal here is to move it at a constant velocity and then return to the starting point. Is there a way that I could test to see if this is a hardware problem?