How to change the frequency of pulse train on the fly using an array of values?

Hi all!
First I want to thank U for the great job you are doing for this forum.
Iam still busy trying to control a stepper motor, by sending pulses from my E-series 6024 to a compumotor s6- stepper Driver. I've managed to get it working. I desperately need to control the motor using the values from an array. I believe we can use two approaches for that:
1st - I can get an array of the "numbers of pulses". Each element must run for 10 milliseconds. Using that we can calculate the array of frequencies to send the number of pulses within 10 milliseconds for each specific element. Could we use the arrays of "number of pulses" and frequencies in a "finite pulse train " and up
date with each element every 10 millisecond?
2nd - Or Could we use of the frequency array in a "continuous pulse train vi" and update it every 10 milliseconds?
Please note that I must use the values as they are.
Can someone please built a good example for me? Your help will be appreciated.
Regards
Chris
Attachments:
number_of_steps.txt ‏17 KB
frequency.txt ‏15 KB

Tiano,
I will try to better explain the paragraph on LabVIEW. The original paragraph reads ...
"While in a loop for continuous pulse train generation, make two calls to Counter Set Attribute.vi to set the values for "pulse spec 1" (constant 14) and "pulse spec 2" (constant 15). Following these calls you would make a call to Counter Control.vi with the control code set to "switch cycle" (constant 7). The attached LabVIEW programs demonstrate this flow."
You can make two calls to Counter Set Attribute or you can make a call to Set Pulse Specs which, if you open this VI, you will see that it is just making two calls to Counter Set Attribute. What you are doing with the Counter Set Attribute VIs is setting two registers called "pulse s
pec 1" and "pulse spec 2". These two registers are used to configure the frequency and duty cycle of your output frequency.
The example program which is attached to this Knowledge Base demonstrates how to change the frequency of a continuous generation on the fly. Why continuous? Because changing the frequency of a finite train would be easy. When the train completes it's finite generation you would just change the frequency and run a finite train again. You would not care about the time delay due to reconfiguration of the counter.
If you would like to change the frequency of the pulse train using a knob, this functionality will have to be added in the while loop. The while loop will be continuously checking for the new value of the knob and using the knob value to set the pulse specs.
LabVIEW is a language, and as with learning all new languages (spoken or programatic) there is a lot of learning to be accomplished. The great thing is that LabVIEW is much easier than mo
st languages and the learning curve should be much smaller. Don't fret, you'll be an expert before you know it. Especially since you're tackling a challenging first project.
Regards,
Justin Britten

Similar Messages

  • How can I generate pulse trains whenever the value of the gate changes?

    I need to generate pulse train both at the rising edge and falling of the gate signal. My DAQ board has only two counters.
    Have a nice day,
    Jun

    Jun;
    As your DAQ board has only two counters available, I'm assuming you are working with either one of the E-series board or SMIO boards.
    If that is the case, your board doesn't have the capability of generating triggered pulse trains. And that is what you need.
    You will need to use the 660x family instead. Those boards have the trigger pulse train capability. Regarding the second part of your application; none of the DAQ boards has the capability of triggering a pulse train generation at both rising and falling edges of the same trigger pulse. You can configure either as rising or falling edge of the trigger pulse. Then, to accomplish wath you need, you will need to configure two counters, both having the same trigger pulse triggering a pulse train gen
    eration, and one configured to trigger the pulse train at the raising edge of the trigger pulse and the other to trigger at the falling edge of the trigger pulse; then have an external OR Gate which the two inputs are the outputs of those two counters.
    Hope this helps.
    Filipe

  • How can I generate synchroniz​ed pulse trains with 6602?

    Hi,
    I would like to generate multiple pulse trains with different frequencies with the 6602 TIO card. Currently I am able to generate pulse trains with different frequencies. But is there any way to synchronize all the pulse trains? For example, I'd like to have all pulse trains with their first low-to-high at the same moment.
    Thanks!
    Dan

    Dan,
    Absolutely, the NI-TIO chip on the PCI-6602 supports a start trigger. If you configure all of the counters that are generating a pulse train to use this start trigger, they will be synchronized. The example Generate Pulse Train - Start Trig (NI-TIO).vi demonstrates this process for one counter. In LabVIEW 7, this example can be found in the following location:
    Examples >> Hardware Input and Output >> Traditional DAQ >> Counters >> NI-TIO
    You will need to add code for the other counters, but this example should give you the general idea. Furthermore, this example demonstrates how you can use one of the digital lines to generate the start trigger.
    Good luck with your application.
    Spencer S.

  • How to generate an (re-) synchronized pulse train

    Hello,
    using a PCI-6601
    I want to generate an endless pulse train of (e.g. 80Hz, high==low) synchronized to an external clock (ca.1Hz, ca 5ms pulse width).
    The output should _re_synchronize with the clock if there is a clock signal but if one clock-pulse is missing it should continue hoping for the next.
    It should look like this:
    Perfect:
    A1) tt________________tt________________tt_________...
    A2) ooo___ooo___ooo___ooo___ooo___ooo___ooo___ooo__...
        0__1__2__3__4__5__6__7__8__9__0__1__2__3__4__5_...
    Output is too fast:
    B1) tt_________________TT________________tt________...
    B2) ooo___ooo___ooo___oxxx___xxx___xxx___xxx___xxx_...
        0__1__2__3__4__5__6__7__8__9__0__1__2__3__4__5_...
    Output is too slow:
    C1) tt_______________PP________________tt__________...
    C2) ooo___ooo___ooo__xxx___xxx___xxx___xxx___xxx___...
        0__1__2__3__4__5__6__7__8__9__0__1__2__3__4__5_...
    Clock is missing:
    D1) tt________________._________________tt__________...
    D2) ooo___ooo___ooo___xxx___xxx___xxx___xxx____xxx__...
        0__1__2__3__4__5__6__7__8__9__0__1__2__3__4__5__...
    The external clock is assumed to be "the truth", so the pulse width for the 80Hz output is recomputed from time to time
    by measuring the clock and then setting then output pulse width.
    Until now I used register programming but this is not a must.
    The examples I've found either generate finite pulse trains or the sync only once.
    Is there a way to do what I want without software interaction?
    Thanks in advance
    Toni Schilling

    I have a possible idea for you, but my experience is with LabVIEW so I can't offer any help with register programming, interrupt callbacks, etc.  Also, the continuous syncing will have to be a software function that continuously performs cycles of measure/adjust, measure/adjust, measure/adjust...   I know of no way to set up the hardware to do this autonomously.
    The approach I would take is to add another counter task and a little extra wiring.  The other task will be for "Two Edge Separation", and you want to measure from the active (lead) edge of the master clock to the passive (trail) edge of your sync'ed pulse train.  There's a reason NOT to measure to the active (lead) edge of your pulse train and it's because counters can only measure finite times of at least 2 timebase cycles.  Whereas you would *like* to have an actual two-edge separation time of 0 between the lead edges.  That just seems like the kind of detail that's gonna burn you sooner or later.
    Let's just suppose the master clock is nominally about 1 Hz and your pulse train is nominally 100 Hz and 50% duty cycle so I can talk through details with some specifics.  Whenever the two lead edges are truly sync'ed, you'll measure a 0.005 sec two edge separation time from the master clock to your pulse train's trail edge.  If you measure slightly *less* than that, your pulse train is going just a little too fast and needs its freq slightly reduced.  If you measure slightly more, then your pulse train is too slow and needs its freq slightly increased.
    It is probably quite likely that you *cannot* expect to maintain perfect sync *without* constant monitoring and adjustment.  Fundamentally, you can only produce pulses with high and low times that are an integer multiple of the 6601's timebase of 20 MHz.  That card's oscillator won't be perfect, nor will it be utterly constant over temperature variations, etc.   So its idea of a perfect 100 Hz pulse train will in fact be very very close but not *actually* perfect.
    And your ability to adjust the frequency away from a nominal 100 Hz will only be possible in discrete steps.
    A 100 Hz pulse train takes 200000 cycles of the 20 MHz clock.  If you adjust your square wave to take 199998 or 200002 cycles, you can produce a nominal freq of 100.001 or 99.999 Hz.  Those are the smallest increments away from 100.00000000 that are possible with a 50% duty cycle. 
    Statistically, it's very unlikely that the frequency needed to perfectly match the external master clock is even *possible* to produce exactly.  I think you need to *expect* an imperfect sync with continual subtle adjustments to your pulse train.  If you watched the signals on a scope while triggering from the master clock, I think you should expect to see your pulse train oscillating back and forth by some small amount, perhaps in the microsecond realm.
    Summary (for 1 Hz master clock, 100 Hz user pulse train at 50% duty cycle):
    Measure two-edge separation from lead edge of master clock to trail edge of user pulse train.  Use units of "Ticks" with 20 MHz timebase.  Nominal expected value when sync'ed is (1/2)*(20 MHz / current user freq) = 100000.
    Subtract measured ticks from nominal to produce your "error signal". 
    Use current error signal its recent history in a control algorithm to determine the amount of adjustment to make to your pulse train.  Hint: it will probably NOT be correct to directly change the user pulse width by an amount equal to the error signal.  I suspect that you'll want to pay closest scrutiny to the derivative of the error signal.  Note also that the correct AMOUNT of adjustment will depend on the RATE at which you run your measurement / adjust loop.
    Change user pulse specs on-the-fly.
    Return to step 1.
    Caution: Let's suppose your software measurement / adjust loop runs at a nominal 10 Hz.  From the time you make an adjustment until the next time you do a measurement, your user pulse train will have generated almost 10 cycles with the recently-adjusted specs.  If you weren't careful to make your previous adjustment subtle enough, you'll find that you now have a *larger* error of the opposite sign, and you are well on your way to instability.
       You need to do an adjustment that lets you expect your *next* measurement to have an error close to 0.
    -Kevin P.

  • Hello, I would like to produce 2 different pulse trains on the CTRo and CTR1 output pins.

    (DAQ-CARD E6024 PCMCIA)I have the 2 output pins monitored on my scope, when CTR0 puts out a pulse train, CTR1 goes high. When CTR1 puts out a pulse train CTR0 goes high. Also, the pulses are interleaved with each other. Is there a way to make then start at the same time
    Attachments:
    Stim_Output_pulses_CTR_0,1.vi ‏94 KB

    Hello Zoltan,
    I would suggest using the counter gates to synchronize the counters. You will need to externally run a wire from one of the DIO lines you're not using to one of the counters' gates. When the counter gate is high, the pulse train will be generated on each counter. Both counters will need to use the same PFI line as the gate.
    There is an example program that ships with LabVIEW 7 called "Gen Dig Pulse Train-Continuous-Pause Trigger" for DAQmx. This demonstrates how to configure the counter to only generate the pulse train when the gate is high.
    With this configuration, you could synchronize the counters by writing to the DIO line which is wired to one of the counter gates when you're ready to start the pulse train generation.
    Hope t
    his helps.
    Kristi Hummel
    Applications Engineer
    National Instruments

  • How to change font size, maximum column size in the result screen ?

    hi All
    That's great when using SQL Dev.
    But I also have a trouble that how to change font size, maximum column size in the result screen ?
    My users think that font in result screen is shown very small, and whenever the data in each colum is long then it's not shown full data in column, they must double click for extend the size. Have the option to default the max size for showing full data in each column ? I try but still not to do that .
    Appreciate for anyone to help us.
    Thanks all.
    Sigmasvn

    You can't change the font for the results screen yet, however you will be able to select an auto-fit option for selected columns, so if some columns have slitghtly wider text you'll be able to set the column widths to handle these wider columns.
    Also, there s the option of switching the layout of a record in the grid.
    Sue

  • How to change colors of individual column bar in the same data series

    in mac numbers, how to change colors of individual column bar in the same data series. The entire column series gets selected in the column bars and cannot select to change colors of specifc bars.

    Hi Kiran,
    no its not possible through Theme editor also ,because these colors are coming from Compiler which u are using.
    Regards,
    Govindu

  • How do I generate two finite pulse trains using counters on PXI-6251

    I'm trying to use Counter 0 and Counter 1 on the PXI-6251 to generate two finite pulse trains.  But, I get this error:   "The specified resource is reserved. The operation could not be completed as specified."  See attached example.
    Inside the disabled box is what I'd like to run on both counters.  I stripped things down to creating the task, starting, and stopping.  I then started to add things to see what my problem was.  The timing VI seems to be what causes me issues but I don't know why. 
    My end objective is two identical pulse trains with one delayed by 5us, which I figured would be easy to do in the initial delay.  I tried both in a single task and as separate tasks with no avail.
    Attachments:
    2_counter_outputs.vi ‏32 KB

    Hi SirMutt,
    Creating a finite pulse train requires
    two counters. What’s really happening is that one counter is creating a
    continuous pulse train while the other counter applies a finite pulse to “window”
    the pulse.
    What you want to do is correlated DIO. I’ve
    done a search on our website for “correlated DIO” and have come up with a few
    resources. Hopefully that will help you get started.
    Digital Output and Pulse Generation
    Performing Correlated Digital IO with an M Series Device in LabVIEW
    M Series Hardware-Time DIO with Counter Clock Generation
    Mark E.
    Precision DC Product Support Engineer
    National Instruments
    Digital Multimeters (DMMs) and LCR Meters
    Programmable Power Supplies and Source Measure Units

  • How to change the frequency of a finite/continuous pulse train in the program?

    Hello!...
    I am trying to modify the Finite pulse train vi example to change the frequency with respect of a ratio (1:2) of the data of a spreadsheet file as they are read one by one.
    My aim is to get the pulse train to clock a stepper motor controller, in such way that the speed of the motor increases when the data of the spreadsheet increases and vice-versa.
    I think that if I want to get the clock to change its speed, I must change the frequency and if I want it to increase/decrease like the data in the spreadsheet, I must tell the frequency that the data is increasing or decreasing in value.
    Obviously the program must do it while it is running
    Can anyone see wh
    ere I have gone wrong and/or give any suggestions?
    I have attached my vi and the spreadsheet file.
    Thanks
    Tiano
    Attachments:
    My_VI.vi ‏99 KB
    wave.txt ‏18 KB

    Tiano,
    Try to build the pieces of the program separately. Get a VI running that reads the spreadsheet and reports the data in it sequentially in an indicator (forget about the pulse generation at this time). This indicator will be wired to the frequency input of the pulse generator VI.
    You have read the data and have a transposed array. Now you must learn to use the Index Array function in a For Loop to extract the data sequentially. You will wire the increment output [i] of the For Loop into Index Array to shift from one data point to the next.
    You have a For Loop with no constant wired to [N] to tell it how many times to run. If you use Array Size to extract the number of entries in the spreadsheet data, this can be the constan
    t that tells the For Loop how many times to run.
    You are using the Tab Control in a way I have never seen before (I don't think it will work this way either. Tab Control is for presenting and hiding controls, indicators, labels, etc. on the front panel, before running the VI. They are not used to control the program functionality itself. Typically you would use a Boolean to choose between 2 options for a Case Structure.
    You can also change the path constant which selects the spreadsheet file into a control. This would allow you to browse for any file you want and eleiminate the need for the Case Structure altogether.
    Mike

  • HOW TO GENERATE FINITE AND CONTINUOUS PULSE TRAIN WITH USB6216 AT THE SAME TIME?

    Hello.
    I am using a USB6216 DAQ and need to generate a 20 kHz signal using the
    ct0 output and at the same time I need to generate a finite number of
    pulses, say 9, on a software trigger using the second counter output
    ct1.
    Currently, I have two VIs that can do this separately, but when I want
    to integrate these into one single VI y get an error in the finite
    pulse train for ct1 that indicates that the requested task is already
    reserved. I am thinking this has to do with the fact that maybe both
    types of task use the same timebase but I have not found the way to
    solve this problem.
    Any help would be very much appreciated.
    Thank you.
    Sincerely
    JSL

    Hello.
    If anybody is interested, the problem is solved.
    There is no resource confilct if I generate the 20 kHz continuous pulse
    signal using the frequency out terminal, and this way I can use both of
    my counters as I please with no problems.
    It's kind of fun to answer one's own questions...
    Sincerely
    JSL

  • How do you set amplitude of pulse train?

    I have successfully downloaded and executed the sample program shown here:
    http://www.ni.com/white-paper/2991/en
    and see the pulse train generate in my oscilloscope.  When measuring the value of a pulse high, the oscilloscope says 5V. 
    How do I change it to 3?
    Looking at the DAQ Create Channel node I don't see any inputs for amplitude, only frequency and duty cycle.
    Where is the amplitude of 5volts being set and how can I change it to 3V?
    Solved!
    Go to Solution.

    Hi Nathand, and Ricky - 
    Do you guys think this website:
    https://decibel.ni.com/content/docs/DOC-3545
    Could help me? I noticed there is a minimum and maximum value passed in to the Analog Output function.  
    I could set the minimum = 0V and maximum = 3V.
    I will also look into the level shifter and transistor ideas.

  • How do I output a finite pulse train through multiple counters?

    Hello,
    I have used LabView examples to create a VI to use with my TIO 6602 that generates a finite pulse train with varying duty cycle, frequency, number of pulse, and initial delay.  I can also have it output the pulses through multiple counter channels, but all the channels have the same delay, and are output at the same time.  I need each channel to have a specific delay from the first one.
    In my VI, I use DAQmx to create a retriggerable finite pulse train by gating a counter with another counter.  I have all the neccessary controls over the pulse train, but I can not seem to find an easy way to just copy this waveform and output delayed versions of it to other channels.  The delay is very important because these signals will be used to drive ultrasound transducers in a linear array, and for the waveforms to focus at one point, the signal driving the transducers with a shorter distance from the focal point need a larger delay, so that the same waveform arrives from each transducer at the same time.
    Any help with how I might do this would be much appreciated.
    Thanks!

    Hey Sneaky,
    Here's a screenshot of the code I put together on how to use multiple counters.  Also, take a look here for more information on how to sync multiple counters. 
    Message Edited by Knights Who Say NI on 02-02-2009 10:36 AM
    Message Edited by Knights Who Say NI on 02-02-2009 10:36 AM
    Message Edited by Knights Who Say NI on 02-02-2009 10:38 AM
    -John Sullivan
    Analog Engineer
    Attachments:
    4xcount.jpg ‏67 KB

  • How do you create a finite pulse train using a FP-CTR-502?

    I have recently replaced my FP-PG-522 module with a FP-CTR-502 module, to achieve higher output frequencies (FP-PG-522 max output freq is 5kHz, wheras the FP-CTR-502 max output freq is 16 kHz).
    I need to be able to generate a finite pulse train. Has anybody created a finite pulse train using a FP-CTR-502 module before? I have started to look into it, but my ideas so far have been complicated (compared to doing it in a PG module).
    Any tips on this would be much appreciated.
    Christopher Farmer
    Certified LabVIEW Architect
    Certified TestStand Developer
    http://wiredinsoftware.com.au
    Solved!
    Go to Solution.

    I can answer this question myself!
    The answer is in the *OLD* version (July 2000) of the operator's manual for the FP-CTR-502. For some reason, this has been removed from the latest version (June 2003).
    See page 11 of this link for more information:
    http://www.ni.com/pdf/manuals/322660a.pdf
    Christopher Farmer
    Certified LabVIEW Architect
    Certified TestStand Developer
    http://wiredinsoftware.com.au

  • How to make a pulse train on DO line useing E-series in LV7

    Im trying to make a finite TTL pulse train that I would like to put on DO-0. Ive gone over some of the VIs that have came with the program but none of them seem to do this. I dont need a starting trigger or anyhting like that. All i really need to get going is to make about a finite 1-3Khz TTL pulse width on my Digital out. Thanks a lot!

    LV7 has several example VI's on how to produce a pulse train. If you are using an E series card, then you should use the GPCTR output for your application.
    I am using an E-Series Card to generate finite pulses and it works fine on the CTR output.
    Have a look at "Finite Pulse Train (DAQ-STC).vi" in your Example Finder.

  • How to change  delivery  block for all item in the schedule lines via va32

    dear sap expert:
    i onle can  change delivery block for one  sales order item in the schedule line  every times via va32,it will take so many time because there are hundreds of item  in a sceduling agrrement. how to change all the item  one times.
    please give me a way to resovle the problem.
    best regards.

    dear:
      the fast change function cann't resovle the problem,i first double click the item of schedule agreement  ,then select the schedule lines option, finally in the delivery block input the reason of bolck.
    best regards.

Maybe you are looking for

  • Data mis match in extractor checker

    Hi Gurus, Please help me to solve this issue. there is a mismatch of records when checking datasource through extractor checker. the extractor is showing 1476 records in r/3 table but i check the table in t-code se11 it is having only 506 records. so

  • Error in MB1A

    Hi GURUu2019s When I try to post the document in MB1A with reference to WBS element and network I got the below error, Incompletion: Vendor: Account Number of Vendor or Creditor (VBPA-LIFNR), error group: 08 Message no. VU014 Please guide me to proce

  • HTTP server does not start on 10g

    I have the following installed on my Linux Intel single box Database 10g HTML DB Application Server 10g I had configured my application on HTTP server and was running fine. On top of it I installed successfully Enterprise Manager Grid Control in the

  • Iphoto slideshows and itouch

    I would like to transfer a photo album with an itunes song attached onto my itouch as a slideshow. I have a how-to book which claims it is possible (that's actually where i got the idea). Supposedly, I just attach a song to an album in iphoto then sy

  • Motor control using labview

    I'm new to Labview. I just installed a new labview system with analog output. What electrical component do I need so that I can power a decent size motor with labview output? The signal from Labview is only enough to power a tiny motor. Well, the onl