Encoder edge counter using analog input

I have using an 9215A USB (4AI).
2 AI are logging data in to a txt-file and the other 2AI will be used for counting the edges from a quadrature encoder (A and B pulse train).
Every edge falling or rising I will write a line in the txt-file also show a egde counter in the VI (total edges read).
I'm a beginner so I need some help to find out how to do.
BR
Johan

the 9215A do 20kSam/s  , that not too much, so .... your encoder should change state 10k/s max.
first approach: continious read  (with max speed) with two buffers, while one buffer is filled by the DAQ, analyse the data of the other. Three independend loops : first wait for and read buffer-> send data via queue to second analyse loop -> send data via second queue to third loop that does the file handling.
second approach: create a trigger so the second loop can be avoided. The DAQmx/Hardware does  might not support the trigger on both edges on two channels, but additional hardware like LS7084 o. HCTL2022 can help you to create the trigger signal. These little bugs are designed for incremental encoders and create a pulse for every change in the A B lines
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 ǝɥʇ'

Similar Messages

  • Measuring frequency with counter or analog input?

    I have some frequencies which I need to measure. Some signals are digital and some are analog.
    I have a PXI-6040E DAQ which has both counters and analog inputs. 
    I heard that you can measure higher frequencies with the counters than with analog inputs.
    What is the range of frequencies an analog input can determine versus a digital counter? 
    Where is the cutoff that you must absolutely use a digital counter to determine the frequency?
    Is the cutoff different for different DAQ cards? Or is generally the same.

    Have you looked at the specs for the device? The max sample rate and the max counter input will be listed there. The max frequency for an analog input is based on nyquist sampling theory. Are you at all familiar with? It states your sampling frequency has to be at least twice the frequency you are measuring.
    Since each device might have a different max sample rate, your last question is answered.

  • Gated-event counting using analog triggers?

    I'd like to software trigger gated-event counting with analog signals. eg. Use a comparison to check analog input levels to a 6024E card, once a trigger level is reached send a digital out from the 6024E to a 6601 gate to commence and terminate a counter of the 6601 card.
    I have found that the counter on the 6024E card is not stable enough for this application, but the NI-TIO cards work reliably.
    Any tips greatly appreciated,
    Alan

    Alan;
    In case you want to trigger a finite pulse train generation of an analog hardware trigger, you can still accomplish that with an e-series board only.
    You will need to use both general purpose counters available on the DAQ device though. The first counter needs to be configured as retriggerable pulse generation, having its gate being routed to the AI Start Trigger pulse of the Analog Input task. With that done, the counter will generate a pulse at its output at every time the Analog Trigger level is met. You, then, configure the second counter to execute a continuous pulse train and route the first counter output to the second counter gate input. That will make the second counter to generate a pulse train that will be "enabled" by the first counter. The p
    ulse train will be generated while the output of the first counter is on its high state level.
    Knowing that, you can configure the pulse width of the first counter to be as wide as you need the second counter to generate the pulse train.
    Hope this helps.
    Filipe A.
    Applications Engineer
    National Instruments

  • Daq counter using gate input

    In our lab, we have a DAQ 6259 card. previously someone made a c++ programme. Now , i want to use labview to counter . but even i use the example(count digital edge), i cannot get the counts . So i tred it on test panels. only if the edge source is gate input(PFI9), it works. I am wondering what is the problem. could you give me some suggestion?

    hi, yao yong, you should read about the configuration you are choosing, the only situation i have seen about using a gate terminal as a input pin is when you signal is too slow and you're measuring frequency, you should try what Kwok How says about try counter input 0 or try daq assistant.vi
    Kwok How, i want to ask you or someone else if edge count or frequency measurement recognize every edge ( like noise-generated edges ) or just edges between 0 and 5 volts
    best regards
    .:. Pedro Rivera .:.
    i love to work and develop on labview, this is real fun!!!

  • Newbie, Would like to use analog input and graph

    I was using the "Real Time Chart.vi" example in Labview 2011 and got it all set up using the random input it comes with. I have a USB-6008 that is set up and I can see the signal in MAX. The big question is how the heck do I get the vi to work with the analog input? If someone could modify the vi and add the AI0 as the input I would really appricate it!!
    Thanks
    Attachments:
    Soil Moisture.vi ‏15 KB

    trimixdiver1 wrote:
    Aside from me adding the gage and bar graph, its the same as the example. Ive added the AI (purple) channel but I guess I need to add some Daqmx stuff to allow it to connect to the strip chart.
    Wheres the analog in channel?  Is this something you haven't posted yet?  Make your changes, then post when you are ready.
    Reese, (former CLAD, future CLD)
    Some people call me the Space Cowboy!
    Some call me the gangster of love.
    Some people call me MoReese!
    ...I'm right here baby, right here, right here, right here at home

  • Error -200072 using analog input with 3 PXI 6120 cards on realtime mx system

    I have just upgraded to the mx drivers for the 6120 S series boards.
    I am trying to sample 12 analog inputs at once with a pretrigger. (4 channels per board)
    The error message -200072 comes up.
    One board works fine, when I add the second board's channels the error occurs.
    Each board shows up as A,B,C respectively in MAX and in the Labview browse menu for selecting channels.
    Greg Morningstar
    Takata

    Probably the best way to do this would simply be to use the Route Signal VI to make it to where each of your boards looks at a particular line for the trigger. You can do the same thing for the clock so that they are all sampling at the same time.
    You will also want to make sure that your device is defined in MAX. Once you do that, everything should be pretty easy to implement. You might also want to look at some of the examples that show how to do RTSI. It's almost the same as you would do for a PXI system.
    Otis
    Training and Certification
    Product Support Engineer
    National Instruments

  • Is there and easy way for Position control using analog input?

    Hi Everyone,
    I would like to set one of the axis with stepper motor using analog feedback to keep the set position which is coming from the analog input.
    In other words I would like the stepper to move when the analog input changes. I need it as a "background service" so the rest of the motion could be easily controlled from the NI-Motion Assistant.
    Is there any easy way to do this? Even complicated is ok but the control should be done by the NI Motion card not the PC processor.
    Thanks,
    Andras

    Hello Andras,
    please use the link below to get the motion example.
    http://zone.ni.com/devzone/cda/epd/p/id/353
    Kind regards,
    Elmar

  • Use analog input as sample clock

    Hi,
        I have a PCI 6115 DAQ card. I currently perform an
    analog acquisition on ai0, with an external clock on PFI7. But
    sometimes, my clock signal is not high enough and the acquisition does
    not occur. At some NI show, I heard a trick to solve this problem :
    plug the clock on analog input (say ai1), the clock signal gets
    amplified by the card internal amplifiers, and then route this
    amplified signal to the sampling clock. This seems to be a wonderfull
    solution, but I cannot find out to actually redirect the amplified ao1
    to the sampling clock. Does someone know how to do it ?
    Thanks a lot,
    Jérôme Lodewyck

    I tested the attached example on a simulated device so hopefully it will work on a real one without any kinks.  You didn't specify your programming environment, so I'm assuming you're using LabVIEW.  If not, hopefully you can translate to the appropriate ADE based on the picture of the block diagram. 
    In the example, I'm using an AO task to program the analog trigger as specified.  This has two consequences.  First, you won't be able to perform hardware timed AO while the AI acquisition is running.  If this isn't acceptable, you'll need to try the second approach described in the next paragraph.  Second, you'll have to wire the signal to PFI0 instead of an AI channel.  With this configuration, the signal will be seen with a +/- 10V range and referenced to AI Gnd.  Since the trigger DAC is an 8 bit comparator circuit for this board, you'll have ~80 mV of resolution.  You didn't mention what the amplitude or DC offset (if any) of your signal is, but hopefully this resolution will suffice.  You can use the level and hysteresis properties for the analog trigger to filter out noise in the analog signal or account for DC offset. 
    If the constraints listed above aren't to your liking, you can try to use a second AI channel as a trigger channel.  This has some advantages and disadvantages.  The disadvantages are that this requires you to use a trigger with your AI task and it also requires you to acquire another channel of data.  You mentioned the trigger wasn't a problem so this can probably be taken care of with simple analog start trigger.  The data can easily be thrown away, but depending on your sampling rates, it might require a lot of extra bus bandwidth or processing power when scaling the data.  On the positive side, it doesn't require you to use up your AO channels needlessly and you can apply gain to the input signal in order to effectively increase the resolution of the trigger circuit.  You can also apply a low pass filter and different terminal configuration if desired.  The gain, coupling, terminal configuration, filtering, and coupling applied to the signal is controlled by the values used in the Create Channel VI and the Channel Property node.  To create an example that does this, simply start with one of the shipping examples for an Analog Start trigger, change the trigger source to one of the AI channels instead of a PFI or APFI pin, and change the clock source to the AnalogComparisonEvent as shown in the attached example. 
    That should do it.  Good luck with your application and post back if you have additional troubles.
    Attachments:
    AI - External Clock Using Analog Trigger Circuit.vi ‏81 KB
    AI - External Clock Using Analog Trigger Circuit.JPG ‏60 KB

  • Measuring mV using analog input

    I am using an analog input of a Ni-DAQ 6025E card. I can measure a 5V signal. If it is 5V on the voltmeter, then it is 5V on the graph of amplitude Vs time. However a 0.5V signals comes as an oscilating signal of between o and 1.5V. Do I need to calibrate the graph? If so, how do I do that?

    Hi labview1958,
    I would recommend doing what LV_Pro recommended and try using the device in Measurement and Automation Explorer (Start > All Programs > National Instruments > Measurement and Automation Explorer). 
    First test the device there (by using a test panel) and see if you are
    getting the measurements that you are expecting. 
    I would also check out some of the related pages here to see if you can get some information that might help you better develop your system.
    The program that was posted will probably work, but it's not really the best way to do what you are trying to do. 
    If you have LabVIEW 7.0 or higher then you can use DAQmx which is much
    easier to use for new users.  I recommend that you simply use the
    DAQ Assistant Express VI to configure your system.  You can access
    that by going into your Block Diagram on a New VI, right click and go
    to Functions > Input > DAQ Assistant.  You can now
    quickly configure your measurements exactly as you like, test the way
    it functions and then use those signals in your application.
    Best of luck getting this together,
    Otis
    Training and Certification
    Product Support Engineer
    National Instruments

  • How do i develop code in LabVIEW 7.1 for configuring and performing gated edge counting using NI-DAQmx

    Hi,
    My application requires DAQ counter channel to count the rising edge of the input signal connected to the source pin of the counter. This counting has to take place only when there is a high pulse in gate pin of the same counter.This can be developed easily using traditional daq vis.
    Please let me know how to develop code using DAQ mx.
    Thanks,
    Sudha

    There is an example that demontrates how to do this in DAQmx called "Count Digital Events-Pause Trig.vi".
    gus....

  • Feedback using analog input to control digital output

    Hi all,
    I've got a program that I intended to open and close two valves (and thus actuate two pneumatic cylinders) based on the readings from load cells mounted to each cylinder. The idea was that it would send a digital out to open the valve and extend a cylinder, then close the valve when the load reaches a pre-determined value (with frequency dictated by increasing or decreasing the inlet air pressure and thus the fill time of the cylinder). It would then do so for the other cylinder in a loop. The issue I have is that the response time of the loop actuating the valves was too slow-for a desired force of 1800 N I had to set the limit to 1100 Newtons. It was nice and consistent in this regard but then I started having instances where the valve would stay open long enough to apply a force of 3600+ N. The biggest need in this program is to maintain a consistent load and ensure that the max. load is not being exceeded. I've used local variables and a queue to pass the load values to the valve actuation loop but it did not seem to make a difference. I don't know if part of my problem is the mishmash of data types I'm using in passing the load cell values or if a notifier would be a better bet.
    Attached is my code (LV 8.2). Thanks in advance if anyone can offer some guidance.
    Attachments:
    Controlled_valves.vi ‏192 KB

    Here's a version in LV 8.0 and an image of the block diagram, for those running older versions of LabView.
    I'd greatly appreciate any help anyone might provide as I'm getting killed here. Thanks!
    Attachments:
    Controlled_valves.vi ‏207 KB
    Block diagram.JPG ‏177 KB

  • How to use both digital and analog input modules in the same worksheet - MCC USB1208LS

    Dear all,
    Hi, I am Imran. I am using MCC USB1208LS. I have created the worksheet using digital input module as below and able to execute (run).
    But when i add another analog input module in the same worksheet and executes, An error Message pops-up as in the below image
    I have connected temperature sensor sognal to the analog input of USB1208LS. When using analog input alone in the worksheet, it indiates the actual values. 
    is any black box solve? please guide me. I am attaching in images
    We already placed a purchase order for USB1208FS. Will it sort out my issues?.
    Thanking you,
    Imran Mohamed.
    Attachments:
    present worksheet digital input only.JPG ‏67 KB
    with analog input module.JPG ‏81 KB
    error menu.JPG ‏77 KB

    Hello Imran,
    the USB-1208LS is not capable of running concurrent operations such as an analog input scan and ANY digital Ins, Outs, counter reads, or analog outs.  In Dasylab, the 1208LS is scanning, and nothing else from that particular device can be requested of it while that is happening.
    Yes, using the 1208FS will resolve some of these issues.
    Please refer to the ULHELP.CHM file installed on your computer in c:\program files\measurement computing\daq for details on this issue, et al.
    also I recommend you send your MCC/DASYLab requests for support to [email protected] as MCC staff (that includes me) does not normally monitor NI's Developer Zone.

  • Event counter using USB-6210 analog

    Hi,
    Any suggestions or directions where to look to generate a VI that would record event from a magnetic counter of a mouse wheel. I would like to record up to 16 wheels using the USB-6210 device. Thanks!
    VO2max

    Thanks for the extra information.
    The 6210 actually has two counters, so you could count the edges (on two of the wheels) if the signals are TTL compatible.  You can use the Count Digital Events.vi example to help you get started.  From LabVIEW, it can be found at:
    Help » Find Examples... » Hardware Input and Output » DAQmx » Counter Measurements » Count Digital Events
    If your signals are TTL compatible, I would highly recommend purchasing a PCI-6602 and using this method for all 8 channels.  You could modify the example code by increasing the delay (software-timed sample rate) to a larger value (say 1 minute), and logging the results to a file as you run.  Doing this would log the value of the event counter every minute, and would keep the file size relatively small (about 15kB if you run for 8 hours).
    If you must use a single 6210 and require all 8 channels, the only option would be to use continuous analog inputs.  You would have to sample at a high enough rate to not skip the pulses (I am not sure what that is without knowing more about the signal), and then process the digitized signal in software to determine the information that you need.  I would use the Producer/Consumer design template in conjunction with a continuous analog input example to get started.  In the consumer loop, you would have to implement the functionality of the counter in software.
    Using a hardware counter would be preferrable to using analog inputs.  The counter is made for exactly this type of task, and implementing it in software can be complicated as well as processor intensive.  If you have any questions let me know, I'm happy to help you out.  You can always try out the counter task on the 6210 for two wheels to see how it will work before deciding whether or not to purchase a new board.
    -John 
    P.S. After your first post I had assumed that you were testing computer peripherals, but it looks like you actually have eight rodents.  We had a good laugh over here over my confusion.
    John Passiak

  • How to use counter using PCI 6259

    Hello, users,
    I have a PCI 6259 board and use Labview 7.1.
    I'd like to repetitively count the photon signals at 10ms integration time. I want cumulative counts in every 1 sec (1000ms) (or 1 min (60000ms)) And I want to save counts into txt.file which is open in excel program.
    I am a beginner to use counter using PCI 6259 board.
    1. Could you explain default NI-DAQmx counter terminals, i.e., CTR 0 SRC, CTR 0 GATE, CTR 0 AUX, and CTR 0 OUT?
    2. How do I use them or how can I connect to count TTL pulse using PCI 6259?
    3. As I mention my purpose above, which example is the first step to start working my purpose?
    4. If you know good example, could you tell me about that?
    5. If anyone has labview example which is similar to my aim, could you give me some tips or your examples?
    Any hint, comment or advice would be appreciated.
    Thank you so much for your response.
    Leek2

    I have never used the PCI 6259 but have used counters many times with labview, the coding should be the same independent of the board.  What you want to do is finite buffered edge counting using a internal clock.  The best way to do this is to look at the examples programs and use the express vi to get started, then you can use this code to customize your program exactly as you need.
    To address your questions:
    1. CTR0 means "counter 0" the name of the physical resource sometimes listed at GPCTR0.  Each counter has 4 connections to the outside world:
    source "src"(for counting input TTL signals),
    gate (for synchronizing to external clocks and edges),
    out (for pulse-train out operations)
    and aux (specialty operations such as up/down counting and encoding)
    2.For event counting with internal clocking you will only use the src this is the input from the signal you wish to count (ie PMT discriminator for photon counting).
    3,4,5. Look at the count edge examples, there isn't one that does exactly what you want but I have done this with a 6602 (it has e counters) where I use one set of counters to set up a finite pulse train in your case 1000Hz with 1000 pulses, and another counter to edge count on an external pulse, with the source of this pulse routed from the out of the other counter.  Then you can start the task and read when 1000 samples are in the buffer (about 1 second later).
    Hope this helps,
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • Triggered and continuous analog input togeather?

    Hi,
    I have a program set up based off a shipped LV example involving digital triggering of the analog inputs. It looks at a pulse and reads in ten points from the rising edge continuously. It appears that we are missing some pulse triggers and only reading in 126 triggers/sec instead of 128. We double checked the pulse and the frequency is correct (128Hz) so it seems as if the LV program is missing some of the pulses. Therefore, I want to use another analog input channel on the same 6062E daq card to continuously read in the waveform and see which pulses are being skipped. Is this possible?

    Lisa,
    I don't believe the E-series architecture will allow triggered and continuous analog input operations to occur in parallel. It is possible to set up different gains/input ranges but I'm 95% sure that the functionality that you are after isn't there.
    If you are looking to keep track of the number of pulse seen by your application you could consider the use of a counter to count the number of rising edges seen by the NI 6062E - basically daisy chain the pulse train to the trigger input and the GP_CTR Source pin of the counter you wish to use. There are a number of examples around that should help with this. Running the counter and analog input operations in parallel shouldn't be a big problem - it might be that you would want to set up a buffered event co
    unt operation for the counter as this will allow you to track and monitor every single trigger event seen by the counter while your analog input operations continue in parallel.
    The other aspect to consider is benchmarking your application with the Profiler. If the problem is that you consistently only see 126 triggers/second, perhaps your acquisition loop is not running fast enough to cope with the data. This can be especially true if any data processing or file storage is taking place inside the acquisition loop. The Profiler will allow you spot bottlenecks and get a better understanding as to the performance of your application.
    I appreciate this is perhaps not a direct answer but hope that it gives some ideas as to how to track down the cause of the problems you are experiencing.
    Jeremy

Maybe you are looking for

  • Need Information On R12 Error tables.

    Hi Friends, I need information on R12 Error Tables and Staging Error tables. Can you please send me any documention on this. Little bit urgent. Thanks

  • Makepkg signature verification

    when I issue makepkg, I get the following output: ==> Making package: abs 2.4.4-2 (Wed Jan 21 05:31:23 UTC 2015) ==> Checking runtime dependencies... ==> Checking buildtime dependencies... ==> Retrieving sources... -> Found abs-2.4.4.tar.gz -> Found

  • Parameter queries in Oracle?

    Does Oracle allow for queries that receive a parameter from ADO? The ability to call pre-compiled queries is very powerful in SQL Server. I would like to use the same in Oracle, but I don't find any reference in the documentation. Any help will be ap

  • Wrong keyboard-layout after suspend

    Hej, when I put my Thinkpad T400 to sleep (by closing the lid), it recovers from suspend with an english keyboard layout. I have to do a "setxkbmap de" manually everytime. Running this from /usr/lib/pm-utils/sleep.d/ delivers a "Can't open "default d

  • Cleaning "holes" out of Live Trace

    I have done a live trace of a somewhat complex GIF that I want to simplify into black silhouette. What I have is a black object filled with dozens of irregularly shaped closed paths within it. I want to get rid of these, and was thinking I could just