DAQmx: Gating Pulses with Pause Trigger

I have an NI 9401 module in a 9171 chassis and would like to gate the output of one counter with the output of another counter. Counter 1 (the signal to be gated) generates a 3 Mhz signal and Counter 0 (the gate) generates a 10 Hz signal that is externally routed to Counter 1's Gate pin. I expected this would gate Counter 1's signal to produce the 3 Mhz pulse only when Counter 0 is high, but the wiring had no affect on the output of Counter 1, it still generated a continuous 3 Mhz pulse train.  I found that some code is needed to get a counter to pay attention to the signal at its Gate pin (this post was particularly helpful) and that this can be done with the Pause Trigger property node. After setting up the node, however, I ran into this error:
Error -20124 occured at DAQmx Start Task.vi:2
Lines 4 to 7 of this port are configured for input. Cannot configure these lines for output at this time.
I'm pretty perplexed by this.  The problem seems to be coming from trying to designate PFI 5 ("CTR 1 Gate" on the 9401) as the Pause Trigger source.  If anything, I would think the error would be that lines 4 to 7 are configured for output, since those lines are grouped under CTR 1 which is configured as a CO channel to generate the 3 Mhz pulse train, and that setting line 5 as the Pause Trigger source is changing the configuration to an input.  Searching for this error in the NI forums and Google doesn't pull up any troubleshooting information.  I've tried to create a task to configure line 5 as a seperate digital input channel, but then I get the opposite error (Error -200125) saying that lines 4 to 7 are configured for output and cannot be configured to input, to make things more confusing.
Any thoughts would be appreciated.  I'm concerned that I'm missing something obvious about gating pulses or configuring CO channels since I keep reading that one of the advantages of DAQmx over DAQ Legacy is that it makes signal routing easier.  I'm using LabVIEW 2012 (32-bit) with DAQmx 9.5.5 installed.
Solved!
Go to Solution.
Attachments:
Simple_Gated_Pulse.vi ‏29 KB

Hi agoncalves,
I took a quick look at your VI and I see two immediate problems:
1.  There is not guarantee that both tasks will reserve before either one starts.  This explains your error and why it seems confusing.  The 9401 is nibble configurable but you can't change the direction while the device is in use (why the reserves are important).  The module powers up with both nibbles set to input.  Your first task drives an output so it switches direction on one of them.  When your task is committed (started) it locks in that configuration.  The second task then tries to also drive an output but on the other nibble which is input and cannot be switched because the first task is running.  The solution is to use the error wire to force the execution order (or use a flat sequence structure).
2.  You'll run into problems with your gating signal unless you wire it into a separate input (and put both pulse trains on the same nibble).  You can change that by setting the channel property CO.Pulse.Term.  That's if you want to route your signal through some external circuitry and back in.  If you are using the signal directly, you could just use it internally.  Such as /cDAQ1Mod1/ctr0InternalOutput

Similar Messages

  • Read analog trigger signal gated by digital pause trigger

    Hi!
    I want to use and analog trigger together with digital pause trigger. At the same time i want to see on the scope the analog trigger signal which was gated by gate signal. Is it possible? Can i somehow wire the gated trigger to one of the outputs of the board?
    Thanks in advance.
     

     Hi Sergei_phys,
    Thank you for the forum post!
    I have a few questions about your post:
    What hardware are you using? Is it NI or 3rd party? You mention using a scope, is that a NI piece of hardware/module?
    In theory you can have a analog trigger to start the acquisition and a digital trigger to pause , but it depends of the hardware.
    Thanks,
    DanC12
     

  • Generate a delayed pulse with analog trigger

    I want to generate a pulse with counter when the gate of counter receives a voltage value which is generated by analog output chanel,is this possible??
    I am using PCI-6713
    Thanks!!

    You can generate a triggered pulse in a counter by sending a signal to the gate from the Analog output, as long as such analog output meets the operational contitions of the counter of the PCI-6713. Just make sure that the signal does not exceed 5V. The trigger on the gate pin will be taken as low from 0 to 0.8V and as high from 2 to 5V.
    Thanks for contacting National Instruments!

  • Edge counting with digitial pause trigger

    Hi
    I should write a program for edge counting with digital pause trigger in visual basic.  I have found an example of using pause trigger in edge counting but it is written in C#.
    Steps in the program followed is:
    1) creating task
    2) creating count edge channel objecy
    3) configuring thr trigger ( where i have been strucked)
    code in c # is:
    taskname.triggers.pausetrigger.digitalleveltrigger ( source, level)
    When i tried to look for trigger function and to configure it in Visual Basic, I have not found any trigger function to set/configure in the function library
    Thanks

    Hi there,
    Here is the code in text format.  That's pretty much all you need.  I took the example code called CntDigEvents.vbp and added the following code before the start task function call:
        DAQmxErrChk DAQmx.DAQmxSetPauseTrigType(taskHandle, DAQmx_Val_TriggerType6_DigLvl)
        DAQmxErrChk DAQmx.DAQmxSetDigLvlPauseTrigSrc(taskHandle, "PFI0")
        DAQmxErrChk DAQmx.DAQmxSetDigLvlPauseTrigWhen(taskHandle, DAQmx_Val_Level1_High)
    As for the C# code I am not familiar with C# so I don't think I can be a great help on that one.
    myTask.Triggers.PauseTrigger.ConfigureDigitalLevelTrigger(triggerSourceTextBox.Text, gateLevel)  This function is the main call for the pause trigger and all it is doing is setting the properties.  triggersource should be along the lines of "PFI0" or "Ctr0" and gate level defines whether the gate level is "high" or "low)
    How is the VB code going?
    AdamB
    Applications Engineering Team Leader | National Instruments | UK & Ireland
    Attachments:
    VBcode.txt ‏4 KB

  • Use of Impact Test with SW Trigger(DAQmx) vi

    Hello,
    I working on modal analysis (with hammer) and so I am trying to use Impact Test with SW Trigger(DAQmx) vi but I don't get signal of the acceleration (should be acquire as voltage), whereas I get the impact. And when I impact the beam I have an error message which says the sampling frequency should be more than 0.
    thanks for your help

    Hi,
    Can you check the "physical channels (stimulus and response)" input to ensure that you have at least 2 signals? I get this error when I am selecting only one channel.
    Hope this helps,
    Charlotte F. | CLAD
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> "Du 11 octobre au 17 novembre, 2 sessions en parallèle : bien démarrer - approfondir vos connais...

  • How to use Counter/ti​mer PWM Pulse as a trigger to aquire data??

    I posted this question on the Counter/timer BOARD, but i got no replies. So i decided to post it here.
    (1) I'm using the NI DAQpad 6015 multi-function card with the DAQmx Driver. I'm using the counter/timer (counter 0, and counter 1) to generate 2 different PWM pulses to supply my sensor circuit. each pulse is a 1 second in duration. The pulse with 5m.sec duty cycle is the supply for my sensor. (Imanaged to generate the required pulses). 
    In addition to that  I'd like to use the 5 m.sec as a trigger to aquire the sensor reading. The DETECTIN POINT should be the middle of the HIGH State of the 5m.sec pulse (i.e just after the 2.5 m.sec point of the high state). Detection takes place only at the HIGH State of the pulse. How Can i read my sensor voltage for this limited duaration (2.5 m.sec) each time the pulse is high.
    (2) another point is: how to display the counter/timer pwm output pulses on the front pannel?? 
    Attached is the VI i'm using (Complete PWM.vi), and the pulses diagram
    regards,
    Attachments:
    Complete PWM.vi ‏49 KB
    pulse.JPG ‏10 KB

    This question has been replied to on this other post.
    Thank you,
    Raajit L
    National Instruments

  • How to use Counter/timer PWM Pulse as a trigger to aquire data??

    (1) I'm using the NI DAQpad 6015 multi-function card with the new DAQmx Driver. I'm using the counter/timer (counter 0, and counter 1) to generate 2 different PWM pulses to supply my sensor circuit. each pulse is a 1 second in duration. The pulse with 5m.sec duty cycle is the supply for my sensor. In addition to that, I'd like to use the 5 m.sec as a trigger to aquire the sensor reading. The DETECTIN POINT should be the middle of the HIGH State of the 5m.sec pulse (i.e just at the 2.5 m.sec point of the high state).  
    (2) another point is: how to display the counter/timer pwm output pulses on the front pannel?? 
    Attached is the VI i'm using (Complete PWM.vi)
    regards,
    Attachments:
    Complete PWM.vi ‏49 KB

    Hello alaali,
    It sounds like what you need is a trigger delay property node.  This property node specifies an amount of time to wait after the Start Trigger is received before acquiring or generating the first sample. This value is in the units you specify with Start.DelayUnits.  This way you can still acquire using the trigger, and you can specify the delay to be 2.5 ms so that the point that you actually acquire will be 2.5 ms after the trigger.
    Hope this helps.
    Regards,Message Edited by Raajit L on 04-23-2007 04:34 PM
    Raajit L
    National Instruments
    Attachments:
    DAQmx Trigger Delay.jpg ‏6 KB

  • Logical multiply instead of pause trigger

    Hello all!
    Can some one help me with gating counter with another one,
    i want to produce modulated timebase, first counter generate pulses in continuous mode, and another one does the same, but with lower frequency,
    for example f1 = 20Hz, f2 = 0,1 Hz. The first counter gated with another one, are there any option to temporary stop counter1 when counter2output is in logic low state, i want produce timebase OUT = [ctr1out] [logical multiply] [ctr2out], not pausing.
    Alexander.
    Solved!
    Go to Solution.

    Hi AlexanderRyabov,
    If you would like to produce a modulated timebase you should be able to achieve this by connecting the outputs of counter 1 and counter 2 to the source and gate of a third counter. The low frequency counter would be connected to the gate and would act as the enable/disable signal for the high frequency counter that is connected to the source. The result would be when the low frequency counter pulse is high, the counter 3 output will exhibit the high frequency counter pulses from counter 1 and when the low frequency counter pulse is low, the counter 3 output is low for the duration of the gate's (counter 2) low pulse. This is equivalent to a logical multiply of the two counter signals.
    Here is a link on how to route the outputs of two counters to the gate and source of a third counter on the board you are using:
    http://zone.ni.com/devzone/cda/epd/p/id/2109
    I hope this information helps!
    Regards, 
    James D.
    Applications Engineer
    National Instruments

  • Create pulse with 6542 card

    Hi just wondering if you can create output pulses that are in sync with a clock in signal input (all TTL) with the 6542 PXI card?  For example control the pulse width and delay with reference to an input clock signal?  If so any examples, thanks.

    Hey svt4cobra6,
    Do you need the 1 ms pulse to go out on a PFI line? If not, I would recommend using one of the data lines on the 6542 to create your pulse. As smercurio_fc mentioned earlier, you can use the Example Finder, and browse by task, then go to the Hardware Input and Output -> Modular Instruments -> NI-HSDIO (High-Speed Digital I/O) folder. Here is where you can find a lot of examples specific to the HSDIO device you are using. For your application, it sounds like you want to do both generation and acquisition, so check out the folder that says Dynamic Generation and Acquisition. One good one you could use to kind of simulate the device you will eventually hook up is the "Dynamic Generation and Acquisition - Source Synchronous". This example is probably not going to do exactly what you need it to do, but you can get some ideas from it, like how to export a clock with your data, or input a clock from your DUT, and how to use a trigger for when to acquire data.
    Now this source synchronous example uses Strobe as the Acq clock, but if you want to generate data based on an external clock, you will probably want to check out the "Dynamic Generation with External Sample Clock" example (found in the Generation -> Non-Scripted folder). If you are basing your pulse off of an external trigger and an external clock, you should check out the Specifications (Start -> Programs -> National Instruments -> NI-HSDIO -> Documentation -> Specifications) of your device for the Delay from trigger to digital data output, to make sure you can account for this if you need to.
    For the acquisition of your serial data, that also has a chip enable, you could check out the Dynamic Acquisition Hardware Pause Trigger, if you want to acquire data when your chip enable line is high, and then not acquire (or pause acq) when that line goes low.
    Now back to my recommendation for using the data lines as your pulse generator instead of a PFI line, you can use the onboard clock rate, let's say you use the max rate of the 6542, which is 100 MHz, which will generate samples every 10 ns, you can generate 0's until you are ready to output your 1 ms pulse, and then you would generate 1's, as many as you need for your 1 ms. I'll let you do the math. If you don't want to "oversample" this much, then you can slow down your clock rate to maybe 10 times your 1 ms pulse, which you would then output 10x "1's" for your pulse, and then however many 0's before and after your pulse. So basically all you are doing is using data (0's and 1's) to build your pulse. You could also use the Digital Waveform Editor to help you do so. One advantage of using a data line to generate your pulse is that you can vary the pulse width by adding or removing 1's, and when you are running at 100 MHz, you can get 10 ns steps of how much you want to change your pulse width.
    Again, there will probably not be a specific example that does your exact example, but by using bits and pieces of the existing examples, you should be able to figure out which functions you will need to do what you want. Finally, if you are just getting started, I recommend not only looking at a bunch of the HSDIO Example programs, but also the NI Digital Waveform Generator/Analyzer Help document (or the online version), as there is a ton of great information in there about your HSDIO device, like how it works, what features it has, and how to program it. I hope this helps. Please let us know if you have any further questions or concerns. Thanks, and have a great day.
    Regards,
    DJ L.

  • Does "pause trigger" have a status flag?

    Hi,
    I am using a BNC2110 with PCI6133 multifunction DAQ card. I am reading random analog voltage pulses on one channel for now, and using the "Pause Trigger" properties (on trigger property node) so that the read task only takes in samples from the pulses, and not samples of the baseline noise between pulses.  This works ok. But is there a way of signalling when the pause trigger has actually started and stopped (at the rising and falling edges of a pulse, respectively)? I want to use these signals to index the collected data so that I know where in the data any one pulse starts and ends, and so keep all pulse data separate, but in one array.
    Many thanks,
    Oliver.

    Hi Oliver
    One thing you could do it to look for a timeout error to flag when a pause occurs. The time-out error code is -200284. If you set the timeout value to the minimum (1) you can keep checking for the timeout and set a boolean to true when a timeout occurs. So if the boolean is true you know you have a pause, if the boolean is false you know you are reading in the signal.
    I have adapted the vi that you posted to do this and attached it below.
    I hope this helps
    Thanks
    Beejal S
    NI UK & Ireland
    Attachments:
    ai_with_analog_pause_trigger_flag.vi ‏44 KB

  • Is a physical gate connection required to produce a gated pulse train?

    I am trying to produce a gated pulse train with traditional Ni-DAQ. I am confused about whether the output of one counter needs to be physically connected to the gate of the second counter. If not, what directs the gating pulse train to the gate of the outputting counter? The NI-6036 is being used for this.
    Thanks,
    Peg

    Hi Peg-
    The answer in your other thread should be quite helpful.
    Thanks!
    Tom W
    National Instruments

  • Multi-buffered acquisition with digital trigger

    I have a PCI-MIO-16E1 and I need to do three channel (250KHz/channel - ~400 scans/trigger) multi-buffered acquisition with digital trigger (trigger => 30 Hz).
    I could not find any example of multi-buffered acquisition. Could anybody help me?

    Hello,
    I assume that you are refering to a retriggering setup where each time you recieve a trigger you take 400 samples on each channel at a rate of 250kHz per channel (total scan rate = 3CH * 250kHz = 750kHz).
    In order to keep the system hardware timed you can use the two counters on the board to produce a retriggerable pulse train that will act as your scan clock. For example each time the counter recieves a trigger it will output a clock signal of 750kHZ with 400 or so pulses in order to take ~400 scans/trigger.
    This clock signal can then act as the scan clock for your 3 channel analog input operation.
    Now we have to figure out how to set up the retriggerable pulse train from the counters and have the analog input use the counter output as a sca
    n clock.
    Good thing there is an example that is already written
    http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/aab61e455564a04d862568930018e725?OpenDocument.
    Good Luck.

  • AO Generation using Pause trigger

    Hi all ,
    I'm trying to do an Analog Generation with my X-Series NI-6356 DAQ ,
    My problem is that I want to make 5 tests each one with 200 points that reflects as a linear wavee for the AO.
    I'm using  DAQmxWriteAnalogF64 but this command is too slow 100 ms over USB!
    And I don't have that time.
    So I Want to use a Pause trigger.
    I'll set a buffer of 1000 points and I want to make 5 tests:
    test 1 - AO of 1-200 from the buffer
    test 2 - AO of 200-400 from  the buffer
    test 3 - AO of 400-600 from  the buffer
    test 4 - AO of 600-800  from  the buffer
    test 5 - AO of 800-1000 from f the buffer
    my questions are :
    1. Is it possible ?
    2. Is there any example I can use ?
    Kobi Kalif
    Software Engineer

    Kobi-
    Can you post some pseudo code so that I can get a better understanding of your intended program?
    Thanks,
    Sean
    Applications Engineering Specialist - Semiconductor Test
    National Instruments

  • How do I generate a pulse with a user specified puse duration, down time and repitition, and then out put to a graph?

    How do I generate a pulse with a user specified puse duration, down time and repitition, and then out put to a graph and then to daq ports? 
    I used lab view in engineering class, but that was the extent of my usage and after fiddling around in lab view and looking on the web looking for solution, I could not produce desired results.  My professor wants me to produce something that will output a pulse for a specified duration, then downtime for another specified duration and then repeat the process a specified amount of times.  
    I am using labview version 7.1
    Thanks in advance.

    Hello,
    Are you using hardware (DAQ card) to generate this pulse or are you planning on doing this all in software.  If you have a DAQ card in LabVIEW you can go to Help » Find Examples and then select Hardware Input and Output » DAQmx » Generating Digital Pulses » Gen Dig Pulse Train-Finite.vi.  This will use a counter from your DAQ card to generate a finite number of pulses at a specified frequency and duty cycle.  Give this a try, or let me know if you are not using hardware, and we can figure something else out.
    Regards,

  • Generate pulse with NI-6024

    Hi,
    can I generate defined pulses with the NI-6024 Card? I'd like to generate 100 Pulses with 0.27 Hz frequency.
    I'm using LabView 7.1
    Yves

    You can add the attached vi between the 'Frequency control and the DAQmx function in 'Gen Dig Pulse Train-Finite.vi' in the examples. This will change the frequency slightly to one that will work. You can add a local variable for the 'frequency' control to see what it changed to. You have have to increase the number of visible decimal places to see the change.
    Randall Pursley
    Attachments:
    Set Frequency.vi ‏14 KB

Maybe you are looking for

  • Why can't I stream my audio to my apple tv and airport express' from my iphone 5?

    I want to walk in my door and have music throughout the house from my phone seamlessly, wake up to my phone alarm and have it continue with a play list that fills the house. If I could get my Hue lighting to sync with my audio alarm or an itunes alar

  • Oracle Intermedia Search in jsp files

    I am using Oracle Intermedia for search ".jsp" files. Actually i am storing the files on a bfile column and passing the bfile to a stored procedure which atually reads and highlights the given search keywords in the ".jsp" files. Problem here is that

  • Time Base / Carry Forward / Copy Last years balances

    Hi Experts, Can anyone throw light on how would the TIME=BASE function as used in the script below help in carry forward ? Is the below syntax correct ? *XDIM_MEMBERSET DATASRC=%MyDataSrc% *XDIM_MEMBERSET TIME=BASE,%TIME_SET% *XDIM_MEMBER ACCTDETAIL=

  • Data not getting fetched bacause of index getting used

    Hi, I am selecting data from employee table having index on emp_id. Select * from employee where emp_id=101 After executing Query doesnt show any data. but after executing like this Select * from employee where trim(emp_id)=101 --so index not getting

  • HOST command malfunction

    In a Forms 5.0 program I need to take the filenames of all files included in a folder having a specific extension. I choosed to use HOST command to create a text file with these files (dir *.xxx /b > filename.txt) and later read this file using TEXT_