Generate/R​ead Digital Pulse - What clock to use?

Hi,
I am using the NI cDAQ-9172 (with output module NI 9472 and input module (9421).   I am trying to generate a pulse, run it through a system (just a resistor at this point) and then read it back into labview.  I am able to generate the pulse with no problem, but anytime I try to read it I get an error regarding the clock.  Any suggestions?
Thanks,
Solved!
Go to Solution.
Attachments:
Generate and Read Pulse.vi ‏30 KB

Looks like i figured it out.  I had the clock said as hardware timed, but my hardware was wired wrong.  After I corrected the wiring it worked, so that must have been the problem.

Similar Messages

  • Generating a delayed digital pulse

    Hi,
    I have two digital inputs, read via a DAQmx assistant, one represents a one pulse per revolution, the other
    one pulse per crank angle degree (hence 360 per rev) which are generated by an optical encoder
    attached to the shaft of a small engine setup.
    What I would like to do is to output a single pulse 'n' crank angle (where n could be changed) pulses after
    the revolution pulse. The output would be via another DAQmx assistant (ideally, as this is what I have been working
    with so far). However I can only find something that will delay my signal on a time basis, rathert than sample
    basis,
    Any help appreciated.
    Sandra

    There is a point by point vi that will delay based on cycles of new data entering the vi. It holds the data value until the number of cycles is up. This might be a place to start. You can go inside this Zero-Order Hold PtByPt.vi to see how it works. This is in 7.0 format.
    Attachments:
    zero hold pt by pt.vi ‏38 KB

  • How to send/recei​ve digital pulses through parallel port?

    Hi, im working on a project to send/receive digital pulses through parallel connection. I need to control the frequency of the pulse sent as my device communicates through negative triggering of the digital pulse. How to use LabVIEW send and capture these waveforms?

    Here's a good place to start:
    http://zone.ni.com/devzone/conceptd.nsf/webmain/72​C6FC6CE4AD4D1386256B1800794596?opendocument
    2006 Ultimate LabVIEW G-eek.

  • 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

  • Generating digital pulses from the pci 6722

    I am trying to generate signals that will drive a piezoelectric motor. I need an analog signal that I will send to an amplifier and 6 digital pulses with varying offsets. I am using a pci 6722 and was hoping to get an offsets between the digital pulses to be around 2 microseconds. I am struggling  to find the best  way to get such exact time delays between multiple tasks. Any help  would  be greatly  appreciated.

    The actual offset times is not as important as the digital pulses firing sequentially and all within the envelope of the analog signal for multiple steps.  I guess my question is less about hardware limitations, and more about how execute my desired process in Labview. My experience in Labview is pretty rudimentary and I am struggling to see how to synchronize events in labview.  We are using a BNC 2110 to output our signals, and it is my understanding that the BNC 2110 has a 1 Mhz clock.  We are trying to import that clock from our device use that to clock timed loops and we are having some difficulties with the details.  I am honestly not sure if I am on the right track.  In hopes that it might add some clarity I attached a picture of the signals we are hoping to produce.  The orange signal is our analog output.  Between times t3 and t4 we need the 6 digital triggers to switch to "on" and we need them to all switch off simultaneously at t6.  Again we are definitely willing to compromise on speed if we can use the card we already have.
    Attachments:
    waveform.PNG ‏28 KB

  • Generate complement​ary digital signals with dead time between each pulse and controlled by duty ratio

    I am to generate  two complementary digital signals using NI 9606 conected by RIO Mezannine Card to NI 9683 (Half Bridge DO).
    I am able to generate the signals but I am not able to put dead time between high and low signal and also, low and high signal.
    Requirement:
    (1) When the first signal goes high and the second signal goes low, there should be a controllable dead time.
    (2) Also when the second signal goes high and the first signal goes low, there should be a controllable dead time.
    I am able to do requirement 1, but I am unable to fulfill requirement 2.
    Please have a look at my VI and let me know how to go about satisfying requirement 2.
    Attachments:
    complementary test 2.vi ‏69 KB

    Hi Frank ,
    I have already taken note of the example Tannerite has provided  and have built my vi ( attached in previous post) surrounding that example.
    Now I require to control the PWM duty cycle as you can see from the vi using a knob and that control refers to both the signal 1 and 2.
    Now the signal 1 end and signal 2 generation requires a controllable dead time. Similarly, signal 2 end and signal 1 geneeration also requires another controllable dead time.
    I am able to do either one dead time at a time using delay but not two dead time simultaneously.
    I feel that I have two put the delays at the appropriate data flow point. I am working on that.
    I would really appreciate if you could give some insight on how to solve this dead time issue and generate two complementary waveform with dead times whose duty cycle can be controlled by a knob controller in fronty panel .
    I have also posted the required timing diagram for reference as suggested by Tannerite.
    Best regards.

  • Digital external sample clock (C#)

    I am using the PCI-6225 card and trying to generate a pair of pulses using the digital lines and internal clock, but I am getting some odd/unexpected results.  Can someone explain?
    Basically what I want to do is generate a regular pulse over a (configured) set of lines.  The pulse will, typically, be 10ms wide at intervals between 900ms and 1,100ms.  The interval will only change occasionally and is usually 1 second (1,000).
    After looking at the various C# examples I created something like the following
            private DigitalWaveform[] m_digitalWaveform = null;
            private DigitalWaveform m_positiveDigitalWaveform = null;
            m_digitalTask = new Task;
            m_digitalTask.DOChannels.CreateChannel(
                "Dev1/port0/line0", "", ChannelLineGrouping.OneChannelForEachLine);
            m_digitalTask.DOChannels.CreateChannel(
                "Dev1/port0/line1", "", ChannelLineGrouping.OneChannelForEachLine);
            m_digitalTask.DOChannels.CreateChannel(
                "Dev1/port0/line2", "", ChannelLineGrouping.OneChannelForEachLine);
            // etc. ...
            // Repeat for each configured line
            double pulseSampleRate = 1000;
            int numberPulseOfSamples = 1000; // This varies between 900 and 1,100.
            int pulseWidth = numberPulseOfSamples / 100;
            int numberOfChannels = m_digitalTask.DOChannels.Count;
            m_digitalTask.Timing.ConfigureSampleClock(
                "/Dev1/Ctr1Source",
                pulseSampleRate, // 1,000 or anything!
                SampleClockActiveEdge.Rising,
                SampleQuantityMode.ContinuousSamples,
                numberPulseOfSamples);
            m_digitalTask.Control(TaskAction.Verify);
            // m_digitalTask.Done += new TaskDoneEventHandler(OnDigitalTaskDone);
            // m_digitalTask.SampleClock += new SampleClockEventHandler(OnClockSamplePulse);
            m_digitalWriter = new DigitalMultiChannelWriter(m_digitalTask.Stream);
            // Create an array of waveforms (1 per channel/line).  Each waveform being the same with the 1st 1%
            // being up and the other 99% being down.  Set the Timing interval at 1ms.
            m_digitalWaveform = new DigitalWaveform[numberOfChannels];
            m_positiveDigitalWaveform = new DigitalWaveform(numberOfSamples, 1, DigitalState.ForceDown);
            for (int sample=0; sample < pulseWidth; sample++)
                m_positiveDigitalWaveform.Signals[0].States[sampl​e] = DigitalState.ForceUp;
            m_positiveDigitalWaveform.Timing = WaveformTiming.CreateWithRegularInterval(
                                                    new TimeSpan(0, 0, 0, 0, 1));
            for (int channel=0; channel < numberOfChannels; channel++)
                m_digitalWaveform[channel] = m_positiveDigitalWaveform;
            m_digitalWriter.WriteWaveform(false,m_digitalWave​form);
            m_digitalTask.Start();
    1. First of all this only did something if the selected clock source was /Dev1/Ctr1Source.  No other clock would do, even though there are 2 clocks on the board (e.g. /Dev1/Ctr0Source did nothing).
    2. Secondly the waveform timing seemed to be ignored, e.g. leave it out or setting to something other than 1ms made no difference.
    3. Thirdly the pulse sample rate also seemed to be ignored, e.g. set it to 1 or 1,000 made no difference.
    4. Fourthly the pulse seemed to be spread over odd intervals.  Set the integer numberPulseOfSamples as follows
    NumberPulseOfSamples    Interval
    ========================================
    1,000                                9 (ish) seconds
    2,000                                18 (ish) seconds
    4,000                                36 (ish) seconds
    1,500                                6½ (ish) seconds
    3,000                                8½ (ish) seconds
    800                                   7 (ish) seconds
    Setting the number of pulse samples to a low value (500) threw an error (-200016, "device memory underflow") when stopping the task.
    Can someone shed some light on what is going on and how I can get what I want?

    I only seem able to select Ctr1Source, but this may be because (?) I have some clocked analogue input going on at the same time, so perhaps Ctr0Source is busy with this.  Unfortunately, the 2 examples of clocked digital wave forms doing a write use PipelinedSampleClock or BurstHandshake, although there are reads using a "SampleClock".  If you try to run the 2 examples you get an error
    Property: NationalInstruments.DAQmx.Timing.SampleTimingType
    You Have Requested: NationalInstruments.DAQmx.SampleTimingType.Pipelin​edSampleClock (or SampleTimingType.BurstHandshake)
    You Can Select: NationalInstruments.DAQmx.SampleTimingType.SampleC​lock, NationalInstruments.DAQmx.SampleTimingType.OnDeman​d, NationalInstruments.DAQmx.SampleTimingType.ChangeD​etection
    Task Name: _unnamedTask<0>
    Status Code: -200077
    So I guess the PCI-6225 board doesn't support them.

  • How do I count digital pulses and convert them to an x-axis unit?

    I am a grad student in Chemistry and I have undertaken a project to switch an old spectroscopic instrument from a stepper motor chart recorder to a digital interface. 
    I am using Labview 7.1.
    I just measured the signals coming from the instrument, so I know exactly what I am working with.
    I have one constant, 100mV, digital pulse--which was used to drive the stepper motor a set # of wavenumbers for a given amount of pulse. I need to convert this signal to correlate with wavenumbers--on the x-axis of my final waveform graph.
     The other signal is an analog signal, up to 250 mV, which is coming from a photomultiplier tube and represents my y-axis of my final waveform graph.
    I am using the NI BNC-2110 DAQ board. 
    Should I design the program based from just the AI Aquire Waveform.vi? Add a Count Events or Time vi. for the digital pulse?
    Could anyone give me some hints with my initial setup/layout? 

    Hints:
    Figure out what is the modle number of your DAQ device. I think the model you cited is just a break-out box.
    Depending on your hardware you may be able to use the step pulses to clock your A/D conversions.
    The number of sample will be the number of steps so all you need is a conversion factor to convert sample count totoal to wavelength.
    Others may offer better ideas so stand by.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Digital pulse on DO line

    Hi, to output a digital pulse on one of the digital output lines instead of the counter, do i just select the particular line instead of the counter for the device?
    And if i'm only generating one pulse, and idle state is low, then does it matter what i choose as my low time?
    Finally, using the Digital output DAQmx, when I write high to a line, will that line stay high until the remainder of the program (or until i write it low)?
    Thanks.

    What type of DIO are you using? If using a standard DIO-96, you can use the Write to Digital Line function from the standard DIO functions. They are easier to use than DAQmx in this case. Just wire in the device number, channel number, line number, and True to output a high or False to output a low. Once a high is written to the line, it stays high until you write a low. The timing is up to you. You can write a high, wait some time, then write a low.
    - tbob
    Inventor of the WORM Global

  • How to generate a bipolar pulse train in LabView using USB DAQ 6211?

    Hi,
    I am setting up a system to generate either a single square pulse or a train of square pulses using LabView, with controls to adjust the frequency, amplitude, number of pulses etc. I have had a lot of help from NI tech support setting up the actual VI itself which seems to be working fine, and outputting the pulses via a USB DAQ 6211 using a square waveform generator and the AO1 channel on the DAQ.
    The problem that I now have is that I need to pulses generated in a train to be bipolar (as they are connected to electrodes so need to be bipolar o avoid salt build up on the electrodes from the voltage going in one direction only, at least that is how I understand it!).
    How can I set up my LabView VI to generate a bipolar pulse train instead of always being positive voltage? I am new to this area and so am trying to learn but there is so much to learn!
    Thanks,
    spamjam

    Hi Shalini,
    Apologies for taking a while to get back to you, I hope I can explain what it is that we need to create with the pulses. I understand what you mean about the existing pulses having a positive and negative on the graph - but we need the pulses to start from a resting voltage and the first pulse to be positive, then back to zero, then the second pulse to be negative then back to zero etc. This is to do with reversing the direction of the current between two electrodes to prevent build up of salts on one electrod from the current always passing in the same direction. 
    I have attached a .Tif file to this post to try to illustrate what I mean - the top picture shows how the pulses are currently generated, then bottom on is what we would like to produce if this is possible?
    Thanks for your help,
    Spamjam
    Attachments:
    Slide1.jpg ‏38 KB

  • Using cDAQ timers to repeat a hardware-timed finite-sample pulse train clock

    Hi all,
    As part of a complex project, I must implement an acquisition hardware interface for a linear motion sensor using the Synchronous Serial Interface (SSI) output common in industrial motion control. (I have a fair bit of experience in digital electronics, but I'm new to hardware timer-synchronized digital I/O in LabVIEW.)
    To do this, I need to create a hardware-timed bursted pulse train TTL clock signal. Each burst consists of 25 high-low transitions with a full-cycle period of 2.67 microseconds (375kHz). The output must then be held high until the next burst, which occur at 1ms intervals.
    Using cDAQ timers and a NI 9401 (based on the example at http://www.ni.com/example/30256/en/), I've been able to create the pulse train burst as described (see attached VI image). Next I need to configure another timer to trigger this burst to repeat at 1ms intervals.
    Does anyone have any pointers about the best way to accomplish the hardware timing for repetition of the pulse train?
    Any suggestions of alternative strategies or observations as to the ways my noobish code is stupid or inefficient are welcome as well!
    Thanks!
    Solved!
    Go to Solution.
    Attachments:
    Hardware Timed Pulse Train Clock.jpg ‏102 KB

    Hey Ryan, 
    A picture of the behavior you are seeing would be helpful. The NI 9411 should only be reading 50 bits every 1 ms.  
    It may not be possible to read 25 bits (do you mean 50 bits? 25 high 25 low) and push it to a queue without encountering an overflow error. If you take a look at the above code the digital input will receive 50 sample clocks every 1 ms. This is equivalent to acquiring 50 points every 1 ms which is an acquisition speed of 50 samples/1 ms=50 kHz. The read loop must keep up with the 50 kHz rate otherwise the buffer will overflow. In the above example I’ve set the read to pull 5000 samples (x) with the assumption that the loop will take less than or equal to .1 seconds (y). This yields a software acquisition speed of 50 kHz (5000 samples/100 ms). If the loop speed is faster than 100ms then the 10 seconds timeout on the DAQmx read will allow for the read to block so the FIFO may be filled.
    The options available for question 2 are below. They may be used separately or in conjunction.
    Move the DAQmx Read for the NI 9411 to its own independent while loop, set the DAQmx Read to acquire 50 samples, do not graph the data, and pass the data to a Queue for processing in a consumer loop. This will increase the loop speed which may allow you to keep up with the 50 kHz acquisition speed. This may not work because the loop speed will need to be 1 ms or less.
    Increase the value of the Samples per Channel control that goes into the DAQmx Timing VI. This will increase the DAQmx Software Buffer size. This buys time until you receive an overflow error because the DAQmx Software Buffer is being filled faster than samples are removed.
    Read in 5000 sample chunks (producer loop), push this to the queue, and perform the analysis in 50 bit chunks (consumer loop). The additional queue created should allow for the acquisition loop to keep up.
    Regards,
    Izzy O.
    Product Support Engineer
    ni.com/support

  • Digital Security - What do You Think?

    Here's a thought: what if we used our own digits (ie 'fingers') to make up the digits of our passcode?
    So, while it's possible that the hacker may find one or two of our prints, they are very unlikely to find all five of them, and to guess the length of the code, or the code itself.
    And I'm pretty sure that the possible permutations will be enormous (in the order of quintillions) if we allow, say, up to 10 digits to be applied in a user specific, digital order.
    And quite difficult to run a dictionary attack on a string of one or more images, too.
    Might be of interest to percolate this idea.

    Interresting is revoking UTL_FILE from public, which is critical. Also revoke UTL_TCP and UTL_SMTP. This is going to upset an expert I know...Okay, as this is (I think) aimed at me, I'll fall for it ;)
    What is the point of revoking UTL_FILE from PUBLIC? Yes I know what you think the point is, but without rights on an Oracle DIRECTORY being able to execute UTL_FILE is useless. Unless of course you're still using the init.ora parameter
    UTL_FILE_DIR=*which I sincerely hope you're not.
    As for UTL_SMTP and UTL_TCP, I think whether a program is allowed to send e-mail to a given SMTP server is really in the remit of the e-mail adminstrator rather than the DBA.
    Look, DBAs are kings of their realm and can set their own rules. The rest of us have to live with them. A couple of years ago I worked a project where I was not allowed access to the USER_DUMP_DEST directory. So every time I generated a TRC file I had to phone up the DBA and a couple of hours later I got an e-mail with an attachment. Secure yes, but not very productive when I was trying to debug a Row Level Security implementation.
    I have worked on both sides of the DBA/Developer fence and I understand both sides of the argument. I think it is important for developers to document all the privileges necessary to make their app run. Maybe you don't have a better way of doing that than revoking privileges from PUBLIC. Or maybe you just want to generate additional communication with developers. That's fine. I know sometimes even DBAs get lonely.
    Cheers, APC

  • Gen Digital Pulse Train Finite Retriggerable - Initial Delay is only for first trigger

    The DAQmx example Gen Digital Pulse Train Finite Retriggerable has an Initial Delay parameter. It appears (6602 and an E series card) that this Initial Delay only delays the pulse generation for the first trigger. Subsequent triggers show no delay. Is this the designed behavior ? Any way to get the Initial Delay to occur for all triggers ?
    Steve

    So, yes, you are seeing the appropriate behavior. However, it is possible to get a re-triggerable finite pulse train with an initial delay. What you have to do is set up a re-triggerable pulse, and have that pulse act as a pause trigger for a continuous pulse train. Let me explain further with an example.
    1) Set up counter 0 as a re-triggerable single pulse (Gen Dig Pulse-Retriggerable.vi). Set the low time = initial delay = X, and high time = Y. The re-triggerable pulse will be low for X, then high for Y after every trigger (it applies the initial delay to the first pulse, and the low time to every pulse after the first). The trigger source is your actual trigger.
    2) Set up counter 1 as a pause-triggered continuous pulse train (Gen Dig Pulse Train-Continuous-Pause Trigger.vi). This pulse train will be the frequency of the finite pulse train you want. The pause trigger source will be the output of counter 0.
    I have attached the VIs I used to accomplish this. There are three VIs, the two mentioned in 1) and 2) and another VI I used just to monitor the signals. These could be combined to a single VI if you would like. Hope this helps!
    -Alan A.
    Attachments:
    Retrig_Finite_Pulse_Delay.zip ‏135 KB

  • Usb6211 finite digital pulse

    My first post to forum. (So hello : )).
    to the point: I want to generate a finite digital signal on one of the digital outputs of USB6211. The signal is a UART frame (8N1) (baud rate can be as low as 100 Hz).
    So I was expecting something what I did to output an analog output signal, i.e. set the rate, set the duration via setting data and runForeground ..etc, but It seems this is not supported with 6211.(am I right?)
    How can I do this? I appreciate any help.
    I'm using Matlab 2014b but I can use C functions if necessary (NIDAQmx.h)
    Thank you

    Hello,
    There are several DAQmx examples for C that come with NI-DAQmx and are located in the following location on your computer:
    Go to your Start Menu > All Programs > National Instruments > NI-DAQmx > Text-Based Code Support > NI-DAQmx ANSI C Examples > Digital. One helpful example is the WriteDigChan.c example, located in Digital > Generate Values.
    This is a great place to get started. If you have further questions, I would brouse through some of the examples on NI Community (http://www.ni.com/examples/)
    Hope this helps!
    Aimee

  • How to generate a delayed retriggerable pulse using only one counter with PXI 6070E card

    Hi
    I have a problem in generating a retriggerable delayed pulse with a single counter(triggered through a signal at gate) using PXI 6070E card. VI was developed in NI LabVIEW traditional DAQ Ver.7.1. I have used the "delayed pulse generator config" VI and a "Start counter" & "Stop counter" VIs for the purpose. But there is no output seen at the out terminal of counter. So I introduced a "wait" VI and set it to 1 sec. Now the pulse output appears but some pulses are missing mometarily after every 1 sec interval. (any solution for this)
    I have gone through a few similar requests in the forum but they suggest either to use two counters or to generate a finite pulse train which does'nt fit my application. Moreover PXI 6070E has only 2 counter timers. I am already using one counter to measure the frequency of a pulse train(signal 1). The application requires to generate a delayed retriggerable pulse for every pulse in signal 1. So I have only one counter left.
    Can I measure the frequency of signal 1 by analog means.? so that I can use two counters for pulse generation. (Signal 1 is a TTL signal).
    Request some help.
    Thanks in Advance
    Regards

    A finite pulse train (N_Pulses >= 2) does require the use of 2 counters on most of our older hardware including your 6070E.  If you're just talking about generating a single retriggerable pulse, you would only need one counter.
    Here's an example in Traditional DAQ that shows you how to set a retriggerable pulse generation (it also allows you to adjust the characteristics of the pulse on-the-fly).
    If you're writing a new program, you might consider switching to DAQmx as it supports NI's latest hardware and recent OSes should you ever need to upgrade.  Traditional NI DAQ is no longer in active development.  Here's an example of how to implement a retriggerable pulse generation in DAQmx.  You should take note that you can't use the two drivers to simultaneously talk to the same piece of hardware, although you should be able to go back and forth by resetting the Traditional DAQ driver before switching to DAQmx.
    Best Regards,
    John Passiak

Maybe you are looking for