LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Animatics Smartmotor, Novice Needs Help!

Solved!
Go to solution

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?

0 Kudos
Message 1 of 15
(8,023 Views)
Solution
Accepted by topic author krenik22

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.  

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 2 of 15
(8,020 Views)

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..

0 Kudos
Message 3 of 15
(8,016 Views)

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..

Message 4 of 15
(8,014 Views)

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 🙂

 

 

Message 5 of 15
(7,986 Views)

Great.

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 6 of 15
(7,981 Views)

wow.. that was not an easy one to figure out.

 

Thanks for sharing!

0 Kudos
Message 7 of 15
(7,974 Views)

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!

Message 8 of 15
(7,957 Views)

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.

0 Kudos
Message 9 of 15
(7,933 Views)

So you were able to use labview to control your smartmotor? Would you be willing to share your finished program? 

0 Kudos
Message 10 of 15
(7,567 Views)