Making a pulse width that is independent of frequency

I'm using the arbitrary waveform generator vi to output two simultaneous signals. I need one to have a 1000 micro second pulse width that remains constant as frequency varies between 200 and 300 Hz. Can this vi do this? If not is there an example vi that can or do I have to program my own?

Hello;
You can do that with the Analog Output channels of your DAQ device. To change the frequency, you just need to change the datapoints to output on the channels. You need to come up with a subVI that calculates the necessary datapoints to be output on the analog output channels, so the width is maintained as you change the waveform frequency.
Hope this helps.
Filipe A.
Applications Engineer
National Instruments

Similar Messages

  • What is the min pulse width that can be measured using a 32-bit conter?

    what is the min pulse width that can be measured using a 32-bit conter?
    and also by chnaging the referenced Clock, can we measure as min as 10ns pulse width?

    You could measure a 40ns pulse, but not with a great degree of accuracy. Here's a good document on how counter pulse width measurements are handled:
    http://zone.ni.com/devzone/conceptd.nsf/webmain/7C77FB9EDC17C3C386256802007B8AB3
    With a 40 ns pulse, you'd have 3 counts per pulse so your uncertainty is pretty high (33%). Another way to look at it would be that you would read either 3 counts or 4 counts which would be values of 37.5ns (3*12.5ns) or 50ns depending on where the rising edges fall. So you wouldn't be able to tell the difference between a 40ns pulse and a 42ns pulse, but you would between a 40ns and a 100ns.
    Hope this helps,
    Andrew S
    National Instruments
    Message Edited by stilly32 on 09-18-2006 05:04 PM
    Getting Started with NI-DAQmx
    Measurement Fundamentals

  • How can I make the marker event pulse width longer in NI-FGEN?

    I want to generate a marker event on PF0 line using NI-FGEN.I can set the marker event pulse width but when I was trying to make the pulse width units as 65 I was getting an  error-1074115931. 
    How can I make the marker event pulse width longer without using script as I am using PXI-5412 which is not supporting Script.
    Can anyone help me out in doing the same?

    Unforunately, as you mentioned, the PXI-5412 does not support scripting mode. This will limit you to 1 marker using sequence mode. However, the PXI-5421 and PXI-5422 would allow the functionality. 
    As far as making the pulse width longer, and as the KnowledgeBase Article that you linked to discusses, I don't think it will be possible to create a marker as long as 1us - 10ms using just the Marker properties and without using scripting. You can still try to do this with property nodes and see if you can get a usable result. Start with an example such as "Fgen Arb Waveform Marker" and use the "Marker Position" value to set the start time (you would want 0 here it looks like), and then "Marker Event Pulse Width Value" to change the pulse length, but again I am afraid you will probably reach the maximum of 640 ns here. If you're not able to get this going with the property node, you will need either a FGEN card that supports scripting or another card that does Digital I/O to accomplish this. 
    Thanks!
    Stephanie S.
    Application Engineer
    National Instruments

  • NI6602 pulse width measurement: Do I have to use an external sample clock?

    Hi
    In the .NET 4 example 'MeasPulseWidthBuf_SmplClk_Cont' it is stated in the comments that:
    An external sample clock must be used. 
    Counters do not have an internal sample clock available.  You can use
    the Gen Dig Pulse Train-Continuous example to generate a pulse train on
    another counter and connect it to the Sample Clock Source you are using
    in this example.
    I have an application running without specifying an external clock. The applications is running, but I'm not sure I can trust the recorded data. Here is the channel creation code:
                    task.CIChannels.CreatePulseWidthChannel(readTaskCounter,
                                                            "ReadPulswidthTask", 25e-9, 20e-6,
                                                            CIPulseWidthStartingEdge.Rising,
    CIPulseWidthUnits.Seconds);
    task.CIChannels.All.DataTransferMechanism = CIDataTransferMechanism.Dma;
                    task.Stream.Timeout = callbackTimeoutInMilliSeconds;
    task.Stream.Buffer.InputBufferSize = 50000;
                    task.SynchronizeCallbacks = true;
                    task.Timing.ConfigureImplicit(SampleQuantityMode.ContinuousSamples);
                    task.Control(TaskAction.Verify);
    Note that I'm not specifying any external clock.
    1) Which clock is the daq using? -It is obviously using some clock since I can collect data via this task.
    2) Do I need to change the configuration to use an external clock to achieve reliable readings - as mentioned in the 'MeasPulseWidthBuf_SmplClk_Cont' example?
    /mola
    Solved!
    Go to Solution.

    Hi mola,
    That specific example is for sample-clocked pulse width measurements.  This type of measurement is only supported on newer hardware such as X Series boards and will not run on the 6602.
    Your application that you linked uses Implicit timing, meaning that the signal itself serves as the sample clock.  That is, at the end of each pulse width that you measure, the sample is deterministically latched in.  So, you end up with a buffered array of every pulse width that is seen by the counter.
    Best Regards,
    John Passiak

  • How can I configure the CTR 1 GATE to output a pulse (10us long) and then immediatel​y take a pulse width measuremen​t?

    I'm using the BNC-2120 DAQ and LabVIEW for interfacing with an ultrasonic position sensor.  The sensor is the "PING))) ultrasonic range finder."  It measures the distance from PING))) to some object directly in front of it.  It has 3 pins (5V, ground, and a signal pin).  The 5V and ground are easily taken care of with the 5V and digital ground outputs on the DAQ.  The signal (SIG) pin works in the following way:
    1) Send a 10us, 5V pulse to SIG.  This triggers PING))).
    2) Wait 200us.  PING))) takes a distance measurement.
    3) SIG outputs a square wave with a specific pulse width. 
    The pulse width varies with the distance of the object away from PING))).  I've tried using CTR 1 OUT to generate the pulse, and then using CTR 1 GATE to measure the pulse width.  However, the measurement is stuck measuring 0V because CTR 1 OUT is on the same pin!  So PING))) tries to output a pulse, but cannot due to the fact that CTR 1 OUT forces the SIG voltage to be 0V.  So I need to use just one counter I/O line to trigger and measure.  How can I do this?

    Hi Matttastica, 
    What DAQ
    card are you using? The reason I ask is that the PFI lines on some cards can be
    used as PFI lines and digital I/O lines, while on others they can only be used
    as PFI lines. The pinouts and diagrams for our cards can be found at www.ni.com/manuals. You can accomplish
    what you are looking to do if your PFI line is a DIO lines as well.
    I would
    suggest doing two tasks, one for counter output and one for counter input.
    (Note that both these are not going to be the same line). The counter output
    will be used to do a single pulse generation, while the counter input will be
    used to read back the period. 
    This will
    work because, at first, we are going to route the line from the counter output
    to the counter input line by using a ‘DAQmx connect terminals’ (basically
    making the input line an output line for a moment). First, setup the tasks and
    the DAQmx connect, start the tasks and have the counter output do a ‘wait until
    done’ to ensure the pulse is sent. After this is done, do a DAQmx disconnect
    terminals (turning the input back from an output to an input), and then do a
    DAQmx read for your counter input (period measurement). You may look at the
    shipping examples for pulse generation and period measurement in LabVIEW (Help »
    Find Examples... » Search tab … search for examples)
    One note is
    that since this is software timed, it may not be fast enough to meet your 200us
    timing. If this ends up being the case, please look at the 6552, as it can do
    per clock cycle direction change very fast.
    David L.
    Systems Engineering
    National Instruments

  • Reading a PWM and determining pulse width using a digital input pin on a NI 9425 DAQ

    Hello!
    I have been experimenting with LabVIEW for about a week now and have run into a brick wall.  I have found a fairly effective way of reading a PWM signal through an analog input and determining the pulse width.  However, it is becoming necessary for this project to do this same thing using a digital input.  I've been playing with this for about a day now and am not making much headway.
    For reference, I will be using a 9524 device
    Any ideas?

    Also, if it is helpful at all, I've attached two vi's.  One, functions just as I need it to - but it doesn't involve data aquisition.  The second should be similar to the first, but is non functional - I keep getting an error that my amplitude is zero.
    Any thoughts?
    Attachments:
    DigitalEdgeDetectionKnown.vi ‏47 KB
    DigitalEdgeDetectionRead.vi ‏148 KB

  • Triggered single pulse width measurement

    I am trying to measure the width of a single pulse, but would like to use the pulse itself as the trigger for a counter input pulse width read using a PXI-6608.  I would like to do this since the pulse can come at any time (much longer than any practical timeout)  and I would like to avoid having to place a DAQmx read in a while loop waiting for the pulse to appear.  Also, while the pulse is high, I would like to produce front panel feedback (light a boolean indicator).  I seem to be able to achieve that by using a digital input line, but again requires a DAQmx read in a while loop.  I haven't had much experience with triggers and my attempts so far appear to seem like triggers are not compatible with counter input pulse width measurement.  Is it possible to set up a trigger for a pulse width measurement?

    Hello kayotik,
    I think the best thing to do here is to use separate while loops. You can put most of your code in a main while loop, and then put your DAQmx read in a separate while loop. Both loops can run in parallel (just don't wire any outputs of one while loop to the other while loop, because then one will become dependant on the other). In order to pass data between the two loops, you will need to use a local variable. The DAQmx read can write to a local variable, and the main loop can read from that local variable. 
    You will also need to stop both loops with a single stop button. This article shows how (and also demonstrates the use of local variables to pass data between independent while loops):
    http://digital.ni.com/public.nsf/allkb/267704CDE91156D186256F6D00711AAE
    Colden

  • DAQmx Counter Input Measure a single pulse's pulse width

    Trying to measure a single pulse's pulse width. It appears that the DAQ only makes the measurement on the read command instead of after starting the task. I just get a timeout error. Is there any way to arm to counter for measurement or am I better off making a seperate thread to trigger my single pulse?
    double measured;
    int numSamp;
    TaskHandle taskHandle;
    DAQmxCreateTask("", &taskHandle);
    DAQmxCreateCIPulseWidthChan(taskHandle, "Dev1/ctr0", "", 0.025, 0.120, DAQmx_Val_Seconds, DAQmx_Val_Rising, "");
    DAQmxSetChanAttribute(taskHandle, "", DAQmx_CI_PulseWidth_Term, "/Dev1/PFI10");
    DAQmxStartTask(taskHandle);
    //Trigger the single pulse here
    DAQmxReadCounterF64(taskHandle, DAQmx_Val_Auto, 10.0, &measured, 1, &numSamp, NULL);
    Thanks,
    Dan

    Which device are you using?
    If you configure implicit timing (DAQmxCfgImplicitTiming) your measurements will be buffered and will begin when the task is started.  The minimum buffer size is usually (always?) 2 samples, but that doesn't mean you have to read two samples back.  
    Best Regards,
    John Passiak

  • Measre pulse width of a very narrow pulse

    hi,
    I have one query.
    I have to measure pulse width of a very narrow pulse , may be it is 0.1 ms
    or less . I m using the VI , which I m sending u with an attachment
    here....I m having doubt that this VI is able to measure the required pulse
    with. Sometimes It is giving wrong values too. So Plz suggest some solution
    which may fulfill my requirement.
    I need the answer at the earliest. I'll be grateful to u.
    Regards.
    GNS
    Attachments:
    Measure_Pulse_duration.vi ‏103 KB

    Hi GNS,
    If you are using an E Series card or a 660x card, you should have no problem making a fairly accurate pulse width measurement. When performing pulse width measurements, your maximum error will be +/- 1 pulse of your timebase (assuming the crystal oscillator error is negligible). If you are using a 20MHz timebase, you will have a measurement resolution of 50ns. 2000 pulses would occur to measure a 0.1ms signal. Your maximum measurement error will be roughly 1/2000.
    If you are trying to measure a mechanical source, there could be "bouncing" which will affect your effective pulse width. This is a situation in which you have several small glitches that occur before and after your main pulse. This is typical with push buttons etc. Anyway, these gl
    itches could seriously alter your measurement.
    The best way to test your measurement system is to use 1 of your counters to generate a 0.1ms pulse and have the other counter measure it with it's maximum timebase. This will indicate your accuracy.
    Hope that helps. Have a good day.
    Ron

  • In Delayed Pulse Generation vi,Problem With THE PULSE WIDTH??

    In Delayed Pulse Generation vi, I want to input a very low number for the Pulse Width while using an external timebase source. But the minimum pulse width has to be 2. Does anyone know how can I solve this problem??

    Hey 45,
    Unfortunately, there is no way to generate a pulse width smaller than 2x your external timebase.
    There is an option to create a pulse of arbitrary width of your external source if you can afford some software processing in between. What you can do is use 1 counter to measure how many source edges of your card's internal timebase (80 MHz for TIO only, 20MHz or 100kHz for TIO and STC) your external signal is. This uses pulse width measurement as the counter application. Once you know how many source edges it takes to represent your pulse, then you can use triggered pulse generation and use the internal timebase with the pulse specs set to create the exact pulse width you want (and delay) and you can use your external pulse as the trigger. Th
    is works well if your pulse is always the same width and you can measure it before hand. As an example, let's say your pulse is 20 internal timebase pulses when measured. This means you can use the pulse specs to specify a pulse width of 0.75 your pulse width by using only 15 internal timebase edges for your pulse width.
    I don't know if I was clear above or not but if you give me your exact application you are looking to achieve, I might be able to help you out. Hope that helps.
    Ron

  • Can I change the delay or pulse width on a trigered pulse on the fly in DAQmx

    In the old DAQ driver you could not change the a triggered pulse delay or pulse width on the fly of a as there was a problem in the DAQ driver or was this a hardware problem?
    Is this now possible with DAQmx , if not why not as you could do this with the old 16 bit cards in dos by updating the registers.
    This has been a major problem with NI counters timers and one would have thought that by now this problem would be fixed.We need to do this with out stopping and restarting a task.
    Any help here.
    Ta
    Colin

    Hi Colin,
    Please can you try the suggestion in this KB. hopefully it should still work with what you are doing. I can not find any information specifically on what you want to do with a triggered pulse. However this example program might give you some hints as well.
    Regards
    JamesC
    NIUK and Ireland

  • I want to create a TTL pulse. The stepper motor I'm trying to control responds to a high to low edge, when the low pulse width is greater than 0.5 microsecon​ds. What is the best way to go about creating a pulse like this?

    I'm using the NI PCI-6025E card connected to an SCB-100 wiring peripheral. I'm programming the DAQ card using LabVIEW 6.0.2 on a win95 box.
    My first attempt has yielded some surprising results.
    I created a vi with a single while loop set to true. Within that while loop is a two frame sequence. Both frames use the "Write to Digital Line.vi".
    The first frame sets the line in wire to false.
    The second frame sets the line in wire to true.
    The device channel on both frames has been set to my user defined channel nam
    e -> clock.
    clock --> sets the DIO0 channel to be digital write out.
    Using an oscilloscope and some wires I hook ground to the SCB-100's digital ground and I hook the probe to the DIO0 channel. What I see are two different pulses alternating between one another. One has a pulse width of 5ms and the other has a pulse width of about 50ms. You seem to get a grouping of one type of pulse followed by a grouping of the other type of pulse.
    Obviously this is very strange and not what I want. It is also far too slow. So I'd like to know if anyone knows how to do this properly. Remember I only need a low pulse width of 0.5 microseconds.
    Thanks,
    Any help or guidance would be much appreciated.
    Scott

    Scott,
    You don't need to use a digital line to create a TTL pulse. The PCI-6025E has two onboard general purpose counters. You can use one of these counters to create a single pulse of the desired pulse width. For an example of how to program the counters on your board, refer to LabVIEW's Search Examples>>I/O Interfaces>>Counters>>Pulse Generation>>DAQ-STC based.
    The advantage of using a counter over the digital line is that it allows you to control the timing of the pulse through hardware and not software. Thus, it is inherently faster, and the timing resolution is more accurate. The counter will count down an internal 20 MHz timebase to create the pulse delay and the pulse width.
    For more information on the hardware capabilities of your board, you can refe
    r to the User Manual online at www.ni.com/manuals.
    Hope this helps.
    Regards,
    Erin

  • How to generate and output 3 TTL square waveforms with different pulse widths using counters of NI 6034E

    Hello
    I just have a few questions.
     I am using the NI 6034E DAQ board in order to
    generate simultaneouly 3 different TTL digital signals, with different
    pulse width, and output these TTL signals to an external circuit that I
    am using for this application.
    The following pattern of the TTL pulses will look like this:
    01010101 01010101
    00110011 00110011
    00001111 00001111
    From
    what I understand,  I have to use the 2 counters, Ctr0 and Ctr1, to
    generate the TTL pulses that I desire, because the DIO lines are
    software timed only and I will not be able to produce a deterministic
    output period using these DIO lines.  Am I correct?    Also, do I have
    to use a separate counter to generate a separate TTL digital pulse.  I
    need 3 different TTL pulses and there are only 2 counters for this DAQ
    device.  The three generated TTL signals will be feed to an external
    circuit.  Concerning the hardware connections for my application, I
    assume that the generated TTL signals will be output from
    GPCTR0_OUT(pin 2)  for counter 0 and GPCTR1_OUT(pin 40) for counter 1
    of the NI 6034E. Is this correct?  Is there any way that these TTL
    signals can be output from three DIO lines(DIO0...2). 
    Here is some code that I plan to use in order to do this:
     #include <NIDAQmx.h>
    static TaskHandle gTaskHandle = 0;
    DAQmxCreateTask ("", &gTaskHandle);
    DAQmxCreateCOPulseChanTime (gTaskHandle, "Dev1/ctr0", "", DAQmx_Val_Seconds, DAQmx_Val_Low, 1.0, 2.0, 2.0);
    DAQmxCreateCOPulseChanTime (gTaskHandle, "Dev1/ctr1", "", DAQmx_Val_Seconds, DAQmx_Val_Low, 3.0, 4.0, 4.0);
    DAQmxCreateCOPulseChanTime (gTaskHandle, "?????", "", DAQmx_Val_Seconds, DAQmx_Val_Low, 7.0, 8.0, 8.0);
    DAQmxCfgImplicitTiming (gTaskHandle, DAQmx_Val_FiniteSamps, 5);
    DAQmxStartTask (gTaskHandle);
    DAQmxWaitUntilTaskDone(gTaskHandle)
    DAQmxErrChk DAQmxStopTask(gTaskHandle)
    DAQmxErrChk DAQmxClearTask(gTaskHandle)
    I believe this code should generate the 3 TTL square waveforms that I want for my application.
    Please provide me with some feedback.  It would greatly be appreciated.
    Thank You

     Hi,
    The NI 6034E is a multifuntion DAQ device, this means you have:
      (2) counters
      (8) DIO lines (software timed)
      (16) AI, single ended
      (0) Analog Output
     You have a couple choices here:
       1. Software timed digital output of all three signals, max 1khz loop rate, non-deterministic.
       2. Hardware timed digital output of 2 signals, max 20Mhz.
       3. Hardware timed digital output of 2 signals and software timed digital output of 1 signal.
       4. Find another NI MIO board such as the NI 6251. This board will do 10Mhz pattern generation for (8) DIO lines.
    For the hardware connection, you are correct, the output for the counters will be taken from pin 2 & pin 40.  Here's the pinout for the NI 6034E for reference:
    The output of the Counters can be routed to some of the PFI's or to the RTSI connector. You can see this in MAX
    Message Edited by Matthew W on 11-19-2007 01:24 PM
    Attachments:
    2007-11-19_131609.jpg ‏61 KB
    2007-11-19_132435.jpg ‏86 KB

  • How to generate a pulse train with different pulse width and delay?

    How to generate a triggered pulse train with different pulse width. for example, after each trigger signal, let's say 2 ms, then the counter output a pulse with pulsewidth of 1 ms, and then after 3 ms delay after the first pulse, the second pulse was generated with a pulse width of 4 ms.  Next cycle when the trigger signal comes, the same two pulses will be generated and so on. Is it possible to achieve this by using 6601 counter card? and if yes, how to achieve this? Thanks!

    Unfortunately you can not create a hardware timed pulse train with different widths on each pulse from a counter. Whilst it can be changed on the fly using software, since you require a hardware triggered signal getting the software involved will not give a huge amount of accuracy when the pulse will actually change.
    So in short you can't use your 6601 card (or a counter timer) to achieve this
    There are three possible Alternative solutions
    1 You could use a high speed digital IO device such as the (6533/34) to generate your variable signal which would require setting up the pulse train as a series of states based around the burst transmission mode where the clock would give you your specific timing.
    2 A timed analogy output (for example on a MIO card with a clock (PCI-6220 / 62xx), i.e. Not the 6704 style static analogy output cards)
    3 A high speed digital waveform card such as the (, 656x , 655x, 654x, 6534, 6533 (http://www.ni.com/modularinstruments/find_right.ht​m) ) this could then be scripted to work with your triggering and also there is a digital waveform editor which will enable you to set up the pattern you wish to generate (http://sine.ni.com/nips/cds/view/p/lang/en/nid/135​55) 
    Hope that helps
    Tim Matthews
    NI (UK)

  • Changing the pulse width of a counter on-the-fly - ?

    I'm seeing strange behavior when trying to change the pulse width of a
    counter while it is running continuously.  Using the property node
    I can set the DAQmx Channel Properties "Low
    Time" and "High Time" when the values are
    changed by the user (see attached VI).  The first change is
    ignored initially, but then applied when a second change is made, i.e.
    the changes are applied one step late.  If I read the respective
    properties the values are what is set but not what is being
    generated and seen on an o-scope.  I added a
    condition of watching the property "Ready For New Value" before applying the
    change, but that doesn't alter the behavior.  What am I missing?
    Windows XP
    LabVIEW 7.1
    DAQmx 7.4.0f0
    PCI-6251
    Thanks,
    DTL
    Attachments:
    GenDigPulseTrain-ChangingSpecs II.vi ‏104 KB

    Alan,
    Thanks for the reply.  I don't know if I explained in well in my
    previous post, but I'll try to confuse again: The issue is that the
    property node change is reflected on the hardware (pulse output) one
    change delayed.  Example: Start the VI with time value A. 
    The user sets the time to value B, the property node read for the time
    will read value B, but the output pulse (hardware) stays at value
    A.  Then the user sets the time to value C, the property node read
    is C, but the output is now B, and so on...
    I've worked with the DAQmx Write, as the example you pointed to shows,
    and it will work properly (reflect the change immediately on the
    hardware).  If one replaces the DAQmx Write to a Channel Property
    Node it will start working as I described above (change reflected one
    change delayed).  Note: A subtle additional change is that I have
    changed everything to Time (High, Low) instead of Frequency (Duty
    Cycle,  Frequency) - ?.  Note 2: DAQmx Write doesn't bring
    out all the properties - what if I have to use a property node? 
    Do I need to "double pump" the values?
    FWIW,
    Don

Maybe you are looking for

  • ERROR IN ESS AND MSS pages when deleting the superadmin role

    hi all According to my clent requirement i have worked with uwl for leave request.....for that i configured uwl and added uwl iview to the standard user role......after i have assigned standard user role to my manager. but' after some time they told

  • How do I open a png file?

    Cheers All, I am not seeing how to open a png file with the new Creative Cloud Pshop. I am fearing that it has been disabled by Apple or some such nonsense. My last version of shop had a right click 'open with', which I am not getting now with CC. ma

  • Lion reformat hard drive

    I want to reformat the hard drive on my MacBook Pro.  How do I load Lion?

  • Please help - Can not use stored procedure with CTE and temp table in OLEDB source

    Hi,    I am going to create a simple package. It has OLEDB source , a Derived transformation and a OLEDB Target database. Now, for the OLEDB Source, I have a stored procedure with CTE and there are many temp tables inside it. When I give like EXEC <P

  • OCI Error

    In the error, Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1291) at java.lang.Runtime.loadLibrary0(Runtime.java:470) at java.lang.System.loadLibrary(