Counting edges with dynapar encoder

Hello,
I am very new to Labview. To kick off some experience, I am trying to count edges on a Dynapar encoder, Model E14020000303. Here is the data sheet:
 https://ecatalog.dynapar.com/downloads/E14_DS_702489_2_.pdf
I am using LabVIEW 2011, with a NI USB-6210 DAQ. My white wire on the encoder is connected to PFI0. The red and black wires are connected to my 5V voltage source. I am rotating my encoder to count the revolutions. Supposedly my encoder is a 200 PPR, and it is also quadrature. 
However, I am not understanding what I am getting when counting edges using DAQ Assistant. I am using the Edge Count on ctr0. I can set the DAQ assistant to run on 1 sample acquisition mode and count the rising edge. When I turn the encoder 100 times, the measured value on the DAQ Assistant is usually around 76500, which would mean 765 edges counted per revolution. I can also change things around and go to continuous acquisition mode. I set up PFI2 as the external clock source with a rising edge and put the green wire in PFI2. I set it to read 1 sample at 1k Hz. This usually results in counting around 820 edges.
I don't understand why I am getting these readings. The DAQ Assistant should only be counting rising edges because that is what it is set at. Why am I getting numbers so high? 
Thanks!
 

Hey guys,
Sorry for the late reply, I have been put on other tasks. You all were right about the ground, that indeed was the problem. With the daq grounded, the encoder measures 200 edges per revolution.
Thanks!

Similar Messages

  • Count edges with hardware reset

    Hello all,
    I have a PCI-6220 and I would like to configure a counter to count edges with a hardware reset or use my counter to measure linear position without the B input, after words, only with the A input to count edges and the Z input to make the initial position.
    Somebody knows how?
    Thanks in advance, best regards,
    Paulo Carmo

    Duplicate Post
    John Passiak

  • Count edges with 6036e

    Hello !
    I am currently trying to count photons with a PCMIA 6036e. 
    I have to detect a TTL signal ; each photon correspond to a pulse. So I tried to count rising edges, since one rising edge = one photon. I want to use either digital line or counter. Moreover, I have to count the rising edges for a limited time (typically 1s).
    I have tried several VIs, but none of them work. I either don't have an error message, but only 0 as a result, or an error message saying data were overwritten before they could be read.
    The problem does not come from the card, since it can count the rising edges in MAX. I have also tried examples such as "count digital events", but they give me the same error.
    I would appreciate any help !
    thanks,
    Camille

    Hello,
    Check carefully the wiring of your signal to the DAQ board; there is to main input for counter application, the source and the gate. Depending on the measurement you do, you have to wire your signal to the gate or to the source. In your case, the acquisition type should be a simple event counting. Using CTR0, the input signal should be wired to PFI8 (PFI3 for CTR1).
    The specification of the PCMCIA-6036E mention that the minimal pulse duration you can handle is 10ns in edge detect mode. If the pulse you measure  are shorter, you will not be able to see it.
    Regards, 
    .mrLeft{float:left} .mrInfo{border-left:solid 1px #989898;font-size:x-small;color:#989898}
    Mathieu R.  
      CTD - Certified TestStand Developer / Développeur TestStand Certifié  
      CLAD - Certified LabVIEW Associate Developer  

  • Timing problem with counting edges

    Hello!
    I use a NI PCI-6221 DAQ card with NI-DAQmx to count edges of TTL pulses for a spectrometric application.
    It is extremely important that I count the pulses for a well-defined period of time. Typically, I want to count the edges that reach the counter in the period of 400 milliseconds.
    Normally, this works quite well, when I use a WHILE loop that reads and restarts the counter every 400 milliseconds. Things change when the PC I run the VI on has other programs running in the background. Expecially computing-time intensive programs delay the 400 milliseconds of the WHILE loop for up to several 100 percent, resulting in an wrong counter read.
    I tried to use a timed WHILE loop but this din't change anything, regardless of the timimg source (onboard clock or PCI-6221 counter) I applied.
    Has anyone encountered similar problems and found a solution? Isn't there a possibility to control the counting time by hardware?
    Thanks in advance!
    EresthorMessage Edited by Eresthor on 04-07-2005 08:17 AM

    Hej Lynn,
    of course your idea works, thank you. It works extremely well this way, too.
    My problem with this approach is that I need both counters on the PCI-6221 to count data from my spectrometer simultaneously on two channels. That's why I would like to trigger the counter in a different way, for example with a clock.
    Is there no way to trigger the counter with the timebase of a hardware clock on the card? Or ist there another possibility without wasting a counter?
    Eresthor

  • Count edges of AI signal with NI 9221

    Hi,
    I'm trying to count edges of an AI signal that are acquired with an NI-9221 on a cDAQ. The average frequency is about 1kHz.
    I'm acquiring the signal with 10kHz but don't get the right amount of edges. 
    Is
    there any solution for this problem. I know, of course it would be
    easier to use a CTR-modul but my signals doesn't fit with the specs.
    Thanks for any help
    Yves

    Yes, I know. I wanted it to be posted in the Labview forum and hadn't realized my mistake.
    But I still don't have any solution....
    Yves

  • Can i Count digital edges with all three channels on a 9421 cDAQ

    Hi!
    We have just purchased a Compact DAQ with NI 9203, NI 9217 and a digital card 9421. In the application for which these parts have been purchased I want to measure flow, power, pressure, temperature and water and energy consumption of a sterilizer. I have connected the flowmeters, and pressuremeters to the analog current card 9203, the RTD termomters to the 9217 and three digital pulse outputs from two flowmeters and a poweranalyser to the 9421 card. I have configured the analog inputs on 9203 and 9217 to my satidafction. But now to my question. I want to configure VI to count the digital edges from the three channels in the 9421. I know that the card only has two counters but since my pulses only has a frequency of approximately 1 Hz I believe that i in some way should be possible to count the edges with a regular digital input channel as well.
    I know I have signal from all three pulse outputs to the 9421 card, since I have tested this in the Measuremnet & Automation explorer.
    Do I need to add an extra DAQ-assistant to be able to acquire the digital signal parallell to the analog signals from the two other cards?
    And is it possible to count the edges of mylow frequency on say for example channel di0, di1 and di2 as i wish and not only on di0 and di5 which I think are the counter-channels?
    Do i need to put the 9421 card in one particular slot on my cDAQ-station, this I also ask since my pulses frequnency is low and I don´t now if i really need to use the counter on slot 5-6 to count my pulses?
    Attachments:
    Measurementbench.vi ‏143 KB

    Hi Gravy Train,
    I'm curious about why you are using 2 loops.   You mentioned one is for monitoring and one is for DAQ....what do you mean by that?   What is the overall goal of this piece of code.   Also, I noticed that you are not closing the task.   Since this is just a subset, I realize you could be closing it in your actual code, but just in case you're not.....it is very important that you close all tasks when you are down acquiring data.
    Best Regards,
    Starla T  

  • Is it possible to use "Delay Values" to create a frequency signal from digital "Count Edges" -task? (= are the results I'm getting correct?)

    Hello.
    I have a digital encoder from which I need freaquency information (to ultimately get rpm -infromation). The problem is that this task is inside a loop with 2 other DAQmx -tasks that are using "one sample on demand"-aquisition mode and if I configure this new counter task to be a freaquency task, it only updates once in ~ second which makes the whole loop lag.
    I thus created an "artificial" freaquency signal by using "Count Edges" -aquicition mode and the "Delay Values" -block so that I substract the delayed signal from original "Count Edges" -signal. There is a 0,01s delay in the loop and I figured out that if the history of the "Delay Values" -block is 100 samples I would thus get the real edge-freaquency.
    I tested this configuration and the results seem to be at least really close to correct but I have no idea if this idea is in any way correct...
    This explanation was probably quite confusing so please see the picture attached.
    Thanks a lot in advance! 
    Attachments:
    are_the_results_correct.jpg ‏200 KB

    First of all, thank you for quick reply. Unfortunately I don't have the acces to the vi. until tomorrow.
    And yes, I think you understood correctly: essentially this arragement measures how many edges have been counted during one iteration. This is how I figured out that this could then be used as a frequency measurement:
    1. From the "Edges - Delayed Edges" I get the information on how many edges have been counted during last iteration.
    2. I "know" (really I don't?) that one iteration lasts ~0,01s because of the delay in the loop.
    3. There is 2048 edges in one round of the encoder so I get the rpm as follows: rpm = (edges - delayed edges)/204,8*60(s)
    (If I was using history size of one as you suggested it would be: rpm = (edges-delayed edges)/2048 * 60) However using history size of 10 and taking it account in the multiplication smoothens the response nicely.
    But doesn't this arragement count on the fact that the vi runs smoothly and there is no additional lag?
    I quess using another loop and notifiers for a dedicated freaquency measurement as you suggested could be worth trying. I just have to first learn how to use them. 
    If I do use them will the main loop run smoothly and not wait for every update of the notifier? This would be essential since the freaquency output refresses only about once in a second if I use the continious aquisition mode.
    Attachments:
    are_the_results_correct.jpg ‏198 KB

  • Fail to use Jeditorpane to display a text with big5 encoding

    Hi All,
    I fail to use Jeditorpane to display a text with big5 encoding correctly.
    It only show machine code.
    I am using jre1.6.0_17. Yet it works well with earlier version of jre like jre 1.6.0_15, and jre 1.6.0_16
    bcpscsin

    bcpscsin wrote:
    ..I can find it in javax.swing
    FFS! It is JEditorPane, not Jeditorpane. Count the freaking upper case letters in both of those!
    Convince yourself by following these two URLs
    [http://java.sun.com/javase/6/docs/api/javax/swing/JEditorPane.html] -> produces a web page.
    [http://java.sun.com/javase/6/docs/api/javax/swing/Jeditorpane.html] -> "Page Not Found"
    My point is - do not type 'something like' the class name - get it right so we can be sure. Programming is a technical business and programmers need to be very accurate. It is even more important to be very accurate when asking for help on an forum. People have very little time to 'hold your hand' about the correct spelling and capitalisation of class names - or anything else for that matter.
    You still have not answered my question about the bug database.

  • Linear actuator controlled with external encoder and smart motor - randomly stops

    Hi,
    This is my first experience with Labview or any sort of programming for that matter.  I am using an Animatic Smart Motor Model: SM1720M version 4.15b with an Ultra Motion Bug linear actuator: 4-2B.125-SM17-3.2-1NO-B/EC4 and a 600 series optical encoder.  I am trying to write a VI that allows me to manually control the linear actuator using the encoder.  I attached the one I have been using, but for some reason it randomly stops working, generally  when the actuator is extended about an inch and 2 1/2 inches.  It stops in the same general area, but not the exact same spot.  Any ideas?  Any help would be much appreciated!
    Attachments:
    Manual Command.vi ‏29 KB

    1. The VISA Clear and VISA Close should be outside the loop. You do not want to be re-initializing the VISA session each time through the loop.
    2. You have the port initialized to use line feed as a termination character. When using termination character, you should not use Bytes at Port. Just set the byte count input of VISA Read to a constant larger than the longest message you expect to receive.
    3. With the termination character you do not need the waits between or before the reads.
    4. The 10 ms Wait in the outer loop is rather meaningless when the start button is True. The VISA Write takes much longer than 10 ms for the string you are writing. It does make sense to have a Wait in the False case.
    5. The start button is set to Latch When Released mechanical action. With that setting it retuns to False every time it is read. The result is that the code in the True case only executes one time for each press of the button. Is that what you want?
    A state machine architecture is more flexible and more robust.
    As to why it stops in a particular place, you have not given us nearly enough information to even guess. What is the relationship between motor speed and displacement? Where do you do anything with the encoder? What is the format of the encoder output? How far does the motor move at various speed settings during one iteration of the outer loop? Where is the command to stop the motor when it gets to where you want it? 
    What error messages, if any, do you get when it stops?
    Lynn

  • Count edges on rtsi0

    Hi all,
    I have a PCI 7831-R and a PCI 6143 card running on my computer. Both
    are synchronized with a RTSi cable. The PCI7831 delivers via RTSI 0 a
    clock signal for Trigger my analog signals. My problem is now that i
    want count the edges on rtsi0 because I want to know what  the
    values  of my analog signal are refered to my triggersignal. For
    example, Trigger edge 1 - analog value x,  trigger 
    edge  2 - analog value x. Is that possible. I don't found nothing
    on ni examples. Thank you for your help.
    Grüße aus Deutschland
    Manuel

    Manuel,
    you want to count edges from a RTSI line with the PCI 6143, right?
    Have a look on the following post:
    http://forums.ni.com/ni/board/message?board.id=250&message.id=4715&requireLogin=False
    Regards,
    ThSa
    Message Edited by ThSa on 04-05-2006 09:42 AM
    http://www.newgistics.com

  • Setting output pin to high while counter counts edges - 660x

    Traditional DAQ allowed you to set the output of a counter while it counted, is there an equivalent for daqmx?  The counter output for our current setup spins a motor until the counter reaches the proper number of counted edges from another pulse generator on the board. Perhaps I need to reconsider the setup, but there should be a method to do this action.  I was only able to find an indicator of the output state in the Channel property nodes. Any ideas? Thanks.

    Hello Roth,
    An event is thrown whenever a counter reaches its terminal count, and you should be able to use that to your advantage here.  Once that terminal count is reached, you can use DAQmx properties to set the counter to output a pulse or toggle the line.  If you use this property in conjunction with the initial count property, you can have the counter cound X number of edges and then toggle the output line:
    I hope this helps!
    Thanks,
    Justin M.
    National Instruments
    Message Edited by Justin M. on 06-12-2006 01:05 PM
    Attachments:
    Terminal Count Toggle.JPG ‏11 KB

  • Alazar count edges synchronization

    Hello,
    We have an Alazar AT9350 of which the acquisition has to be synchronised with the acquisition of a Count-Edges channel on an NI-6259 DAQ board. Running them synchronously is easy, for we run the Alazar board with a trigger signal (50KHz) that we can route to the NI board as well. However, starting them synchronously poses more of a challenge. The original solution was to input the trigger on the NI-board and reroute it when the count edges VI starts. However, the board needs one counter to create the sample clock (or receive the trigger signal), and one counter to output the signal. This leaves no counter for the Count-Edges channel (our NI board has only two counters). 
    I have come up with a possible solution for synchronisation, but it is a bit ugly. I output the task just after the start task VI to an indicator, and create a local variable. I connect a read version of the local variable to the acquisition while loop of my alazar board. My assumption: because the while loop has to wait till all data flows have presented data to him, the while loop must start synchronously with the start task. The actual program is much bigger, that's why I'm using a local variable here. A direct wire is also possible, but it would look even uglier. 
    I have put a snapshot of a simplified version of my program as an attachment. I realise I am not actually saving any data or outputting what the Count-Edges reads, of course this is different in my real version. 
    Is my method viable or should I use a different method? (or perhaps it is viable, but I should still use a different method).  
    Solved!
    Go to Solution.
    Attachments:
    labview program.JPG ‏114 KB

    Dear GerdW,
    Thanks for your suggestions.
    [quote]Probably not "real time"… When you use DAQmx to read your input data you can synchronize input channels. Have you looked in the example VIs for that case? [\quote] I use an NI board with DAQmx drivers to acquire the Count Edges. I use an Alazar board with their own SubVI's for the other acquisition. Therefore I cannot use the DAQmx synchronisation (which would've been quite easy indeed). And indeed, by "real-time", I of course mean that the amount of data I process per second is the same as the amount of data that I acquire per second .
    I changed my example, hope I finally understood you well. I added a wait function to the loop that sends the notification. Otherwise the notification is sent on the same time, but there is still no synchronisation because the notifier is retrieved upon reaching the loop (and it essentially does nothing). To make sure I know when I start the two loops synchronously, I will add a high-resolution relative seconds to both loops and subtract them in another loop. If there is a better way to test synchronisation I'd happily take any suggestions. (Though perfect synchronisation is the best, one or two ticks off won't do much harm). 
    Attachments:
    MinimalExampleWhileLoopSynchronisation.PNG ‏14 KB

  • NI 5124 count edges

    Hi,
    Im using distance sensor ELGO EMIX3 (10-30 VDC square wave output). Max resolution is 0.01 mm while using 4 edge triggering.
    Current principle is to count rising edges from the signal (attachment)
    Problem is that I'm not able to count pulses as fast as needed. maximum speed for the sensor is 4 m/s and I'm nowhere near! I Would be happy for 0.1 m/s speed
    Is there a better way to count signal edges using NI 5124
    regards,
    Asmo
    Attachments:
    countedges.jpg ‏55 KB

    Thanks HSD,
    Code you provided does the trick and the system is able to count edges very fast.
    First I had to upgrade SCOPE driver software, because I got several errors about memory overload and one like this:
    > Component Name: nimxslu proxy
    > File Name: This is NOT an error in nimxslu. See nimxsl/tStatus2KernelProxyWrapper.cpp for information
    > Line Number: 290
    > Status Code: -218802
    Further, i tried to modify your code to count rising edges from two sensor signals with no success.(attachment)
    I added input channels 0,1 and get waveform array size 2. I also ensured that waveform array consist different signals from channels 0 and 1. Anyway, total records still show pulses from only one channel. I guess this has something to do with fetch records property node?
    and further..
    I need to count both rising and falling edges from two channel input. Sorry, Im not familiar using scope property nodes. Is it possible to modify this code you suggested earlier to count rising and falling edges?
    Attachments:
    countedges2.jpg ‏68 KB

  • Counting edges @ 90MHz

    Hi
    I'm looking for a solution to count edges from an external source without prescaler* @ 50 (90) MHz and read the counter (>=32bit) with a sampleclock of 100kHz.
    The M/X series Daq have counters  but the external sources routings limit the counter source to about 25MHz
    * I want every edge!
    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 ǝɥʇ'
    Solved!
    Go to Solution.

    John P wrote:
    Hi Henrik,
    I think you're talking about the TB-2715, which is a screw terminal block that mounts directly to the PXI-6602.  I'd want to actually set this up before giving a recommendation--the TB-2715 might work out but I haven't tried it before at high frequencies.  I'm hesitant on recommending a screw terminal connector block because I have had issues with the SCB-68 passing through high frequency signals cleanly, but perhaps the 2715 doesn't have the same problems since it connects directly to the 6602.
    Close I was thinking about that housing with the connector and a matching PCB core in Ultiboard for custom designs
    In the past I have used the BNC-2121 cabled directly into the SMB clock out connector of a PXIe-6545.  Both the output impedance of the 6545 and the characteristic impedance of the SMB to BNC cable were 50 Ohms.  I actually did not terminate at the BNC-2121 as I found it wasn't necesary with the cable lengths that I was using (I don't recall exactly what they were).
    The spec claims a 75Ohm input impedance for the 6602, well the mismatch probably don't hurt that much if you have short cables.
    The spec for the max external source for the 6602 only goes up to 80 MHz, so anything above that would not be a guarantee.  From past experience I believe it should work under the right circumstances, but it's probably something that would have to be set up to know for sure.  Do you have the contact info for your Field Sales Engineer who might be able to arrange for a loaner 6602 for you to try out?  Or, perhaps you can simply order one and return it if it does not suit your needs (check with your sales representative to confirm NI's return policy).
    I'm in close contact with NI here in Germany and a PXI-6602 was already offered for a test * 
    Best Regards,
    A maybe root idea, but how about using a PXIbus breakout board and feed the 90MHz to one of the internal triggerlines? Would that drill a hole through the f-max limited input?
    Spoiler (Highlight to read)
    The PTB seems to be a good value customer
    The PTB seems to be a good value customer
    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 ǝɥʇ'

  • NI PCIe-6351 Count Edges Channel error on fast TTL - Multiple Sample Clock pulses were detected

    Hello,
    I am trying to use a PCIe-6351 to record the arrival times of a fast TTL pulse stream (generated by an Excilitas/Elmer Perkin APD). The TTL pulses are 2.5 volt amplitude, 20 ns duration, with a gauranteed dead time of 50 ns between pulses. I am trying to use the the Count Edges function, with the  100MhzTimebase as the input terminal and the input to counter 0 (PFI8) as the sample clock. After a few seconds of acquiring data at 100 Mhz, the application throws the following error (-201314):
    "Multiple Sample Clock pulses were detected within one period of the input signal"
    I had thought that because there is 50 ns dead time between pulses, multiple pulses would never arrive within a single clock cycle of the 100 Mhz timebase. Is there any way this might not be the case? Alternatively, is it possible that the counter is triggering on some jitter around the edges of the pulses? If so, is there any way to filter such high frequencies without losing the 20 ns pulses?
    I have read through the forums for similar problems with photon detectors, but have not been able to resolve this issue. Thank you for the help.
    Matthew Bakalar

    It sounds like the input signal is being detected as multiple edges.
    The PFI filtering feature on the X Series card likely isn't going to be suitable for you.  The minimum setting is actually exactly 20 ns, which should in theory guarantee a 20 ns pulse passing through.  However, if the signal is high for anything less than that there wouldn't be a guarantee (depending on the phase of the timebase relative to the rising edge of the signal)--considering rise times and that there is evidently a glitch in the signal itself, it probably isn't actually a continuous 20 ns high time by the time the DAQ card sees it.
    What you should do instead:
    Configure a second counter as a retriggerable counter output (single pulse).
    Use your external signal as the start trigger for this counter output task.
    Set the initial delay, high time, and low time for the counter output task all to 20 ns (the minimum).
    Use the internal output of the counter output task as the sample clock source for the original edge count task.
    The counter output will be triggered when it sees the external signal, wait 10-20 ns, then generate a 20 ns pulse.  If there is a glitch on the trigger line during this 30-40 ns that the output is generating, it will be ignored.  The counter output will be re-armed in time for the next pulse given the minimum dead time of 50 ns between pulses.
    Best Regards,
    John Passiak

Maybe you are looking for

  • Tablet Only Showing Blank Screen

    My tablet is not showing anything on the screen. Only the backlight is on, so the screen gets power. Pressing Windows button is vibrates the tablet. Holding the power button for 10 seconds shuts it off. A short press (like waking it up) lights the bl

  • Can I put two h:dataTable in one page?

    I find that if I put two dataTables in the same page, something goes wrong. Any solution to this? Thanks in advance.

  • FBL1N with dynamic selection WITHHOLDING TAX CODE is dropping rows

    Using FBL1N with dynamic selection field: WITHHOLDING TAX CODE and noticed that several vendors dropped off the report. Appears FBL1N's filter logic uses LFB1-QSSKZ and not LFBW-WT_WITHCD. Upon examination, I determined that the missing vendors didn'

  • I want to call popup in the loop

    Hi, for example: I selected the N no.of rows in a table and click the button based on that  N no. of pop up i want to display.\ For this I got the selected elements in the table.here i have condition loop at wa to itab. if field ne empty. LO_WINDOW->

  • DVD-ROM question.

    I want to place a single folder named "Documents" at the root level of the DVD with a single .pdf file in it. When I add the DVD-ROM content to the project by selecting a directory on my hard drive named "Documents" what I get on the burned DVD is th