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

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 - ni.com/cvinews

Similar Messages

  • Error -107380724​6 when trying to control a circulator in Labview via RS-232

    Hi, I'm trying to control an F32 refrigeration/heating circulator through LabView via an RS-232 cable but am having trouble. I keep getting the error - 1073807246 at property node (arg1) in VISA configure serial port. What does this error mean and how can I correct it? I have already specified the values for Baudrate (4800), parity (even), handshake (RTS/CTS), data bits (7), and stop bit (1).
    Thank you,
    Hung

    It is rare to get a timeout when writing. I usually get this when I am reading a port. What value did you use for the timeout when you configured the port? I think the default is 10,000 ms, i.e. 10 seconds. If it were timing out, you would notice the code hanging for 10 seconds as the serial I/O function tries to run to completion.
    To avoid timeouts, check the following in your code.
    1) Make sure the configured timeout is long enough to handle the data stream sent on your write. If you are sending a long stream of data, you should test the time it takes and make sure the timeout is larger than the longest time for your longest data stream.
    2) When you are reading a port, make sure the number of bytes you request is equal to or smaller than the number of bytes being sent from your serial device hanging on the other end of the cable. Otherwise, it will always use the entire alotted time (the timeout value) attempting to read the data.
    3) Verify that the response time of your device is not abnormally slow. Some devices don't interrupt processes very quickly. In fact, some devices put a very low priority on the serial port and may not respond at all while executing certain functions. You need to set the timeout value to be long enough to account for the device's response time when reading a response from your device.
    If you don't know what to use as a timeout value, always start with a long one and try to handle timing variations in your code, e.g. read or write the data in chunks perform sanity checks as you go. Long delays in the response of your code will point you to a bug in the handling of serial port communications. You will get a long delay everytime the serial command cannot complete due to an unreasonable request, e.g. telling it to read 100 bytes when the device can only return 16 bytes for the requested command.
    You can use the NumberOfBytesAtPort property to help you determine when data is available for reading. Also, in a loop that may be used to poll a serial port, try to use a wait (the wristwatch timing function). This keeps you from pummeling the serial port to hard with futile requests.
    Another good way to avoid serial timeouts is to use a termination character. If your device always expects a as the last character in a command, or if it always sends a as the last character in a response, then configure your port to terminate a transmission automatically upon receiving the character. I think the default termination character is (linefeed character) it you elect to enable this feature in your configuration.
    jc
    Mac 10.4
    LV7.1
    CLD

  • Need to control waterbath temp using labview via RS232

    HI,
    I am new to labview. I have labview 6.1. I need to control a thermo RTE7 water bath temp.  controler using labview.
    The water bath has to be connected to computer via RS232 port and the commands have to be given via binary values.
    The users manual for the bath has "hex" bytes that are to be converted
    to binary values to be passed to bath. If anyone has done this before
    or anyone can help me on this please let me know. Thanks,

    Use simply the recommandations given in the RTE manual. You don't have to convert to binary : that's something done by the hardware.
    For instance, to send the temperature setpoint to the controler, you have to send a byte string such as
    CA 00 01 F0 02 01 2C DD, where CA 00 01 is a header specific to the type of serial link you are using,
    F0 is the set temperature command,
    02 is the number of bytes expressing the temperature that you are about to send
    01 0C is the temperature in tenths of degree (here : 30°C = 300 tenth = 010C$
    DD is a check sum byte.
    The corresponding labVIEW program is as follow :
    Of course, do not forget to initialize the serial port before writing the string !
    Message Edité par chilly charly le 10-21-2005 06:21 AM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Water bath.png ‏4 KB
    Water bath.vi ‏28 KB

  • NVIDIA control (Shadowplay mostly) with LabVIEW via ActiveX - Does anyone have documentation?

    Hi Everyone,
    I'm looking to capture my monitor video at around 30fps. ShadowPlay works well with my graphics card, and I've found that there is an ActiveX Library on the PC. The attached screenshot shows an example code for 5 seconds of capture. 
    Shadowplay only captures one monitor but I want it to capture both, or make two videos (one for each monitor) preferably. Although a possible work around would be recording one at a time but being able to programatically change between the two. The Shadowplay library is: ShadowPlayServerLib and the NVIDIA Library is: NVI2Lib (I presume this is NVIDIA but could be wrong)
    I can't find any documentation on the activeX commands so I'm struggling to know what inputs and outputs of the property nodes should be. Does anyone have any? A search of the internet brings up my own forum post on NVIDIAs website: 
    https://forums.geforce.com/default/topic/805560/geforce-experience/shadowplay-activex-documentation-...
    Any help on the NVIDIA/ShadowPlay side of things would be great, alternatively any ideas for capturing video at 30fps (I tried to use .NET to capture the screen shots to png files but it only managed 2.5fps without saving them)
    Many thanks
    Attachments:
    NVI class.png ‏27 KB
    shadowplayActiveX.png ‏32 KB
    ShadowPlayCapture.vi ‏12 KB

    Hi Woody247,
    Here is brief overview to help using LabVIEW with ActiveX:
    http://www.ni.com/white-paper/2983/en/
    Here is an interesting example that could be useful to your application's functionality 
    https://decibel.ni.com/content/docs/DOC-41144
    Regards,
    Mark 
    Applications Engineer Intern
    National Instruments UK and Ireland

  • How to run stepping motor using LabVIEW

    Hi
    I need to run bipolar stepping motor using LabVIEW 6.1. Would anyone please guide me how to do that.
    I have measurement and automation 3.1.0.3021 installed on my system. I am new to LabVIEW.
    Jayaprakash.

    Hi,
    Do a search for the words "stepper motor" in the forums. This should bring up several threads where this has been discussed.
    -Sal

  • Need help with LabVIEW code for motor control.

    Hi,
    My name is Sasi. I am a BME grad student working on my thesis topic of evaluating spine implants for low back pain. For this I am building a test machine that would apply pure moments to a spine specimen. I am using LabVIEW 8.5 to implement control of a brushless AC servo motor. My requirement is,
    Step 1: Initialize the motor.
    Step 2: Start moving it at a uniform RPM to the right (This RPM value too user can enter).
    Step
    3: While doin Step 2; simultaneously read torque cell data (Using DAQ
    asst.). DAQ o/p is from 0 V to 10 V; 0 V being -10 Nm n
                10 V being  +10 Nm
    Step 4: When Torque value reaches +10 Nm, i.e 10 V, the motor stops.
    Step
    5: From the position where motor stopped (i.e no need to reset to
    initial position) Start moving in the opposite direction at the same
                uniform RPM as in Step 2 while reading torque cell data.
    Step 6: Once again when torque reaches -10 Nm, i.e. 0 V, the motor should stop.
    Step 7: Repeat 'Step 2' to 'Step 6' 3 times.
    Step 8: Reset motor postion.
    Till now I have managed to get the motor to move forward n backward @ a desired vel, accl, n deceleration for 3 cycles. I am attaching my code. I am having problem inserting the code for reading DAQmx amidst all this. Can anyone help me out.
    Thnks,
    Sasi.
    Solved!
    Go to Solution.
    Attachments:
    Test_012609.vi ‏35 KB

    Hi Sasidhar,
    I took a look at your problem and I think I have a workable solution for you.  I definitely agree with Lynn's suggestion of using parallel loops.  This will allow the DAQmx portion to run uninhibited by the motion portion, and vice versa.  Plus, you only need to iterate the motion loop whenever the voltage level crosses a threshold.  So, by iterating on the motion code in the same loop that you are iterating on DAQmx code, you are essentially wasting processor.
    I created a VI that should do what you are wanting.  I tested it out myself and it works great.  You might have a tweak a few things to apply to your system (like motion board ID and DAQmx physical channel, etc.).  I used two parallel loops and event-based programming.  Basically the motion loop starts the motor spinning at the specified velocity.  Once the motor is spinning, it waits for the DAQmx loop to tell it that the voltage value has crossed the threshold.  When the voltage value exceeds the maximum threshold (which I set to a value slightly less than 10 to allow for jitter and saturation), the DAQmx loop signals the motion loop that it can finish its iteration.  The motion loop stops the motion, reverses the direction, and starts the motion again.  Once motion has started, it again waits for the DAQmx loop to tell it that a threshold has occurred, but this time, it is looking for a minimum threshold.  I used "Occurrences" to implement the event-based programming in LabVIEW.
    I have commented the code rather thouroughly, so hopefully the comments will answer any remaining questions.  The benefit of using event-based programming for this is that you save processor time, and your motion is more closely synchonized with the DAQmx.  Instead of iterating the motion loop as fast as you can, checking for updates each time, you just pause it, and wait for the other loop to tell you when to start up again.  In the mean time, the processor doesn't have to worry about iterating that loop over and over again.  Also, when the occurrence does occur, you catch it immediately, instead of having to wait until the next iteration.  Thus, you are more closely synchronized with the DAQmx portion of the code.
    I hope this will help you.  Please post back if you have any questions about the code or its implementation.  Good Luck!
    Message Edited by Wes P on 02-03-2009 05:18 PM
    Wes P
    Certified LabVIEW Developer
    Attachments:
    Motion and DAQ.vi ‏59 KB
    DAQmx Loop.png ‏24 KB
    Motion Loop.png ‏17 KB

  • How to make the servo motor to move in steps of set degrees and stop

    how to make the servo motor to move in steps of set degrees and stop

    Hi,
    I think the following document would be a good starting place: NI Developer Zone Tutorial: Single Axis Moves It includes links to several example programs that you may find useful for your application. Keep in mind that there are many motion examples that ship with LabVIEW as well.
    I strongly recommend that you check out the following documents as well:
    NI Developer Zone Tutorial: Simple Point to Point Motion
    NI Dev
    eloper Zone Tutorial: Hands-On Motion
    NI Developer Zone Tutorial: Axis Settings for Motion Controllers
    These tutorials will help give you a good foundation for understanding motion control systems.
    Best wishes!
    Dawna P.
    Applications Engineer
    National Instruments

  • Dc motor ::what are the step to build a controller

    hi
    i hava a dc motor with position sensor  and DAQ
    i want to control ""position"" of this dc motor use state space method in labview
    can any one give me the  step that can i do to implement this controller ??
    i rad many artical but i am confude from where begin
    best regards
    m.s
    hi ?Q>
    Solved!
    Go to Solution.

    See reply in:
    http://forums.ni.com/t5/LabVIEW/DC-motor-speed-con​trol-using-LQR-controller/m-p/2359316#M735694
    Barp - Control and Simulation Group - LabVIEW R&D - National Instruments

  • Trouble positioning a stepper motor accurately (to one step)

    I'm using a PCI-7344 with an MD7506 motor driver from RS. I'm testing angle sensors whose voltage output is proportional to (you've guessed it...) angle.
    I'm stepping the motor round by one step, checking that it's got there by reading the encoder, measuring the sensor voltage and repeating.
    My problem is that the motor sometimes 'hunts' around the target position. In closed loop (with an encoder associated with a motor) this results in sometimes not being able to reach the target exactly with the pull-in moves.
    Using open-loop and reading the encoder directly I get better results because I can loop more times, but the motor will still 'hunt' around a target point, changing direction a few times as it over
    shoots by a step.
    As there are a million MAX settings for this I won't list them all here, but I'm checking for a move complete when the InPos flag is set and I have a deadband of 0 steps too. I'm only rotating at 120 step/sec with a 10ms pause between steps.
    Do I have to accept that stepper motors are only accurate to +/- 1 step or am I doing something wrong?
    Thanks,
    Mike
    Mike Evans
    TRW Conekt
    N.I. Alliance Member, UK
    http://www.Conekt.net

    Mike,
    Maybe other people will have better suggestions, but in my case I can advise to either:
    1. increase the number of pull-in moves,
    2. increase the microstepping of your drive,
    2a... together with a higher precision encoder...
    Other than that, the accuracy is advertised to +/- 1 step, so maybe you would like to consider a stepper with more steps/rev.
    Good luck!, I hope other people will give other suggestions.
    Nestor.
    Nestor
    National Instruments

  • Controlling a Nanomotion motor with LabVIEW?

    What do I need to run a Nanomotion motor with LabVIEW?
    LabVIEW - Controller - Driver - Motor
    The Nanomotion motor which I intend to use is a HR4, for alignment purposes in a cleanroom environment. Do you have any experience in using this or other Nanomotion motors please add a comment to this post.
    Regards,
    Marcus
    Marcus Törndahl
    Senior Software Designer @ Prevas AB

    Marcus,
    some years ago I have used an NI 7344 motion control board to control a Nanomotion ultrasonic actuator. I don't remember the model type of the drive, but it has provided a +/- 10 V command input. The position feedback signal came from a quadrature encoder.
    In fact NI's motion control R&D has worked with Nanomotion to implement some features into the control algorithm of the 734x and 735x boards to optimize the control behavior for Nanomotion actuators. The most important parameters, that were added to support these motors are the foward and reverse offset voltages to configure the static friction deadzone.
    Brief explanation: There is a deadzone of approximately +/- 2 V at the command input, where the motor doesn't react to command voltage changes. The 734x and 735x boards can avoid this deadzone. Otherwise it would be very hard to properly control the actuator.
    I hope that helps,
    Jochen Klier
    National Instruments

  • Control a servo motor thru labview.

    I want to control a servo motor thru labview. I have the following hardware: servo motor, electro-craft bdc-12, s8vm-15024 cd power supply, NI PCI-7831R, and scb-68 circuit board. I am new to the field and I have no idea how to connect the amplifier to the circuit board and create a program in labview to control the motor. Thank you for your help.

    reposted here: http://forums.ni.com/t5/LabVIEW/I-want-to-control-a-servo-motor-thru-labview/td-p/1651742

  • How to control an electric motor using LabVIEW?

    Hi,
    is there a simple way to control the rotation speed of a electric motor (12V) using LabVIEW?
    I have an idea how to achieve this by using NI measurment card, by its not that cheap. Any ideas?
    Maciek.
    LabView 2009.
    Solved!
    Go to Solution.

    Rubid wrote:
    Let's complicate the problem. Is there a way to control the output voltage of the USB port in my PC?
    Do you know what a USB-RS232 converter is??
    Buy one together with that power supply and your problem is solved
    What do you mean with "control the output voltage of the USB port" do you want to drive the motor directly from the USB port

  • How to power a motor using labview DAQ output signal

    The power from labview is not enough to move a decent-sized motor (works with tiny one). Is there any electrical component/device that I can use to sort of increase it (something in between output from labview and the motor)?
    Thanks

    LabView is a software and does not supply any physical signals. To generate physical signals you need an interface board, NI has plenty of them which can be controlled via LabView. Anyhow, as you mentioned, digital i/o interfaces can handle currents in the mA range only. I think the best way to control motors via LabView and an interface board is using an additional relay driver board. Since relay contacts only switch power and do not supply any power you will need an external power supply matching the voltage and current specs of the motor.

  • How can i connect simple dc motor to labview

    any one who help me how can i connect simple dc motor to labview and speed control of that

    Hi,
    There is a selection guide for motors on our website which can be found here: http://zone.ni.com/devzone/cda/tut/p/id/12594
    There is also software specifically for LabVIEW to control motors.  You can find it here: http://sine.ni.com/nips/cds/view/p/lang/en/nid/13851
    Regards,
    Greg H.
    Applications Engineer
    National Instruments

  • Sinusoidal velocity profile of a stepper motor using labview

    Hi I am trying to get sinusoidal velocity profile of the stepper motor using labview.
    Could anyone please help me out...

    I'm also really interested in this solution.
    I think you could do it by controlling the velocity of the stepper with points (excel) or function maybe... but that's an idea...

Maybe you are looking for

  • How to view pdf in 5700

    hi how to view pdf file in 5700?

  • Page cannot be displayed

    Hi All, I am into a support project. Customer is facing an issue, can any one suggest what needs to be done. In SAP Portal, customer clicks on Procurement Tab and then clicks on Shop. A pop up appears with Header as "Security Information" and the con

  • It's possible?

    Hello everybody, it's possible work with xserve raid only for ethernet? I have a xraid with 14 disk raid 5 and after waiting 2 days the sync disk, arrays not apairs disk utility... Any idea? tks a lot.

  • Cluster Mini Render Farm

    I'm terrible at server things, I wanted to start with that and be rather upfront about it.  But that's why I'm asking out to you in the community.  I'm a video editor and in Final Cut Pro it takes literally forever sometimes for things to render when

  • Importing a catalog from Photoshop Elements 7

    I upgraded my Windows Vista machine to Windows 8, and my Photoshop Elements 7 disappeared.  I recently installed Photoshop Elements 11, and I want to import the catalog from my original Photoshop Elements 7.  How do I do this?