Frequency divider by 2 and 3

Hello,
I'll start by saying that I am new to labview and it is possible that my question will be simple for most. As the topic I need to perform frequency divider by 2 and 3. 
To digital input card will be given a signal of frequency 50Hz. I can use a USB card 6009 and 6221.
I found
a few examples of the frequency dividers on the NI forum and on the
internet but do not quite know how I could use them in my case...
For example, the divisor using JK flip-flop in attachments.
If
anyone would be able to explain to me how it should look like in my
case, or give some examples on the basis of whose ideas I will be able
to understand the operation of such a program would be great.
Regards,
Mat M.
Attachments:
freq div.vi ‏28 KB

Kevin is absolutely correct that the signal resulting from the method I linked earlier would have an extremely low duty cycle.  You can use this method to "divide" by 2, 3, or any other positive integer (other than 1), but like Kevin mentioned the resulting signal is a pulse every N ticks, rather than a true division of the input clock.
You can use Kevin's method to divide by 2 and give a 50% duty cycle using either AO or DO with an external sample clock.  However, the waveform to generate would be [1, 0, 1, 0 ...], giving 1 period of output signal for every 2 clock edges.  You can't use this method to give a 50% duty cycle and divide by 3, but you can get either a 33% or 67% duty cycle by generating [1, 0, 0, 1, 0, 0 ... ] or [1, 1, 0, 1, 1, 0 ... ] respectively.  Generating [1, 1, 1, 0, 0, 0 ... ] is actually a divide-by-6.  Any odd number divisor would not give you a 50% duty cycle. 
There is a way to divide by an odd number and maintain a 50% duty cycle, but only if your input signal is also a 50% duty cycle square wave.  Unless you absolutely need to have a 50% duty cycle then it's probably more trouble than it's worth:
    1.  Configure a DI task with Change Detection Timing.  This can be used to generate a pulse (Change Detection Event) on every rising and falling edge of your external signal, effectively multiplying it by 2.
    2.  Use the Change Detection Event as the sample clock for your DO (or AO) task.  The task would output [1, 1, 1, 0, 0, 0 ... ] for a divide-by-3 of the original signal.
Like Kevin mentioned, any divisor >4 is easy using the counters in their default "toggle" mode, but the duty cycle would not be 50% for odd divisors (similar to the DO/AO method).  If you only care about one edge of the clock and the duty cycle is not terribly important, the Pulse Mode example that I linked in my last post can be used for any divisor between 2 and 2^N-1 on an N-bit counter.
Best Regards,
John Passiak

Similar Messages

  • Frequency divide by N doesn't work on Counter-Ti​mer PCI-6602

    Hello everybody,
    I tried to do something basic ( ?) with this Counter-Timer 6602 Board, and it doesn’t work.
    So I hope some people with more experience than me could understand what happens here.
    1) What I need:
    I need to generate 4 synchonised clocks, whose periods will be multiple of 1 ms.
    2) What I have:
    LabVIEW 7.0 and a PCI-6602 Counter-Timer Board in a DELL PC running under XP pro.
    The PCI-6602 Counter-Timer Board has 8 counter timers named CTR 0, CTR 1, ... CTR7.
    3) What I have already done, and that worked:
    - Generate a 1 kHz “Master Clock” signal from CTR 4, configured by “Continuous Pulse Generator Config.vi” (found in “Data Acquisition, Counters...).
    - configure CTR 0 and CTR 1 to work as frequency dividers, by use of “Down Counter or Divider Config.vi”.
    - Apply the output signal of CTR 4 (OUT ) to the SOURCE inputs of CTR 0 and CTR 1 by means of physical wiring in the SCB-68 connection box.
    When I do this, I get two nice secondary clock signals on my oscilloscope screen, ( with periods = 3 ms, or 5 ms or whatever multiples of 1 ms I choose) from CTR 0 and CTR 1 outputs , very clean and perfectly in phase with the 1 kHz Master Clock.
    So far, so good...
    But I still need 2 more secondary clocks...
    One would say: “No problem, do the same trick with two other counters...” Well, not so simple, it seems...
    4) What I tried to do, and that didn’t work:
    When I try to do the same frequency division with any of the remaining counters, (CTR2 to CTR7), the program stops and I get an error “ –10020 : Time base not valid “.
    I can’t figure out what happens here: I thought any counter could be configured to work as a frequency divider, but it seems not to be so, and I am stuck here.
    Has anyone an idea about how to fix this type of problem?
    Attached file: hor_div02New.vi
    Attachments:
    hor_div02New.vi ‏123 KB

    karolik,
    I'm just adding a followup in English. As Marc L. mentioned, the particular vi named "Down Counter or Divider Config" isn't compatible with the 6602. While the 6602 does have the ability to generate 4 synchronized clocks, a different syntax is needed. Here's how I'd do it:
    Traditional NI-DAQ
    1. Configure a continuous pulsetrain on CTR 4. Route its output to, say, RTSI 4. Don't start it yet.
    2. Configure CTR 0,1,2,3 for continuous pulsetrains using RTSI 4 as their "timebase source." Start them.
    3. Start the CTR 4 pulsetrain.
    4. Now CTR's 0-3 should generate separate clocks with synchronized phasing.
    DAQmx
    1. Configure a continuous pulsetrain on CTR 4. Don't start it yet.
    2. Configure CTR 0,1,2,3 for continuous pulsetrains using "Ticks" for units. Use a DAQmx property node (probably Channel property node, but am not 100% sure and don't have a LV PC handy to check) to specify that the "ctr4 internal output" should be used as the timebase. Start them.
    3. Start the CTR 4 pulsetrain.
    4. Now CTR's 0-3 should generate separate clocks with synchronized phasing.
    -Kevin P.

  • Pci 6602: configuring a frequency-divider with daqmx using labview7.1

    i´m using labview 7.1 and the pci6602 counter-board. i want to configure a counter as an frequency-divider with varaibale division-rate, witch is a easy thing to do with the classic "old" daq-driver.
    it´s recommended to use the "new" daqmx-driver, and i want to do so, cause i´m using also other ni-devices and want to use the same driver for all of them, but i can´t find any possibility in the daqmx-vi´s to configure such a frequency-divider.
    i also couldn´t find any example-code for this problem.
    please help me!!

    hi, thanks for the answer, but unfortunatly it´s not what i ment.
    i need to configure a counter on the pci6602 wich divides down the frequency "f_in" of the square pulses connected to it´s "source" pin by "divisor" and puts out square pulses with frequency f_out=f_in/divisor at another pin. That process should take place only on the 6602-board without using the cpu.
    i´ve found the solution already, how to configure a counter on the pci6602 with daqmx like described above. see attachment.
    servus
    markus
    Attachments:
    Divider_Config_mw.vi ‏40 KB

  • Frequency divider + narrow pulse output

    Hello all,
    I need to divide the frequency of an incoming digital pulse by a factor of N (typically 10-50) but I would like the output signal to be 200ns wide. I'm able to divide the incoming pulse by using CO pulse ticks with the incoming pulse as the tick source and specifying the low and high ticks (low + high ticks = N). The problem is that the narrowest pulse I can generate is 2/f_in (or in my case  2/75kHz~ 26 us).
    Is there any other way to divide a pulse  and control the width of the  output pulse?
    I can use the "wide" pulse to trigger a narrow  pulse on a different channel but I rather not use so many channels for this application. Is it possible to use just 1 input channel and 1 output channel?
    Any advise will be greatly appreciated.
    I'm using Labview 8 and pci 6251
    Eyal

    Hello Eyal,
    Let me rephrase what it is I think you want to do:
    1.  You have a digital input with a frequency at or approximately 75 kHz.
    2.  You want to divide down this input frequency by N, where N is between 10 and 50 or so.
    3.  On every Nth pulse you want to generate a pulse with a 200ns high time and then return to a low state until the next 200ns pulse is generated.
    If this is what you want to do then you would need 1 CO task to generate a pulse ever Nth rising edge of your input.  Then you would use this pulse to trigger a retriggerable pulse train to output your 200ns pulse.  All of this routing can be done internally so you would only physically connect one input and one output, however this setup would require three counters.  One counter for the CO task and two counters for retriggerable pulse generation.  Unfortunately your PCI-6251 only has two counters so to do this you would need to get a board with at least 3 counters. 
    If I didn't describe what you are trying to do accurately please reply back with further clarification incase what you are actually trying to do can be accomplished on your board.
    If you would like to contact National Instruments directly to speak with a technical representative about getting a counter board you can find contact information at www.ni.com/contact.
    Have a good weekend!
    Brooks

  • Frequency divider/ pulse generation from 1 to n

    Hi,
    I have a sample pulse which in some cases needs to be divided. I tried to use the pulse train generation function, which works fine (giving me a pulse every n sample pulses), but only starting at 2 input pulses. I need to be able to use this function from a division of 1 and up.
    Put in another way, can a counter be configured in such a way that it outputs a pulse every rising edge of the source signal?
    I'm using a PXI 6602 counter card and am programming it through calls to NIDAQ32.DLL under Labview 7.

    Hi Walter,
    In short, no. You can't output a pulse on every input pulse. You can however configure the degree of division. Here are the rules for division:
    When set to pulse train generation, you will have a register for the low value of the pulse train and a register for the high value. What happens in typical pulse generation is that these registers are loaded with count values such as 2 and 2 for each register respectively. In default operation, the first register will count 2 pulses on the source and then toggle the output. The second register will then count to pulses and toggle the output again. The operation then cycles back to the first register. This toggling effectively creates a pulse train that is divided by 4 and a duty cycle of 50%.
    You can however change the output mode to pulse instead of toggling upon completion of counting on a register. In the above example, you would count 2 source edges and then pulse for the first register and the count 2 more edges and pulse again for the second register. You will of course repeat this in pulse train generation mode. This mode allows you to obtain greater resolution since you are now dividing by 2 but your duty cycle will be different. Each pulsed output will be equivalent in size to the source pulse width.
    Finally, the two registers can be populated with integer values of 2 or greater. Therefore, the smallest frequency division is 2.
    You will have to work with these three elements to obtain the pulse train of your desired frequency. Hope that helps. Have a good day.
    Ron
    Applications Engineering
    National Instruments

  • I have a Airport Time Capsule 2T, I would like to know if it is possible to backup all my apple divides (iMac, iPhone and iPad)?

    I have a Airport Time Capsule 2T, I would like to know if it is possible to backup all my apple divides (iMac, iPhone and iPad)?

    The iMac can back up to the Time Capsule, but iOS devices like the iPhone and iPad back up to either iTunes on your Mac....or....to iCloud.
    If the iPhone and iPad back up to iTunes on your Mac, then when the iMac backs up the iOS backups are sent to the Time Capsule as well.  So, the iPhone and iPad back up indirectly to the Time Capsule.
    The iPhone and iPad cannot back up directly to the Time Capsule.
    For more information on iOS backups, see this Apple support document:
    Back up and restore your iPhone, iPad, or iPod touch using iCloud or iTunes - Apple Support

  • Catching errors such as divide by zero and typing non-numeric characters

    Fellows: How do I extend following script to catch errors such as divide by zero and typing non-numeric characters.      Thanks
    This program takes two integers (whole numbers), then displays the sum, average, division,
    Modula of those numbers and finally the first number raised to the power of the second number.
    import java.io.*;
    public class HWOne
         public static void main(String[] args) throws IOException  // error handling
              // variable declaration
              String firstdigit, seconddigit;
              int first, second, sum, total, modus, power;
              float division;
              double average;
              BufferedReader myIn = new BufferedReader(new InputStreamReader(System.in));
              //Invoke user response
              System.out.print("Please enter first digit ");
                   firstdigit = myIn.readLine();
                   first = Integer.parseInt(firstdigit);
              System.out.print("Please enter second digit ");
                   seconddigit = myIn.readLine();
                   second = Integer.parseInt(seconddigit);
              //computations
              sum = first + second;
              average = (double)sum / (double)2;
              division = (float)first / (float)second;
              modus = first % second;
              power = (int)Math.pow(first, second);
              //Screen message
              System.out.println("Sum: " + sum);
              System.out.println("Average: " + average);
              System.out.println("Division: " + division);
              System.out.println("Modula: " + modus);
              System.out.println("Power: " + power);

    Have you learnt about try/catch statements yet?
    The parseInt method throws a NumberFormatException. So you place the call to that method inside a try statement and catch the exception.
    For divide by zero, you can use an if statement. If the divisor != 0 perform division.

  • Firefox 4 Hidden Cache Divided Into Folders, and Folders Within Folders

    Firefox 4 - Hidden Cache Divided Into Folders
    I don't want cache divided into folders and more folders.
    It's now virtually impossible to copy and save streamed media directly from the hidden cache.
    Solution to permanently eliminating all the folders and reverting back to 1 cache folder filled with a list?

    I'll try to explain this more coherently -
    documents and settings/owner/local settings/application data/mozilla/firefox/profiles/profile-name_default/cache
    Firefox 4 has a new caching system
    cache - open up and say hello to multiple folders and subfolders, instead of single cache folder filled with cached files
    This is making it an utter nightmare to try and copy/save streamed media, flash videos, unsaved pictures, other documents, etc
    Many files in the hidden cache are not stored in "Temp" folder or "Temporary Internet Files" folder, the hidden cache is the only location where they're stored
    How can users revert back the old cache (single folder) system?

  • How do I divide a number and have 1/3 entered on 3 seperate sheets?

    How do I divide a number and have 1/3 entered on 3 attached sheets?

    Hi Ellaspapa,
    If you are copying the formula from my reply, it may be the fancy divide sign (÷) that Numbers 3 shows in formulas.
    I constructed those formulas by
    clicking in the destination cell (Table 2 Cell B2),
    typing =
    then clicking in the source cell (Table 1 Cell B2)
    and typing /3
    press enter
    Repeat for Tables 3 and 4
    Numbers will change / to ÷ but it should work.
    Any error message with the syntax warning?
    Regards,
    Ian.
    Message was edited by: Yellowbox and typing /3
    Message was edited by: Yellowbox

  • SCTL-NFC1 is a Near Field Communication(NFC)/Radio Frequency Identification(RFID) Reader and Payment Adaptor designed for iPhone/iPod Touch to provide NFC two-way communication,RFID read/write and contactless payment capabilities.

    SCTL-NFC1 is a Near Field Communication(NFC)/Radio Frequency Identification(RFID) Reader and Payment Adaptor designed for iPhone/iPod Touch to provide NFC two-way communication,RFID read/write and contactless payment capabilities.
    commercial applications such as asset tracking, document tracking, healthcare, security and access control.

    We are the manufactuer of the reader

  • Generating frequency dependant square pulse and making it digital

    trying to generate a square wave pulse at a specific frequency
    it would be great if its simple as setting the amount of frequency (i.e., 50 , 50 pulses per sec)
    but it gets complicated because of the sample rate
    my problem is to convert it to digital and i don't know whats wrong
     i attached a pic of my block diagram
    as you can see, one pulse has frequency F, the other F/2, and lastly F/4
    i need it to be compatible with the VI attached as well. can anyone help? thanks in advance!
    Message Edited by sdkpark on 10-10-2009 12:19 AM
    Attachments:
    Create Digital Waveform.vi ‏20 KB
    Correlated Dig Write With Counter.vi ‏31 KB

    Hello again Sdkpark,
    Apologies the message I was writing didn't include my full post.  Take a look at this great community example for a prebuilt solution to what I believe you're trying to accomplish:
    http://decibel.ni.com/content/docs/DOC-5763
    Let me know if this isn't what you're looking for and I'll reply back.  Have a great day!
    -John Sullivan
    Analog Engineer

  • How to switch central frequency fastly with labview and USRP?

    Hello everybody,
             Recently I was making a frequency hopping receiver with labview and USRP N210 and SBX. The transmitter works on the 2.4G band, and it changes from one central frequency to another every 65536us. As I think, if I start receiving at the correct time, and  change the central frequency of the USRP every 65536us, I should be able to receive the data.
        But I find that, when usrp switch form one central frequency to a different one, it spends nearly 48ms and when it switch from one frequency to the same one, it only spends 3ms(I test the performance by modifying the niUSRP EX Rx Continuous Async Reconfig on the Fly.vi example). So if I want to follow the hopping sequency, I may can only receive 17ms data because I have to save time for switching central frequency. 
         My problem is that: why usrp changes central frequency so slow,  how can I make the process faster? If I want to follow the hopping sequency, can anybody give me some good advice? Thanks

    There is an attribute "LO Frequency" that you can use to lock down the frequency of the local oscillator.  Then, when you set the "Carrier Frequency" attribute, the difference between the carrier frequency value and the LO frequency value will be realized by frequency shift in the DSP in the FPGA.  Changing this "digital" frequency shift value is much faster, since you don't have to re-tune the local oscillator.
    Let's say you're sweeping from 2.44 GHz to 2.46 GHz.  Set the "LO Frequency" to 2.45 GHz then Commit.  Then, in your loop, program the "Carrier Frequency" attribute from 2.44 GHz to 2.46 GHz.  In the loop, it will only program the digital frequency shift, which will happen much faster.
    Another tip is to use the property node to program only the attributes you want to change, rather than the niUSRP Configure Signal.vi (which sets many at once).
    For more details, see the "Configuration:Advanced:LO Frequency Property" in the NI-USRP Help, and look at this example:
    <LabVIEW dir>\examples\instr\niUSRP\niUSRP EX Fine-Tune LO Frequency.vi

  • Frequency counter with start and stop - Need help

    When No load, 200VA Unity , 400VA Unity, 600VA Unity, 400VA LAG, 400VA LEAD or Short is active Frequency Counter starts.
    When OFF and BENCH PWR is active Frequency Counter stops and is grayed out.
    Frequency Counter is grayed out when BENCH PWR is inactive
    Any one know ho to do this?
    Attachments:
    Buttons.vi ‏77 KB

    In order to enable or disable a control you need to write a U8 value to the Disabled property of the property node for that control.
    The values are:
    0 = Enabled
    1 = Disabled
    2 = Disabled and Grayed Out
    Kelly Bersch
    Certified LabVIEW Developer
    Kudos are always welcome

  • Continuous Wavelet Transforma​tion frequency output in columns and rows?

    Hi
    I´m trying to understand the output of the Continuous Wavelet Transformation Vi. I am only a beginner in wavelet, so is viewing from a Fourier Transformation method with moving windows. For example if I have 8 points say recorded with 1Hz = 8sec of data and run it thought the CWT with 8 scales, I get 8x8 array of data. So as far as I understand I get the frequencies of (starting with column 0 going to 7): 1Hz, 0,5Hz, 1/3Hz, 1/4Hz, 1/5Hz, 1/6Hz, 1/7Hz and 1/8Hz. Is this correct so far?
    What I don´t get is how it is possible to make 8 (rows) of wavelet correlations on the columns from 1-7, when there is for example only one possibility to make correlation of 1/8Hz stretched wavelet, because the wavelet must be stretched over 8points (7th column). In picture below is illustration of wavelet where for the largest scale 8 (=lowest frequency) here 1/8Hz there is only 1 value for every 8 values for the smallest scale 1 (=highest frequency) here 1Hz.  
    I really hope someone can help me!
    Best Regards
    Jesper

    Your current code can be replaced by an autoindexing FOR loop, you only need once instance of the "add array elements" operation. Easiest would be to acquire it as a 1D array with a constant number of samples then use "reshape array" to create a 2D array of the desired dimensions to be used for autoindexing as suggested.
    LabVIEW Champion . Do more with less code and in less time .

  • Divide file contents and read from threads

    I am reading a file which contains doubles... I can do this with 1 thread.
    Now I want to use 2 threads and make each thread read half of that file.. How do I make file to half .. If I take the length and divide by two wont it destort the doubles?
    public class SingleThread extends Thread
         /*** Constructor ***/
         public SingleThread(){}
         /*** Run the thread ***/
         public void run()
              try{
              FileInputStream fis = new FileInputStream("File1.bin");
              DataInputStream dis = new DataInputStream(fis);
              int size = fis.available();
              System.out.println("Size of File1 "+size);
              /*Create an array that can store 100,000 numbers*/
              double num1[] = new double[100001];
              /*Get random number*/
              for (int count = 0; count <= 100000; count ++)
                   num1[count] = dis.readDouble();
                   System.out.println(count); //Count
                   System.out.println(num1[count]); //Prints doubles that are read from file.
         }//try
              catch(Exception e){System.out.println("Exception: "+e.getMessage());}
         /******************** Main Program ********************************************************/
         public static void main(String[] args)
              new SingleThread().start();
    }

    I dont know....my professor wants us to test multithreading response times.. :(

Maybe you are looking for

  • Automatic impagination of image

    I've a problem when I would to place a image using indesign cs4. The javascript must to do: 1. import a structure xml 2. place the story in a text-frame The story is formed from a lot of pdf file mixed with text, this create a overflow in the text-fr

  • Multiple versions of same InfoPath Template in Forms library

    Using SP 2010 and InfoPath 2010.  When I create an IP template today, say with 20 fields and publish to a Forms library then my Forms library will use this template as the default template, all good.  6 months later I need to add a field and re-publi

  • How to pass checkbox multiple value in URL as parameter?

    Hello, I have a checkbox in two page. The checkbox is based on a LOV and user can check more than one value at a time. The return value of the checkbox is like "ID1:ID2". I want to call another page with the same checkbox item and want to pass the ch

  • MICROPHONE IS NOT WORKING WITH WINDOWS 8

    HI,RECENTLY IAM UPGRADED MY LAPTOP HP G60 WINDOWS VISTA TO WINDOWS 8.FROM THAT,INTERNAL AND EXTERNAL MICROPHONE IS NOT WORKING..IS IT I NEED ANY DRIVER SOFTWARE?ANYBODY HAVE SOLUTION FOR THIS ISSE?

  • Sorting a hashmap with duplicate values

    How would i sort the hashmap values in ascending order with duplicated values. thanks.