How to create stepper motor signal (myRIO)?

Hi there,
I'm fairly new to LabVIEW, and I'm trying to run a small stepper motor with ULN2003 based driver board (one of these) with a myRIO. I have gone through a few examples in the project guide to get a feel for things, but I can't figure out how to run this stepper.
What I'm wondering is how do I create the signals to run to the IN1,2,3,4 on the driver board? What functions would I use?
I don't have a deep understanding of LabVIEW yet, so any specific explanations are welcome. Or, if anyone has an example VI for doing this or something similar, I can just look through that.

Hey GregRomero,
I'd start simple.  You can control the stepper motor controller inputs using the Digital Output Express VI, but before you to that, play around with the LED Express VI so you can see how digital outputs work.  Create a VI that looks like this:
Run the VI and click the buttons to turn on and off the LEDS.  Then switch the LED Express VI to the Digital Out express VI and choose the DO channels you've connected to the stepper drive.  Now you can use the buttons to set the digital outputs and use the logic table on the page you linked to set the motor step.
Once you get that working you can replace the manual button presses with generated values to drive the motor.
Let us know if you have questions about any of this.
-Sam K
LabVIEW Hacker
Join / Follow the LabVIEW Hacker Group on google+

Similar Messages

  • How to create 2 output signal locked in phase from a one input signal

    Hi all,
    I have a case in which I want read in a signal analog input (voltage) from a photodiode, I want to create a 2 sinewave signal locked in with same phase as the input signal and output them as analog output to my 2 laser diode. the frequency of the input signal is low aroud 15 Hz , the 2 output signal i want to be  around 120 hz and 150 hz . 
    I am using USB - 6003 daq card.
    I have created a vi to see the input signal but I dnt know how to create 2 signal from the waveform generator locked in the phase as the input signal. I have seen a PLL vi , but dont know how to use that with my program.
    can any one tell me how to proceed.
    thanks
    AG
    Attachments:
    pulse_PLL.vi ‏27 KB

    Hi AnkitG,
    Here are a couple of links that might help you understand a little more how the PLL work and a way to synchronize the task to perform a PLL.
    http://digital.ni.com/public.nsf/allkb/07BC8D77D4E9AE258625708B007CE74F?OpenDocument
    http://digital.ni.com/public.nsf/allkb/2F675A9F2162EA24862572570059A308?OpenDocument
    Also, you should be able to find a lot of examples on how to accomplish the synchronization of tasks on the community, if you consider that the only consideration is that both must start at the same moment. 
    I hope, these examples might show you some useful concepts:
    http://digital.ni.com/public.nsf/allkb/EBD603683446EC13862575B3006A63A2
    http://digital.ni.com/public.nsf/allkb/9E71F8D7D3CD1B0886257688004AE353
    Regards,
    Luis C.
    National Instruments

  • How to create snmp trap signal

    hello friends,
    I am going to create NMS tool for my wireless devices.
    We are using java for front end monitoring.
    For my project work, how can I create SNMP Trap signal.?
    Any examples is there.
    thank you.
    Rgds,
    ram

    There are many ways to modify the array to do what you want. One of my favorites is to use the "Insert Into Array" function. Just build an array of each waveform you wish to generate and arrays of 0 or NaN (depending on what you agilent device will accept) for the no signal gaps. Append them all together and you will have your arbitrary waveform for your generator.
    Kyle K.
    Product Manager for Product Data
    National Instruments

  • How do create an analog signal from a text or binary file?

    I'm trying to output an analog signal from a file on an NI-DAQ 6251 card using labview 8.5. I've found the examples on building a waveform, but I'm stuck at how to read a text file and make a 1-D array to input my amplitudes into the buildwaveform.vi and I can't find any information on how to do so. Any help or direction is greatly appreciated.
    thanks,
    David
    Solved!
    Go to Solution.

    If all that you want in the file is the Y values, then a text file with a value on each line could be read. The Read From Spreadsheet File can be used. It will return a 2D that you can then use the index array function to get a column or if you select Transpose, the returned 1D array would be used.
    If you want to create an example, use a 1D array constant in a VI and pass it to the Write to Spreadsheet File.

  • How to create a custom signal?

    Hello,
    I am working with the agilent 33250A arbitrary waveform generator, and I am trying to create an arbitrary waveform that is comprised of several sin waves, all at the same freq. and amp. and phase, which start at arbitart times and last for arbitary amounts of time.  For Intance, the pattern might be at:
    0s, 10.2Mhz 1v sin signal for 40microseconds
    10milliseconds,  10.2Mhz 1v sin signal for 20 microseconds
    15 milliseconds, 10.2Mhz 1v sin signal for 80 microseconds
    Finally, this pattern consists of 5 or 6 bursts, which will loop after a fixed time.
    I am not sure the best way to do this.  I found the sin wave pt by pt block, and I thought about combining that with a time signal that goes to 0 when I need no signal.  However, that seems too difficult to be the right way to do it.  The agilent 33250A comes with an example arb. waveform that takes a simulated signal and converts the dynamic data to an array of floats, and sends it to the device.
    Any pointers would be appreciated.
    Thanks,
    Eric

    There are many ways to modify the array to do what you want. One of my favorites is to use the "Insert Into Array" function. Just build an array of each waveform you wish to generate and arrays of 0 or NaN (depending on what you agilent device will accept) for the no signal gaps. Append them all together and you will have your arbitrary waveform for your generator.
    Kyle K.
    Product Manager for Product Data
    National Instruments

  • Repeatable different steps of a stepper motor

    Hello everyone,
    I am working on a project where i have a stepper motor moving a plate and a signal sensor who measures a distance. I managed to initialize the signal so my initial position is the position where the sensor gives me the minimum value (Voltage).Each time the stepper motor moves, i define it from the front panel. My question is, how can my stepper motor moves automatically for e.g. 8000steps then without define it again for another 5000 steps or whatever i want with a time delay. The definition of the steps now is being done from DAQmx Timing>Samples per channel. I want to run the program and the steps to be already defined wihtout change them again and again from the front panel. I attach my current VI.
    Thank you in advance
    Attachments:
    (2nd version (a-D).vi ‏73 KB

    Hi Chris,
    not a problem, we all were new at some point. In case you don't know there are boatloads of classes you can access online with your License or even without one:
    Here's a small collection (courtesy of crossrulz):
    3 Hour Introduction
    6 Hour Introduction
    LabVEW Basics
    Self Paced training for students
    Self Paced training beginner to advanced, SSP Required
    LabVIEW Wiki on Training
    Learning NI
    Getting Started with NI Products
    And if you are a student you can take a real class with NI for a ridiculously small amount of money (say, 93%) discount).
    With start twice I mean that I was wrong in believing you did so, when I fact you started two different tasks, so: nevermind.
    PFI stands for Programmable Function Input, which is confusing because it is probably assigned to an I/O line. I just asked to find out what section of your code I have to look at. I'm still not quite sure about this, butI understood you want to move the motor, when you push a button. The only part of your code, where you even read a button within a while loop is for the Direction Line. Apart from that you just write the inputs once and then forget about the tasks (not even stopping them sometimes). I suggest moving the button that should move the motor into a while loop. 

  • Configure stepper motor with MAX

    Hi,
    After wiring VI, I don't know what must I do to control my stepper motor?
    Can anyone give general information what must to do.
    How to configure stepper motor with MAX? I'm using PCI6036E.
    Thank you

    The answer to your question is dependent on your motor/motor controller and the inputs that it needs. Are you using a stepper motor controller? The PCI-6036E probably won't be able to supply enough current to power your motor (max 5mA) by itself, so you will probably need a stepper motor controller. With the 6036E, you do have 2 analog outputs, 8 digital I/O, and 2 counters (can be used for pulse train generation). Have you considered an NI Motion Control Board? ni.com/motion
    -Alan A.

  • How can I output a square wave to control a stepper motor using 7332 controller?

    I have the following system configuration for testing a linear actuator (LA):
    LabView 7.1
    NI FlexMotion 7332 Motion Controller
    NI Flex DMM 4070
    The LA is a stepper motor with Step and Direction of Rotation inputs, as well as some discrete I/O for Power Enable and other functions.
    The LA specification only requires that I send a 50% Duty Cycle square wave signal with frequency less than 300 Hz to it in order to make it step.  The LA has it's own power source.  I only need the 7332 to generate the drive signal and the DOR signal to the LA.  Using some of the example VI's, I can get the LA to work, but I will need to incorporate the functions in to a custom application. 
    How can I weed through the numerous advanced functions the 7332 offers and only generate a DOR signal and a step command at a user-defined frequency.  How do I set up the controller for this?
    Thanks

    Hello,
    All the VIs that you can use to create a pulse train and digital I/O from your motion controller are found in the "Analog & Digital I/O VIs" sub-palette in the "Flex Motion" palette. Use "Load PWM Duty Cycle" and "Configure PWM Output" VIs to create the square wave. Use the "Set I/O Port Direction", "Set I/O Port MOMO", and "Set I/O Port Polarity" VIs to create digital output. I hope you find this information useful. You can learn about the specifics of these VIs and their inputs/outputs in the NI-Motion VI Help.
    Regards,
    Aaron B.
    National Instruments

  • How can i control the motor movement of stepper motor using a NI PXI 7330

    Good day to all,
    i'm a newbie in programming in motion control of NI. I just want to ask if how can i control the clockwise and counter-clockwise rotation of a stepper motor using NI PXI 7330 module. all i can do is the counter-clockwise rotation using the example vi (Simple one-axis move.vi) found in the examples of LabView 2009.
    Thanks

    what type of limit switch sensor are you using and how did you wire itß What are your MAX settings regarding the limit switches?
    Good day SIr Jochen,
    I am using two reed switch for the reverse and forward limit. I wired the signal wire of the reed switch to the limit ports(forward and reverse Limit) and its ground to the digital ground of the UMI-7764.
    the attachment below is the my max configuration about limit switches
    Attachments:
    max configuration.JPG ‏155 KB

  • How to eliminate the noise from the stepper motor

    I’m using stepper motors to move a traverse on which a hot-wire anemometer probe is mounted. When the stepper motors are turned on, they induce noise on the analog signal of the hotwire anemometer, or of any other transducer, at multiples of 120Hz.
    The stepper drives are P41 Series made by American Precision Inc. The P41 Series contains a power supply, a motor drive and a logic controller. The logic controller inputs are optically isolated and utilize the 5 VDC supplied internally by the drive.
    An NI 6251 or NI 6024E DAQ card is used with LabVIEW to send digital output signal to the logic controller in order to step the motors.  
    The AI input channels of either NI 6251 or NI 6024E DAQ cards and LabVIEW are used to acquire the signal of the hot-wire anemometer. Different DAQ cards are used for the data acquisition and the stepper motor control and the noise is transferred through the laptop to the data acquisition card (analog signal).
    All cables are shielded and the noise was confirmed to be conductive and not radiative.
    There was no difference when measuring the analog signal with Differential or RSE.
    As a test, the leads from to the drive’s logic controller were connected to the AI input channels in order to check the magnitude and frequency of the noise flowing to the DAQ card and were found to be 5 V peak-to-peak at 60 Hz.
    Please let me know if you have an idea on how to eliminate this noise.

    It sounds like you have a ground loop issue.  If possible, try totally isolating the stepper controller from the data acquistion AI more than you already have.  This could include any of the following:
    Ensure the optoisolation on the control lines fully separates the power and ground of the digital output and stepper input.
    Use different grounds for the stepper power supply and the DAQ power supply/computer.  Isolation transformers can help here.
    Use lower inductance lines for the stepper controller.  This will reduce the movement of the ground.
    I suspect you have probably been over the above, so you are left with filtering the noise out of the signal.  Since it has high harmonic content, a simple low-pass is unlikely to work well.  Your best bet is probably to characterize it and use some sort of Fourier filtering.  If the relative sizes of the harmonics are always the same, you can take the Fourier transform, find the height of the fundamental, use this to calculate the sizes of the harmonics, delete them from the Fourier transform, and do an inverse Fourier transform to recover your signal.  Alternately, you can use a series of narrowband filters to remove the noise, although this will also remove any signal at the same frequencies.  It is better if you can improve your circuitry to remove the noise.
    Good luck.  Let us know if we can help you more.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Stepper motor 8SMC1-USBhF and power meter PM100D: how to merge the two VIs into one and make a XY graph of the current position and the power

    Hi there,
    I have a stepper motor (8SMC1-USBhF) and a power meter (PM100D). I want to measure the power while the stepper motor is moving, and obtain an XY graph with the current position on x axis and the power on y axis. So I just merged the two VIs together by copying and pasting, and created local variables for current position and readout value, and changed them to read, and then linked them to the XY graph, but apparently it doesnt work.
    So could you please instruct me how to merge them and obtain an XY graph appropriately?
    Attached are the two VIs.
    Thank you!
    Attachments:
    PM100D Simple Example.vi ‏42 KB
    StepperMotor.vi ‏97 KB

    Hello,
    The XY graph requires that each datapoint on the X axis corresponds to a datapoint on the Y axis.  To create XY data you will need to creat two arrays of X data and Y data with the same amount of elements then cluster the two arrays together to wire into the XY graph.  As an example take a look at the VI snippet below.  Is there a specific error being thrown?
    Regards,
    Isaac S.
    Applications Engineer
    National Instruments

  • How can I control a stepper motor drive using a DAQ card?

    I need to control a simple CW/CCW stepper motor drive using a DAQ
    card.  I simply need to output a 5 volt signal and then a drop in
    the signal, and so on 200 times or steps for 1 revolution.  I have
    desiigned the basic program, but do not know how to output the
    appropriate signal.
    Cheers,
    Matt

    What DAQ card do you have? Ideally, one with a counter output to generate the steps, where you can control frequency. If you try to start the motor too fast (acceleration or abrupt application of fast pulses) it may stall out. Search in Help/Search for Examples for 'frequency' and 'pulse' for example of frequency generation. You can also use a digital output on the DAQ card to control direction.
    If DAQ card does not have a counter, you coul do a software timed loop to toggle a digital output to generate the pulse train. It may not be fast enough nor accurate for your application, do not know from info you have given
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    "It’s the questions that drive us.”
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

  • How to create a c++ shared library (.so) for linux real time (for myRio) with Eclipse to use in LabView?

    I tried already these Tutorials and Advices but I didn't find a solution:
    - http://www.ni.com/tutorial/14625/en/
    - http://www.ni.com/tutorial/14690/en/
    - http://forums.ni.com/t5/LabVIEW/Shared-Library-on-myrio-Linux-Real-time-system/m-p/2842540/
    - http://forums.ni.com/t5/LabVIEW/How-to-create-shared-library-for-linux-real-time-target-in/m-p/28218...
    - and some more
    I want use c++ codes on linux real time. For testing reasons I want to have a function that adds 2 values and gives the result.
    I've done these steps:
    1. writing a c++ file in Eclipse (see screensot 2)
    2. building a shared library (.so) from my c++ project in Eclipse (with Cross GCC)
    3. putting this file on myRio (path: /usr/local/lib/)
    4. creating a VI that calls this library from Labview with a "Call Library Function Node" (see screenshot3)
    5. Setting the properties for the "Call Library Function Node" (see screenshots 4-7)
    After I run this VI i get this error message: LabVIEW:  (Hex 0x627) The function name for the ... node cannot be found in the library. To correct this error, right-click the Call Library Function Node and select Configure from the shortcut menu. Then choose the correct function name. (see screenshot1)
    I've tried a lot things to solve this problem but I couldn't find a solution. Would be very happy if anyone can help me. I guess that I have to edit my c++ code to export my function (symbol). But I have no idea how to make it. I also tried it with a dll file in the same folder but it didn't help.
    Perhaps someone can send an example which works on myRIO.
    Thanks!
    screenshot1
    screenshot2
    screenshot3
    screenshot4
    screenshot5
    screenshot6
    screenshot7

     can see it in the screenshot8 there is a function called "_Z8AddierenddPd" instead of "Addieren". I copied this name to Labview (see screenshot9) and it worked.
    I'm sure that there is a way to compile the shared folder with gcc without decorations (mangling). But I don't know how. If someone has a recommendation I would be very glad!
    Prepend each function declaration that you want to be available without name decoration with
    extern "C" <your function declaration>
    Or if you have multiple functions you want to export you can in the header file where you declare your functions simply use:
    #ifdef __cplusplus
    extern "C" {
    #endif
    <all your function declarations>
    #ifdef __cplusplus
    #endif
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How do you control LED lights on the front panel to identify the number of steps a stepper motor has taken?

    I am controlling a stepper motor that is coupled with a valve with four outlets (using an Arduino).  I've got a general understanding of how to control the motor, but I want LED lights on the front panel to light up that indicate which outlet the valve is currently at after the steps are taken.  The method I'm thinking about involves a lot of repetitive code.  I'm not that experienced with LabVIEW, I'm assuming I need some sort of loop structure but I don't know how to set it up in order to control the sequence of the LEDs.  I've attached my current block diagram for a visual aid if needed.
    Attachments:
    Capture.JPG ‏33 KB

    I was thinking about using the Stepper To Go and Stepper Write functions four separate times, using the same constants for the steps each time since the distance between each outlet is equivalent.  The only difference would be what's connected to the "steps remaining" node, which would be the function that activates one of the four LEDs (if that makes sense).  I was thinking that doing it this way would be a little counterintuitive since the only thing that needs to be changed is the LED indicator.

  • How do I establish serial communicat​ion using LabView to two stepper motors using a motor controller​?

    I currently use an off the shelf motor controller to run my two stepper motors. It already has integrated a firmware software that sends commands to operate each motor. I would like to create an interface where I can send these commands using LabView. If someone can point me in the right direction I would appreciate it.

    Look at the examples for the serial VISA vi.  Something like Basic serial write and read.vi is a good starting point.
    Have you searched for a LabVIEW driver  at the NI LV driver network?   Asked the vendor?
    If you write your own driver with the serial VISA vis remember to open and configure the port only once at the beginning and close it at the end of your program. 
    Message Edited by Henrik Volkers on 07-13-2009 04:21 PM
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

Maybe you are looking for

  • How can i transfer my new purchased itunes apps to my itunes library

    actually having several problems, installed itunes on a new computer, have transfered/sync all of my existing ipod touch apps/music successfully. I purchased new apps and a movie, but they do not appear on my itunes library, how can i transfer these

  • Interlaced in Windows but not on Mac

    I have 4 QuickTime files which are interlaced DV25 but look soft and progressive when viewed in QT on a Mac. The files look fine when viewed on a PC, you can see the slightly jagged edge of the fields and the pictures look good. When the same files a

  • Icc profiles and 10.4.3

    Hi! I just bought the highly praised Epson Photo R2400 printer. This was my choice most of all because I´m into b&w photography - also as a professional. My problem seems to be getting the icc profiles for different papers to work properly with the p

  • BEX: Aggregation question

    Hi to all, I think I need some help of a BEX expert. I have an issue with a query. Following scenario: In my cube I post the following values: Org-unit Employee Position P E 00000001 00000001 00000001 0 1 00000001 00000002 00000001 0 1 00000001 00000

  • IBook Author: how to print from inside a book?

    I would like to include an image in the book for printing, but can't think on how to solve this from inside IBA. The closest think is to include a thrumbnail of the image with a hiperlink to an external website where the reader can download the full