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)

Similar Messages

  • 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

  • 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

  • PCI-6229 Digital I/O sample clock problem

    Hi,
    I am using PCI-6229. I need to use digital output channel to generate 20KHz 30%duty cycle pulses.
    The datasheet shows DO sample clock frequency can be 1M Hz. But in may application, only 100KHzTimebase can work to generate. But acctually I need at least 200K Hz.
    Attached is the Vi I made. Can anyone help me with this problem?
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    Digital pulse_DO Channel.vi ‏26 KB

    Hello All,
    I tried to modify the VI posted in this thread in order to aquire a digital signal with the PCI-6229. Sinc the frequency of the signal is below 1k i tried to devide the signal of ctr0 respectively of freqout by 8 or 16 since 6.25k or 12.5k sampling frequency would be more than enough for my purpose. By the way, when I am using the 100k timebase for the timing of the task the programm is working. Since i try to monitor up to 20 channels, the amount of data genereated is too much. Therefore I tried to use the modified VI.
    Sometimes, the VI works, but almost always, the DAQmx - Read VI doesn´t terminate.
    Has anybody an idea what i did wrong?
    Thank you for your assistance.
    Sincerely,
    Mirko
    Attachments:
    Digital pulse_DI Channel-1_mod.vi ‏32 KB

  • External Clock PCI-6110

    Hello / Bonjour
    I am using Labview 6.1 / Window 2000 and a NI PCI-6110 card.
    The system that I develop uses an external clock (connected to the PFI7) to sample a signal in channel 0, a trigger connected to TRIG 1 starts an acquisition. The program controlling the DAQ is a modified version of “Acquire N Scans ExtScanClk D-Trig.vi” example, I have removed from this example the two sub-vi “AI Clock Config”. The program uses then the STARTSCAN signal as an external clock.
    I have three questions:
    1 How do you configure STARTSCAN to either the rising or falling edge polarity as it is stipulated in the pci-6110 user manual?
    2 What is the purpose of the two sub-vi “AI Clock Config” in the “Acquire
    N Scans ExtScanClk D-Trig.vi” as it seems the PCI-6110 card doesn’t need them to run properly with an external clock?
    3 Should I configure the CONVERT* signal if I would like to sample the channel 0 signal immediately when a STARTSCAN pulse appears?
    Thank you

    Thank you rgharrison for your answer
    I tried to make some modifications and tests following your comments.
    I have incorporated the �AI Clock Config� in my application (which is now very similar to �Acquire N Scans ExtScanClk D-trig.vi� except that there is only one �AI Clock Config� VI) and I have these questions and comments:
    As the PCI-6110 samples each channel simultaneously (and I want to sample only one channel), should I set the channel clock as you mentioned?
    Given that my external clock is connected to PFI7 and I have specified �PFI pin, high to low� in �clock source code�, it doesn�t matter for the board if I set any PFI as �clock source string�: my board still find an external clock. But if I leave �clock source string� blank I�ve got
    an error. I noticed also that the parameters of the �actual clock rate specification� cluster are still equal to zero. Is it normal or I misunderstand something?
    I don�t understand why I should set up the �clock source� as fastest as possible, as I want to use an external clock and sampling my signal one time per external clock period. Also, in the �Acquire N Scans ExtScanClk D-trig.vi� exemple, after set the clock as fast as possible, the following VI �Ai Start� disable the internal clock, so again why set up the clock and disable it just after?
    If I set the �clock source� at the maximum rate and if the scan clock (my actual external clock) is slower than the �clock source�, can the board acquire more than one sample by external clock period?
    Regards

  • Continuous in- and output with PCI-6229

    Hi All,
    I'm currently evaluating a PCI-6229 card on RTX (and maybe InTime later on). The main goal of the evaluation is to prove we can get hard real-time, deterministic behaviour from this system in order to use it to replace our current DSP-based solution.
    To do so, I'm setting up a rather simple program that should
    - continuously acquire 1 channel @ 20kHz
    - have a processing loop of 5mSec, ie 100 samples; this loop should be entered every 5mSec as exactly as possible
    - do some simple processing in the loop (thresholding the signal)
    - bring out the result on an analog output (low signal if signal is under threshold, high signal for all samples above the threshold)
    I could get the basics working pretty quickly: continuous input, continous output, continuous input with dma, input using interrupts.
    Trying to combine everything isn't really working out however.. Normally I'd try and try until knowing the device inside-out but now I have a rather strict timeframe so hopefully someone here can provide some insight.
    Questions:
    1. For the input, I can get an SC_TC interrupt each time one frame is scanned. I measured this on a scope by toggling a digital output on the card, and there's no noticable jitter on the squarewave which is a good sign.
    However I'd like to combine this with DMA, but the DMA is lagging a bit on the interrupt so I end up having to poll the DMA after all in the ISR, so there's no use using the interrupt in the first place.
    Is there a way to set up continuous DMA servicing and get an interrupt from the DMA system itself after 100 samples are transferred?
    2. For the output, I cannot get continuous mode working with DMA, only by writing to the FIFO manually. I can preload a couple of frames with the dma, but after calling aoStart(), tDMAChannel::write() works once, but all calls afterwards return kBufferUnderflow. Any ideas?
    I probably have to check when exactly to write to the DMA, but I have no idea which of the many status functions to use. Tried with AO_Status_1.readAO_FIFO_Half_Full_St() but that's not it. tried to write it on each UC_TC interrupt but that didn't work either.
    3. DMA is, to my understanding, a more performant way of getting samples into the host and doesn't require to call AI_FIFO_Data.readRegister() in a loop and vice-versa for the output side. But are there really benefits in using DMA?
    4. I made a basic program to bring everything together the simplest way possible: preload 100 samples in the output FIFO, start analog input, start analog output, have the ISR copy all values directly from input to output FIFO.
    Putting both analog signals on a scope, I expected to see the input and about (see question5) 5mSec later the same signal on the output, with no jitter.
    However what I see is the output is just floating around, in other words there is no fixed delay between output and input! How is this possible? I use the same divisor for in-and output. Is there any sample code available that achieves what I want?
    5. Is there a way to start both input and output at the exact same time, eg at the same edge of a certain clock pulse? How are input and output synchronized? Can I be sure they never go out of sync?
    Solved!
    Go to Solution.

    update: looking at the DAQmx control samples, it seems some of them set the start trigger for the AO to the AI start trigger. I mimicked this using kAO_START1_SelectAI_START_1 with the aoTrigger method, and the sync seems better now: the output starts exactly 10mSec after the input (or 5, if I preload only one frame) and stays in sync for about 25mSec. That it goes wrong.
    At the moment I'm using no DMA, just one simple interrupt routine that basically does
    board->Interrupt_A_Ack.writeAI_SC_TC_Interrupt_Ack( 1 );
    board->Interrupt_A_Ack.flush();
    toggle ^= 1;
    board->Static_Digital_Output.writeRegister( toggle ? 0x00 : 0xff );
    for( u32 i = 0 ; i < numSamples ; ++i )
      const u32 val = board->AI_FIFO_Data.readRegister();
      board->AO_FIFO_Data.writeRegister( val );
    In the screenshot in the attachment you can see this goes wrong: cursor A shows the position of the input signal (=AI 0, yellow) that should be shown 10mSec later at the output (blue line=AO). Cursor B shows this 10mSec later position, and you can see there's some garbage right after the cursor. This is the data that was written to the AO FIFO in the fifth interrupt (interrupt position show in purple).
    Trying to figure out where that comes from, I put board->AI_Status_1.readAI_FIFO_Empty_St() in the interrupt loop. And effectively, when trying to read the 500th sample, it reports that the FIFO is empty. Consequently the data written to the AO FIFO does not make sense anymore. But I do not understand how can this ever happen? The SC_TC interrupt is fired whenever 100 samples are read from the input. So after this interrupt occurs, the FIFO should always contain at least 100 samples, no?
    Attachments:
    tek00000.png ‏22 KB

  • Reading digital port with external clock at maximum speed

    I have a PCI-6509. I am programming a fast loop to read 32 bits values from the digital input using an external clock ( injected into one of the card pin inputs )
    The environment is Windows2000 + Visual C++ .
    basically I am doing
     DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
     DAQmxErrChk (DAQmxCreateDIChan(taskHandle,"Dev1/port0:3","",DAQmx_Val_ChanForAllLines));
     DAQmxErrChk (DAQmxSetSampTimingType(taskHandle,DAQmx_Val_ChangeDetection));
     DAQmxErrChk (DAQmxCfgChangeDetectionTiming (taskHandle,"/Dev1/port5/line4:4", NULL, DAQmx_Val_FiniteSamps  , sampsRequested));
     DAQmxErrChk (DAQmxStartTask(taskHandle));
     getSystemTime...
     DAQmxErrChk (DAQmxReadDigitalU32(taskHandle,-1,-1,DAQmx_Val_GroupByChannel,data,sampsRequested,&sampsRead,NULL));
     getSystemTime...
    I pass a data buffer big enought to hold the number of samples I am requesting ( for example 10000 of uInt32 ).
    It works fine. I get my values but the speed I get is only around 10 KHz.
    I print the system time before and after the call to DAQmxReadDigitalU32 as you can see from the above code. 
    This makes no sense because my external clock in ,"/Dev1/port5/line4:4" (as selected on the ChangeDetectionTiming call) runs at 2.0 MHz.
    Could someone tell me what parameters I have to pass to this sequence of NI DAQ functions calls in order to really read at the speed of my external clock?
    many thanks in advance,
    Roberto AButer.
    Note :
    I am going desperate with the web pages, documentation , online helps and the pletora of products and so on.
    I did pay to NI a considerable amount of money for the card , the labview software etc and I just want to do the simplest 20 lines C program to read my digital signal at the speed is being injected. Should that be that difficult????

    Hello caca,
    the board you are using is specified as a static IO board. That means it was not constructed to do highspeed DIO operations.
    You cannot use a hardware clock to time your input and output
    operations, so you have to use a software timing or, as you chose, the
    change detection interrupt. But the maximum speed you can archieve
    doing this, is somewhat limited of course.
    Check this thread for some more information.
    Ingo Schumacher
    Systems Engineer Sound&VibrationNational Instruments Germany

  • Driving DO lines with external clock wired to PFI lines

    Hi all,
    I have few issues understanding how to use hardware timing resources in M series USB6229, with particular focus on DO. I have read last couple of day all google offered on the subject but I am still straggling with some basic tasks. To cut the story short, the 1e6 dollar question:  can I set up 7 independent DO lines where (different tasks or virtual channels) where lines use same hardware timing source (eg, freqout or CO0 set to ~10kHz sampling time routed to PFI0).
    Note: the reason I need 7 independent lines and not a port output (which would be obvious solution) is because I need to have (vastly) different number of samples and for each line.
    Follow up question regarding timing: As I understood, any of PFI ports could be used and a input to the external clock which could be used to drive DO line(s) samples. I have tried to generate one DO, eg. P0\line4 by using CO0 to generate 10kHz sample rate.  The signal on the line4 is pulse with frequency of few Hz which I routed to PF6 (with actual wire) in hope to use this signal as a clock for line5. I tried this but I am receiving errors about "resources in use"
    Possible reason(s):
    Specified route cannot be satisfied, because it requires resources that are currently in use by another route.
    Property: SampClk.Src
    Property: SampClk.ActiveEdge
    Source Device: USB-6229
    Source Terminal: PFI6
    Required Resources in Use by
    Task Name: _unnamedTask<7B>
    Source Device: USB-6229
    Source Terminal: PFI4
    Destination Device: USB-6229
    Destination Terminal: do/SampleClock
    Task Name: _unnamedTask<79>
     Apparently, many of internal clocks are routed internally to different PFI lines which mean the lines are occupied resource, and I do not know how to solve this.
    I wanted to ask you does this principle sound as something that should work and if you know about some examples that would be excellent.   
    Any help would be greatly appreciated.
    Cheers, Nenad

    > To cut the story short, the 1e6 dollar question:  can I set up 7 independent DO lines where (different tasks or virtual channels) where lines use same hardware timing source (eg, freqout or CO0 set to ~10kHz sampling time routed to PFI0).
    No, you can't. The USB-6229 has a single digital output FIFO which can only be used by one task at a time.
    > Note: the reason I need 7 independent lines and not a port output (which would be obvious solution) is because I need to have (vastly) different number of samples and for each line.
    It should be possible to generate all seven signals with a single task by generating a waveform that includes all seven signals. If the signals repeat at different rates or you need to start/stop them independently, you will have to disable regeneration and continuously generate new waveform segments on the fly. Continuous Write Digital Port - External Clock - Non Regeneration should be a good starting point for the DAQmx programming, but actually generating the data is likely to be the challenging part.
    Brad
    Brad Keryan
    NI R&D

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

  • External clocking proble with NI-DAQ 6534 after driver upgrade

    Hello newsgroup,
    I've got a Problem with a pattern generation using the NI-DAQ 6534.
    I'm using it in 32 Bit Output mode with external clocking.
    After changing the PC and the OS from a P II 333 Mhz running Win98
    to a P 4 1,8 GHz running WinXP Pro the use of new drivers was nessasary,
    because the old driver doesen't work at all. The following problem occurs
    by using actual driver: Using my old programm external clocking doesen't
    work anymore, but internal clocking works fine. I'm using C++ not Labview.
    I'm not shure if this is the right newsgroup for my problem. If not please
    give me a hint were it belongs to.
    Regards
    Michael

    Michael:
    What version of NI DAQ did you have? What version did you upgrade to? Is your 6534 a PCI board or is it an AT/ISA based device? Have you changed your code at all? You code should be fully compatible with a new version of NI-DAQ... Please provide more exact details of the problem so I can help futher. Are you getting errors or is it just not working?
    Sincerely,
    Brooks B
    Applications Engineer
    National Instruments

  • Counter problem PCI 6229

    i am using TWO PCI 6229 cards (2*2 counters, DMA Channels), OS-winXP, LabVIEW 2009 SP1.
    now using 3 counters (1. edge counter, 2 and 3 for semiperiod measurements).
    i can run the edge counter alone without problem. but i cant run all the 3 counters in parallel.then the whole application slowsdown and i see the readVI at 3rd counter (buff_semi-period_continuous) not running.
    i have changed the data trasfer mechanism from DMA to Interrupts but that also doesnt help.
    analog input (16 differencial ) and output channels of both the cards are using.
    can any one suggest a solution to this problem??
    Kudos always welcome for helpful posts

    Hi RENN,
    the semi-period-measurement is a implicit-timed measurement. This means that there is no fixed point in time when the result of the measurement is delivered. (It depends on the signal when the driver provides you with a valid value.)
    The behaviour you see is mostly caused by using multiple implicit-timed measurements in one single loop, esp. with buffered measurements.
    To prevent this kind of deadlock use a single loop for every semi-period measurements.
    I hope this helps.
    Ralf N.

  • PCI-6229 M-Series (count 3 encoders)

    Hello,
    I only have one DAQ board (PCI-6229 M-Series) and as I know, the board have two counters:
    Ctr0 which uses PFI8 and PFI10 - now using that to count outputs from my first encoder
    Ctr1 which uses PFI3 and PFI11 - for my second encoder
    But I have 3 encoders, can I use other PFI pins on the DAQ board to count the outputs coming from my third encoder? Is it possible with just one DAQ board? Did I miss any example code which tell me how to do this?
    Thanks alot.
    Kenneth

    Hi
    Try the link below
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=F0F64AEE06C0010CE0340003BA7CCD71&p_...
    for using a counter as the DIO clock for M Series boards.
    Requirements= LabVIEW 7.1
    NI DAQ MX 7.3
    I hope this example helps!
    Kind Regards,
    Kurt
    Attachments:
    Using_a_Counter_as_the_DIO_clock_for_M_Series.vi ‏84 KB

  • 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

  • External clock LabView crash with Measurment Computing board.

    Hi,
    I'm using a Measurment Computing PCI-DAS6402-16 board with Labview (using Universal librarys VIs) in a 4-stroke engine DAQ application and amognst the signals obtain Internaly clocked, there is In-Cylinders Pressure signal which is timed with a Crank-angle deocoder sending analog pulse signal.
    Although there seems to be no problem while the motor is running, it appears that when to external clocked signal  is not getting any pulses (while the motor is not running) then Labview stops to respond and awaits for the external clock to start, and that doesnt happen within 10s then it crashes.
    I dont know whether it is Software problem (because external and internal clocked signals are both in the same WHILE LOOP) or if it is a Hardware problem (because With a NI card there seem to be no problems).
    THNX in Advance

    Well it couldnt be a more typcal windows crash:
    If a channel is externally timed with an analog pusle signal, If the VI starts running but the external clock isn't then:
    -Labview stops to respond to any clicks (there is no .exe at this point) but it keeps working though (That i know cause if i start the ext. clock at this point it "un-stucks' and starts working)
    -But, if for some secs no ext. pulse signal is generated then labnview app stops respondin and i get the typical 'send error report' window.
    Could it be that the Universal library for Measurment Computing boards haw a bug? Cause the same thing happens with the "Analog input External Clock.vi" example given with the Library..so it can't be my mistake..or can it?!

  • 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

Maybe you are looking for