Counting external clock

Hi,
i have an optical mouse connected with a vi that i could see the data and the external clock of the mouse..
the problem is that i want to know or measure  the  real time which the external clock create each pulse..
i thought to get a counter which measure any dig pulse  send by the mouse..
but can i get and the time with counters?
andrikos

Hi,
Your question was :
i want to know in real time,, when the external clock create the pulses..
You can use counters to find when the external clock is generating pulses.  It looks like you have connected to an analog input right now.  You could essentially do some kind of software analysis but it would not be accurate.  Using the counters you can measure all the pulses and when they occurred.  Are you using the DAQmx driver for this application?  If you are using LabVIEW for this application I can point you to an example that achieves something similar to this.  In the LabVIEW environment, click on Help >> Find Examples.  In the example finder window, select Hardware Input and Output and then select DAQmx >> Counter Measurements >> Count Digital Events.  There are a few examples in this folder that can show you how to make counter measurements.
There are also examples of counting pulse width etc., if that is something that you might want to do.
Hope that helps.
Regards,
Raajit L
National Instruments

Similar Messages

  • USB 6210 Using counter as an external clock

    I was referencing an old post for how to read and write data from a quadrature encoder. I am using a USB 6210 card along with Labview 8.2.1. In the previous post it describes needing to:
    "You will have to create an external clock using the other counter on
    the board then route the signal either externally or internally"
    I do not know what this means and I do not understand what is required to do such (Changes to wires, change the Vi...etc). If someone could please shed some light on this I would really appreciate it.
    I am basing my approach on the following NI example:
    Meas Angular Position-Buffered-Cont-Ext Clk.vi

    Hi rose8,
    The example you are referencing requires an external clock to basically take samples of the angular position based on time.  For instance, you can rotate your angular encoder all you want, but it will not save which position you are at until a sample clock rising edge is seen.  When the sample clock rising edge is seen, then it places that position into a buffer, and continues to wait for the next sample clock rising edge to happen.  Every time the rising edge happens, the position of your angular measurement is recorded one point at a time, stored in a 1D or 2D array. 
    The sample clock cannot be an on board clock that is already created.  So now, we look at what sources we can use for our external clock to sample the position of our encoder and save it in our memory buffer.  We can use an external source and bring it into the board, or we can create a clock using another counter on the board.  Since you are looking to do this, I'll assume you want to create a clock from there.
    In software, you specify two counter tasks; one to measure your angular position and one to generate a pulse train.  The pulse train you generate will be the sample clock for the buffered angular position measurements you are taking.  Now, you can route this externally or internally, based on your application.  The easiest way is internally, because it doesn't require any additional wires to accomplish.
    To route internally, all you have to do is for your DAQmx Timing VI, specify CtrXInternalOutput from your USB 6210 as the source, where X is the counter you generate your pulse train on.  To see this source as an available selection, right click your Resource Name and select I/O Name Filtering from the shortcut menu, and then be sure that Include Advanced Terminals is checked. 
    In programming, you would want to start your angular position task first, and then start your clock generation from your second counter.  They will run in parallel and just be sure to clear both threads at the end of your program.  Hopefully this clears up some confusion for you.
    Kyle A.
    National Instruments
    High Speed Digital I/O Product Support Engineer - R&D

  • How do I use a quadrature encoder as an external clock (PCI 6229)

    Hello, ( a similar post has been placed on DAQ forum apologies as I did not know best place)
    I have a PCI 6229 M Series data acquisition card. I want to use a quadrature encoder to be the external clock driving the acquisition of a number of signals. I have set up reading 24 signals each time a clock pulse is received using the DAQ assistant and set my external clock to pin pfi8 (I think) this is then connected to an encoder output. This works well enough until the encoder is run too fast when it appears I am either missing pulses or getting bounce.
    How can I set up to clock using a quadrature encoder? I have seen a number of questions on this forum regarding quadrature encoders and reverse counting but not on using them as an external clock.
    Basically I want to have the stability and "bounceless" nature of using two outputs from a quadrature encoder whilst still using an external clock. Is this just a case of configuring controls to certain pfi's? If so how is it done?
    Any help or pointers would be helpful. So far I have managed very nicely by simply using the DAQ assistant and the interface it has would suggest that if configured for a certain pfi pin I could actually still use it.
    Thanks in advance.
    Kevin

    Hi,
    Well I've had alook into this for you and I'm not quite sure I understand what you are looking for.
    Is it possible for you to phone back in to support?
    The reason you are seeing bounce at high speeds, or indeed loss of points, is due to the sampling rate that you have set up.
    What you will find is that the trigger will start an aquisition of a number of points at a certain rate.  If your sampling rate is too low then you will not finish that sample batch before the next set of samples is recorded.
    It is possible to use an external clock into a trigger or digital line, however this will limit the number of samples you can take to the speed of your encoder.
    If you increase your sampling rates, and then configure a start trigger from a single input from the encoder you will be able to record a number of samples after a rising/falling edge.  (Set the clock as an internal clock)
    Hope this helps
    AdamB
    Applications Engineering Team Leader | National Instruments | UK & Ireland

  • Single Pulse Width with External Clock

    I am trying to setup a 6602 counter for a single (non-buffered) pulse width measurement with an external clock. Under normal testing, the unit under test will provide the pulses, I need to measure the number of pulses during different time periods (1, 60, and 300 seconds). I want to do a pulse width measurement and I'll supply the gate signal pulse to the counter for the specific time needed.
    Under normal operation, the unit under test is wired into the counter's source and the pulse is wired into the gate.  For testing purposes I am using a BNC-2121. I have the counter's source wired to the Adjustable Square Wave Output and the gate wired to the Trigger output.
    Here is my C++ code. I am getting a timeout error on the read and I don't know why. Any help would be appreciated.
       //Create Task
       DAQmxCreateTask( "task1", taskHandle );
       //Create Pulse Width Channel
       DAQmxCreateCIPulseWidthChan( taskHandle,              // TaskHandle
                                                      ​  szCtrName.c_str(),     // Counter Name
                                                      ​  "",                             // Channel Name
                                                      dMin,                          // Min Value
                                                      dMax,                         // Max Value
                                                      DAQmx_Val_Ticks,     // Units
                                                      DAQmx_Val_Rising,    // Gate Edge
                                                      "" );                            // Scale Name
       //Set the Pulse Width Terminal to the gate signal
       DAQmxSetCIPulseWidthTerm( taskHandle,          // TaskHandle
                                                     "",                       // Channel
                                                     "/CTR2/PFI38" );  // Terminal
       //Set the Timebase Src to the counter's source
       DAQmxSetCICtrTimebaseSrc( taskHandle,         // TaskHandle
                                                    "",                       // Channel
                                                    "/CTR2/PFI39" );   // Terminal
       //Start Task
       DAQmxStartTask( taskHandle );
      //***Send pulse to gate counter***
       //Read Counter
       DAQmxReadCounterU32( taskHandle,                      // Task Handle
                                              DAQmx_Val_Auto,           // Num Samps to Read
                                              10,                                  // Timeout
                                              ulBuffer,                           // Read Buffer
                                              1000,                               // Buffer Size
                                              &lSampsRead,                 // Num Samps Read
                                              NULL );                            // Reserved

    I've setup a pulse width task in NI-MAX using the onboard clock and everything worked fine, so I know the hardware is working.
    My unit under test is providing the pulses (from gyros) I need to measure. The pulses indicate the position of the unit so there are X, Y and Z axis gyros. I need to measure these pulses for specific periods of time (1, 60, and 300 seconds). For example during the 1 second measurement, the X and Y gyros should measure zero pulses and the Z axis should measure 515 gyros. During a 300 second measurement the X and Y gyros should measure < 60 and the Z axis should measure 30800.
    So the gyro pulses are wired to the counter input and I am using a DIO channel from NI-6508 to provide the gate pulse. The gate signal will be high for either 1, 60, or 300 seconds depending on the test. The gyro pulses are essentially the external clock to the counter. I want to count the gyro pulses during the pulse of the gate (DIO).
    To simplify the setup, I connected to BNC-2121 directly to the card. I have the adjustable clock output going to the counter input of ctr0 and the trigger signal going to the gate of ctr0. Once the task has been started and before the read ( I had a breakpoint set in the code), I would press the trigger button on the BNC-2121 and hold for approx. 1 second. I then execute the Read statement, and I always get a timeout. From my experience working with NI, I'm guessing I don't have a channel property set correctly, but its not obvious to me and I can't find an example to do exactly what I'm trying to do.
    The CTR2 designation in the code was the object name of the card. I have two 6602 cards in my chassis. I was using ctr0 of the second counter card, so PFI38/39 was correct.
    Again, any help would be appreciated.

  • External clocking on 6711 card

    Hi all,
      I just read the manual of the card PCI6711, it supports the external clock. So does it mean we can change the update rate by using different external clock rate?

    chris88 wrote:
    HI dragondriver
    They are both correct, the PCI 6711 supports external clocking for the analog output tasks, but for Digital I/O tasks the timing can only be set to software timed, meaning that you cannot use external clock for digital tasks.
    The main difference between RTSI and PFI is the physical connection, PFI lines conects through the connector block you are using and the RTSI is connected through a RTSI bus cable used to synchronize several DAQ cards.
    You can choose any PFI <0 to 9> and this article show how to select which PFI line is the source of sampling.
    Regards
    Thanks for the clarification . I only one doubt. Someone told me that 6711 only supports software-based digital pulse input/output but it supports external-clock-driving counter output. So when you said softwarebased digital I/O task, do you mean all digitals output including counter output? Thanks.

  • Do I have to use an external clock with a cDAQ-9188 and NI 9401 to read a linear encoder? I'm seeing error message that implies that but the example code doesn't show it.

    We can set up a task that works on demand but when we go to continuous sampleing we see Error -200303, which claims an external sample clock source must be specified for this application.  However, some of the NI linear encoder example code doesn't show that (uses the cDAQ 80 Mhz clock) and the documentation didn't mention that. 

    It's mentioned in the 918x user manual:
    Unlike analog input, analog output, digital input, and digital output, the cDAQ chassis counters do not have the ability to divide down a timebase to produce an internal counter sample clock.  For sample clocked operations, an external signal must be provided to supply a clock source.  The source can be any of the following signals:
    AI Sample Clock
    AI Start Trigger
    AI Reference Trigger
    AO Sample Clock
    DI Sample Clock
    DI Start Trigger
    DO Sample Clock
    CTR n Internal Output
    Freq Out
    PFI
    Change Detection Event
    Analog Comparison Event
    Assuming you have at least one available counter (there are 4 on the backplane), I would suggest to configure a continuous counter output task and use its internal output as the sample clock.  Specify the internal counter using an "_" for example "cDAQ1/_ctr0".  The terminal to use for the sample clock source would be for example "/cDAQ1/Ctr0InternalOutput".
    Which example uses the 80 MHz timebase as a sample clock?  It is far too fast for a sample clock on the 9188 according to the throughput benchmarks (80 MHz * 4 byte samples = 320 MB/s).  There is also no direct route between the 80 MHz timebase and the sample clock terminal for the counters--making this route would use a second counter anyway.
    Best Regards,
    John Passiak

  • DAQ Card is inducing noise on an external clock signal resulting in false triggering

    I am using an optical encoder as an external clock source for analog measurements with a PCI 6036 card.  The optical encoder signal is "filtered" using a Schmitt Trigger circuit and proper shielding practices are used on the encoder cable.  I am using a recent version of Labview.
    When the TTL square wave signal from the encoder is viewed on an oscilliscope (without the DAQ attached) it is a picture perfect square wave, nothing that would cause any problems.
    When I then connect the encoder output to my PFI line (with or without the oscilliscope) I get false triggering due to intermittent (seemingly random...) high frequency noise "blips".  Out of 360 expected samples, I will typically get between 2 and 6 "bonus" samples...  When captured on a scope, the noise looks like a decaying sine wave and lasts for only a few us.  the peak magnitude is tyically around 2 V or so as shown on the scope, which is apparently just enough to make my card grab a sample.
    Since the noise is only present when the encoder signal is attached to the DAQ, it seems that the DAQ is somehow inducing noise into the signal.
    I have been fighting this problem for a while now and tried the following:
    1)  I first tried the raw encoder signal, but then added the Schmitt trigger, increased the signal strength of the encoder lines by adding resistors to ground, double checked my shielding, etc...
    2) I verified that my ground potential between my card and my conditioning circuit were not causing problems.  The conditioning circuit and encoder is now powered of the card itself, which should resolve any possible problem with grounds.
    3) Cursed at various inanimate objects (made me feel better but didn't help the situation)
    4) Checked if I could set a minimum pulse width required to trigger off of an exernal scan clock (I can't with my hardware.)
    5) Swapped my card with a card of a different type (problem is still there)
    If anybody out there has some recomendations, I am open to anything.

    Hello OSU_Mech_Eng,
    I'm not quite sure how the DAQ card could be inducing glitches into
    your digital signal.  Digital signals from mechanical devices like
    quadrature encoders can often be glitchy or bouncy, but your schmitt
    trigger should act as a debouncing filter to clean up that digital
    signal.  It sounds like you have thoroughly troubleshooted this
    problem, and I would recommend moving on and trying to use a counter on
    your DAQ board to generate the digital signal, rathar than using the
    raw signal from your encoder/schmitt trigger.
    You were correct when you stated that the best way to do this is by
    configuring your counter to perform retriggerable pulse
    generation.  You can use the signal of from your encoder to gate
    the internal clock on your DAQ card, creating a clean digital
    signal.  By setting the minimum pulse width of the signal, you
    will be able to ignore the small glitches in your signal. Here is
    a link to some Knowledgebases describing how to do this:
    How Do I Remove Glitches or Add a Debounce Filter to My Digital Signal?
    How Do I Define the Parameters for Pulse Generation in NI-DAQmx?
    For further reference, on all of NI's new M-Series DAQ cards (PCI
    625x), the PFI circuitry contains built in debouncing filters to
    protect against small glitches in digital signals.  If you have an
    M-Series card lying around, it might be helpful to give that a try.
    I hope this helps,
    Travis Gorkin
    Applications Engineering
    National Instruments
    www.ni.com/support

  • PCI-6229 Interrupt on external clock

    Hi,
    I want to generate an interrupt from an external clock (2 kHz). I can't find anything on generating an interrupt from a Digital Input. So I have tried using the G0 TC interrupt.
    I modified gptcex1 for a countdown timer as described in the source file.
    - set to reload on TC
    - set source switching to same.
    - enabled G0 TC interupts
    - connected my input clock to PFI 8
    It appears that "reload on TC" reloads 0xFFFFFFFF instead of my initial count. So I have to reload my initial count in the ISR.
    board->G0_Load_A.writeRegister(GPCT0_INITIAL_COUNT);
    This results in an interrupt every GPCT0_INITIAL_COUNT + 1 cycles. This means that I can only generate an interrupt every second cycle at best.
    Is there some way to overcome this limitation or is there a better way to achieve my aim?

    Russell_Thamm wrote:
    I want to generate an interrupt from an external clock (2 kHz). I can't find anything on generating an interrupt from a Digital Input.
    <snip>
    or is there a better way to achieve my aim?
    Hi Russell,
    Ideally, the best course of action is to use change detection [1]. Unfortunately, the M Series DDK does have change detection support like the X Series DDK does [2].
    However, if you have the analog input or analog output subsystem available, you can use your 2 kHz signal as the sample clock and enable interrupts on the START signal. Since the device will expect to acquire or generate samples, you'll need to either throw that acquired data away or provide safe, dummy data to generate.
    Analog input: tInterrupt_A_Enable :: setAI_START_Interrupt_Enable
    Analog output: tInterrupt_B_Enable :: setAO_START_Interrupt_Enable
    [1] M Series User Manual :: Change Detection (page 104)
    http://www.ni.com/pdf/manuals/371022k.pdf
    [2] How to generate an interrupt using DI change detection on m-series card
    http://forums.ni.com/t5/Driver-Development-Kit-DDK/How-to-generate-an-interrupt-using-DI-change-dete...
    Joe Friedchicken
    NI VirtualBench Application Software
    Get with your fellow hardware users :: [ NI's VirtualBench User Group ]
    Get with your fellow OS users :: [ NI's Linux User Group ] [ NI's OS X User Group ]
    Get with your fellow developers :: [ NI's DAQmx Base User Group ] [ NI's DDK User Group ]
    Senior Software Engineer :: Multifunction Instruments Applications Group
    Software Engineer :: Measurements RLP Group (until Mar 2014)
    Applications Engineer :: High Speed Product Group (until Sep 2008)

  • Generate pulses in NI-ELVIS II to be used as an external clock

    I am using the NI ELVIS II counter for edge counting and to set the clock for Sample clock function I have to use an external clock but I am not sure how to do it. I suggest I have to use Counter Output/ Pulse generation to generate a pulse with a desire frequency and output it on pin PFI12 or PFI13 or even Freq-Out pin and then use this pulse as the external sample clock.
    I can do pulse counting withough using a sample clock function but I would like to sample as high as possible to have more points and less oscillation. Would you please help me with this vi. I have attached the vi to this post.
    Attachments:
    Edge Counting.vi ‏25 KB

    Hi tintin99,
    I'd recommend checking out the NI Example Finder, found in <LabVIEW> » Help » Find Examples... 
    Then navigate through Hardware Input and Output » DAQmx » Counter Measurements.
    In particular, I'd suggest that you load up Count Digital Events.vi which shows how to implement simple Counter based Edge Counting measurements. These are useful for interacting with peripheral hardware such as Quadrature Encoders. With this VI running, you could also concurrently execute the Gen Dig Pulse.vi  found in the 'Generating Digital Pulses' section also within the Counter Measurements category. These are both good demonstrations on how to efficiently create Counter I/O DAQmx tasks within LabVIEW and will serve as a great foundation for your own code.
    As a general overview, there are three main terminals you will need to be aware of when dealing with Counters:
    Source - The counter input signal, effectively the signal we wish to count.
    Gate - An input signal which determines whether we should continue counting, based on digital highs, lows, active edges and falling edges. These can all be preconfigured in software.
    Out - The counter terminal output. This will be used in pulse generation.
    As you want to perform two Counter based tasks, you will need to make use of two different onboard counters.  You can find out which pins can be used to access these different counter terminals by loading up the Measurement and Automation Explorer (MAX) and selecting your device under the Devices and Interfaces tree from the left hand pane. With the device selected, click on Device Pinouts, found on the toolbar. This tab could be hidden, so I suggest either maximising the MAX window or clicking on the double arrows on the right hand side of the toolbar to display any missing options.
    Best of luck with your application. 
    Kind Regards,
    Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

  • Configure digital filter for external clock

    I am trying to use a digital filter on my PXI-6602 card and I can't get it to configure for an external clock. It keeps telling me the numbers don't match up but I don't see the logic to the numbers it supports. Here is the error I got for a time base of 100 Hz and a min pulse width of 1/(100 / 2) based on the period of 2 clock cycles.
     Desired Minimum Pulse Width could not be produced.
    Minimum Pulse Width is affected by the Digital Filter Timebase Source and the Digital Filter Timebase Rate. To see how these two property settings can affect the Minimum Pulse Width, refer to product documentation for more details.
    Property: CI.CountEdges.DigFltr.TimebaseSrc
    Requested Value: /PXI1Slot2/PFI36
    Property: CI.CountEdges.DigFltr.TimebaseRate
    Requested Value:  100.000000
    Property: CI.CountEdges.DigFltr.MinPulseWidth
    Requested Value:  20.0e-3
    Supported Values:  80.0e-3 to  171.798692e6
    Task Name: _unnamedTask<49>
    I know my math is off since the filter uses the leading edge of the pulse but 0.08 seconds is 12.5 Hz and I don't get it. Other frequencies produce different but also odd (to me) numbers.
    Attached is a copy of my VI
    Attachments:
    External Clock for Filter.jpg ‏131 KB

    Digital filtering ensures that a high pulse is high for at least a certain time (minimum pulse width) in microseconds.  This is to ensure that a fluke noise signal does not count as a high pulse.  It also ensures that a voltage overshoot to the high value does not register more than one high pulse as it settles in to the value.
    The specifications of the digital filtering is outline on page 3-1 to 3-3 of the 660x User Manual, found here. It specifies on page 3-3 that there are five different settings for the digital filter minimum pulse width:
    5 µs 
    1 µs 
    500 ns 
    100 ns 
    Or, programmable with a custom tfltrclk (period in seconds of Filter Clock).  However, when using tfltrclk, minimum pulse width needs to equal to 2*tfltrclk.  Your current setup has the minimum pulse width set up for minimum pulse width = 1/(tfltrclck/2) = 2/tfltrclck rather that 2*tflrclk.
    I think you already knew all of this.  However, the Filter Clock does not equal the Filter Clock Timebase.
    If we look on page 3-3 in the manual we seed that Filter clock is actually 1/4th the speed of the Filter Clock Timebase.  
    Therefore, in your setup:
    Filter Timebase Rate = 100Hz
    Filter Clock Rate= 1/4th *100 Hz = 25Hz
    Filter Clock Period = 1/25Hz = 0.04 seconds
    2*Filter Clock Period = Minimum Pulse Width = 2*0.04=0.08 seconds.
    Which is the minimum value it was suggesting.  This will always be four times as large as what you were guessing before.
    Eric S.
    AE Specialist | Global Support
    National Instruments

  • How I can measure frequency of TTL signal without external clock?

    Hello,
    I want to measure frequency of TTL signal using PXI-6254 or PXI-6713, without using external clock.
    Frequency will be up to 100kHz. How I can use internal counter of 20MHz or 80MHz?

    Hi Yuta K,
    You have not stated what software you want to use for this measurement, but in case you're using LabVIEW, please go to the Example Finder (in LabVIEW go to "Help >> Find Examples"). 
    In the Example Finder, you make sure the "Browse" tab is stil selected, and than you go to:
    Hardware Input and Output >> DAQmx >> Counter Measurements >> Digital Frequency
    Here you will find some good examples of measuring a digital frequency with 1 or 2 onboard counters.
    If you need additional information, please let us know!
    Best regards,
    Peter S

  • How can I use external clock to implement a delay?

    Hi all,
      I am testing to use external clock to drive dev/PFI0 (on device 6711) which is used as the clock for the analog ouput. I have thinking two applications by using the external clock but I don't have much idea on the implementation yet.
    First of all, I have a sequence of data (array) with each sample being sent at the interval of 1us. I use an external clock (10MHz) driving the PFI0 so it is pretty easy to achieve that goal. I am thinking what happen if I want each sampel being sent at different time. For example, if I have 5 samples, I want the first one sent 1us after the task start and wait 2us to send the 2nd sample, wait 5us to send the 3rd sample and wait 11 us to send the 4th sample, and wait 1us to send the last sample. Is it possible to achieve that based on the external clock?
    Second question is about the delay. My code require ciritcal timing and the builtin delay doesn't behave very well because I am running in windows. I can increase the priority of the vi to highest, it helps a bit but still not perfect. I am thinking if it is possible to implement hardward delay based on the external clock. Any idea?

    Hello dragondriver,
    To answer your first question, yes you could send data in that fashion. You would have to programmatically build a pulse train and use that to trigger the sending of data. The answer to the second question is essentially the same. You should be able to programmatically build a pulse train with a delay and use it as trigger to begin whatever operation you have.
    Jonathan L.
    Applications Engineer
    National Instruments

  • Is the PXIe-PCIe8361 adequate for this system? And external clock questions...

    Hi all,
    I have spent some time piecing together a system and I'd like a sanity check before pulling the trigger on this purchase.  The system will contain the following hardware:
    1. Chassis: PXIe-1078
    2. Controller: PXIe-PCIe8361
    3. 3 x PXIe-6363 (16 analog inputs each card, 32 digital inputs each card, all internally clocked @ 10kHz)
    4. 2 x PXI-6224 (32 digital inputs on one, 8 digital inputs on the other, externally clocked in "bursts" of 62.5khz)
    5. Labview software
    The three PXI-6363 cards will be responsible for  a mix of analog and digital measurements made @ 10 kHz, timed continuously by the onboard clock.
    One PXI-6224 will be clocked externally @ 62.5 kHz and will be used to collect digital data on a 32-bit port.  These clock pulses will not be continuous, but will occur in bursts lasting for 2ms every 20ms.
    The other PXI-6224 will be clocked externally @ 62.5kHz as well and will be used to collect digital data on an 8-bit port. These clock pulses will not be continuous, but will occur in bursts lasting for 2 ms at random intervals.
    My questions are:
    1. Am I planning anything that looks unreasonable for this hardware?
    2.  Should I expect issues with data transfer rates with the PXIe-PCIe8361?  I will be operating well within the advertised 110MB/s throughput of the device.  I plan to stream this method... NI Fast TDMS data streaming
    3.  I have only ever used NI cards for continuous measurements made by an onboard clock.  When I set up a task to collect data that is externally-timed, will the DAQ be expecting a "continuous" clock pulse, or will the system wait patiently for clock pulses to arrive at any rate (any rate within the spec of the card, of course)?
    Thanks, any input is appreciated.

    Hello LucasH0011
    1-As long as you put the PXI-6224  and the PXIe-6363 cards in the corresponding slots, meaning the express(PXIe-6363) in the express and the hybrid(PXI-6224) in the hybrid.
    2-I think you would  not have issues with the transfer rate.
    3-Your timing specifications sound reasonable to me, I think you will be fine. 
    Here is a document that has useful concepts for the use of cards:
    http://www.ni.com/white-paper/3615/en/
    It is for the M-Series, but the concepts apply to the X-Series as well. 
    Regards 
    Ernesto

  • Is it possible to read digital data using an external clock (PCI-6259 M)?

    I’m using a NI PCI-6259 M Series card and trying to write my program in VC++6.0 using the functions in the DAQmx driver.
    Question1: Not all functions listed in the NI-DAQmx C Reference Help seems to be supported by my NI-card, where can I find information about which of the functions that are supported?
    Question2: I want to read data from a device that clock out data on the falling edge of a clock signal. The clock signal and the data signal are routed to two DIO terminals on the NI-card. The question is if it is possible to read data using the clock as a sample clock? See two code examples below that doesn’t work. In both cases 10 samples are read at once, even if the external clock is not present.
    Example 1
    // Create tasks
    Status = DAQmxCreateTask("", &m_ReadTrimTask);
    // Set up read task
    status = DAQmxCreateDIChan(m_ReadTrimTask, "Dev1/port2/line0", "", DAQmx_Val_ChanPerLine);
    status = DAQmxCfgChangeDetectionTiming(m_ReadTrimTask,"Dev1/port2/line6","Dev1/port2/line6",DAQmx_Val_FiniteSamps, 10);
    // Read data
    int32 sampsPerChanRead, numBytesPerSamp;
    status = DAQmxReadDigitalLines(m_ReadTrimTask, 10, 10.0, DAQmx_Val_GroupByChannel, result, 10, &sampsPerChanRead, &numBytesPerSamp ,NULL);
    Example 2
    // Create tasks
    Status = DAQmxCreateTask("", &m_ReadTrimTask);
    // Set up read task
    status = DAQmxCreateDIChan(m_ReadTrimTask, "Dev1/port2/line0", "", DAQmx_Val_ChanPerLine);
    status = DAQmxSetSampTimingType(m_ReadTrimTask, DAQmx_Val_SampClk);
    status = DAQmxSetSampClkRate(m_ReadTrimTask, 1000.0);
    status = DAQmxSetSampClkActiveEdge(m_ReadTrimTask, DAQmx_Val_Falling);
    status = DAQmxSetSampClkSrc(m_ReadTrimTask, " Dev1/port2/line6");
    // Read data
    int32 sampsPerChanRead, numBytesPerSamp;
    status = DAQmxReadDigitalLines(m_ReadTrimTask, 10, 10.0, DAQmx_Val_GroupByChannel, result, 10, &sampsPerChanRead, &numBytesPerSamp ,NULL);

    Hello Magnus,
    Thank you for contacting National Instruments.
    "Question1: Not all functions listed in the NI-DAQmx C Reference Help seems to be supported by my NI-card, where can I find information about which of the functions that are supported?"
    The best place to look for this information would be the M Series Help Manual. There you can find the features of your PCI-6259 and what operations it supports.
    "Question2: I want to read data from a device that clock out data on the falling edge of a clock signal. The clock signal and the data signal are routed to two DIO terminals on the NI-card. The question is if it is possible to read data using the clock as a sample clock? See two code examples below that doesn’t work. In both cases 10 samples are read at once, even if the external clock is not present."
    Look at the "ContReadDigChan-ExtClk_Fn.c" example project which ships with the NI-DAQ driver. This is located at: C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Read Values\Cont Read Dig Chan-Ext Clk.
    You will have to make some minor modifications to convert this to a finite acquisition, but that is simply a matter of changing the "sampleMode" parameter of the DAQmxCfgSampClkTiming() function. You will also have to route your clock signal to a PFI line and specify which line in your code.
    I hope this helps.
    Sean C.
    Applications Engineering
    National Instruments

  • Using external clock on a 6062E DAQ card

    In my application I need to use an external clock (2 MHZ) to sample 10 channels at 40 KHz each. I connected the external clock to PFI_7/Startscan, enabled the ND_IN_CHANNEL_CLOCK_TIMEBASE and ND_IN_SCAN_CLOCK_TIMEBASE using The Select_signal function. If I use only two channels (instead of 10) everything works fine. If I try to increase the number of channels to more than 2 I get a digitized waveform with points missing (one every 2). I tried to decrease the sampling rate to 4 KHz per channel, but the problem persisted. For 2 channels everything is always fine, but for more than 2 I get the same error in the digitization pattern.
    The relevant lines of my codes are attached
    Thank you for your help
    Enrico Gratt
    on
    Attachments:
    Sample_code.pas ‏3 KB

    Enrico,
    I have a couple of questions. Do you see the same amount of missing data regardless of how many channels (more than 2) you are acquiring? If you use the internal 20 MHz timebase, can you successfully acquire all 10 channels at 40 kHz?
    Spencer S.

Maybe you are looking for