Implicit counter and sample clock together

Hi,
I am using Labview with a NI DAQPad-6015 to measure temperatures (4 thermocouple channels) and control via a duty cycle (at constant pulse frequency).
The VI I built contains a sample clock for setting measurement rate and an implicit timer to drive the "pulse frequency counter output".
In this way, the measurement rate is slowed by the implicit timer (I guess, as the measurement VI alone runs with the properly timing).
How to overcome this matter?
Thanks in advance
Gianluca 

here is the VI I built for acquisition and control.
The bottom loop acquires and sends signals, while the top loop averages measurements and write all into a file.
Freq_duty_cycle.vi allows me to change on the fly both frequency and duty cycle of pulse.
HBridge.vi is the control for a H bridge I drive to invert current direction to a load. 
Attachments:
HBridge.vi ‏12 KB
temp_acq_4channels_peltier_control_Hbridge.vi ‏71 KB
Freq_duty_cycle.vi ‏14 KB

Similar Messages

  • Aggregate devices and sample clock sync

    Hi All,
    Finally got the 2.8 8 core Mac Pro and am wondering how easy it is to sync multiple interfaces with sample accuracy. Would word clock be the route to take ?
    Has anyone done this with 2 devices from different manufacturers ?
    Btw, no cpu spikes here. Everything runs smoothly.... however , everything is all Apple.
    Cheers !!

    Hi,
    I just had a terrible time with a TC Konnekt 24D on brand new MacPro. Let down by really awful drivers but a lovely piece of kit otherwise. How do the m-audio drivers fare? I'll be using it with a Yamaha 01v96 v2 mixer, world clock delivered through the lightpipe itself but there is also a separate connection.
    Do you have firewire conflicts say with a FW iSight or FW Printer/Scanner?
    30/03/2008 09:08:20 kernel ential FireWire workloop deadlock!
    30/03/2008 09:08:20 kernel Naughty cmd is a IOFWCompareAndSwapCommand

  • Counter Output as Sample Clock of Digital Signals

    I have a situation where I need to use a hardware counter as sample clock of digital output signals.
    How do you specify the "Counter Internal Output" signal as a sample clock of digital output?
    I want to do something like this:
      // Create counter task
      CNiDAQmxTask m_Task(_T("ATask"));
      m_Task.COChannels.CreatePulseChannelTicks(_T("Dev1/ctr0"), "", _T("20MHzTimebase"), DAQmxCOPulseIdleStateLow, 0, 10, 10);
      m_Task.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger("PFI0", DAQmxDigitalEdgeStartTriggerEdgeRising);
      // Create digital output task                     
      CNiDAQmxTask m_Task2(_T("ATask2"));
      m_Task2.DOChannels.CreateChannel("Dev1/port0/line0", "", DAQmxOneChannelForAllLines);
      m_Task2.Timing.ConfigureSampleClock("XXXXXX", 0, DAQmxSampleClockActiveEdgeRising, DAQmxSampleQuantityModeFiniteSamples, 400);
    How do I specificy "counter 0 Internal Output signal" instead of "XXXXXX" above, i.e. the sample clock of the digital output signal. Can't find the name of the signal anywhere in the documentation and help files. I have a 6259 DAQ board. 
    /pek

    Thank you for your answers, but I can't get it to work.
    When I use "ai/SampleClock" as sample clock everything works correct. When I try to use a counter as sample clock the task completes imediately, before any digital signals has been sent/measured. The task even completes before I have started the trigger, which is very confusing. No error appears.
    I think that something is wrong about how I setup the counter. I use the code below:
    // Create counter task
    CNiDAQmxTask m_Task(_T("ATask"));
    m_Task.COChannels.CreatePulseChannelTicks(_T("Dev1/ctr0"), "", _T("20MHzTimebase"), DAQmxCOPulseIdleStateLow, 0, 100, 100);
    m_Task.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger("PFI0", DAQmxDigitalEdgeStartTriggerEdgeRising);
    // Create digital output task
    // The code below works with "ai/SampleClock" as sample clock
    CNiDAQmxTask m_Task3(_T("ATask3"));
    m_Task3.DOChannels.CreateChannel("Dev1/port0/line0", "", DAQmxOneChannelForAllLines);
    m_Task3.Timing.ConfigureSampleClock("Dev1/Ctr0InternalOutput" /*"ai/SampleClock"*/, 0, DAQmxSampleClockActiveEdgeRising, DAQmxSampleQuantityModeFiniteSamples, 400);
    // Create samples
    CNiUInt32Vector ui_data;
    for(int i = 0; i < 200; i++)
      for(unsigned int j = 0; j < 2; j++)
        ui_data.Append(j);
    // Create digital writer
    CNiDAQmxDigitalSingleChannelWriter m_writer3(m_Task3.Stream);
    m_writer3.WriteMultiSamplePortAsync(true, ui_data);
    // Wait until task completes
    m_Task3.WaitUntilDone(-1);

  • Link Recipe Group counter and Operation

    Hi,
    I need to develop a report where selection screen will have "recipe group", "group counter" and "plant" and want to extract operation details for that group and counter.
    Please tell me the table / field name where I can see Group/ Group Counter and Operation details together. (In PLPO group counter is not available and other fields like "Group of the referenced task list" and "Refer. group counter" is appearing blank; value in field "node" is not the value of "counter").
    Also let me knwo the table where operation classification (KLAKZ) indicator is maintained.
    I am trying to extract operation classification (class type 019) values for a recipe group and counter.
    Regards,
    Abir.

    hi .
    Please find following tables related with routing
                         MAPL                    Allocation of task lists to materials
         PLAS                    Task list - selection of operations/activities
         PLFH                    Task list - production resources/tools
         PLFL                    Task list - sequences
         PLKO                    Task list - header
         PLKZ                    Task list: main header
         PLPH                    Phases / suboperations
         PLPO                    Task list operation / activity
         PLPR                    Log collector for tasklists
         PLMZ                    Allocation of BOM - items to operations
    Regards
    SANIL

  • Buffered event counting. Why can't I explicitly sequence generating the Sample Clock Pulse and reading the counters?

    At irregular occasions I need to grab counts from several counters, and buffering the counts must be done simultaneously for all counters. I'm modeling my approach after zone.ni.com/devzone/cda/tut/p/id/5404 which someone kindly pointed out in an earlier thread. However, that example only uses one counter, and you can't test the synchronization with only one counter, so I am using two counters configured the same way, and they're wired to a single benchtop signal generator (for example at 300 kHz).
    What I want to do, I can test in a loop with a somewhat random wait in it. I want to drive a hardware digital output line high for a few ms and then low again. The hardware line is physically connected to terminals for my timing vi's Sample Clock Source and so will cause them to buffer their counts for later reading. After I pulse this line, when I know new good buffered counts await me, I want to read both my counters. If their bufferings are simultaneous, then each counter will have counted the same number of additional counts since the last loop iteration, which I can check by subtracting the last value sitting in a shift register and then subtracting the two "additional counts" values and displaying this difference as "Diff". It should always be 0, or occasionally +1 followed immediately by -1, or else the reverse, because buffering and a count could happen practically at the same moment.
    When I do this using a flat sequence to control the relative timing of these steps, so the read happens after the pulse, the counters often time out and everything dies. The lengths of time before, during, and after the pulse, and the timeout value for the read vi, and the size of the buffer and various other things, don't seem to change this, even if I make things so long I could do the counting myself holding a clipboard as my buffer. I've attached AfterPulse.vi to illustrate this. If I get 3 or 10 or so iterations before it dies, I observe Diff = 0; at least that much is good.
    When I use two flat sequences running in parallel inside my test loop, one to control the pulse timing, and the other to read the counters and do things with their results, it seems to work. In fact, Diff is always 0 or very occasionally the +/- 1 sequence. But in this case there is nothing controlling the relative timing such that the counters only get read after the pulse fires, though the results seem to show that this is true. I think the reads should be indeterminate with respect to the pulses, which would be unreliable. I don't know why it's working and can't expect it to work in other environments, can I? Moreover, if I set some of the pulse timing numbers to 1 or 2 or 5 ms, timeouts start happening again, too. So I think I have a workaround that I don't understand, shouldn't work, and shouldn't be trusted. See SeparateSequence.vi for this one.
    I also tried other versions of the well-defined, single sequence vi, moving the counter reads to different sequence frames so that they occur with the Sample Clock Source's rising edge, or while it is high, or with the falling edge, and they also often time out. I'll post these if anyone likes but can't post now due to the attachment limit.
    Here's an odd, unexpected observation: I have to sequence the reads of the counters to occur before I use the results I read, or else many of the cycles of this combine a new count from one counter with the one-back count from the other counter, and Diff takes on values like the number of counts in a loop. I though the dataflow principle would dictate that current values would get used, but apparently not so. Sequencing the calculations to happen after the reads fixes this. Any idea why?
    So, why am I not succeeding in taking proper control of the sequence of these events?
    Thanks!!!
    Attachments:
    AfterPulse.vi ‏51 KB
    InSeparateSequence.vi ‏49 KB

    Kevin, thanks for all the work.
    >Have you run with the little execution highlighting lightbulb on? -Yes. In versions of this where there is no enforced timing between the counter and the digital line, and there's a delay inserted before the digital line, it works. There are nearly simultaneous starts on two tracks. Execution proceeds directly along the task wire to the counter. Meanwhile, the execution along the task wire to the digital high gets delayed. Then, when the digital high fires, the counter completes its task, and execution proceeds downstream from the counter. Note, I do have to set the timeout on the counter longer, because the vi runs so slowly when it's painting its progress along the wires. If there is any timing relationship enforced between the counter and the digital transition, it doesn't work. It appears to me that to read a counter, you have to ask it for a result, then drive the line high, and then receive the result, and execution inside the counter has to be ongoing during the rising line edge.
    >from what I remember, there isn't much to it.  There really aren't many candidate places for trouble.  A pulse is generated with DIO, then a single sample is read from each counter.  -Yup, you got it. This should be trivial.
    >A timeout means either that the pulse isn't generated or that the counter tasks don't receive it. - Or it could mean that the counter task must be in the middle of executing when the rising edge of the pulse arrives. Certainly the highlighted execution indicates that. Making a broken vi run by cutting the error wires that sequence the counter read relative to the pulse also seems to support that.
    >Have you verified that the digital pulse happens using a scope? -Verified in some versions by running another loop watching a digital input, and lighting an indicator, or recording how many times the line goes high, etc. Also, in your vi, with highlighting, if I delete the error wire from the last digital output to the first counter to allow parallel execution, I see the counter execution start before the rising edge, and complete when the line high vi executes. Also, if I use separate loops to drive the line high and to read the counter, it works (see TwoLoops.vi or see the screenshot of the block diagram attached below so you don't need a LV box). I could go sign out a scope, but think it's obvious the line is pulsing given that all these things work.
    >Wait!  I think that's it!  If I recall correctly, you're generating the digital pulse on port0/line0...  On a 6259, the lines of port 0 are only for correlated DIO and do not map to PFI. -But I'm not using internal connections, I actually physically wired P0L1 (pin 66) to PFI0 (pin 73). It was port0/line1, by the way. And when running some of these vi's, I also physically jumper this connection to port0/line2 as an analog input to watch it. And, again, the pulse does cause the counter to operate, so it clearly connects - it just doesn't operate the way I think it is described operating.
    For what it's worth, there's another mystery. Some of the docs seem to say that the pulse has to be applied to the counter gate terminal, rather than to the line associated with the sample clock source on the timing vi. I have tried combinations of counter gate and or sample clock source and concluded it seems like the sample clock source is the terminal that matters, and it's what I'm using lately, but for example the document I cited, "Buffered Event Counting", from last September, says "It uses both the source and gate of a counter for its operation. The active edges on the gate of a counter is used to latch the current count register value in a hardware register which is then transferred via Direct Memory Access...". I may go a round of trying those combinations with the latest vi's we've discussed.
    Attachments:
    NestedSequences.png ‏26 KB

  • Counter that triggers off the rising and falling clock edges?

    I've got an interesting problem of a device that flips its state between high/low everytime an event happens (so two events make one complete cycle).  I'd like to clock an E series synchronously with it, but looking at the documentation I can't see anyway to tell a PFI input or counter to generate a new clock cycle on both the rising and falling edge.  Instead, it just generates a new cycle at half the actual event rate.  
    I realize I could generate a new clock at approximately the same frequency using the internal timebase, but unfortunately any jitter between the two clocks must be very, very small (<5 ns) for my application to work and the internal time base doesn't have great resolution.  
    Is there some obvious solution I'm missing ?

    Nope, E Series can't do this.
    Many newer DAQ cards support a feature called "change detection" for digital I/O timing that could be used to generate a sample clock every rising and falling edge of your external signal (you could then export this sample clock or use it for another task).  
    You should probably elaborate on exactly what you mean when you say <5 ns jitter though, because this timing requirement is probably going to rule out using these devices anyway.
    Best Regards,
    John Passiak

  • Using a Counter to error-check External Sample Clock

    Hi all,
    I am newish to labview and am working on a data acquisition project. I've managed to get the basics under control, but here's my situation and question...
    -- I am using the S-6123 card to capture and record data on two or more AI channels.  I am using a rotary encoder to generate a pulsetrain that I am using via PFI0 as the sample clock for recording the AI data.
    -- This rotary encoder gives 720 pulses per revolution and an index pulse once per revolution.
    -- In my data acquisition, I am pulling 1440 samples at a time with the DAQmx "read" function.
    I have been experimenting with counters and can get the RPM out of the pulse trains well enough, however I was wondering...
    Is there some way to use the 2 counters on the card (and signal routing of the two pulse trains) to double-check that the 1440 samples I take correspond to two exact revolutions, and that I'm not getting ahead of or behind the rotation of the encoder due to missing clock pulses or reading false pulses. I have a couple of ideas on how to attempt to do it, but to me they don't seem very reliable or efficient, so I thought I'd put it to the experts to point out of there is a more obvious way of doing it.
    I have attached a pdf of the specifications of the encoder family, the pulses that will be output are on the right hand side of page 2.
    With many thanks in advance,
    Peter
    Message Edited by mumech on 07-22-2008 01:05 AM
    Attachments:
    REncoder Specs.pdf ‏312 KB

    Thanks very much for your reply. I had come across the use of counters with angular encoders but hadn't quite thought of the concept in this way.
    I will have to experiment a bit over the next day or to see what this is capable of, the examples seem quite comprehensive, however I'm not sure if I will run into issues due to the fact that I am using the rotary encoder as the sample clock for my analogue data.
    Would I indeed be able to compare these values (ideally check the position of the encoder after each set of data acquisition) without a "third party" sample clock common to both? (which isn't appropriate for this application)
    If I was only running at low speeds, I might be able to implement this by simply checking the position of the encoder after each read of the data. However, at higher speeds there might be synchronization issues due to the buffering of the analogue data. So when getting the measurement from the encoder counter chances are the analogue data was acquired at an earlier time.
    I know I haven't worded this very well, but how might I synchronise this error checking method?

  • How to output sample and convert clocks to PFI lines of E-Series DAQ (DAQPad-60​15)

    Hi,
    Can someone tell me how to output sample and convert clocks to PFI lines of E-Series DAQ (DAQPad-6015)?
    Thank you very much.
    Jack

    John --
    Windows is not an option for me. I like your idea of using a counter output -- it may be helpful as I am getting ramped up, but my application will eventually require both timer outputs.
    I have a legacy C application written for Macintosh, and I am in the process of moving it onto OS X. So my options are to use DAQmx Base, or write an in-kernel driver. I actually have already done the latter for 6024/6025 E-series boards (for another company); for this client I was hoping to use the DAQmx Base to allow an easy transition to M-series boards, without the cost of writing and supporting a low-level driver.
    The specific task I am doing is relatively straightforward. I record 2 channels of AI for a short period (usually about 250 ms.) and during this time I drive 2 external digital signals. Right now, I use the 2 timer outputs, which allows precise synchronization with the output and AI sampling.
    I appreciate your comments, and thanks in advance for any additional suggestions you can lob my way.
    --spg
    Scott Gillespie
    Applied Brain, Inc.
    scott gillespie
    applied brain, inc.

  • Using AI Sample Clock to Trigger Counter Samples

    My basic question is:  Is the ai\SampleClock signal only active while an analog input task is running?
    The details are:
    I have an X-series PCIe-6321 multifunction DAQ card.  It is controlling a SCXI chassis and has a SCXI-1180 and SCXI-1302 so I can control analog inputs of the chassis as well as access the 4 counter  on the card.  My application requires that I use all 4 counters to measure a frequency input signal and synchronize the samples to the analog input signals.  I have created 5 tasks, 1 for the AI and 1 for each counter.
    I am using LabVIEW 8.6.1 with the latest NI-DAQ drivers on and 64-bit Vista OS 
    1. Are there any driver or hardware restrictions that would cause this solution not to work? 
    2. Can I use the ai\SampleClock as in input sample clock for each of the frequency tasks?  If I do this will the sampling start be syncronized?  I.e. if I start each of the frequency tasks first, will they wait until the AI task is started before they start sampling?
    3. If that doesn't work, do I need to route the sample clock from the AI task to a PFI line (PFI1) and then use that as input to the frequency task sample clock? 
    I usually do option 3 when synchronizing two cards in  PXI chassis and only use the software task start in stead of of synchronizing on a digital start, since the sample clock will control the samples anyway.  I need to know if the same behaviour works with the scenario above.
    Thanks,
    Bob
    Prolucid Technolgies Inc. 
    Solved!
    Go to Solution.

    Hi Bob,
    I can confirm that the ai/SampleClock will only be active while the AI task is running.  As far as the other questions go:
    1.  You'd have to provide more information about what you looking to do exactly, but there is no problem with routing the sample clock of the Analog Input task to be used with the Counters.  I would read through the section of the X Series User Manual that discusses sample-clocked frequency measurements (starting on page 7-16) for some more information about what is actually going on during this configuration to make sure it suits your requirements. 
    The frequency of the signal to be measured should be at least twice as fast as the sample clock of your AI task.
    2.   You can indeed route the signal to all four tasks at the same time (you can refer to the Device Routes page in MAX to double-check routing restrictions).  The sampling will be synchronized provided the four counters are started before the AI task, but the counters will be armed at different times unless you configure an Arm Start Trigger (see page 7-45 of the X Series User Manual).  I would consider using the ai/StartTrigger if you wish to do this. 
    The effect of not arming the counters at the same time would be a different number of periods to average on each counter for the very first sample (assuming averaging is enabled).  This might not be a big concern but I just wanted to point it out.
    3.  The routes are available internal to the board so external routing isn't necessary, you can just specify to use the AI Sample clock for the clock of each counter and the routes will be made for you.  If you prefer to export the signal on a PFI line and route it back in on a different PFI line this option is also available to you but shouldn't be necessary.
    I hope this helps you get started.  I'd make sure to take a look at chapter 7 of the X Series User Manual if you get a chance since it describes how all of the counter configurations work in more detail.  If you have any related questions don't hesitate to post back.
    Best Regards,
    John
    Message Edited by John P on 12-01-2009 07:52 PM
    John Passiak

  • Sharing an external sample clock between PCI-6722 and PCI-6602

        I need PCI-6602 work with PCI-6722。6602 shares 6722’s ao/SampleClock as external clock and triggered by 6722’s ao/StartTrigger。The master device is 6722, which refered as Dev1, and the slave device is 6602, which refered as Dev2. A RTSI line is used to connect the two devices correctly.
        I use C API to finish my program and my code is as follows:
    //config 6722 analog out task
    1、DAQmxCreateTask("NI6672", &hAOTask);
    2、DAQmxCreateAOVoltageChan(hAOTask, "Dev1/ao0", "", -10.0, 10.0, DAQmx_Val_Volts, "" );
    3、DAQmxCfgSampClkTiming(hAOTask, "", 1000.0, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000);
    4、DAQmxWriteAnalogF64(hAOTask, 1000, 0, 10.0, DAQmx_Val_GroupByChannel, data, NULL, NULL);
    //config 6602 counter task
    5、DAQmxCreateTask("NI6602", &hCounterTask);
    6、DAQmxCreateCICountEdgesChan(hCounterTask, "Dev2/ctr0", "", DAQmx_Val_Rising, 0, DAQmx_Val_CountUp);
    //use /Dev1/ao/SampleClock for external clock
    7、DAQmxCfgSampClkTiming(hCounterTask, "/Dev1/ao/SampleClock", 1000.0, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000);
    //use /Dev1/ao/StartTrigger
    8、DAQmxSetTrigAttribute (hCounterTask, DAQmx_ArmStartTrig_Type, DAQmx_Val_DigEdge);
    9、DAQmxSetTrigAttribute (hCounterTask, DAQmx_DigEdge_ArmStartTrig_Src, "/Dev1/ao/StartTrigger");
    10、DAQmxSetTrigAttribute (hCounterTask, DAQmx_DigEdge_ArmStartTrig_Edge, DAQmx_Val_Rising);
    //start counter task first
    11、DAQmxStartTask(hCounterTask);
    //start 6722 task
    12、DAQmxStartTask(hAOTask);
    I run it on the MAX virtual Device, and the Step 11always returned -89120。
    I try to slove this problem, so I change the Step 7, use /Dev2/PFI9 to instead of /Dev1/ao/SampleClock.
    7、DAQmxCfgSampClkTiming(hCounterTask, "/Dev2/PFI9", 1000.0, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000);
    The code runs well, but I don’t know which terminal is connected by /Dev2/PFI9. Does it connect to /Dev1/ao/SampleClock?
    I use another API DAQmxConnectTerms to ensure that, I add a Step before Step 11.
    DAQmxConnectTerms( "/Dev1/ao/SampleClock", "/Dev2/PFI9", DAQmx_Val_DoNotInvertPolarity );
    The program also run well. But I am still not sure that 6602 is sharing /Dev1/ao/SampleClock。If not, which terminal of Dev1 is connected by /Dev2/PFI9?
    Is my code right? If not, hwo to fix my code or supply some example for me? Thanks.

    Hello Shokey,
    From looking over your post, it looks like you want to program in C, using simulated instruments, a master/slave design with a PCI-6602 and PCI-6722. The PCI-6722 is the master device and the PCI-6602 is the slave device. In order to implement this with the real cards, you would need a RTSI cable between the 2 cards in order to pass the triggers and the sample clock. Unfortunately with simulated devices you can't implement this so parts of your code won't be able to work exactly like if you had the instrument.
    If you did have the instrument, you can implement this by performing the following steps:
    Master Device:
    1.) Export the ao/SampleClock and ao/StartTrigger to a RTSI Line. (See DAQmx C Reference help for DAQmxExportSignal to export these)
    Slave Device:
    1.) Set the Sample clock and the trigger to the RTSI.
    There is another forum that I think will help you out to implement this correctly. In this forum, the customer was trying to export a trigger through a RTSI and the problem he was experiencing was a broken RTSI cable. His code, he states, works. I hope this helps you with this and if you have any more questions, feel free to post.
    Jim St
    National Instruments
    RF Product Support Engineer

  • NI 6343 Internal DI Sample Clock counter name text string?

    I need to add a frequency test to my remote site (remote debug). Could someone tell me the text string as counter name for NI 6343 Internal DI Sample Clock? Thanks. 

    Does your remote computer have MAX installed? This is the easiest way to see what the device alias is.
    You can always just try Dev1 and see if it works. This is the default when the very first device is added to a system.
    If you can deploy code to the remote system, you can also use the DevNames property of the System Node from the DAQmx System Setup palette. This will show you all of the names of the devices in the system and you should see your device there.

  • NI PCIe-6351 Count Edges Channel error on fast TTL - Multiple Sample Clock pulses were detected

    Hello,
    I am trying to use a PCIe-6351 to record the arrival times of a fast TTL pulse stream (generated by an Excilitas/Elmer Perkin APD). The TTL pulses are 2.5 volt amplitude, 20 ns duration, with a gauranteed dead time of 50 ns between pulses. I am trying to use the the Count Edges function, with the  100MhzTimebase as the input terminal and the input to counter 0 (PFI8) as the sample clock. After a few seconds of acquiring data at 100 Mhz, the application throws the following error (-201314):
    "Multiple Sample Clock pulses were detected within one period of the input signal"
    I had thought that because there is 50 ns dead time between pulses, multiple pulses would never arrive within a single clock cycle of the 100 Mhz timebase. Is there any way this might not be the case? Alternatively, is it possible that the counter is triggering on some jitter around the edges of the pulses? If so, is there any way to filter such high frequencies without losing the 20 ns pulses?
    I have read through the forums for similar problems with photon detectors, but have not been able to resolve this issue. Thank you for the help.
    Matthew Bakalar

    It sounds like the input signal is being detected as multiple edges.
    The PFI filtering feature on the X Series card likely isn't going to be suitable for you.  The minimum setting is actually exactly 20 ns, which should in theory guarantee a 20 ns pulse passing through.  However, if the signal is high for anything less than that there wouldn't be a guarantee (depending on the phase of the timebase relative to the rising edge of the signal)--considering rise times and that there is evidently a glitch in the signal itself, it probably isn't actually a continuous 20 ns high time by the time the DAQ card sees it.
    What you should do instead:
    Configure a second counter as a retriggerable counter output (single pulse).
    Use your external signal as the start trigger for this counter output task.
    Set the initial delay, high time, and low time for the counter output task all to 20 ns (the minimum).
    Use the internal output of the counter output task as the sample clock source for the original edge count task.
    The counter output will be triggered when it sees the external signal, wait 10-20 ns, then generate a 20 ns pulse.  If there is a glitch on the trigger line during this 30-40 ns that the output is generating, it will be ignored.  The counter output will be re-armed in time for the next pulse given the minimum dead time of 50 ns between pulses.
    Best Regards,
    John Passiak

  • Sample data at one rate and output clock at another

    Hi all,
    I'm using an NI USB 6289 DAQ. I'm currently samplying data at 5kHz. I want to sync this to a camera that accepts at 1kHz signal.
    Is there some way of generating an ouput signal of 1kHz that is synched to the 5kHz sampling clock? 

    Hi, 
    Thanks for the reply. That was helpful.
    I wrote a vi that will acquire data at 5kHz and produce a square wave at 1kHz. Does this look correctly synched? (I modified one of the labview examples). 
    Edit: I changed the vi attached. I had forgotten to attach the trigger. It now gives and error saying that all the samples were not written.

  • PCI-6281 How to use80 mHZ timebase for A/d and D/A sample clocks

    Does anyone know how to use the 80 mHZ internal clock as the timebase for my A/D and D/A sample clocks rather than the default 20 mHZ timebase?
    I am using straight NI-DAQmx version 8.3 with C code. No Lab View, no Measurement Studio.
    I have an application which uses the D/A to generate a sequence that is collected by the A/D.  The D/A is clocked out at an integral multiple of the A/D clock.  In order to maintain this integral relationship I can only use a limited set of Sample Clock Timebase Divisor pairs (as returned by DAQmxGetSampClkTimebaseDiv).  This means that am further from my desired base frequency than normal.  For example, using the degault 20 mHZ timebase, if I want a 2000 hz center fequency, the closest I can get is 2003.205 hz.
    I cannot find anyway to use the 80 mHZ internal clock as the timebase for my A/D and D/A sample clocks.  If I could, it would be possible to get closer to my desired center frequency.

    Post is responded to in the multifunction DAQ forumn.
    PCI-6281 How to use80 mHZ timebase for A/d and D/A sample clocks
    Have a good one.
    Michael D
    Applications Engineering
    National Instruments

  • "External sample clock" and "Rate" for digital input acquisition

    Dear all,
    I want to acquire digital input (21 bits with external clock = 50 kHz) with a PCIe-6343 NI board. Using the  DAQ assistant under Labview, I selected the advanced timing with the sample clock time parametrized as External. However, it is also possible to select the Rate of the acquisition. In my case, i want to get the data at the rising edge of the external clock signal, so at a frequency of 50 kHz.  How can I do that ? I just need to put a Rate of 50 kHz ?
    thanks for your help.
    Cedric 

    Cedric,
    dddsdsds wrote: 
    [...]In my case, i want to get the data at the rising edge of the external clock signal, so at a frequency of 50 kHz.  How can I do that ?[...]
    You answered your question already. If you want to use an external clock, you have to configure the timing source of your task to be external. In order of proper buffer configuration, you should enter 50kHz as rate in addition to the external configuration, but this will not influence the speed of the acquisition (since it is "clocked" externally!)
    hope this helps,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

Maybe you are looking for