04-26-2011 10:36 AM
I installed the SMI (smart motor interface) software that comes with the motor. That works well enough, as soon as I start the software and plug in motor I can type in the SMI's ASCII command:
EIGN(2) 'Remove motion Limit
EIGN(3) 'Remove motion Limit
ZS 'Clear Errors
ADT=100 'Acceleration Limit
VT=450000 'Velocity Limit
PT=300000 'Position Destination
G 'GO
I want to use LabView to command the motor. My assumption was to make a VI that did serial communication and send the same ASCII syntax commands via serial write, etc. See attached VI.
I get no reponse, I have no idea what is going on, OR what I am really doing for that matter...
Is this possible and the right direction? Can I not use SMI and instead just use LabView serial write/read commands to communicate with it? Or is the SMI software doing other tricks behind the scene I am unaware of?
Solved! Go to Solution.
04-26-2011 10:55 AM
Do you have a manual for the SMI software command? You should try simple command that you give you a response. For example, if there is a serial number query command, you should try to issue that and read from the visa buffer to see is there a response or not. Open NI-Spy when you are troubleshooting your code more more visibility.
04-26-2011 11:47 AM
Have you tried communicating with the motor using a Terminal Emulator application, such as TerraTerm, HyperTerminal, etc?
If so and you were successful, you will need to configure LabVIEW the same way.
By the way, are you sending a termination character '\n' at the end of the command?
I will have a look at your posted code..
04-26-2011 11:53 AM
You are not reading data back from the serial port... Only sending it over and over and over and over and over and over .............. You are flooding the poor motor with the same instruction.
It's easier to point to you towards better code than to explain how to fix yours.
Have a look at the code snippet that I posted here:
http://forums.ni.com/t5/LabVIEW/Reading-time-interval-of-serial-port/m-p/1529140#M568806
The modified code is also attached in that thread. Try it using that code.
You will need to implement the serial port configuration as you have done in your code. That would be the only change you need at this time.. Or use the code I posted as a sub-vi inside your code. But try it out the way it is for now..
04-27-2011 03:18 PM
All I was missing was a " " space! Its the SMI termination character. I looked at the hex commands going from SMI, 20=a blank space....woot it works! now i can start the fun stuff 🙂
04-27-2011 04:07 PM
Great.
04-27-2011 07:48 PM
wow.. that was not an easy one to figure out.
Thanks for sharing!
04-28-2011 12:35 PM
It's great that you guys figured this out. The ASCII string command for the SmartMotor requires a line delimiter character at the end and this can be either a linefeed (hex0A), carriage return (hex0D), or space (hex20). Page 10 of the SmartMotor user's guide talked about this. The user's guide can be downloaded from animaics.com, the last item in the Support tab. You can also call the Animatics Tech Support line if you have questions in the future. Good Luck!
05-01-2011 02:44 PM
Thanks for sharing mtran,
I do not have experience with the smart motor. ANd this was the first time I hear about the space being a delimiter.
I am glad that you posted the fact that it also support the linefeed or carriage return.
05-14-2012 04:02 PM
So you were able to use labview to control your smartmotor? Would you be willing to share your finished program?