Ni 6215-USB counter

Hello
We are currently using af NI 6215-usb DAQ to aquiere signals from a quadrature encoder. At maximum speed the encoder generates roughly 33000 pulses per second, which we doesn't count accurately. Our DC-motor turns roughly 90 degrees too much. If we s,low the speed down, we are able to turn very precisely.  We are using a digital filter on the counter with a minimum pulse width: 6,425*10^-6, which should fit our setup. Is the DAQ too slow? Or are we doing something wrong in our counting or setup of the counter??
Thanks in advance
Christian Carøe 
Attachments:
Block.jpg ‏412 KB

Hi Christian,
I can see that you are doing pretty much everything in one loop structure in Labivew. That's not recommanded when you are have Data acq. and Write to Disk functions. Write to Disk functions are slow compares to your Data Acq. part of the code, and it will slow down your loop execution.
You should implement parallel structures and using e.g. Queue Structures for passing data from Data Acq. loop to the Write to Disk loop.
See. "File --> New... --> VI --> From Template --> Frameworks -->Design Patterns --> ProducerConsumerData Structure" for more info.
For testing the USB-6215 and the Quad. encoder output you can basically create a new VI and only tests the Counter Input part of the code.
Please let me know if this helps.
Thanks!
Message Edited by Morini on 12-16-2009 09:48 AM
Dennis Morini
Field Sales Engineer
National Instruments Denmark
http://www.ni.com/ask
Attachments:
screendump.png ‏21 KB

Similar Messages

  • Difference between USB6008 &USB6215 counter input?

    Hello,
    I have to count pulses of a gas meter (5029 pulses = 1 m3 gas).
    I did this with a USB-6008 and it works OK. Now I want to switch over to USB-6215 and counting goes wrong.
    The USB-6215 counts one cycle random a lot of pulses (e.g. 250) and next cycle 1 as it should be if I select rising edge. This alternating process goes on and on. If I select falling edge then every cycle it counts a lot of pulses more. 
    I have the inputs connected parallel so both modules have exact the same pulses. Pulses are 4,7V with low frequency 1 Hz  till max 100 Hz.
    USB6008 input in connection = pin 29 (pulse) & pin 32 (gnd)
    USB6215 input in connection = pin 1 (pulse) & pin 5 (gnd)
    In the MAX same result as with attached LabVIEW program with rising edgge selected.
    Who can help me?
    Rgds Geert
    Attachments:
    gasmeter.vi ‏19 KB

    Hello Martijn,
    Thanks, yes this works! With digital filtering set on 2,56ms I get with USB6215 same counting as with USB6008.
    If I put digital filtering on 6,425 us then sometimes I count too much, at 125 ns this happens regularly but much less then without digital filtering. These are the only allowable settings, on other setting the counter does not work.
    Has the USB6008 a standard filter then? With a scope on the pulse input signal I cannot find glitches, so it is for me still a question why a cheap USB6008 performs in this case much more user friendly.
    Regards,
    Geert Wever
    Application Engineer
    Honeywell Emmen NL

  • How do I get 12 hardware counter channels?

    Hello,
    I am wanting to count 12 seperate pulse signals. The USB device I am currently using (6501) has only 1 counter channel that works great for one signal, but the extremely short pulses (@5us) makes software programming a nightmare for 12 signals into the digital inputs lines.
    Ideally I would be able to find a dedicated 12 channel usb counter that I can read into labview, but it does not look like an option. It looks like I may have to go with a combination.
    What are cost effective combinations of hardware devices with dedicated counters to supply my total of 12 channel counter needs?

    As always, "it depends."
    What kind of counter measurements do you intend to do?  Occasional on-demand measurements or buffered measurements for transient analysis?
    People's idea of cost-effective varies too.  On the forums, it often means that someone can't spend $1000 on truly suitable hardware, but they *can* spend many extra weeks cobbling together a sub-optimal solution with inadequate hardware.
    3 PCI-express X-series devices would be a very efficient hardware platform for all manner of buffered counter measurements since you get 4 DMA channels per card and you don't share bus bandwidth among cards.
    A single X-series device would let you capture 12 pulses as hardware-clocked digital input signals that you can post-process for pulse analysis.  You could even do neat things like capture based on change detection while using a counter to create timestamps from the change detection event pulse.  In short, it's very likely you can capture all the necessary data but will need to do some software post-processing that's conceptually straightforward but fairly tricky to get completely and exactly correct.
    -Kevin P

  • Low profile counter/timer board

    Does NI (or anyone else) make a low-profile counter/timer board? Perhaps with specs similar to 6602? If not, are there some other options that I could look into (I think the sample rates may be too high to use USB)?
    Solved!
    Go to Solution.

    Hi greatgrandpadog,
    Unfortunately, NI does not have any counter/timer solutions that are low-profile on PCI.
    Our cDAQ-9171 single slot USB chassis has four 32-bit counter/timers that can use an onboard 80 MHz clock (detailed specifications).  For external signals, you would need to use one of our digital i/o module which have various specifications.  You can find a list of them here.  This will be the best way to go for a compact USB counter/timer.  If you have additional i/o, take a look at our CompactDAQ Advisor, where you can use a 4- or 8-slot chassis to expand your i/o in a single system.  For more sophisticated control, CompactRIO offers a similar platform but with FPGA and Real-Time for greater customization and reliability.  There is an online advisor for that as well, here.
    Regards,
    Chris E.
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • Error -20023

    Hello
    I have now made a program for the USB-6215 for counting signals. I have connected a button between +5V and AI15. It can count every time i push the button, but sometimes when i don't touch the button, it still count because of noise. I then made a filter, but every time i start the program, I get "Error -20023"
    Please look my program attached to this post, and help me fixing the problem
    Thanks 
    Attachments:
    Collect Signals.vi ‏157 KB

    You are still trying to filter a single point and the filter you are using expects multiple points - you could perhaps store the points using your 'collector' and filter the result from them.
    Also, I assume you are switching between 0 and +5V? If this is the case why don't you set you switch level to a more appropriate level, perhaps some in the middle of the range (say 2.5V). If you still get unwanted switching due to noise add some hysteresis as I previously mentioned (have different on and off levels for example "low" when between 0 V and 0.8 V and "high" when between 2.2 V and 5 V) - this might be a more appropriate solution than filtering.
    If there is anything that you are still unsure of then ask and I can try to give you answers or recommend solutions but I am not going to do the work for you.
    David
    www.controlsoftwaresolutions.com

  • Cellular modem is not recognised by Leopard

    Hi. My CMOTech CCU-550 cellular modem worked fine with 10.4.10.
    Since I installed Leopard, even after checking all the configurations I keep getting the message that "the device does not exist" when I try to connect.
    My supplier tech support does not support (ie does not know anything about) macs...
    Anybody out there with any ideas?

    I'm using a HUAWEI HSDPA USB Modem to access the internet via GPRS 2G & 3G. (Vodafone NZ)
    Activity Monitor in Tiger showed up and downloads in Network, in Leopard nothing.
    Tiger's Internet connect is now part of Leopard's System Prefs > Network.
    I use the modem status icon from there, on the menu bar, to get online.
    Does System Pref > Network show the modem?
    Do you have a Mac OSX disc from your internet provider? if so check for an update, reinstall anyway.
    I often get the modem not found message after a restart. Unplug from USB count slowly to 10 and reattach, wait for a minute and try again. Try a different USB if available. If you have third party connect software from your internet provider try that, three or four times somedays. Try alternating with the menu bar option.
    Mine tells me to use the Internet connect App which of course doesn't exist in Leopard. I use the menu bar option instead. Seems to take a while to get noticed some days
    I use CheetahWatch software to keep track now Activity Monitor no longer works. It works, very well.
    http://www.versiontracker.com/dyn/moreinfo/macosx/33154
    Hope this helps.
    Cut out again with modem not found ~ only had to try three times
    It wasn't any better with Tiger.
    Message was edited by: Ashka

  • AC plug in & Battery % goes down

    I notice that even with my ac plugged in, my battery will go from 99% to 95%. Then the ac starts charging to 100%. Is this normal? I thought the MB would be using AC power only if plugged in.
    Also: is there harm in disconnecting the magsafe while MB is on? I have installed the battery update, and calibrated battery. Battery cap looks ok (FC 6259, Remaining Cap 6215,cycle count 3)
    Thanks in advance
    rj

    This is normal - your MBP will not try to charge the battery if the current charge is >95%, and depending on usage the AC power is (occasionally) insufficient and the MBP will draw a little from the battery. (In fact, this is why your MBP will actually shut off one of the processor cores if you run on AC without the battery installed, to avoid the hard shutdown that would occur if it could not draw that additional power from the battery.)
    Also, be aware that power is used during sleep. I use my MBP on AC at work and home, but it's (obviously) not plugged in during transit. So it will drop from 100% down below 95% over a couple of days, then charge back up.
    There's no harm in disconnecting the MagSafe while running - I do this all the time.
    Hope this helps...

  • Samplerate problem using Analog In and Counter In from a NI 6259 USB. "Counter timeout" setting in DAQmx?!

    Hello,
    I got a fundamental problem with the correlation of the timer settings of the DAQmx driver in DIAdem DAQ. I dont know where the problem is located exactly but maybe someone can help me if I explain what happens:
    In my configuration I use some analog inputs from a USB 6259 with 20kHz samplerate and two counter inputs for frequency measuring via DAQmx in DIAdem DAQ.
    There has to be an extra DAQin block for the analog inputs and the counter inputs with also an extra "Clock"-block for each of them. The clock of the analog inputs runs with 20kHz hardware clock and the other one with 10Hz software clock because the hardware clock mode is not allowed or supported.
    My problem is the display refresh rate in VIEW. If the counter signal has no input (because the measured system is not active) the display seems to wait for any input and doesnt refresh the analog values on screen. If the system is active and a rectangle signal is seen by the counter in, the display refresh rate raises and the frequency value is displayed more or less accurate. Has that something to do with the counter timeout setting in the DAQin driver options block (marked in the attached image)? If i decrease the timeout, the display refresh rate gets better but not as good as without using the counter inputs in my DAQ diagram. I think the counter input is not as easy to handle as the usual analog inputs... I only want to see the measured frequency on the display during the measurement without getting any influence on the analog input channels and their displaying.
    The other problem is the display and the measurement of the frequency itself. If i check the function of the counter input in the Meas. & Automation Explorer the frequency is display correct without any dropouts or something like that. The signal I measure in DIAdem on the other side looks quite bad because there are spikes of some MHz and even more although the measured range is between 20 and 80Hz!
    Has anybody made similar experiences?
    Regards
    S. Zimmer
    Attachments:
    probs.png ‏112 KB

    Hi there,
    it seems that german is your mothertongue, so I'll reply on german.
    Digitale Eingänge müssen Software getaktet werden, da nur analoge Eingänge Hardware-Takt Unterstützung haben!
    Sie können den Hardware-Takt nur mit analogen Eingängen einsetzen, die, von einem Timer gesteuert, gepuffert Werte einlesen können. Digitale Größen verarbeitet der Hardware-Takt nicht.
    Mit dem Hardware-Takt erreichen Sie sehr hohe Abtastraten. DIAdem überträgt die gewünschte Rate und die Kanalliste auf die Karte und startet die Messung. Die Hardware erfasst die Daten selbstständig und sammelt die Daten. Der PC ist nur für den Abtransport und die Weiterverarbeitung verantwortlich.[...]
    Da digitale Signale nicht im Hardware-Takt erfasst werden können, müssen diese Signale parallel in Software-Takten ermittelt werden. Dies kann zu zeitlichen Verschiebungen führen, weil sowohl beim Start der Messung als auch während der Messung keine Synchronisierung der Timer im PC und im Messgerät erfolgen kann. Da zwei Timer nie ganz genau gleichzeitig gestartet werden und auch nie ganz genau gleich schnell laufen, stimmen die Zeiten in den Zeitkanälen nach der Messung nicht genau überein. Üblicherweise betragen die Abweichungen einige Millisekunden.[...]
    Weiters hab ich mal n Versuchsaufbau für die Frequenzmessung gemacht. Ich konnte problemlos Frequenzen messen...
    Am besten du schilderst kurz den Aufbau deiner Messung, was du messen möchtest und wie du den Max konfiguriert hast.
    Mfg Markus

  • 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

  • How can i get the every rising edge's time value with usb 6212 counter continues acquisition

    i have a usb 6212,and now i can get every pluse 'period ,frequency。 
    i want to know how to get the every rising edge's time point value by DAQmx Counter.
    thx

    As you already know YouTube doesn't play in the background, that's why I wasted my time trying to give you an alternative.

  • USB 8451 no timer / counter ?

    Hi all,
    i´m not sure if i´m in the right topic now, but i found no answer with the search function.
    I tried to generate an digital pulse using timer/counter functions with Labview 8.5 and an USB 8451, but it didn´t work.
    Is it possible that the USB 8451 doesn´t support timer / counter signals?
    Thanks for all your answer!

    Hi AK2DM,
    thanks for catching this one. I missed the important piece of information that the original poster would like to generate pulses. We have a KB-entry for this. You could also generate software-timed pulses with the 8451. The jitter (timing deviation), as you mentioned, could be a problem. The same issue arises with the 6501 I mentioned!
    For generating pulse trains I would recommend a basic E or M series device such as the 6210 USB.
    If you have further questions, don't hesitate to ask.
    Best regards,
    Peter
    Peter A.
    Field Sales Engineer, NI Germany

  • USB-6211 - Getting Error 50103 when attempting to use two counter method

    I am using a USB-6211 and want to measure the speed of a motor by counting pulses coming back from sensors on the motor. Speed will vary from 0 to about 5k Hz.
    My strategy is to use "Method 2" in the manual to measure using two counters.  To do this I am attempting to generate pulses of known duration with Counter 0, route these pulses to the gate of Counter 1, send the motor pulses into the source of the counter1 and letting the counter determine and report the number of pulses that occur during the "gate time".
    To get the pulse generator going at 8,333 Hz I do this:
    AGniDAQmx_CreateTask(instrHandle,"TimingPulses, Task_Handle8)
    AGniDAQmx_CreateCOPulseChanFreq(instrHandle, Task_Handle8,"Dev1/Ctr0","Out",DAQmx_Val_Hz,0,8.333,0.5)
    AGniDAQmx_CfgImplicitTiming(instHandle, Task_Handle8, DAQmx_ValContStamps,1000)
    AGniDAQmx_StartTask(instrHandle, Task_Handle8)
    This works fine.  (By the way, I do stop and clear the task before exiting.)
    Now I add this code in a new task to try to use the Counter0 pulses to measure the input pulses with Counter1.
    AGniDAQmx_CreateTask(instrHandle,"MotorPulses, Task_Handle5)
    AGniDAQmx_CreateCIFreqChan(instrHandle,Task_Handle5,"Dev/ctr1",MotorPulses,0,10k,DAQmx_Val_Hz,DAQmx_Val_Rising,DAQmx_ValHighFreq2Ctr,0.12,10,"")
    AGniDAQmx_ReadCounterScalarU32(instrHandle,Task_Handle5,10,E)
    AGniDAQmx_ClearTask(instrHandle,Task_Handle5)
    This function fails on the CreateCIFreqChan() call with an DAQMXError 50103.
    Apparently Counter1 resources are being tied up by Counter0.  Is this true?
    Any suggestions?
    Thanks,
    -CBJohnson

    Hi Mallori,
    Thanks for the great reply message.  I do appreciate your help.
    Yes, I think you understand my application.  The motor can turn from zero to about 5K RPM and one pulse is generated with each turn of the motor.
    This application is using Agilent VEE but the statements are "C-like" so that's why I posted them like that.  I can't "cut-and-paste" directly from the VEE statements and I have to type them.  I mis-typed the Implicit Timing statement.  It was missing an "_".  It should have been:
    AGniDAQmx_CfgImplicitTiming(instrHandle,Task_Handle8,DAQmx_Val_ContStamps,1000)
    I think I understand what you are saying about DAQmx_Val_HighFreq2Ctr using the resources from both counters  That explains why I get the message about resources not being available.  
    I have tried to use Counter Method 1 and it *almost* worked.  A problem comes about when the motor speed is zero (stopped) and, since these motor pulses are being fed into the Gate of the counter, the zero value makes it simply time out.  Increasing the timeout value to infinite (-1) makes the entire program hang.  I need it to go on -- looking for other user input, reporting other data being collected, etc. If the counter is waiting for the Gate signal to rise to start counting and to drop to stop counting and do the calculation, it will not work since it just times out.  I went to this counter method (actually called counter method 3 in the DAQ manual) because then I am trying to generate the pulses of known period and send these pulses to the Gate.  Then I am feeding my pulses into the Source of the counter and letting it determine how many pulses occured during the "gate time".  In this case, zero pulses during the "gate time" should be OK; it should simply report that zero pulses were detected and start counting again on the next rise of the Gate pulse.  I thought I could simpy adjust the length the "gate time" to measure my range of frequencies.
    Make sense?  Any way to do this with the two counters of the USB-6211?
    Thanks, Mallori,
    -Craig

  • 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

  • Buffered event counting: migration from E/M series to NI-USB 6210

    Hello,
    I create a project developed in LabWindows CVI that does buffered event counting.
    The project ran on E/M series for a year. Now I have to migrate to NIDAQ-USB and precisely NI-USB-6210 (that is a M-series). The problem concerns reading acquired samples. The buffered event counting that I need is performed in this way:
    1) Start a buffered event counting task
    2) After n seconds, read the number of samples and read the samples
    3) Stop the task
    This procedure works fine on E/M series on PCI bus, but it does not work with NI-USB. With NI-USB, the number of samples is always 0. I link a project that demonstrates that (the "after n seconds" clause is simulated by pressing "stop" key).
    After many tries, I saw that the problem is in reading number of samples and so I modified the sequence of operation in this way:
    1) Start a buffered event counting task
    2) After n seconds, try many times to read the number of samples
    3) Read the samples
    4) Stop the task
    After some houndreds of attempts, the number of samples moves from 0 to the correct number of samples...It seems a bad working....And I don't know after how many attempts I can surely assert that no samples effectively "crossed" card input....
    Is there an error in my procedure? Have I made some incorrect operations? Or maybe is there a inconsistency in NIDAQmx driver?
    Attachments:
    Provausb.zip ‏463 KB

    Hello Luca,
    I changed the code a bit and I found something interesting about your situation; in the attached VI there is your CVI project modified as follows:
    After the Stop button hes been pressed, and the corresponding callback function is called, we read the acquired samples two times: the first one we ask for 1 sample only. This allows to avoid the USB transfer mechanism issue and then, with the second read function it is possible to get all the remaining samples acquired (selecting -1 as "number of samples to read");
    Hope this helps you,
    Best regards
    Fabio Mussi
    P.S. A SR request about this problem has been opened too. If you need more information, call me at 02-41309217;  
    Fabio M.
    National Instruments
    Embedded & OEM Systems Engineer
    Attachments:
    Provausb_modified_2.zip ‏471 KB

  • NI USB-6215をC++ Builder 2010で使用する方法

    今回、NI USB-6215を使用してデータ集録を行います。
    作成するソフトウェアですが、C++ Builder 2010での作成となります。
    NI-DAQmx 8.9.5をインストールし、サンプルプログラムを作成したのですが、
    以下のようなエラーメッセージが出ました。
    [ILINK32 エラー] Error: 'C:\PROGRAM FILES\NATIONAL INSTRUMENTS\SHARED\EXTERNALCOMPILERSUPPORT\LIB32\MSVC\NIDAQMX.LIB' には無効な OMF レコード (タイプ 0x21) が含まれています (COFF の可能性もあります)
    他のディスカッションで、C++ Builder用のインポートライブラリを作成すればよいような記載があります。
    しかし、nidqa32.dllが見つかりません。
    (C:\Program Files\National Instruments 以下)
    また、NIDAQmx.libをリンクすればよいのかと考えたのですが、上記エラーが出ました。
    今回、初めて御社製品を使用します。
    インストール方法、その他、何か足りない、もしくは間違えていることがあるのでしょうか?
    何かわかることがありましたら、指摘していただきたいです。
    よろしくお願いいたします。

    お世話になります。
    自己フォローです。
    本件ですが、NIDAQmx.libを含むDLLをVisual C++で作成し、それをimplibでインポートライブラリを作成することで対応できそうです。
    お騒がせしました。

Maybe you are looking for