NI 6008 + counter

Cordial saludo
Estoy empezando con el labview y deseo realizar una medicion de velocidad de un motor con un encoder. El problema es que no se qué herramienta de sofware emplear para reiniciar la adquisicion, debido a que los pulsos los cuento con la entrada digital COUNTER en un tiempo determinado, pero los pulsos son acumulativos, de manera que debo reiniciar el conteo para tomar muestras cada 10 segundos, por ejemplo, pero no se como. 
Si alguno de ustedes con su gran experiencia puede darme la mano, quedo inmensamente agradecido.
ALBERTO

Hola. Una forma de hacerlo poner todo en una secuencia.  Pone todo lo que ya tienes de código dentro del primer cuadro de la secuencia y haz que este corra por el tiempo que necesitas hacer cada conteo y en el segundo cuadro, reincia el contador a cero. Si quieres que todo se esté ciclando, encierra todo eso en un ciclo while.
Si tienes algún problema, adjunta tu programa aquí y yo o alguien más te puede ayudar a hacerlo.
Ali

Similar Messages

  • USB-6008 Counter offset

    Hi,
    I am using a linear pot to monitor the motion of a test rig I am instrumenting.  I would also like to increment a counter each time a cycle of the rig is complete.  I tried to use the counter integrated into the USB-6008 board, but it only counts each time the voltage goes to zero and more than likely the linear pot will not be compressed that far (leaves little in the way of margin of safety).  Is there a way to offset or bias the counter so it looks for 1v or 2v instead of the voltage falling to zero?
    Thanks in advance for the help...
    Ben

    I'm generally an advocate *for* the use of counters, but in this case I'd actually suggest that you do some software processing
    on the analog voltage from your linear pot.  My guess is that the range of travel will not be utterly consistent in your test rig.  Every
    time you break out your tools to adjust your brackets and sensor placements, you'll see the range shift.  Maybe an offset, maybe 
    a scale factor, maybe both.  So the problem with an external circuit is selecting the correct threshold voltage used to delineate
    logical low from high.
    In this case, you may want to consider doing some simple software processing on the analog linear pot signal.  There will be some
    nominal expected shape, and you can design your processing around detecting the "end of cycle" signature.  This may be fairly
    easy, but it will depend on the expected shape and the nature of your motion cycles (continuous or discrete).
    -Kevin P.

  • USB 6008 Count Edges

    I am trying to count the edges on a signal with a period of 50us using the counter on a usb 6008.  Is this possible or is the period to small?

    Hi there!
    From the specifications listed at http://sine.ni.com/nips/cds/view/p/lang/en/nid/201986 and http://www.ni.com/pdf/manuals/371303l.pdf the minimum input pulse width is 100ns. Seeing that the period you are trying to measure is 50us, considerably bigger, then it should be fine.
    I hope this clarifies,
    Liam A.
    National Instruments
    Applications Engineer

  • 6008 counter

    Hi
    Can any one tell me why i caanot use the signal as seen in the tdms file   about 4.2 volts   why the counter in 6008 does not see it?
    Is there something wrong with my 6008? or   should it just work
    is there anything i should change on this signal?
    Also at my digital input channels does not see this signal    i tought below 2v  it low   and   above it a high
    so no counter no digital i/0     only at analog signal
    i have to do a count and calc speed so     counting freq is a bit much for this
    Cees 
    Attachments:
    Voltage.tdms.doc ‏1067 KB
    Voltage.tdms_index.doc ‏7 KB
    Voltage_meta.txt.doc ‏1 KB

    Cees,
    Thank you for posting on the NI Forums.  I was able to look over the documentation for the USB-6008 and the specifications for counting events and it seems as though your signal meets the requirements for the device.
    Input High Voltage: 2 Volts
    Input Low Voltage: 0.8 Volts
    Minimum High pulse width: 100 ns
    Minimum Low pulse width: 100 ns
    I was able to look over your TDMS documents and it appears as though your signal falls within all of the necessary requirements. Are you configuring your device to take a counter measurment on PFI0? My next recommendation for steps to try is to see if you can read in any digital signal. I would recommend using the Test-Panels in Measurement and Automation Explorer to see if you output a digital signal on one line if you can see it on another line. This would let us know if there was a problem with your device. Thanks!
    Aaron W.
    National Instruments
    CLA, CTA and CPI

  • Buffered counting 6008

    Hi to all
    Is here some one who can tell me how i can make a buffered counting of the  pulse count
    This make sure i have a correct speed     count/time
    The problem also is that i also need to see on meter how fast the speed is   i want to count as fast as possible  ,but the meter must run  at normal slow speed
    Sorry guys i am new to labview   to please do not be so hard on me ,
    Any one who could help me?
    i want a TDMS file  
    Attachments:
    snelheid wielen].vi ‏28 KB

    mm
    strange    on page  6008 specs
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/14604
    here its says
    Buffered Operations
    Yes
    is counting not a operation?

  • Making another counter VI for usb-6008 using Labview 8.5

    I want to create another counter for usb-6008 using Labview 8.5 as it is needed to calculate two speeds simultaneously.
    Solved!
    Go to Solution.

    The best way to do this is to use the counter.  The counter counts
    signals without having to interrupt the system or use the USB bus. 
    When you request the number of ticks that the counter has seen, a
    request is thrown from the CPU to the USB line to the 6008, which then
    asks the counter "How many ticks have you seen?"  That number is
    returned over the USB bus, goes to the CPU, and then displays on your
    screen.  Since the DIO lines on the 6008 are software timed, there is
    no way to guarantee that the data returning to the CPU is
    deterministic.  The conceptual difference between software-controlled
    DIO (which nondeterministically returns an entire data stream) and a
    software-tick-request-controlled counter (which returns a single number
    with the number of ticks) prevents us from using the DIO lines on the
    6008.  The cheapest way to count more edges is to purchase more 6008s. 
    Another possibility would be to purchase a PCI counter board such as
    the PCI-6602, which has 8 counters. The most counters we offer in the
    USB form factor is 2 per device.
    -John Sullivan
    Analog Engineer

  • Counting TTL pulses using USB 6008

    Hi Folks,
    I am trying to setup a performance monitoring VI for a manufacturing line.
    I am going to use a sensor at the end of the line to count the number/rate of boxes that come of the line and perform a calculation to give us the productivity.
    The problem I have is that I would like to be able to scroll back over time to view historical productivity. Also I would like to be able to insert reason codes for downtime and print off a report at the end of the week showing a productivity graph and downtime associated with the line.
    I am new to Labview and I am not sure if this can be done, any help would be appreciated.
    Thanks
    Tony.
    Attachments:
    K2 Productivity-s.vi ‏60 KB

    Search 'count'.  Count Digital Events.vi is the most basic one of interest.
    Of course you won't find an example of counting pulses, analyzing the data and creating a report.  You'll have to put all the pieces together yourself.  This is just a start.  The good news is that LabVIEW is designed to do just the type of thing you're needing and your app will be quite simple to contrive once you get the hang of LabVIEW.  I suggest going through the many tutorials to get the basics down before you try to architect your program.
    Using LabVIEW: 7.1.1, 8.5.1 & 2013

  • Quadrature encoder counter with 8 channels

    Hi,
    I need to acquire the signals (A and B) of four quadrature encoders. The signals have a maximum frequency of about 5kHz and should be read out with about 100 Hz. Is there a device that fulfils these requirements? It seems that a frequency of 5kHz is no problem since e.g. the USB-6008 has a counter for frequencies up to 1 MHz. However, I can't find a simple low-cost device that provides several counters. Does anyone know such a device with 4 or 8 counters?
    No other analog or digital channels are necessary, but a USB connection and Matlab support would be ideal.
    Thanks in advance.

    Depending on your definition of low-cost, the 9171+9401 might suit your needs:
    4 counters capable of quadrature encoder measurements (the single counter on the 6008 only does simple edge counting).
    USB connection.
    MATLAB support via the Data Acquisition Toolbox (according to their website).
    I don't believe NI currently has any other option that meets these requirements at a lower cost.  If USB isn't mandatory, you could also consider the PCIe-6612 which provides 8 counters.
    Best Regards,
    John Passiak

  • DAQ counter vi

    I'm using a DAQ USB-6008 to count the edges of a digital pulse. i need to calculate the frequency of these pulses but I can't do it using the period time because this device doesn't allow it (or so i'm told) I'm using a counter channel, and can successfully count the edges, but can't figure out how to change this into frequency? I've tried timed loops of 1 second long, to calculate the number of counts per second, but can't reset this value and therefore can only get one accurate result.
    Any help would be greatly apperciated!!!
    Thanks,
    Tom

    Hi Tom,
    I've attached a VI as an example.  This uses a shift register to come up with a frequency based on the counter input from the USB-6008 device.  Let me know if you need anything further or have any questions.
    tsc
    Attachments:
    CalcFrequencyExample.vi ‏37 KB

  • Measuring speed with incrementa​l single counter

    Hi,
    I need to measure the rotational speed and acceleration of a wheel that has 3 hall sensors on it. I will use only 1 of them en it gives 24 pulses 0-5V for a 360° rotation. How can I measure the speed with only a pulse train. I dont have the Quadric encoder...
    Now I'd like to measure the rotational speed using a counter of some sort, but the software I tried writing for it isnt working.
    Thank you for your help

    Hey Nitch,
    Concerning the measurements errors:
    As you get error when speeding up, it looks like the pulses coming from the hall sensors are to short to get measured by the counter.
    Following the USB-6008 specifications, the pulse needs to have a minimum lenght of 100ns (both in high and low state).
    As a counter is using edges to count the pulses (for USB-6008 only the falling edge) the edges need to comply with the TTL specifications which means that the rise and fall time of the pulse needs to be within the 50ns range. 
    So please have a look at the pulse lenght at higher speeds (are they at least 100ns?) and make sure the pulse comply with the TTL specifications.
     If not you will have to add some additional electronics to reshape the pulses.
    Looking at your program.
    It's not nescesarry to have two loops.  It's very well possible to have two DAQ tasks within the same look.
    Have a look at the Examples which come with LabVIEW --> Exampled Finder --> Hardware Input/Output --> DAQmx --> Synchronization --> Multi-Function.
    There are some examples which so the combination of analog and digital input.
    Anyhow you will have to remove the right while loop as the DAQ Express VI which apparently gives you the "spanning, stroom, gashendel" values will only start once you have done the counter measurements.  I assume that you would like to have the "spanning", "stroom", "gashendel" and"speed" synchronized measured.
    Then you have the choice to log to file during acquisition or after the acquisition.
    If you would like to log on the fly don't use the express VI's, but use the lower lever "File I/O" functions. These are faster (less processor time usage).
    As you VI is written now, the left while loop will only output the lastest counter value measured to the next loop when you click the stop button for example.
    You have to "Enable Indexing" of the m/s output tunnel.  Right click on the tunnel and you will be able to select "Enable Indexing".
    This way the application will automatically create an array and each loop iteration the measured value will be added.  One the measurements have been done you can do analysis and save the data using the full array instead of point by point.
    Again, also bring your "spanning, stroom and gashendel" inputs to the left loop.
    In your right loop you also have a loop counter.
    You can simply use the loop iteraction counter (the square box in the left bottom corner with the i).  This is also counting from 0 and incrementing by 1 each loop iteration.
    Again, you can do this in the left loop and forget the second loop completely.
    Hopes this will bring you a step further.
    Don't hesitate to post the VI itself.  This is always easier to look at than an image.
    This way we can also make some modications and post it back.
    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!

  • NiDAQ 6008 -- Long running task stability

    I have a small C program using nidaqmxbase, based on the example code provided.
    This runs with a usb connected 6008 on a Red Hat Linux machine. The task is simple, read the analog voltage (differential, reference source 2.5v range) from one channel at 1000hz in blocks of 50 samples. The results are placed into network messages to send to another program for analysis.
    This program works fine, but has a long run-time stability issue when left running for more than about 24 hours continuously (and, for my application I need to capture in realtime 24/7 indefinitly). The symptom observed is that the 6008 stops returning data -- and "lsdaq" shows that the device is no longer seen by the system. Sometimes the green LED stops blinking as well. Has the DAQ crashed? Did some counter overflow and cause the driver to malfunction? I am able to restore function only by physically disconnecting and re-connecting the 6008.
    Thank you
    Andy.

    Hi aws-
    It sounds like the problem you are seeing could be related to bus powering or resource conflicts on your system.  The fact that the failure results in total loss of connectivity with your device certainly seems to indicate a hardware problem.
    You said your code is based on the example code; please verify if an unmodified shipping example fails similarly.  If so, please let us know which program fails and I will attempt to replicate the issue here.  Do you see this problem on multiple computers and/or with multiple USB-6008 devices? 
    Thanks-
    Tom W
    National Instruments

  • Why not use USB 6008?

    Hi,
    I have an application that requires me to sample 6 AI channels at 1 kHz.
    Processing every 20 ms.
    I also need to output a PWM on 3 channels.
    Normally I'd use PCI-DAQ cards.
    e.g. a PCI-6023E and a PCI 6601 (timer/counter).
    This costs about 700€.
    Why shouldn't I use a NI USB 6008 (145€)
    and two NI 6501 (99€).
    Is there a big difference in programming and performance?
    Are those devices all USB-2?
    Because If I sample at 10Khz, I do not suppose that all that
    data can go over a USB1-bus.
    Thx !

    Hi!
    My observation is that a 6008 will work for you if you only need to acquire 6 channels at 1 kHz and you can handle 11 bits of resolution (to use six channels you must be in single ended mode, which losses one bit of resolution on this board). The other possible disadvantage of the 6008 is that you will have to learn to use DAQmx Base, if you haven't done so yet. However, if you are familiar with DAQmx, this should not be too difficult.
    As for digital output, using two 6501's may not work for you. They will be software timed digital outputs, where it seems that you were looking for hardware timed outputs before (6601).
    Both of these devices are USB 2.0 Full-Speed, which can handle this amount of data.
    Good Luck with your project!
    Justin

  • Need some suggestion​s for creating a software based digital I/O counter

    Hi All
    I've been using LabVIEW to sucessfully create a number of fluid level monitoring applications for oil well drilling. bear in mind that I'm a geologist not a software engineer so you may have to talk/type slowly .
    I've been using the USB 6009 & 6008 for these aplications so far, they are however limited by only having 1 counter per DAQ. What i'd like to do (if possible) is use the some of the digital I/O channels as counters. The events i'm attempting to count are simple open/closed pulse signals from a micro switch. The micro switch is attached to a slow running mud pump which is sending up to 3 pulses per second but is usually running at 10-80 pulses per min. The slow cycle rate of these big pumps means I can't use a frequency aplication as they don't seem to work below 1hz.
    I've tried to use a case structure to create a counter but I'm afraid I can't seem to get the logic right to turn the output into a counted output. Anyone got a suggestion for things I could try?
    Thanks
    Kim

    Kim,
    Tttt yyyy pppp iii nnn gggg slowly.
    You described your situation quite clearly.
    As you probably know the digital inputs on the USB-6008/9 are software timed, so you have some uncertainty in the time of any sample.  Depending on your OS that uncertainty will typically be on the order of a few milliseconds but occasionally may be much longer.
    To count the pulses in software requires a combination of several things.
    1. You need to have a data acquisition method which is fast enough to capture each high and low state of the pulses produced by the pump.  For software timed Digital Input a good way to do this is to have an independent, parallel loop which reads the input line rapidly and passes the data or transitions to another loop via a queue.  This is known as the Producer loop in a Producer/Consumer architecture.  Examples come with labVIEW. A 10 ms Wait in the loop is probably appropriate.
    2. You need to convert the digital inputs (levels) into pulses or transitions to be counted.  Suppose you want to increase the count by one every time the logical level changes from False to True. To do this you need to know the previous level and the current level. A shift register is one of the best ways to do this in LV.  Add a shift register to the loop.  Initialize it to False. Connect the result of the Digital Read to the right terminal of the shift regsiter inside the loop.  When that Read is True and the previous value (obtained from the left terminal of the shift register) is False, increment the count value (which is also kept in a shift register) in the case structure.
    3. You did not indicate what you are doing with the counts or what the pulses represent.  Do you need to measure the frequency (or the period which is the reciprocal of the frequency)?  Do you need to accumulate the number of pulses? Over what time period?
    Lynn

  • Digital counter data is not written into a file

    Hello
    I'm a beginner with labview and I'm trying to make a measurement program for my setup (sensor data -> file). I have the USB-6008 and I'm trying to save data from  a digital counter and 3 analog ports. The counter is for RPM and the number of revolutions. Analog is used for force, potential voltage and temperature. Currently data from the analog ports is written to a file normally but all the data from the digital side is lost. So in the measurement text file columns for the digital data are empty.
    The DAQ assist for the counter is set "on demand" but the analog DAQ assist has a sampling rate of 1k (continous). My problem propably comes from the different sampling rates. I could set analog sampling to "on demand" but I need the 1k rate for the measurements. Also making two different measurements files works but it's very inconvinient.
    Am I right about the sampling rate and how would I fix this?
    Attachments:
    measurements.vi ‏144 KB

    Think Data Flow.  For a Loop to "loop", everything inside the loop must execute.  Furthermore, since your loop starts with "Acquire one sample" and ends with "write one sample", the time for the loop to execute will be the sum of the times to sample (1 msec) + write (??).
    Take advantage of the fact that LabVIEW in inherently parallel.  Instead of taking one sample/loop, take (say) 1000, but do not write them in the same loop.  Instead, "export" them to a parallel loop (via a Queue) so that when the 1000 samples arrive, they are written all at once.  While it is true that to acquire 1000 samples at 1KHz will take 1 second, most of that time will be spent "waiting" for the next sample to be taken (it takes almost no time to put a point on a Queue).  Similarly, if I have a whole second to write 1000 points to a file, that's more than enough time.
    Separating "serial" tasks into parallel streams is a common LabVIEW Design Pattern called the Producer/Consumer pattern.  There are numerous examples of this pattern, including a template that will write the basics of the code for you (open the File menu, choose "New...", From Template, Frameworks, Design Patterns, Producer/Consumer Design Pattern (Data)).  A slightly more sophisticated example can be found by starting LabVIEW, New Project, Continuous Measurement and Logging. 
    Bob Schor

  • Help! To design a counter for counting clocks

    Dear all,
    I want to design a counter that count all clocks of a square wave. I have tried but I am getting stuck somewhere. Here's attached the file that I started. In this project, my objective is to use NI-USB-6008 to send a square wave to an external oscilloscope. That square wave has to be self-controlled such that nth first clocks have  a certain frequency different to the next (n+1, .....,m) clocks. As part of that, I need to use a counter that I designed myself.
    Actually, I have the C++ codes for that:
    int count=0;
    if(result==1)
    count++;
    This is just the section that I want
    Attachments:
    DigOutFuncAuto.vi ‏180 KB

    Hello,
    I am a bit confused about your application, are you trying to count (input) clock edges or generate a clock signal with your 6008. If you want to count digital edges with the USB-6008 you can use the counter on the 6008 to count these edges; an example in the example finder exists already and can be found in the location shown below. If you want to generate this varying clock signal, it will be difficult with a USB-6008 since it software timed and updates to the digital line will depend on the updates over the USB bus. If you can clarify your application a bit, I may be able to make some suggestions.
    Eric
    Eric Liauw
    AE Specialist - Automated Test | CLD | CTD
    National Instruments

Maybe you are looking for

  • How do I move a section of Pages within a document ?

    Hi there, I am writing my thesis and I want to move a group of 6 pages (representing a chapter) from one area of my document to another. I inserted a 'Section Break' at the end of the page preceeding the first page of my grouping, and inserted anothe

  • How to change margins

    When trying to print from Address book, in List with Name, phone and email the some of the email address take two lines Like Home [email protected] t Is there a way to change the margins to get it all on one line Thanks Mike

  • Firefox 4.0 takes about 60 seconds to start even after reinstalling.

    Firefox 4.0 takes about 60 seconds to start. I have tried reinstalling with no change. It isn't antivirus software, as I turned that off and it was still slow. I run Vista Ultimate. Internet Explorer loads very quickly.

  • Since yosemite install, I cannot openAI cs5.5 -error msg

    since yosemite install, I cannot open ai cs5.5 -error msg is "an unknown error has occurred (-50). Adobe illustrator will now quit, I have spent ages trying to find fix and since I downloaded the app, am not sure what to do, can I re-install online f

  • LMTP issue

    I've deployed MS 6.2 on 2 hosts. hostA - MEM, MMP, UWC, AccessManager, MTA - frontend hostB - store, ME - backend users has accounts on domain.com -> hostB Everything was ok until I wanted to use LMTP. Sending, receiving - no problems. When I followe