06-26-2009 11:48 AM
Hi,
I was trying to figure out the best way to use LabView to upload a routine ("program") into an MDrive (17 or 23) motor. Apparently,you can upload a program through some hyper terminal software. But I am thinking to change the internal motor program many times during my Labview software run. So, I need a way to keep re-writing this code and keep uploading it into the motor from LabView. I know I can just send a command line to execute a motor action. But I am not sure about how to initiate and execute an upload of whole series of commands that the program consists of. I will appreciate any help.
thank you and best wishes,
Alex
Solved! Go to Solution.
06-29-2009 02:54 PM
Hey Alex,
Unfortunately, I am not familiar with your MDrive motor. Could you provide some sort of link to the document page for this motor? How are you controlling this device now? Are you using an NI Motion Controller? If not, what medium are you using to send commands to your computer (i.e. USB, serial, Ethernet, etc.)? If you are already able send commands to the motor through a third party software, perhaps that software has ActiveX support and you could use ActiveX commands in LabVIEW to upload your commands.
What sort of commands are you sending to your motor? It almost sounds like NI VISA would be a driver that you would be looking for. However, at this point there is too much that is not known to be able to determine what the best method of sending commands to your motor.
06-29-2009 05:21 PM
Ben,
here is one link I found.
http://www.imshome.com/downloads/manuals/MDM17_23_Plus.pdf
I am using a SR232 to communicate with it. Yes, if I am using a visa vi in LabView, an example command line would look something like MR -90000 (return). This would move the motor 90000 microsteps in the reverse direction, relative to the current position. There are many other commands. A program is a series of commands between certain designators. That's what I have nor played with much.
Alex
06-30-2009 08:48 AM
Hey Alex,
For starters, have you been able to send a command to your motor at all using NI VISA in LabVIEW? It would be good to know if you could use some of the examples in the NI Example Finder within LabVIEW to at least send some sort of recognizable command. This would demonstrate that you can connect to the device and write to it.
What would an example program look like. In your first message, it almost seemed like the way you went about programming this motor was to create an entire routine and then store that routine on board the actual device. Does this sound correct? If this were the case, if you wanted to change and entire routine, you would send a series of commands to the motor all at once. Or, do you simply send a series of commands to the device and the device executes them one at a time as they are sent to the device. This way, your motor would be simply responding to commands sent by your program.
If you control your motor with the second method, you should simply be able to generate a program the write a command to the device, then when it has finished, you would simply send another command. This way, you could change what command gets sent to your device easily in code.
Can you use some of the example programs to send a series of commands to your motor via RS232 using NI VISA?
07-01-2009 03:09 PM
Hi, Ben,
I figured it out. Yes, a program is just a series of commands separated by a return (and the motor does execute them one at a time). It did not seem at first that if I send series of commands it will accept, by I played around with the syntax and seems work great. Example program:
PG 1 MV 500000 MR -9000 E PG
if I send these commands one at a time through VISA write, the motor will now have a saved routine that sets the motor speed to 500000 steps per second and makes it move negative 9000 steps.
So, sounds like it works, thanks for your help.
|