Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Control Step Motor in LabVIEW via Step Motor Driver

I am looking to control a Step Motor (P/N 4023-828) with a Si5580 Driver, both from Applied Motion Products, with a LabView VI.  Applied Motion provides a simple utility program which accepts SCL commands to drive the motor and recieve information about the motor from the driver via a serial connection.
 
Preferably, the LabVIEW VI would have an input field, and a running list of output responses.  I am kind of a novice with LabVIEW, but I know how to create simple VIs.  Any reference to tutorials which explain setting up this type of control would also be appreciated.
 
Thank you
0 Kudos
Message 1 of 30
(13,485 Views)
Hello Spike22283,

From your description, if the driver you received from Applied Motion Products is a DLL and you know the API for the driver (the inputs and outputs for the functions defined in the DLL), then you can use a Call Library Function Node in LabVIEW to get the set up you desire.

In particular, you would first configure the Call Library Function Node to call the particular function in the DLL.  Then wire a string control into the Call Library Function Node, which would be the input command to drive your motor. Then depending on the data type of the return value of your DLL function, you can wire an string indicator to the output of the Call Library Function Node and see the output responses.

As a reference, I would suggest looking at the shipping example Call DLL.VI (Help >> Find Examples >> Search for "DLL").  This example VI allows you to browse examples of external code (C and C++) data types and how they interface with LabVIEW. Each data type has an example VI that demonstates the use of the Call Library Function Node. To open the example VI for a particular data type, select that data type from the list on the left and then press the "Open Example VI for Current Data Type" button. The function prototype, the function's source code, and any specific details about this example will appear in the External Code Information cluster.

Hope that helps.
Wendy L
LabWindows/CVI Developer Newsletter
Message 2 of 30
(13,472 Views)

Wendy,

Thanks for your reply.  I sent your response to a technician at Applied Motion and he said:

"The communications is not as complicated as they are making it. Our protocol using  simple ASCII commands over as 3 wire RS232 port."

I checked out the Call DLL.vi example that you recommended, but I could not find ASCII as a data type.  To be honest, I am still a little confused as to where to go next. 

You said I need to use the Call Library Node Function to call a particular function in the DLL.  Does this mean I need the software code that is loaded on my stepper driver?

Due to my lack of experience, any more references to tutorials or examples would be helpful.

Thanks for your help, Tristan

0 Kudos
Message 3 of 30
(13,440 Views)
Forget that you ever heard anything about a DLL.  From  Applied Motion's response, all you need to do is communicate with the driver/controller over your computer's serial port.  You still need to know what commands the drive expects, and how it responds.  ASCII is nothing more that normal typing, like we are doing here.  There are examples of serial port communication that ship with Labview.  Read the manual for the drive and everything should eventually make sense.
0 Kudos
Message 4 of 30
(13,439 Views)
Guess what just showed up in my office today?  An Applied Motions STAC6 drive that I didn't know I was getting.  Have you had any success with the SCL?  I will try to get mine working this week.
0 Kudos
Message 5 of 30
(13,414 Views)

Brian,

I am still working on this problem.  I have been working with the Labview <->Serial.vi  example that is within Labview, however, the commands I enter in the input field are not causing the stepper motor to respond.  The VI gives a timeout error, and nothing happens.

I have a feeling that I need to put some sort of data type translation into the labview command window, that changes the data type as I send and recieve data.  I contact the tech support at Labview to get this information, and I am waiting for a response. 

Have you had any success getting your applied motion driver to respond?

Thanks again for your help on this.

Tristan

0 Kudos
Message 6 of 30
(13,390 Views)
Yes, I got mine to work.  I will put together some simple VIs and post them here tomorrow.  You must have the drive in SCL mode.
0 Kudos
Message 7 of 30
(13,387 Views)
Here is a VI that has all of the commands in it.
0 Kudos
Message 8 of 30
(13,368 Views)

Brian,

Thanks for sending that VI.  Unfortunately I have LabVIEW 7.0.  Is there any way you can create it in 7.0?

Tristan

0 Kudos
Message 9 of 30
(13,364 Views)

Tristan-

Sorry, but I can't.  I could normally go back to 7.1, but it won't let me do that on this one. 

This is very simple.  Just send the 2-letter command out the serial port.  You need to append a carriage return-line feed to it, though.

Can you get movement using the Applied Motion SCL Utility?

 

Brian

0 Kudos
Message 10 of 30
(13,361 Views)