High frequency quadrature decoder (NI PCI 6221)

Hello, i would like to ask you about high frequency quadrature decoder. I am using module in DAQmx for measuring linear position. For this i am using NI PCI 6221. My problem is that i want to use this for my interferometer and we need really high speed. So I tried to use External timing whitch should be possible for this card up to 80MHz. Unfortunatelly i always will get error message that there is some kind of owerflow and my program crashes. So my question is how to get all data form this card. I know that the buffer size FIFO is only 2 so if it is impossible to get all data so i want find another solution. Is it possible let my card work alone on 80MHz and only repeatly rewrite all buffer and just sometime ask this card for sending current buffer. I dont really need all the data, but when i will ask i need to know reall position. This high speed is really necessary because my interferometer is sensitive and i dont wat to lose any steps. If there would be any possibility how to work on 80MHz and only sometime ask for sending data with position, it would be great. Sometimes i will ask not for only current position but for full buffer because i want so see what is happening during some time period, but this task will be only sometime. 

Dear BMAJTZ,
  The counter frequency (the maximum speed available) is configured by the Task in the background. In our case, the counter is set to detect edges, so it always uses the maximum speed available. If an edge occurs, the count value increases by 1, and this accumulated count value (stored as a binary number) is read by the DAQmx Read VI, and converted to meters. So if your encoder input is slow enough for the 80 MHz card to handle, you won't miss any ticks, even if you only read the value occasionally.
You can find further information about counters and encoders on these links:
http://www.ni.com/academic/students/learnlabview/digital.htm
http://www.ni.com/white-paper/7109/en
 Also if you can tell me the approximate frequency of your encoder signal, and how often you nedd the position info, I can do some benchmarking for you to see if your card is capable of the task.
Best regards:
Andrew Valko
National Instruments
Andrew Valko
National Instruments Hungary

Similar Messages

  • PCI-6221 high CPU usage

    I'm currently using a PCI-6221 DAQmx card to continuously acquire readings from 9 channels at 5000 samples per channel per second. Using a timed while loop, I reduced the CPU usage to ~50%. When I add the additional control code for two other devices (that use ~4% of the CPU each), the CPU usage goes up to 100%. I tried to increase the DMA on the PCI card, but it doesn't appear that I can alter it on this card. I'm setting the "DAQmx Read" control to "Analog 1D Waveform N Channels N Samples." Also, when I remove the waveform indicators on the front screen, it doesn't lower the CPU much. If anyone can offer suggestions for lowering the CPU usage without sacrificing the above mentioned data collection parameters, I would appreciate the help greatly!
    Nina

    Alan,
    The CPU usage for the 9 EMG signals is ~50%.  The second input is video acquisition using an IMAQ 1411 card acquiring 30 samples per second with real time display.  The third input is a serial connection which samples at 1Hz.  Each of these codes uses approximately 4% CPU when running separately.  Each has the option of saving the data while still continually displaying on the front panel. The video acquisition utilizes the grab image setup along with notifiers for saving the data.   To link  the saving of the files (using case structures) to a single control button on the front panel , I created local boolean variables. The EMG readings use a timed while loop.  The serial connection uses a timed while loop cycling at the same frequency.  The video acquisition uses a while loop contained within a for loop.
    Thanks for your continued help!
    Nina
    Message Edited by nins on 07-06-2005 02:47 PM

  • Do I need extra logic circuit for quadrature encoder using M-series DAQ PCI-6221?

    Hi,
    I understand that extra logic circuit, say quadrature clock converter LS7083/7084, is needed to enchance the reliability or integrity of the data for E-series board DAQ in accordance to application note: AN084.
    This is due to the vibration/jitter of the motor during running.
    Currently, I'm using M-series PCI-6221.
    Is it this new model itself can eliminate to construct this extra circuit?
    Coz I observed error is accumulating after motor rotating certain period of time. It defintely affect the control performance.
    Other than using hardware, can we use software to eliminate/mitigate the error?
    Please enlighten me. Thanks.
    Best regards,
    IANES

    Hello,
    The ap note you are referring to discusses circuitry that conditions the quadrature encoder signals before they get to the DAQ device to eliminate 'false' signals being sent to the DAQ device. The same system would apply to an M Series Device. I am not aware of any way to achieve this functionality in software. FYI, there is some good documentation for counters and counter applications for M Series. Take a look at the attached M Series help file. Hope this helps some.
    -Alan A.
    Attachments:
    M_Series_Help.zip ‏1145 KB

  • NI PCI-6115, problems in high frequencies

    Hi,
    I'm not sure if this is the right place to make this question but let's try..
    I try to measure the frequency response of the output impedance from a certain switched-mode converter using NI PCI-6115 (I inject sinusoids into output voltage and measure the output current). I get a nice plot but there are some problems in high frequencies. It seems that the measurement card makes some unexpected peaks. I use the network analyzer (Venable) to verify the results and beyond 200 kHz the results do not match. I attached the plot with the results from both methods (MC = PCI-6115, Venable = network analyzer). Does anyone have any idea what could cause this difference in high frequencies? The measurement set ups where exactly identical. 
    Thanks! 
    Attachments:
    Doc1.pdf ‏87 KB

    looks like a resonace at 400kHz...
    Are you shure that the input impedances of both setup are the same? Are you injecting with a transformer and build a LC resonator with the MC?
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

  • Trouble specifying TTL for digital outputs from PCI-6221

    Hi!
    I'm trying to generate TTL output signals using a PCI-6221 daq board - within Labview, I'm using DaqMx to create two digital waveforms and then write these. When I plug in an oscilloscope, the shapes/frequencies of the signals are correct, but the lower value is 0V, and the higher value is 1V, rather than the TTL values. Is there a way to specify these voltage levels to TTL within the software? I see from NI help that "do.logicfamily" exists to specify TLL, but when I add a property node and connect it to the channels, I do not see Logic Family as an option under "digital output." Let me know if you have any ideas!
    Thank you,
    Emily

    Set your oscilloscope to use 1MOhm impedence.  Your problem is that the maximum current for those DIO is 24mA.  1V/50 Ohms = 20mA.  So you are current limiting the digital outputs.  If you need more current, then you need to add in some digital buffer chips that can output more current.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to make a ramp for a stepper on PCI-6221

    Hello!
    I'm looking for a solution/example in ANSI-C to make a ramp for a stepper that is connect at PCI-6221 CTR-port.
    The function I'm actually using is:
    DAQmxErrChk (DAQmxCreateCOPulseChanFreq (taskHandle, "Dev2/ctr1", "", DAQmx_Val_Hz, DAQmx_Val_Low, 0.0, 1000.0, 0.5));
    DAQmxErrChk (DAQmxCfgImplicitTiming (taskHandle, DAQmx_Val_FiniteSamps ,1800));
    So this works fine when the stepper have to run constantly. But for my application I need the use of a ramp. To change the frequency value I have to write in a running Task, but that is (IMHO) not possible? Please correct me, if I'm wrong.
    I don't not know how to change the value unless to stop the task and start it with new value. But this method is not a solution, cause i always stop the motor and start it with a higher frequency from zero. So what I'm actually do is to look after the correct NI-function for my problem.
    If someone has an idea/example/solution, please post it. I'm thankful for all kinds of feedback.
    Best regards,
    Oliver

    Unfortunately, ramping a stepper is not straightforward using the counter hardware.  Under finite generation, the freq cannot be changed on the fly.  And under continuous generation, where freq *can* be changed on the fly, it must be done under software-timed control.  Also,  under continuous generation, it will be pretty tricky to both change the freq on the fly *and* control the exact total # of steps.
    If you need a well-controlled ramp and a well-controlled # of steps, I'd suggest you start figuring out a scheme to use the hardware-timed digital output port (see also "correlated dio").  The big downside is that you'll need to generate a large buffer of digital states to define your pulse train because you'll probably need to output at something approaching a MHz.  Out of those million samples per second, probably only about 0.1% of them represent transitions.
    When these kinds of apps come up, I always put in a good word for one of NI's Alliance partners - Viewpoint Systems, who sells a digital board that works much more sensibly for these situations.  With the DIO-64, you create buffers containing only the timestamps of the transitions and the digital state at those transition times.  So to generate 1000 steps in a second, you'll buffer 2000 states rather than 1,000,000.  You'd also get ~20x better quantization error for your available step rates.
    I've been requesting a buffered counter output capability from NI since before Y2K, so I'm no longer holding my breath...
    -Kevin P.

  • Need help with counters on PCI 6221 (37 pin)

    Hi all,
    I have a system with a PCIe 1429 connected to a Basler A504 camera and a I use a clock generator (SRS CG635) set at 3.9 kHz to trig the image acquisition.
    On the same system I need to add a PCI 6221 37
    pin to acquire :
    - 2 AI at 39 kHz, synchronized with the image acquisition. (10 AI sample for each image)
    - 1 counter to measure a frequency
    Since the accuracy of my 3.9 kHz clock is much higher than what I have on the DAQ board, I figured a nice option would be to have a retriggerable DAQmx task that generates 10 pulses at 39 kHz for each pulse received from the clock and then use this to trigger the DAQmx AI task.
    Of course this can only work if the "trigger" sources that I define for these two tasks don't take the two counters I have on the board.
    So let's describe the DAQmx tasks :
    - here's the one that generate the 39 kHz on counter 0, from the 3.9 kHz that I input as a trig source on PFI 4
     - here is the analog input task for which I set the trigger on PFI 6.
    Question is : can I "softwarely" tell the board to route the output counter (Ctr0) to PFI 6? And if yes, how?
    Thanks in advance for any help!
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Solved!
    Go to Solution.

    Sorry, no can do on the counters.  The M-series boards would use up both counters for the task of generating a finite pulse train so there'd be no counters left for freq measurement.  From what I've read, the newer X-series boards only use 1 counter for finite pulse trains (and also have 4 total available.) 
       FWIW and for future reference, software routing of signals *will* work though there are some restrictions on which signals can be routed to where.  The M-series boards are generally very flexible though, and you can double check the routing options in MAX.  Also, in general, there's no particular problem running 2 tasks of the type you proposed simultaneously.  Note though that the term "trigger" has a more specific meaning in LabVIEW-land than it may have in normal life.  Here you were using the counter output as an "external sample clock" which is distinct from using it as a trigger.  Triggers initiate tasks, then sample clocks cause samples to be taken during them.
    Anyway, here's a possible workaround which doesn't require you to generate any counter pulses, so you can perform your freq measurement and still have a spare counter left over.
    1. Configure your AI task to use the external 3.9 kHz signal directly as its sample clock.
    2. Also configure your AI task so that the channel list contains at least 10 duplicates of each of your 2 AI channels, along the lines of "ai0,ai0,ai0,...ai1,ai1,ai1,..."   Or you could alternate them back and forth if you want.  You'll have to trade off the importance of the time difference between the two AI channels vs. the risk of the crosstalk-like effect from mux'ing back and forth on each sample.  Myself, I'd probably make a channel list with 12 dupes of ai0 followed by 12 dupes of of ai1 and later ignore the first 2 conversions on each channel just to be more sure the ADC has settled after muxing between them.
    3. Finally configure your AI task to use a specific timing for its "convert" or "channel" clock.  Since the timebase for your AI board is independent of the more accurate external 3.9 kHz clock, you should err on the side of caution.  For example, supposing you were going to take exactly 20 scans within each sample interval, I'd pick a convert clock rate that's a bit higher than the apparent minimum of 20x3.9kHz=78 kHz.  Probably something in the 80-100 kHz realm.
    -Kevin P

  • Using timer/counter with PCI-6221/USB-6210 to control timed-loop VI

    Dear all,
    I need to ask about two devices and one of their functionalities, PCI-6221 and USB-6210. For our NI-based system, we need to control some timings in a Timed-Loop vi, for that currently we are using PCI-6221 and we give external TTL signal (at 1 kHz) to it,
    recenntly we need to make some changes and for that we found USB 6210 DAQ to be more suitable, but we need to clear ourselves on some specific things.
    Can the counter/timers functions available in the either PCI 6221 or USB 6210 can be used to control the Timed-loop VI by giving external clock or by using their own internal clock source?
    Although we are using external clock with the PCI 6221 but we want to know about the usage of their internal clock, also are controlling timed-loop also possible for USB-6210
    Also... What if we use the RTOS, are they still able to control the timed-loop VI  without giving any 'EXTERNAL CLOCK' and using the internal clock sources of the DAQs
    Waiting for reply,
    Bests,
    RaJaf
    Solved!
    Go to Solution.

    Ben,
    I having read previous email which I send earlier with general overview, we discussed in more detail within our team and I am giviing the specific answers.
    Please check in RED the most recent answers. Blue are the questions/suggestions by your side.
    1.    Using Internal hardware clock of PCI-6221 would enable us get rid of external clock, but how to divert the internal hardware clock to the current settings. Any idea  (can you provide us with some reference manul for otherwise). I mean is there some flag-bit etc. or VI
    2.       Is it also meant that with the installation of RTOS the timed-loop can directly get the timing source from the internal hardware clock PCI-6221? --- How???
    3.       In order to make desktop to work as RT system, what is the hardware (motherboard, processor, etc..) requirement? What are the LabVIEW modules (specific name) that needed to be installed? Our platform is LabVIEW 8.6. (Currently we have windows-7 with i7 core processor)
    What kind of application are you intending for this system? ---- high-speed laser scanning system.
    Are you most concerned about accuracy, speed, or responsiveness? To control the laser mirror scanner to move at 1 kHz or 2 kHz speed. On the other hands, using PCI-5105 (128 MB memory) as a DAQ for real-time/on-the-fly data processing.
    Bests,
    RAJAF

  • High frequency power measurements

    Hey,
    I'd like to know if there are developments in measuring electrical high frequency signals with labview without using an extern power analyser. At the moment i'm using a yokogawa power analyser but i'd like to know if it's possible to log HF signals without the help of a power analyser... Are there NI products on the market for this purpose?
    Thx,
    Andy

    Hello,
    In the case of frequencies up to 200 KHz, NI can provide several solutions using the 'standard' data-acquisition boards or digitizers (scopes), from a low to very high accuracy solutions.
    A good solution can be one of the high speed M-series boards (PCI-625x).  These boards have up to 32 multiplexed channels with a resolutions of 16-bit at a speed of 1 MS/s  (500 KHz).
    A better solution would be a S-series boards.  These data-acquisition boards sample all input channels simultaneously.  We have boards with 2, 4 and 8 channels and sample frequencies of 10 MS/s  (up to 5 MHz if needed).  S-series board are the boards with product numbers PCI-61xx.
    The best solution is to use a digitizer (scope).  Also here a lot of possibilities going from low to higher bandwidth and resolution.
    The most flexible is the PXI-5922.  A 24-bit digitizer if you sample @ maximum 500 KS/s.  This board only exist in the PXI platform.
    Then NI has 8-bit digitizers (normal resolution for scopes) from 15 till 125 MHz bandwidth.  If you need a higher resolution they have solution up to 14-bit (very high for scopes) @ 100 MHz.
    Please give your local NI Office a phone call.
    They have technical engineers who can discuss your needs and provide you a solution.
    Best regards,
    Joeri
    National Instruments
    Applications Engineering
    http://www.ni.com/ask
    Make our forums great:
    If you like the answer, don't forget to "Kudos!".
    "Accept the Solution" if your question is answered!

  • Error 200141 when trying to measure motor encoder's speed from PCI 6221 card,

    Hi,
             I was trying to measure angular speed of a motor from its encoder signal. I'm using Ctr pin from PCI 6221 card take signals from the encoders. The problem comes when I've got an Error-200141 saying "data was overwritten before it could be read". I have tried a few ways as follows to overcome this problem.
         - Use DMA
         - Get rid of the noise from the signal by shielding the wire from encoder to DAQ card and using a capacitor.
            None of those seemed to solve the problem completely. Even though the noise from the signal was removed, I could still see the mechanical glitter at the edge of all the pulses from the oscilloscope. Is that a possible cause of this problem (my technician told me we can do nothing with this glitter. In other words, we can't remove it)?
            Please suggest me how to solve this Error-200141. With this message, I have also attached VI.
            Thank you very much.
       Regards,
       Suksun
    Attachments:
    Meas Dig Period-Buffered-Continuous-Low Freq 1 Ctr_Angular speed from encoder.vi ‏72 KB

    Hi Suksun,
    Only had a quick glance at your code, but can you drop the samples to read to 100.
    I think what the problem is from what I can make of your code, is that
    you have a low frequency counter, that you measure on the rising edge,
    however if you don't get a 1000 pulses within 100 seconds, DAQmx will
    report an error. So by lowering the number of samples to read you
    should be able to get 100 samples in 100 seconds, you should not
    overwrite data as the buffer will be sized correctly.
    Hope this help
    Regards
    JamesC
    NIUK AE

  • DAQmx Error 89137 When trying to make a high frequency measurement.

    I am using a PCI-6602 Timer/Counter for multiple measurements on a serial interface...
    I have the clock line connected to Gate0, the enable line to Aux0 because I need to make a two-Edge seperation measurement between the two later...
    But I also want to make a "Period/Frequency Measurement (High Frequency with Two Counters)" measurement...
    This requires that the signal to be measured is on Source0...
    I implimented the following Code:
    void meas_FP_Freq(float64 *Freq0, float64 *Freq1)
    TaskHandle CLK0_Freq, CLK1_Freq;
    DAQmxCreateTask ("FP_CLK0_Freq", &CLK0_Freq);
    DAQmxCreateTask ("FP_CLK1_Freq", &CLK1_Freq);
    DAQmxConnectTerms ("/Dev3/PFI38", "/Dev3/Ctr0Source", DAQmx_Val_DoNotInvertPolarity); // Gate0 to Source0, No Error....
    DAQmxConnectTerms ("/Dev3/80MHzTimebase", "/Dev3/Ctr1Source", DAQmx_Val_DoNotInvertPolarity);
    DAQmxCreateCIFreqChan (CLK0_Freq, "Dev3/ctr0", "", 6000000, 6500000, DAQmx_Val_Hz, DAQmx_Val_Rising, DAQmx_Val_HighFreq2Ctr, 0.001, 4, "");  // High freq measurement
    DAQmxCreateCIFreqChan (CLK1_Freq, "Dev3/ctr1", "", 6000000, 6500000, DAQmx_Val_Hz, DAQmx_Val_Rising, DAQmx_Val_LowFreq1Ctr, 0.001, 4, "");
    DAQmxReadCounterScalarF64 (CLK0_Freq, 3.0, Freq0, 0); // Run-Time Error -89137 Specified Route cannot be satisfied..etc
    DAQmxReadCounterScalarF64 (CLK1_Freq, 3.0, Freq1, 0);
    DAQmxDisconnectTerms ("/Dev3/80MHzTimebase", "/Dev3/Ctr0Source");
    DAQmxDisconnectTerms ("/Dev3/80MHzTimebase", "/Dev3/Ctr1Source");
    DAQmxClearTask (CLK0_Freq);
    DAQmxClearTask (CLK1_Freq);
    The "Low Frequency" method works fine, but the resolution is too low...
    Every help file I've read indicates I can use different PFI inputs for measurements... What am I missing?

    Hi,
    The reason that you are getting the error is the PFI lines are being reserved twice. You don't need the DAQmx Connect Terms functions in your code because the DAQmx driver does this for you automatically. If you still receive an error after doing this, try to changing the low frequency counter number.  I hope this helps you with your application.
    Regards,
    Hal L.

  • PCI 6221

    Good day all,
    Kindly assist on this. I have a PCI 6221 and a connector block BNC 2110. I am using a PCB accelerometer to acquire signal from a modeled building with the aim of getting the frequency components  from the time response after exciting the building at a specific constant frequency. The problem is I kept noticing that I cannot select acceleration with PCI 6221 so I selected voltage in DAQ. The time response seems okay but the FFT is totally not worth it. I presume I should get my specific frequency back since this if forced excitation but this is not happening.
    My question are
    1) Since PCB accelerometer are supposed to be given a little voltage of 4A to get them started, can I use PCI-6221 the way I am using it and still acquired signal from my building which can be presumed normal.(I mean okay)
    2) Is it right for me to select voltage in DAQ instead of accelerometer using PCB accelerometer when the aim is to acquire acceleration values or let me put it this way :if I cannot get a card that can read acceleration can I still used the voltage in DAQ since the PCB ICP accelerometer gives out voltage values. Please which is the right way.
    Thanks all.

    Hi Osmosis,
    to measure acceleration using 6221 and PCB accelerometer, you need signal conditioner (480C02 from PCB) to
    power sensor and decouple sensor DC offset (around 10V). You can use voltage task and scale readout according
    to your accelerometer sensitivity (for instance 100mV/g). Another way is to use one of DSA cards. Consider
    USB 9234 for direct connection to PCB accelerometer and measurement using acceleration task.
    Damir
    Niksis d.o.o.
    PCB Slovenia

  • PCI-6221 pwm on separate 24 channel outputs

    We have a PCI-6221 board and want to produce 24 separate 100 hz pwm signals. All 24 signal will be at the same frequency but they will all have different duty cycles. What is the best way to develop these separate 24 pwm signals?

    hei,
    i am not familiar with the word "pwm". explain.
    i guess you want to use the DIO signals, at 100Hz? this card has about 1MHz frequency. therefore depending on the accuracy of your waveforms, you can go to lower time base.
    Once this is set, you can use DAQmx for addressing either all channels together, or one at a time. i would opt for the "1-channels n-samples", where your 1 channel is actually the whole combination of the 24 ports out.
    in order to do that you will have to compute in advance (or at same time as you output to buffer), the whole 24bits for each cycle. that is one reason you might want to lower your timebase - lots of computation.
    all you have to do now, is create a subvi wich will create 24 rows lists of values. the list will be following your timebase, say 1MHz.
    then, assemble all columns into 3 words (3*8bytes), or one 32bit long. that will depend how you enter the data to DAQmx.
    at the end you expect to have a single 1D array with all info for all 24 channels at a specific time. you enter that into buffer and start task.
    for futur implementations, say if you want to do that for 100s of seconds, you will have to regenerate those function while it is running. we will get there as you finish the first step.
    Is it helpfull?
    Gabriel
    ... And here's where I keep assorted lengths of wires...

  • How to get counter values from pci 6221 card?

    Hii
     I am using PCI 6221 card .. In that i am using the ctr o .. In my application i am using Linear encoder to measure the Lift movement.. so from software how to access the counter values i.e how much mm it moves... 

    Measure Angular Position.vi in the LabVIEW examples will be a good starting point. Adapt it to Linear Encoder by clicking on the selector below DAQmx Create Channel.vi.
    You can also create a corresponding DAQmx Global Channel (or task) in MAX and then use it in your code.
    Feel free to post back if you need further help.
    Message Edité par JB le 10-31-2008 02:15 PM

  • How Do I enable multiple trigger voltages on the PCI-6221 using NI-DAQmx?

    I am using the PCI-6221 to do some simple data acquisition.  The idea is to allow three different analog voltages to trigger the data acquisition state.  I currently have the code set up for one voltage trigger but I am not sure what needs to be done to add the two additional trigger voltages. Any ideas?
    Thanks.
    Solved!
    Go to Solution.

    Is it possible to do something as simple as this:
        DAQmxErrChk
            (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai0","",DAQmx_Val_Cfg_Default,0.0,5.0,DAQmx_Val_Volts,NULL));
        DAQmxErrChk
            (DAQmxCfgSampClkTiming(taskHandle,"OnboardClock",3000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,3000));
        DAQmxErrChk
            (DAQmxCfgAnlgEdgeStartTrig(taskHandle,"Dev1/ai0",DAQmx_Val_Rising,0.7));
    or will I need to put the trigger on PFI0?

Maybe you are looking for