Generating a pulse train

Hello everyone,
I'm using one counter timer from the DAQ card PCI-6014. I want to generate a pulse train with this output where I can control the number of pulses and the frequency of the pulse. The duty cycle is not important, I want to use the default value, i.e. 50%.
I have used the vi called "train_impulsion2.vi" with the following values:
-number of pulses = 10
-frequency = 1 Hz
-duty cycle = 0.5
When I connect the output from the counter timer 0 to an oscilloscope (pin 2 and pin 53), what I see is a constant 5 V for the 10 sec. I don't see the 10 changes from 5 V to 0 V as it would be expected.  No falling or rising edges are observed.
However by using the DAQ assistant with the vi "daq_assistant_pulse_train.vi", with the following numbers:
-time high = 500 ms
-time low = 500 ms
-generation mode = N samples
-number of samples= 10
I'm able to observed what I want, i.e. 10 changes from 5 V to 0 V on the oscilloscope.
How can "train_impulsion2.vi" works like "daq_assistant_pulse_train.vi"? Thanks a lot
Marc  
Attachments:
train_impulsion2.vi ‏21 KB
daq_assitant_pulse_train.vi ‏101 KB

Hello everyone,
Everything is now ok. I didn't put the correct leads inside the oscilloscope. That's why I wasn't measuring any rising or falling edges. Doh!!!!!!!!!!!!!
Marc

Similar Messages

  • Generate a pulse train using a count from a quadrature encoder as the clock

    I am trying to generate a pulse train with the same frequency as my quadrature encoder.  Every time the encoder counts, I want the pulse to go high until the next count and then go low and so on.  I am using a 6602 PCI card and a BNC 2121 accessory.

    Maybe I'm not understanding your app, but I *think* you and I are approaching it from two very different directions.
    As I understand it, you'd like to emit a pulse with each quad state change.  Then that pulse would act as a counter Source signal.  The counter will then increment on each pulse, to keep track of accumulated position.  Further, you'd use your device-under-test (DUT) as a counter Gate signal, which would buffer the position count each time there's a rising edge on your DUT.  The end result is a buffer of position values, captured at each rising edge of your DUT.
    I'm talking about a different approach to produce the same data.  You'd use 2 tasks on a M-series board.  One of them is a hardware-timed digital input task based on "change detection."  Each time one of the specified bits has a transition, your whole set of digital input bits can be captured and an internal "change detect pulse" is generated on the board.  This task should be sensitive to the DUT edges.
    The other task would be a buffered position measurement.  It would receive the reference encoder inputs and internally do quad decode and keep a running count.  The sampling clock for this task would be specified as the other task's "change detect pulse."
    Net result: on each specified edge of your DUT, you'll buffer a reference encoder position value and a digital state of your DUT.  You can choose to be sensitive to rising edges, falling edges, or (!!!!) both at once. You can also choose to be sensitive to many bits simultaneously.  These are better capabilities than you get with the 6602 alone.
    I *think* the 6220 should be ok, based on a quick overview of specs.  I assume your 3.6 MHz is the rate of ref encoder quad state changes, right?  In the approach I'm suggesting, you only need concern yourself with the rate of DUT edges which appear to be in the 10's of kHz or less.
    Gotta go for now.  Post back if any further questions.
    -Kevin P.

  • How can we generate a pulse train with variable inster pulse delays?

    I want to generate a pulse train with random inter pulse delays (100us-10000us) and the pulse width would be 50-100us. I programmed for single pulse generation using counter cfg,a for loop contaning set attribute parameters pulse spec 1 and pulse spec 2. I changed the pulse spec 1 value in every cycle
    This program is generating the pulses but not the exact values in the sense the some times the delays are more than 10 msec. As per the program the delay should be maximum 10 msec. please help me ASAP.
    thanks
    thota

    Hey Thota,
    I would suggest to take a look at the example program linked below. It shows how to change pulse specs on the fly. You have to be make sure you are ignoring a certain error when doing this.
    Pulse Train Generation with Changing Pulse Specs (PWM)
    http://sine.ni.com/apps/we/niepd_web_display.displ​ay_epd4?p_guid=B45EACE3E21756A4E034080020E74861&p_​node=DZ52328&p_source=External
    I hope this helps.
    Regards,
    Todd D.
    NI Applications Engineer

  • Generate a pulse train

    How do I generate finite pulse train of 3 pulses of 25us pulse width, pulse period (1/(7000Hz)), and retrigger the same finite pulse train every 588.23us with the PCI-6602?
    What are the externals connections?
    What is the right Labview programming?

    this can be done with the 6602 using multiple counters, but this board has 8 so you will still have many left over for other tasks.
    You will need essentially 2 tasks, one taks is a retrigerable gated finite pulse train and the other is a simple finite pulse train.
    I have done something similar using DaqMX and LV 7.0
    To create the finite pulse train, create a CO.PulseTime task, create a channel setting the high times and low times (25 microseconds)and set the low polarity. I will assume that such a pulse train is going to trigger some external event or other DAQ card. Next set the timing to be implicit and sample mode to be finite and the number of pulses to be 3. To handle the retriggering and gate properities use a channel properitiy node and select:
    StartTrigType = Digital Edge;
    Start.Retrigerable = True;
    Start.DigEdge.Edge = Rising;
    Start.DigEdge.Src = PFI number of the out from the continious pulse train.
    This last option will allow you to route the trigger from the controlling pulse trian to trigger your finite pulde train.
    Now set up a second task to put out a continious pulse train with the period equal to the total durration between finite pulse trains (~500microseconds I dont have the exact number in front of me).
    After creating these two tasks, start the retriggerable task first.
    now when you start the continious pulse train you will get a finite pulse train of 3 pulses every time the rising edge of the continious pulse train fires. Stop and start the continious pulse train using software at will but only stop the finite task when you are done. Hope this helps.
    -Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • Generating multiple Pulse Trains.

    I am trying to generate two different pulse trains. Once the first pulse train has begun I need to start the
    second pulse train approximately .69444 ms after the first has started. I am currently using the two counter channels on the NI ELVIS, but the second pulse doesn't always start after the first, but it does work sometimes. How can I fix this? Attached is my vi file.
    Thanks,
    David
    Note: Each pulse train has a 33% duty cycle.
    Attachments:
    SaO2.vi ‏91 KB

    Hello,
    Here is what I would try:
    1. Set up counter 0 to perform a continuous pulse train (see the LabVIEW example called Gen Dig Pulse Train-Continuous.vi)
    2. Set up counter 1 to perform a continuous pulse train with a digital start (see the LabVIEW example Gen Dig Pulse Train-Continuous-Dig Start.vi)
    A. Modify this example code so that the trigger source is your counter 0 output.
    B. Modify this example code so that the initial delay value of the pulse train is 0.7 milliseconds (or whatever delay you want). Create the delay with the input to the DAQmx Create Channel VI (the delay is currently set with a default of 0.00 seconds).
    What you are doing is triggering the second counter off of the rising edge of the first counter. So, counter 0 will start generating a pulse train. Counter 1 will not start until the rising edge of counter 0's first pulse has occurred. Once this trigger has occurred, Counter 1 will start (after the initial delay time of 0.7 ms has passed). You can cut and paste to put the code of the two examples together.
    Hope this works for you,
    Sam

  • Generate two pulses train with difference phase

    Hi'
    Spec:
    LW 7.1
    Daqmx
    NI PCI 6602
    freq 300kHz
    I want to generate two pulses train with two counters with a difference phase between them (change by user)
    Thanks

    Duplicated thread.
    .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  

  • How to continuously generate a pulse train with variable frequency

    Dear all,
    I am trying to use NI-USB 6259(BNC) to send Pulse signals to conduct position control of a servo motor with labview. The position control of servo motor follows these rules:
    The number of the pulse train determines how many degrees the motor rotate ;( e.g. the angular position of motor)
    The frequency of pulses determines how fast the motor rotate; (e.g. the speed of motor rotating)
    The digital determines the direction of rotation of motor (e.g. clockwise or counterclockwise)
    My question comes when I need to continuously generate a finite plus train signal in a period of time. Below is a sample:
    Time(s)
    Number of pulses
    Direction of rotation
    (1 is clockwise, 0 is counterclockwise)
    Frequency
    0-1
    923
    1
    923hz
    1-2
    3540
    0
    3540hz
    2-3
    1751
    1
    1751hz
    3-4
    2663
    0
    2663hz
    4-5
    353
    0
    353hz
    5-6
    1017
    1
    1017hz
    6-7
    3436
    1
    3436hz
    7-8
    302
    0
    302hz
    8-9
    1513
    1
    1513hz
    9-10
    570
    1
    570hz
    Here is the explanation of this table, the motor keeps rotating in clockwise direction during 0~1s. When the time reaches 1s, the motor just complete the rotation of 923 pulse signals. And then the motor starts to rotate in counterclockwise direction during 1s~2s. When the time reaches 2s, the motor just complete the rotation of 3540 pulse signals. So we can see that the rotating speed of motor in 0~1s is different from the speed in 1s~2s. Namely, the frequency of pulse signal in 0~1s is different from the frequency in 1s~2s.
    I have already use the counter output of DAQmx, it just can generate pulse signal with certain numbers and certain frequency in one time. The attachment is the vi which can generate a finite digital pulse train from a counter output channel and the frequency, duty cycle, Initial delay, and Idle state are all configurable.
    How can I continuously generate  a series of pulse train with varying numbers and frequencies during a certain period of time.
    Thank you very much for your help!
    Solved!
    Go to Solution.
    Attachments:
    Counter - Finite Output.vi ‏57 KB
    Finite output.png ‏13 KB

    Hi aacuna,
    Thank you for your reply!
    I already checked that  article.  The frequency in that Vi can change dynamically, but the method of adjusting the frequency is ‘manual’ .Below is the front panel of that Vi. When the Vi is running we can change the frequency by press the button.   
    Time(s)
    Frequency
    0-1
    923hz
    1-2
    3540hz
    2-3
    1751hz
    3-4
    2663hz
    4-5
    353hz
    5-6
    1017hz
    6-7
    3436hz
    7-8
    302hz
    8-9
    1513hz
    9-10
    570hz
    Thank you!

  • 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)

  • Generating interruptable pulse train

    I have a PCI6071E board and I'd like to use its counters (DAQ-STC) as a triggered pulse generator as follows.
    I get an 50% duty cycle pulse F ~ 10Hz (F is inaccurate). On each lo->hi edge I want to generate a train of 50 pulses using the counters.(*) If next trigger edge occurs before the train finishes, I'd like to immediately reset the current train (the output should be 0) and to start next one.
    There is an example of how to generate a finite-length train, but it fails to treat the (*) condition. As far as I understood, there is no hardware "reload" to the DAQ-STC counter. Is there another solution ?
    If it's impossible, is there any cheap dedicated counter board with an RTSI bus and an option to perform a hardware "realoa
    d" ? Any other options to solve this problem ?
    Thank you,
    Sergey.

    Hello;
    Unfortunatelly, you can't accomplish that task with the STC counter chip. The STC counter doesn't support triggering operations.
    You will need to migrate to one of the 660x counter boards so you can catch the trigger edge.
    As far as the hardware reset is concerned, there is no National Instruments device that support that operation. Once the pulse generation is started by the trigger pulse, it will run freely in hardware until it generates all pulses of the train. In case another trigger pulse comes while the pulse train is being generated, it will be ignored by the hardware.
    Regards
    Filipe A.
    Applications Engineer
    National Instruments

  • Generating two pulse trains with on a PCI 6602 (2 CWPulse)

    I am writing an application that should generate 2 pluse trains. I'am using ComponentWorks 3. I've tried to use 2 CWPulse but after configuring the 1st, i cannot start the other one because "too many controns are configured for this DAQ device".
    Do you know how to use 2 CWPulse with a 6602 device ?

    Dear Sir,
    If you need to use two CWPulse components you will not be able to set a finite number of pulses to be generated. When you set the component to produce a finite number of pulses, it actually uses two counters to perform the operation. One is used to generate the pulses and the other one is used to count the pulses that are generated. You can use multiple CWPulse components as long as the pulse type is set to continuous on both components.

  • Can the DAQPAD-6016 generate a pulse train?

    If so, what is the procedure and what pins are involved? Also, where can I find a 6016 Users Manual showing a pinout description?

    Avana,
    Greetings!
    You can find a pinout for the 6016 from this manual:
    http://sine.ni.com/apps/we/nioc.vp?pc=res&cid=14041〈=US&p_0=manual
    AND
    Yes, you can setup a pulse train. You would use the counters. If you are using LabVIEW you can go to Help >> Find Examples to help you set this up.
    Hope this helps,
    AnujD

  • PCI 6602:How can I use the digital lines of the board and in the same time to generate pulse train using a counter?

    Hello!
    My problem appeared when I tried to update my code from Traditional NI-DAQ Legacy to DAQmx.
    I am using 2 counters (counter 5 and counter 7)  from PCI-6602, to generate pulse train, and also the Digital I/O lines of the port 0 (the lines form 0 to 7). What I do in my application is that I am starting to generate the pulse train on the output of the 2 counters, and after that I am playing with the state of the digital lines.
    In traditional there was no problem using the counters and the digital lines in the same time, everything was going perfectly, but in DAQmx this is not possible.
    What happens: I start to generate pulse train on the output of the counters,  no errors encountered, but when I try to modify the state of one line of the digital port the generation of the pulse train is stopped. This is happening when I start the task associated to the digital port.
    My question is: it is possible to create a channel on the digital lines without altered the channels created for the counters?
    Another thing what I manage to see using the  "Measurement & Automation Explorer" and Test panels for PCI-6602, basically is the same thing, I generate pulse train on the output of the counter 7 and try to start a task on the digital line, but I get one error :
    "Error -200022 occurred at Test Panel
    Possible Reason(s):
    Measurements: Resource requested by this task has already been reserved by a different task.
    Device: Dev4
    Terminal: PFI8"
    Instead if I use the counter 0 or counter 1 to generate pulse train I don't encounter the same problem.
    Which resources are used by the counters 2 to 7 from the PCI-6602 board and the counters 0 and 1 do not use?
    Thank in advance for any replies!
    Ciprian
    Solved!
    Go to Solution.

    Hello Jordan, thank you for your reply.
    I am sorry but I can not see or run your example, I don't use LabView, I use Visual C++ for developing.
    Here is the code for generating the pulse train:
    GeneratePulseTrain(unsigned long ulCount1, unsigned long ulCount2)
        short nStatus = 0;
        nStatus = DAQmxCreateTask("",&m_taskHandle);
        nStatus = DAQmxCreateCOPulseChanTicks (m_taskHandle, "Dev4/count5", "", NULL, DAQmx_Val_Low, 0.0, ulCount1,ulCount2);
        if( bTriggerMode == true) // if hardware trigger is enabled
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_ArmStartTrig_Type, DAQmx_Val_DigEdge);
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_DigEdge_ArmStartTrig_Edge, DAQmx_Val_Rising);
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_DigEdge_ArmStartTrig_Src,"Dev4/PFI17" );
        //set the internal timebase
        nStatus = DAQmxSetCOCtrTimebaseSrc(m_taskHandle,"Dev4/count5","20MHzTimeBase" );
        nStatus = DAQmxStartTask(m_taskHandle);
        return nStatus;
    And the code where I try to set the digital line:
    SetChannelState(short nState)
        short nStatus = 0;
        uInt8 wrtBuf0[1]={0};
        nStatus = DAQmxCreateTask("",&m_taskHandle);
        // Configure line as output 
        nStatus = DAQmxCreateDOChan (m_taskHandle, "Dev4/port0/line0", "", DAQmx_Val_ChanPerLine);
        nStatus = DAQmxStartTask(m_taskHandle);
        wrtBuf0[0] = nState;
        nStatus =DAQmxWriteDigitalLines (m_taskHandle, 1, 0, 0, DAQmx_Val_GroupByScanNumber , wrtBuf0, NULL, NULL);
        nStatus = DAQmxWaitUntilTaskDone(m_taskHandle,10);
        nStatus = DAQmxStopTask(m_taskHandle);
        nStatus = DAQmxClearTask(m_taskHandle);
        m_taskHandle = 0;
        return nStatus;      

  • On E series Card with 2 counters I want to generate a fixed length pulse train and want to continuously monitor it.

    On E series Card with 2 counters I want to generate a fixed length pulse train and want to continuously monitor it.

    Depending on the software you are using, there are many shipping examples and example programs on the web that illustrate generating a finite pulse train. The E series boards have the DAQ-STC counter/timer chip, and so make sure you search for DAQ-STC examples. I have included links to a LabVIEW example and Measurment Studio Example in Visual Basic.
    Generate finite pulse train in LabVIEW.
    http://eagle.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3DA2156A4E034080020E74861&p_node=DZ52328&p_submitted=N&p_rank=&p_answer=&p_source=Internal
    Generate finite pulse train in Visual Basic with Measurement Studio
    http://eagle.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3D96156A4E034080020E74861&p_node=DZ52328&p_submitted=N&p_rank=&p_answe
    r=&p_source=Internal

  • How can I generate synchroniz​ed pulse trains with 6602?

    Hi,
    I would like to generate multiple pulse trains with different frequencies with the 6602 TIO card. Currently I am able to generate pulse trains with different frequencies. But is there any way to synchronize all the pulse trains? For example, I'd like to have all pulse trains with their first low-to-high at the same moment.
    Thanks!
    Dan

    Dan,
    Absolutely, the NI-TIO chip on the PCI-6602 supports a start trigger. If you configure all of the counters that are generating a pulse train to use this start trigger, they will be synchronized. The example Generate Pulse Train - Start Trig (NI-TIO).vi demonstrates this process for one counter. In LabVIEW 7, this example can be found in the following location:
    Examples >> Hardware Input and Output >> Traditional DAQ >> Counters >> NI-TIO
    You will need to add code for the other counters, but this example should give you the general idea. Furthermore, this example demonstrates how you can use one of the digital lines to generate the start trigger.
    Good luck with your application.
    Spencer S.

  • How can I generate pulse trains whenever the value of the gate changes?

    I need to generate pulse train both at the rising edge and falling of the gate signal. My DAQ board has only two counters.
    Have a nice day,
    Jun

    Jun;
    As your DAQ board has only two counters available, I'm assuming you are working with either one of the E-series board or SMIO boards.
    If that is the case, your board doesn't have the capability of generating triggered pulse trains. And that is what you need.
    You will need to use the 660x family instead. Those boards have the trigger pulse train capability. Regarding the second part of your application; none of the DAQ boards has the capability of triggering a pulse train generation at both rising and falling edges of the same trigger pulse. You can configure either as rising or falling edge of the trigger pulse. Then, to accomplish wath you need, you will need to configure two counters, both having the same trigger pulse triggering a pulse train gen
    eration, and one configured to trigger the pulse train at the raising edge of the trigger pulse and the other to trigger at the falling edge of the trigger pulse; then have an external OR Gate which the two inputs are the outputs of those two counters.
    Hope this helps.
    Filipe

Maybe you are looking for