In NI-DAQmx, how to change the frequency of a pulse train?

I was using "GPCTR_Change_Parameter()" to change the frequency of my pulse train in Traditional NI-DAQ and Labwindows/CVI; is there any function can do the same thing in NI-DAQmx without restarting the task?

You can do this in one of two ways, depending on the version of NI-DAQ you are using. If you are using 7.2 or later, you can use the counter write functions (ex: DAQmxWriteCtrFreq()), which are available for each flavor of pulse generation tasks (Freq, Time, Ticks). If you are using NI-DAQ 7.0 or 7.1, you can modify the attributes directly (DAQmx_CO_Pulse_HighTime, DAQmx_CO_Pulse_LowTime, etc). Keep in mind that for each attribute pair, one of the attributes will cause the counter to load the new pair. The attribute that causes the load is LowTime, LowTicks, and Frequency.
I hope this helps!
gus....

Similar Messages

  • 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

  • How to change the frequency of a finite pulse train?

    Hi all? I Know I’ve asked once a similar question, but I need a better answer. I would like some ideas or examples on how to modify the example in LV; "Finite Pulse Train Generation - Intermediate for AM9513-Based Devices",so that the frequency can be changed while the VI is executing.
    Will i have any problem with I use this VI in a DAQ-STC-Based Devices(E-series)?

    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

  • 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 measure the frequency of a pulse being generated by a counter

    Hi,
    I am using labview 8.6 to generate 5 evenly spaced pulses for every 1 revolution of my shaft. However, I would also want to know the frequency of these pulses so I can determine the shaft speed. Since I am already generating the pulses using one of my counters, can I still tap into that or task another counter to measure the pulse frequency? If so, how? I have attached my code for generating the pulses and I am using an Ni 9401 module and an NI 9172 chassis. If someone can helo me modify the code to measure and tell me the pulse frequency as well, that would be really appreciated
    Attachments:
    autotrain2.vi ‏19 KB

    You'd probably get a more coherent answer if you didn't bounce around from thread to thread so much...
    How can I generate a pulse train from shaft encoder? (5/13)
    pulse train from encoder (5/15)
    how to measure rpm (5/20)
    How to measure rpm using shaft encoder and labview (5/23)
    This thread (also 5/23)
    I see you ignored my suggestion from the other thread--Kevin's solution is good too but using an encoder task offers more noise immunity (I think this is probably the cause of the problem you reported on the other thread).  You can fix it with digital filtering if you want to keep using a counter output instead of an encoder task.  Noise during transitions is pretty common for a quadrature encoder.
    A finite counter output task uses 2 counters on the 9172 (although you said 9174 earlier at one point--this wouldn't be the case on a 9174) so you wouldn't have one left to make your frequency measurement.  With the solution you have now, you can change to continuous to free up a counter if you don't care about outputing an exact number of rotation's worth of pulses (I'm not sure if you do or not--I didn't read through all of the various threads relating to this application to find out).
    For your actual question in this thread...  Have you tried running one of the frequency measurement examples?  From the code here I can't tell what you have tried (it just looks like a mangled version of the code Kevin gave to you in your other thread).
    Best Regards,
    John Passiak

  • How to modify the frequency of a pulse generator without stopping application

    I need to generate pulses on a counter output of a 6024 card. But I have to change the frequency while the programm is running between 1Hz to 800 Hz.
    If I do the initalization on each loop, the system becomes very slow and I can't reach 800Hz.
    Anyone can help me?

    Good news -- you can change the frequency on the fly with no skipped pulses. You'll find a couple examples posted here on ni.com by searching on "pulse width modulator". One's for traditional DAQ, the other's for DAQmx.
    Possible caution -- not too many NI-DAQ's ago, there was a limitation about changing pulse specs on-the-fly. I'm not sure whether it still applies to the latest traditional NI-DAQ or to DAQmx. Caveats aside, here's what that limit was (is?):
    -once you set new pulse specs on-the-fly, you must allow at least one new pulse to be generated before the next time you set new pulse specs.
    Your frequency range is low enough that you'll likely need to put extra delays in your code to keep it working smoothly.

  • How to change the frequency of time machine back ups

    Time machine backs up every hour. And it takes several minutes. I don't need to back up that often. Once a day is fine. But I don't see any way to set the frequency of back ups.

    There are a number of applications that can be installed to set different time schedules for TM. I have not provided links as I know nothing about them.
    If you do a web search on the title of your post you should find them.

  • For PCI-4451,How to change the frequency of an output signal without any undefined state

    I would like to generate a signal using output channels of PCI-4451 and at the same time capture data using the input channels. Is there any method that I can generate a continuous signal without any undefined state when the signal frequency is being changed?
    Attachments:
    Input_Signal.bmp ‏729 KB

    Wee,
    DSA boards such as the PCI-4451 have a number of very desirable properties including high precision and a high sampling rate. The trade-off for the combination of these two properties is that the DSA boards cannot adjust their sampling rate on-the-fly. Instead they have to be stopped and reconfigured. During this reconfiguration time, the value of the board's output becomes flat and level.
    If you are looking to adjust the board's output without seeing these flat spots, you have to take a different approach to programming a DSA board. Instead of reconfiguring the board, what you need to do is allow the board to continue to run (at the same output frequency), and then overwrite the output buffer that the board reads to output values. This will
    allow you to output new data without the flat spots. Below you will find an example that displays this behavior.
    If you determine that this is not an acceptable workaround due to the limitations on output rates, you may want to look at using a Multifunction DAQ board (60xx or 62xx) or an arbitrary waveform generator (54xx) device instead.
    Best of luck with your application.
    Regards,
    Jed R.
    Applications Engineer
    National Instruments
    Attachments:
    Cont_Gen_Voltage_Wfm-Int_Clk-With_Updates_for_DSA.llb ‏161 KB

  • How you change the download frequency for a single Podcast?

    I have iTunes 11.1.5 for Mac, and I can't find how to change the down load frequence , aka "check for new episodes" setting for individual podcasts. I've tried using the settings menu in the "My Podcasts" and the "List" podcast view. When I do this, I see these setting:
    Keep
    Download
    Sort Order
    Play Order
    If I click on the "Defaults..." button, the top setting is "check for new episodes"
    I have no problem with being able to change the  default download frequency setting, but I am at wit's end with locating where I can change that setting for individual podcasts.

    Bump.

  • HT1689 How do I change the frequency in which I enter my password when purchasing/downloading from iTunes?

    I changed the settings and now I cannot figure out how to change them to the default setting. How do you change the frequency in which you enter your password in iTunes?

    I don't use restrictions but check ..... Settings>General>Restrictions>Allowed Content>Require Password.

  • How to control keithley 6221 just to change the frequency of a wave at intervals .

    Hello,
    I'm very new to LabVIEW. I'm trying to control keithley 6221 using RS-232.
    What I want to do is just to change the frequency of a sine wave at every 30 seconds, and the series of the required frequencies could be input at the beginning.
    Does anybody know how can I do it?
    I'll be glad to get any help.
    Thanks!

    NI does not have a LabVIEW driver for that instrument but you might want to check with Keithley.
    On the main Instrument Driver Network page are links on developing an instrument driver. There is a wizard (Tools>Instrumentation>Create Instrument Driver Project) as well as the Instrument I/O Assistant. You will need the instrument manual to look up the programming commands. There are example VIs for serial communication.

  • How to change the properties of waveform graph from time domain to frequency domain?

    Actually, I want my output waveform graph give me the answer in x-component in frequency instead of time after the FFT. My output waveform graph gives the x-components in time instead of frequency. How to change the properties of the waveform graph?

    vasus wrote:
    Hi,
           I amtaking sensor input signals through NI FPGA cRIO-9004. i am analysing this using wave graph. the problem is i am not getting accurate singal.How to decrease the frequency? 
    You are responding to a very old (8 years) thread, be aware that that might not be the best option.
    However, you want to decrease the frequency? or increase?
    What is the code you are running?
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • How can I change the frequency of when Time Machine reminds me to backup?

    I used to get a pop up every ten days telling me that it's been ten days since I backed up Time Machine, but since the last time I backed it up, it's started notifitying me everyday. I'm just wondering if there's a way I can change the frequency, since I usually just back it up every few months and I don't keep my external hardrive hooked up all the time.
    Thanks!

    That's not a particularly wise backup strategy. You should backup at least once per week. Time Machine is designed to backup hourly if left alone. You should have a permanent backup drive that remains connected to the computer at all times except, perhaps, when you are traveling.
    If you disconnect the backup drive then Time Machine will start to save snapshots on your computer until the backup drive is reconnected at which time the snapshots are transferred to your backup drive and erased from the computer's drive.
    You can use a utility such as TimeMachineEditor 3.0.3 to change Time Machine's backup interval.

  • How to change the update rate of an Analog output in a loop

    I have to generate a ramp at a decreasing frequency. I use a shift register in a "for" loop to decrease the rate of the analog output. Unfortunately, the loop or the analog output initialisation take a too long time delay..
    How can I solve this problem?
    Any help is greatly appreciated
    Thank you

    Hello;
    I'm attaching an example VI that shows how to change the output rate on the fly.
    Hope this helps.
    Filipe
    Applications Engineer
    National Instruments
    Attachments:
    aochangeonthefly.zip ‏47 KB

  • Changing the frequency

    How do I change the frequence so that my airport sends out the signal on 5.5 rather than 2.4?

    Ahhhh, I think I see a misunderstanding... setting the multicast rate to 2 Mbps (for example) does NOT limit every client to that bandwidth. What it does is break the connection to a client if 2 Mbps link can not be maintained to that client.
    Every client negotiates bandwidth individually. Regardless of what the multicast rate is set to, the clients are going to be using the highest data rate their connection to the base station is capable of. Therefore the clients close to the base station will be using a high data rate while the clients far from the base station will be using a lower data rate.
    If the data rate to any client falls below the multicast rate, that connection will be dropped.
    The AEBS has no settings to limit bandwidth or spread it out among clients. I think that is what you are looking for. Any client can dominate the bandwidth.

Maybe you are looking for