Determining Analog Signal Frequency with Prebuilt VIs

Don't know what is wrong with this code.  Am trying to determine the frequency of a signal from an analog signal (paddlewheel flowmeter).  As a starting point, I'm using a simulated square wave with the "Timing and Transition Measurements" VI and am getting following error:
~~~~~~~~
Error -20308 occurred at Timing and Transition Measurements -> frequency_determination_example.vi
:3"  (waveform index 0 of 1)
Possible reason(s):
Analysis:  The waveform did not cross the mid reference level enough times to perform this measurement. Check the signal length, reference levels, and ref level units.
~~~~~~~~~
However, there seems to not be any options in the "Timing and Transition Measurements" VI to set mid reference levels.
Any insight into why this simple problem is occuring would be appreciated.  Attached is my program's simple code.
-tsippel
Attachments:
frequency_determination_example.vi ‏101 KB

Hi,
Dennis was right (without looking at the code). You generate one (1) square wave, if you had generated 1000 sampled you'd get the correct answer.
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!

Similar Messages

  • How to generate two different analog signal in two different VIs

    I'm using a PCIe-6321 board and a SCB-68 connector block. As it has two analog output I would like to use one of these output in one Vi to generate a square waveform and the other output in another VI to generate a sine waveform. Each VI work perfectly separatly but if I run one then the other, the second one doesn't send any signal. Since I don't want to merge the two VIs (It's more convenient to operate them separatly), how can I figure out to make them work together (sometimes).
    Solved!
    Go to Solution.

    I assume you get error -50103 (resource is reserved) at either on vi.
    It's not possible to run two AO channels independetly from each other with different VIs since both Tasks are trying to request the same timing engine at the DAQ device.
    Christian

  • Reading all FP-TB-10 channels -- analog/ digital, whatever -- with optomux vis

    Hi,
    I am in the process of writing an efficient acquisition routine for accessing I/O
    channels on a FP1001/FP-TB-10 from a cFP2020. (earlier posts here by me
    dealt with the problems associated with the less-than-ideal means of getting
    to these remote channels versus local I/O)
    I have reviewed and played with the example vi's for accessing analog/digital
    input/output dual-channel modules on the FP-TB 10, and have found them to
    be far more general-purpose and computationally intensive than my hard-coded
    application requires.  As a result, I would generally like to do a bulk read of all
    channels, rather than a pair at a time and format the results according to what I
    know each channel to be.
    If I use the (!G)Read16BitDataWithStatus with all channels targeted and ranges
    defined, including the output channels, will I get all of my data, digital or analog?
    Will I get the last written value on the outputs, as I do on cFP2020 outputs when
    I configure them in the .iak and use FP read?  Or is there a better VI to work with?
    I almost hesitate to ask if I can do the same for write, e.g.
    I can play with this and figure it out eventually, but I only have access to the
    fieldpoint a few hours a week, so knowing in advance how things work is quite helpful.
    Bob

    Graziano,
    Your message is very interesting... 
    Modules upstream and downstream of the problem module are all working fine.  Their ready lights are "on" and I can access them from the NI software.
    However, prior to the current state, the module in question had slightly different behaviour.   Upon power-up, the ready light would come "on" but some-time later (~5 minutes or so) after I tried to start the control software the software would give an error message and when I looked back at the hardware the ready light was now "off".  Thinking I might have a loose connection somewhere, I poked around and noticed that the module right next to the problematic module would "change state" when I jostled it.  By "changing state" I mean the channel LED's changed from on/off to off/on - so it looked like I did have a poor connection; maybe on the backplane line.  I tried to improve the connections on THAT module and it now behaves in a normal manner. 
    Thanks.

  • Analog signal duty cycle incorrect

    I am using an NI PCIe 6535 board to send digital timing signals to a custom PCB.
    The signals are digital square wave signals with various duty cycles and phase shifts.
    I also need to send a 12 bit ramp signal to the board.
    I am having issues with the frequency.
    I need the timing signals to run at 833.33333 khz.
    I need the lsb of the ramp to run at 416.666666khz.
    To create the timing signals I am using "Create Analog signal", so that I can set up the square wave with the appropriate phase shift and duty cycle.
    Then I conver from analog to digital.
    I am using a DAQmx generate to output the signal to the PCB. I have noticed that the DAQmx gen frequency directly controls the ramps frequency.
    However for the digital timing signals there is some scaling factor. The frequency of the digital timing signals can be set in the timing signals them selves. The sample rate in the analog signal also effects the frequency.
    To get the frequencies that I need. I had to set the"create analog signal" sample rate at 2.778G S/s, the "create analog signal" frequency to 1.2889GHZ, and the DAQmx generate frequency to 1.66666 MHZ. At those numbers, I get the timing signals to output at 833.333KHZ and the second bit of the ramp at 416.6666HZ (for the ramp I upped it to 13 bit and I don't use bit 0, as it outputs at 833KHZ).
    However at these settings all of my timing signals have the same phase, and the same duty cycle, even though I have them set differently.
    Can someone please help? I think the issue is that I have the sample rate and frequency of the "create analog signal" block set too high, but if I set them lower my signals will not be at the right frequency.
    Attachments:
    timing signal 1.JPG ‏44 KB
    timing signal 2.JPG ‏47 KB
    daqmx gen.JPG ‏55 KB

    Hi David,
    We found that there seems to be a weird divider between the sampling rate of the analog signal module, the analog signal sample rate, and the f daqmx gen.
    After various tests we made a chart of what we observed. Fsignal and sample rate are values set in the "create analog signal" module, Fdaqmxgen is set in the "DAQmx generate" module. We used a "create anaolg signal" module to create the square wave, then convert analog to digital convert the square wave to digital.
    We have "repeated signal" and "N periods" checked.
    Fsignal
    Fdaqmxgen
    Sample rate
    Frequency   measured on the scope
    1GHZ
    10MHZ
    100G s/s
    100KHz
    100MHZ
    10MHZ
    100G s/s
    10KHZ
    1GHZ
    1MHZ
    100G s/s
    10KHZ
    10GHZ
    10MHZ
    100G s/s
    1MHZ
    100GHZ
    10MHZ
    100G s/s
    10MHZ
    100GHZ
    10MHZ
    100G s/s
    5MHZ
    The equation we came up with is Feff = (Fsginal/FDaqmxgen)*1000.
    To meaure the frequencies were using an HP 54600A oscilloscope, and probing standoff pins on our custom pcb.
    We have several versions of the project, attached is the latest one.
    Kyle,
    How do I set the compression to false?
    The picture below looks like labview? We are using signal express.
    I can't change the frequency on the DAQ mx gen because I need the ramp to run at a set frequency.
    There is a divider between the daqmx gen and the f signal. I have to set the Fsginal in the GHZ to get it to out at the right frequency. The equation we came up with is Feff = (Fsginal/FDaqmxgen)*1000.
    Thanks,
    Devin

  • How to make a synchronous acquisition of two analog signals with a one channel DAQ ?

    Hi !
    It is the first time I use Labview. I have just made some easy VIs, and now, I do not know how to deal with my problem...
    My problem : I have only one acquisition card (DAQ Ni 6034E) and I would like
    to acquire simultaneously two analog signals. It seems to be possible, in a quasi-synchronous acquisition if the card acquires one point of the first signal, then the first point of the second signal, then the second of the first signal, and so on ... I thougth that I could made two sequencies with a VI of data acquisition in each sequency, with the AI MULT PT. But with this, I think that I will lose the precision of the sampling frequency. And I have to know the sampling fre
    quency ...
    Thanks for your help !
    Carline

    Hi Carline,
    A PCI-6034E is a low-cost board, which only has one Analog to Digital Converter (ADC).
    With only one ADC you can't acquire different channels at the same time. That's why you find a multiplexer before the ADC in this type of board. This enables you to acquire multi-channels at the same rate quasi simultaneously. The samples of the different channels will be interleaved as it is explained in the following knowledge base :
    - http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/9379ea091c264b7c86256bc90082ca5d?OpenDocument.
    With this method, the sampling frequency is the same for all channels. The sampling frequency of one channel is determined with the "scan rate" parameter. There is only a small delay between the samples
    of each channels. When you perform an interval scanning acquisition, this delay depends on the "sample rate" that you specify. To have more informations about this terminology, please refer to the following KBs :
    - http://digital.ni.com/public.nsf/websearch/4D1435DF82EF494186256D8A006DD6D4?OpenDocument.
    - http://digital.ni.com/public.nsf/websearch/4D1435DF82EF494186256D8A006DD6D4?OpenDocument.
    To easily perform such a multi-channels analog acquisition, you can use the VI named "AI Acquire Waveforms.vi". You also can use an example provided with LabVIEW. You just have to browse the NI Example Finder in "Harware Input & output >> Traditional NI-DAQ >> General".
    Best regards,
    Benjamin
    National Instruments France

  • Measuring frequency with counter or analog input?

    I have some frequencies which I need to measure. Some signals are digital and some are analog.
    I have a PXI-6040E DAQ which has both counters and analog inputs. 
    I heard that you can measure higher frequencies with the counters than with analog inputs.
    What is the range of frequencies an analog input can determine versus a digital counter? 
    Where is the cutoff that you must absolutely use a digital counter to determine the frequency?
    Is the cutoff different for different DAQ cards? Or is generally the same.

    Have you looked at the specs for the device? The max sample rate and the max counter input will be listed there. The max frequency for an analog input is based on nyquist sampling theory. Are you at all familiar with? It states your sampling frequency has to be at least twice the frequency you are measuring.
    Since each device might have a different max sample rate, your last question is answered.

  • 2 Square signal to frequency with DAQCard ?

    Hello,
    My configuration : PC portable P4 / 1.8GHz, Win 2000, Labview 7.0, DAQCard AI-16E-4, BNC 2110 and two magnetic speed sensors (6000rpm, 120 top/rotary)
    1) I would like to recorde the two frequencies with the two counters of the DAQCard. Can I do it with my configuration (2 counters are enough ?) ?
    2) Can I synchronize these two inputs with analog inputs ? If not, which configuration I need for ?
    Thanks a lot,
    Yvan

    You can make a frequency measure with only one counter. This method use
    the internal timebase as source and your input signal as gate: the
    process take the number of clock period in a period of your input to
    compute it's frequency.
    Accuracy of this method is quite good if the input frequency is small
    compare to the internal timebase. So with the sensor you described:
        6000rpm => 100 rotary per second
        with 120 top per rotary => 12000 top per second
    The AI-16E-4 use a 20MH internal timebase, so I think there is no problem
    More information about frequency measurement...
    For the synchornisation, I'm not sure to clearly understand what you
    need, but take a look to the DAQmx timming and DAQmx start trigger VIs.
    .mrLeft{float:left} .mrInfo{border-left:solid 1px #989898;font-size:x-small;color:#989898}
    Mathieu R.  
      CTD - Certified TestStand Developer / Développeur TestStand Certifié  
      CLAD - Certified LabVIEW Associate Developer  

  • Input analog signal with trig signal on DAQPad6020​E

    I would like to record an input analog signal in continous with trig signal on falling edge. The frequency trig is 3.87hz (258ms)with 5V level. In fact I want to record the input analog signal every 258ms.
    I use a DAQPad6020E and the VIs "AI-Config", "AI-Start" and "AI-Read" with a "digital A" trigger type (PFI0/TRIG1 on block connectors) and record datas in a file.
    I use the following configuration:
    - sampling rate= 100000 S/s (max rate DAQPad6020E)
    - minimum scan= 25200 pts
    When I read the datas I notice that the gap between the first point of the first acquisition and the first point of the second acquisition is 1016ms and not 258ms like the trig.
    I change the configuration:
    - sampling rate= 10000 S/s
    - minimum scan= 2520 pts
    The gap is now 516ms (it correspond to two trig)
    An other configuration:
    - sampling rate= 155 S/s
    - minimum scan= 40 pts
    The gap is 516ms (it correspond to two trig)
    I use also the VI "AI-Wave" but the results are the same.
    I don't understand what happend. Maybe it's due to the card limits ?
    Thank you for your answer.

    Hello,
    A trigger is an external stimulus that initiates one or more instrument functions. Trigger stimuli include a front panel button, an external input voltage pulse, or a bus trigger command. The trigger may also be derived from attributes of the actual signal to be acquired, such as the level and slope of the signal.
    A trigger is not a clock.
    If you want acquire with a specific clock, I advise you to use external clock. Instead of using your signal as trigger, use it as external clock.
    Have a look at "Cont Acq & Graph Ext Scan Clk - D trig.vi" example. This example is provided with LabVIEW (Help >> Example Finder).
    Here a tutorial about external clock acquisition :
    http://zone.ni.com/devzone/conceptd.nsf/webmain/7d​8eaea1d87cfb2686256802007b8c52?OpenDocument
    Regards,
    Isabelle
    Ingénieur d'applications
    National Instruments France

  • Can you tell me how to measure audio signal frequency in measurement studio with visual basic 6.0?

    I'd like to measure two differential input signal(I.e. A+ and A-),below is two test projects,
    1.connect A+/A- to PCI 6052E card's ACH0/ACH8 ,and refer to GND for testing
    2.connect respectively A+/A- to PCI 6052E card's ACH0/ACH8 for testing
    Could you tell me the details of the second project?and give me a illustration in measurement studio with visual basic 6. 0 about the second?
    In addition,I would like to measure the audio signal frequency,could you give me a illustration in measurement studio with visual basic 6.0?
    Wait for your reply!

    Dear kelven,
    Thank you for contacting National Instruments.
    To address your question, there are Analog Input shipping examples that demonstrate how to measure an analog input differentially, as you specify in (2).
    As for measuring the audio signal frequency, you may want to check out the following KnowledgeBase. The link is:
    http://digital.ni.com/public.nsf/websearch/4b08380530d72d3b86256340004c3005
    Let me know if you have any further questions or if this does not resolve your issue.
    Thanks again and have a great day!
    Chad AE
    Applications Engineer - National Instruments

  • Is there a VI availible that will allow one to interact with an analog signal

    Hello all,
     I am new to the sight and look forward to participating. I have a project that I’m working on and I would like to ask for your thoughts and direction if you’re willing. I have a few weeks left before completing an electronics program degree and Labview is one of the classes. The project I have chosen is to illustrate the differences between a micro controlled system and Labview controlled environment. I will be  acquiring a signal through a ultra sonic distance sensor. The analog signal will be produced after which  acquired  through a SCB – 68 connector block and converted using the pci-mio-16E. The sensor operates at 40 kHz emitting a 5v pulse (burst) then falling to gnd for a short period followed by a 5v rise and staying high for a period of time waiting for the return of the frequency. This time period represents 3 inches to 27 ft in distance.  I would like to interact with this signal through the distance period (portion) and output a string displaying a numeric value of the distance on the front panel obtained from an array built from different periods of the signal.  I am not clear on what Labview function offers this type of control.  I am hopeful in utilizing a vi or some type of trigger that allows me to build an array produced by some math functions.  Any help would be appreciated.
    Thank you, dhitch

    First thank you for your response, I will have an opportunity to make a capture tomorrow in class.  I believe I have run across the waveform measurement VI in my searches and am sure it’s a very good choice. The trigger VI you suggest, going by the name, should be my ticket. Would you imagine a delay or decreasing time after the capture, allowing the trigger VI time to respond to an output configuration be required?
    If I remember correctly the sampling rate capabilities are 500K samples/ second with 12 bits of resolution and as I say that it seems some of the capabilities rely on the processing speed of the computer. I guess I will kick the tires tomorrow hey.  There are 2 class periods remaining to finish our projects @ 2 hrs / class and my anxiety is a bit high. Wish me luck and thank you so much.
    dhitch

  • Measuring frequencies present in an analog signal

    Hello,
    I want to measure the frequencies present in an incoming analog pulse signal.
    I tried it as shown in the vi using ‘Extract single tone information.vi’ which was showing the value as ‘39m’ I dont understand what is this value. Can someone explain the right way of measuring the frequencies present in the signal so that I can feed them to my bandpass filter limits.
    Thanks.
    Solved!
    Go to Solution.
    Attachments:
    Measure_Frequency.vi ‏102 KB

    Hello,
    The acquired analog signal is pretty much filtered as shown in the attached image.
    Now I am collecting data for 5 seconds (collecting 2500 samples using collector.vi ) and finding the single tone frequency from it and plotting the measured frequency after 5secs in a waveform chart.
    But I am confused with these1)The original detected signal has an amplitude of above 1.6V but the measured amplitude only shows 0.6V and 2) how the waveform chart has a plot plotted over the duration of 5seconds  when the frequency is measured for every 5seconds data I mean shouldn’t  the chart has a plotted value of HeartRate plotted  for every 5 seconds.
    Can someone explain a bit about these.
    Thanks.
    Attachments:
    Freq.JPG ‏74 KB
    Frequencyplot.vi ‏94 KB

  • Synchronize Motion velocity with DAQ analog signal

    Hi Everybody
    I am acquiring analog signals using hw trigger and external clock with C and A signals of a 1024 counts TTL encoder.
    Now I want to measure the rotation speed of a shaft. I have a Flex-Motion board with which I want to read the velocity (or the same encoder), but I don't know how to synchronize each scan of the analog signals with the velocity signal for that instant.
    I can´t use RTSI bus because my Motion board doesn´t have RTSI connector.
    Software and hardware:
    LabView 6i (v. 6.0.1.b3)
    DAQ-Board: PCI-6023E, NI-DAQ 6.8.1, MAX 2.0
    Motion board: PCI-FlexMotion-6C, NI-FlexMotion 5.0.1
    Thanks a lot for your help.

    Hi chia,
    with the hardware configuration that you have, I think it´s not posible to synchronize both boards due to you cannot share the same clock source (not RTSI on the motion board).
    http://zone.ni.com/devzone/conceptd.nsf/2d17d611efb58b22862567a9006ffe76/66e6f4ee7e0848d686256a55006...
    Sorry for the delay :-)
    Regards
    DiegoM.

  • Acquire analog signal with NI PXI 1042 with RT

    HELLO,
    Do you have an example of this program ??
    I ACQUIRE a analog signal on the enter of the PXI and then i must to write it on the RT computer !!
    Thank you for your help!

    Hi,
    You can find examples in the LabVIEW "NI Example Finder". You can access it in the LabVIEW help menu. Click on "Toolkits & Modules" then "Real-Time" to find RT examples.
    Best regards.
    Benjamin
    Application Engineer
    National Instruments

  • Graphing two analog signals vs. a third with xy plot

    I am trying to plot two analog signals on the y
    axis vs. an analog signal on the x axis on an xy plot. If anyone knows how to do this or has
    an example vi showing it I would appreciate it.

    I think the best starting point for you is the XY graph.vi example. You will locate it in examples\general\graphs\gengraph.llb directory. The example that most probably matches your needs is '(X and Y arrays) Multi Plot' graph.
    Hope it helps
    Roberto
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Analog signal sound indicator

    Hi,
    I would like to have a sound indicator for an analog signal.
    I have a detecor which generates an voltage signal and I would like to indicate the strength of the signal with a sound.
    Low signal menas a low frequency sound and a high signal means a high frequency sound.
    Any hints ?
    Johan

    You mention strength of signal one place and frequency of the signal another. Strength is usually associated with an amplitude such as voltage or current or power rather than frequency. Can you clarify what you want?
    The sound output VIs can be used to generate an audio signal through the computer's sound device. You can control the frequency, amplitude, and duration of the signals you send to the sound output. So you should be able to do what you want, once you have it well defined. It may not be a pre-packaged solution, but it should not be too difficult to write oyur own.
    LynnMessage Edited by johnsold on 05-10-2007 09:17 AM

Maybe you are looking for