LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

controlling stepper motor through serial communication in labview when the programming manual controlling the motor is given

Dear AliT !

 

I am sorry,I I can't help that much, as I am also very new in these stuff!

I am following the answers, because i am planing to do almost the same thing.

 

let me know how you'll advance.

 

good luck

 

amayas

0 Kudos
Message 21 of 33
(1,637 Views)

AliT,

 

This is a LabVIEW Board.  There is a LabWindows/CVI Board.  You will get better responses to questions about LW/CVI there.  Also, it appears that your question is sufficiently different that you should probably create a new thread.

 

Lynn

0 Kudos
Message 22 of 33
(1,632 Views)

Hi all,

 

Sorry, I know this thread is a bit old...

I'm having trouble getting my stepper to work with LabVIEW '12. I am not familiar with using serial/VISA commands in LabVIEW.

My motor is an Anaheim Automation 17MDSI with an integrated controller. There is an online manual, which lists commands. It is here: 

 

http://www.anaheimautomation.com/manuals/stepper/L010473%20-%2017MDSI%20Series%20Users%20Guide.pdf

 

I took a look at the basic & advanced serial write and read VI's before I came here (glad to know I was on right track). I've tried to give it a command using those VI's (basically I try to write @0$\n to the controller... the manual says this should cause some output) but it just sits there and reads nothing. Any thoughts? Am I doing something completely wrong?

 

The motor itself is configured correctly, I can use it with Anaheim's archaic motor testing software and make it move in single steps.

 

Any help would be appreciated!

 

 

0 Kudos
Message 23 of 33
(1,421 Views)

Are you sure you have the right cable?  (null modem vs. straight through?)  Sounds like you are since their software works.

 

Are you sure you have the right communication settings?  (baud rate, data bits, stop bits, parity?)  Again, sounds like you are since their software works.

 

Are you sure you are sending the correct command?  You say you are sending "@0$\n" but is the string constant or control set to display \codes or normal mode?  A common error is for someone to literally type that into a string set for normal display which will send a literal backslash literal n, rather than \codes display which will send the linefeed character (ASCII code 10 decimal) where the \n appears in the string.

0 Kudos
Message 24 of 33
(1,414 Views)

In the order you asked...


Yes, the cable was used before successfuly (sadly no VI was saved). The motor is hooked to a tiny breakout board on a RS485 connector, which is hooked to the serial port on my machine.

 

Maybe - I am sure about baud rate (38400), data bits (8), stop bits (1), and no parity. The manual says to use XON/XOFF flow control. Do I have to configure the flow control beyond just selecting that from a menu? I did select XON/XOFF in the sample VI.


Lastly, no, I am not sure about the command I am sending at all. I do not actually know if the controller is looking to recieve a \n at all, nor am I sure if I am sending "return" or literally sending "\n" text as you are saying. How would I check that? 

 

As far as actual commands, all the manual says is...

 

   How to get a response from the unit:

   @0$ (Carriage Return)

 

It goes on to say that this command will make the stepper controller return it's model number. It follows up by pointing out that other commands can be sent to the controller with the "@XYZ_1234..." format.  I've tried sending "@0$" on its own, or literally hiting the enter key (which Labview converts to \n). I really am not familiar with this stuff!

0 Kudos
Message 25 of 33
(1,412 Views)

A carriage return is ASCII code 13.  It would show up as \r in a string control in \codes mode.  So using \n would definitely not work.

 

To check, right click on the constant or control and see what display mode is checked off in the shortcut menu.

 

With newer versions of LabVIEW, you can right click, Visible Items, Display style.  This will put a symbol on the constant or control to show what display mode it is set for.

0 Kudos
Message 26 of 33
(1,408 Views)

Thanks, I think I was doing both of those wrong, the motor controller is responding now.

 

Definately saving the VI this time.

 

Thanks again.

0 Kudos
Message 27 of 33
(1,402 Views)

Hi Jake,

 

Can you post the VI that you made to successfully connect to the motor controller please?

 

Thanks!

0 Kudos
Message 28 of 33
(1,021 Views)

Hey what's up yall, I remember asking about this a while back, never found any code online, but wrote a basic one that people can copy, extract and improve to state machines or event structures as needed for an Anaheim Automation motor through RS485 to Serial USB converter.

 

Anaheim Basic Connectivity.JPG

Message 29 of 33
(963 Views)

Good work sandman92. Could you save it in LabVIEW 2012 so that others with older versions can use it? That would be appreciated. My Anaheim Automation 23MDSIs just came in.

0 Kudos
Message 30 of 33
(919 Views)