Counter input problem

hi, i'm using a counter input to count the falling edges of a digital pulse. I need to convert this into a time based measurement (period/frequency), but am having a litle trouble doing this. If any one can help? i'd prefer it if it were as simple as possible, i.e. no fancy programming as I'm new to LabVIEW and would like to fully understand what i'm looking at!
Many thanks in advance!
tom

Hi
What version of LabVIEW are you using? If you're programming with version 7.0 or higher you can configure your counter for period or frequency measurements quite easily using the DAQ Assistant.
Just drop down the DAQ Assistant Express VI. The Wizard that opens will ask you to choose your input type. Choose Counter Input and it list options for Edge Counting, Frequency and Period Measurement. Choose the one you want then choose the counter with which to do the measurement. When you click Finish a configuration dialog box will open up for you to configure the Input Range, the Task Timing, etc. There will also be some further information in the help section along the right of the window. When you click OK the DAQ Assistant will build your code.
I've attached a Zip file with 2 labview programs to demonstrate this. (They're written in version 8). Connect DIO 0 to PFI 9 of your DAQ card (I'm using an M Series card. If you're using a different card let me know). Extract and run both files. The Digital Output VI generates an alternating high and low signal for each iteration of the loop. The Counter Frequency Measurement VI measures the frequency of this output. The frequency is determined my the Wait Until Next ms Multiple function so change the input to that to vary the frequency.
Let me know how you get on with that and if you require more info.
Good luck!
SarahB
NI | UK
Sarah
Applications Engineer | National Instruments | UK & Ireland
Attachments:
Frequency Measurements.zip ‏65 KB

Similar Messages

  • Route multiple 6602 counter inputs to one counter output...

    Hi!
    I´d like to route 4 different ttl signals, that are read by 4 different counter inputs to one single output channel (e.g. the output of one of the counters used) using pulse train generation with a divider of 4. Note that only one of the four inputs is active at the same time, to prevent overlay.
    How can I do that with Traditional-DAQ?
    Setup would look like this on the SCB-68
    TTL1 ----o in0 (ct0)----o out0 TTL(1..4)/4 [Hz]
    |
    TTL2 ----o in1 -- (output of ct2 is redirected ro ct1)
    |
    TTL3 ----o in2 --
    |
    TTL4 ----o in3 (ct3)--
    May it be better to just output each counter input signal at it´s own output and connect these outputs to one free I/O-pin hardwired?
    Best regards
    Zorniki

    In the end I configured a counter for Pulse Train generation and opted to change the duty cycle and frequency via 'DAQmxWriteCtrFreqScalar" (i.e. Pulse Width Modulation)
    I registered a callback for the 'DAQmx_Val_CounterOutputEvent' and then changed the dutycycle and frequency in that callback. 
    Unfortunately, I kept getting  "The pulse generation with previous property settings must complete a
    full cycle before the property can be updated." error messages and, opon further reading, managed to find a doc where National Instruments suggest adding a 'Wait(period)' before executing the 'DAQmxWriteCtrFreqScalar' call.
    The problem with this solution is that it one has to wait a minimum of 2 Periods before the Pulse Train can be modified which is not acceptable for our work.
    So is there an alternative solution which allows us to change the Pulse Train after only 1 Period ? Is there an event we can trap which allows us alter the Pulse Train after every period ? I'm sure PWM must be possible on Daq cards (PCI-6602 or PCI-6281 or PCI-6259)?
    Cheers, Shaun.

  • Custom scale for counter input?

    Hello everyone,
    Is it possible to create a custom scale for a counter input? I saw there is a feature to allow input Custom Scale Name to the Channel Property Node. However, when I tried to create a custom scale to input to the channel, I got this error
    Error -200212 occurred at DAQmx Read (Counter DBL 1Chan 1Samp).vi:1
    Property: CI.MeasType
    Corresponding Value: Count Edges
    Property: CI.AngEncoder.Units
    Corresponding Value: From Custom Scale
    Channel Name: CountEdges
    Task Name: MyCountEdgesTask
    Do you know what is the problem with it? Thank you

    How do you have the channel set up? Can you attache the VI's that you are using? Is this a global virtual channel?
    Tim
    Johnson Controls
    Holland Michigan

  • Save counter input data against time

    Hello, i would like to know about recording using a write to measurement file.
    When i record a data like analog input, at the save file with display the analog data against time.
    But when i tried to applied for the encoder, which is using counter input, in the .txt file dont display
    the result as analog input. So can someone give me a guide on what to setting on write to measument
    file to measure the revolution per minute rotation against time, thanks
    Solved!
    Go to Solution.
    Attachments:
    encoder recording.vi ‏180 KB

    There is no setting for the Write Measurement File. Your problem is that you are passing a scalar to the function and that scalar has no timestamp information. When you use an analog acquisition, the data type is either a waveform or dynamic data type. Below is one way to add the timestamp information. You also should have a delay or msec wait in your loop. This can be used for the dt information.
    Message Edited by Dennis Knutson on 09-24-2007 09:51 AM
    Attachments:
    Save Scalar with Timestamp.PNG ‏6 KB

  • PCI-6602 - What to do with unused counter inputs?

    I've got an application where I need to track the position on two quadrature encoders.  I've developed my application with VB6 however, I've been using a sample LabView program called "Meas-Ang-Pos-Buff.vi" for testing purposes.  (I got the example off the NI discussion board).  I'm seeing some very odd results that I can't explain. 
    For testing purposes, I've got one encoder tied to multiple channels on my 6602.  I have the same 'A' signal and the same 'B' signal (from the one encoder) jumpered to multiple encoder channels.  I'm using a onboard pulse generator to generate the latch pulse (connected to the Index/Z of each counter) to ensure there is no skew in my count values.  I'm using an external servo to turn the encoder at a rate equal to my application speed.
    The unexplanable results I'm seeing are below:
    If I'm monitoring counters 0, 1 and 2, I see the following.
    1)  If I have counters 0,1,2 and 3 inputs connected to the same 'A' & 'B' from my encoder, the counts on all 4 channels (0,1,2,3) track perfectly.
    2)  If I disconnect counter 3 and only have counters 0,1, and 2 connected to the encoder, then counter 0 and 2 track perfectly, but counter 1 looses pulses (only when traveling in one direction, the other direction seems to be fine)
    3)  If I connect counter 3 to ground and have counters 0,1, and 2 connected to the encoder, I get the same result - bad.
    4)  If I connect EVERY counter input (2,3,4,5,6) to ground and only monitor counters 0 and 1, I still get bad results.
    In summary, I ONLY am able to see the same number of counts while monitoring 3 channels IF 7 of the 8 counters are connected together (the 8th being my latch).
    This happened to me in the past on a previous setup that did the same thing, but I was able to fix it by moving from counter 1 to counter 4.  At that time, I chalked it up to a bad counter 1, but I think there is a bigger issue since it is happening again.
    Please any advice would be appreciated.

    Thanks for the response.  This one has really got me confused and any help is greatly appreciated.
    To answer your questions, no I have not modified the sample program and I'm using NI DAQ v8.5.
    I've decided to break the problem down to see if I could find a pattern, but no such luck.  Here is the testing that I've done.
    I'm making the following connections while using the sample program I mentioned earlier:
    Counter 0...............PFI_39 (term 02) - Channel_A(0).................PFI_37 (term 40) - Channel_B(0)
    Counter 1...............PFI_35 (term 07) - Channel_A(1).................PFI_33 (term 06) - Channel_B(1)
    Counter 2...............PFI_31 (term 34) - Channel_A(2).................PFI_29 (term 66) - Channel_B(2)
    Counter 3...............PFI_27 (term 31) - Channel_A(3).................PFI_25 (term 63) - Channel_B(3)
    Note:  I connect the "Z" channel for gating purposes in my VB application, but this isn't required in the LabView sample program since the gating appears to be done internally.
    My testing results:
    1.  If I jumper my one encoder to channels 0,1,2, & 3 at the same time, everything works great.  Each channel reports the same number of counts regardless of whether I'm turning the encoder in the positive or negative direction.
    2.  If I disconnect channel 3 and only have 0,1 & 2 connected, then 0 & 2 track perfectly, but channel 1 looses counts in the negative direction.
    3.  If I only connect channels 0 & 1, then channel 0 counts perfectly in both the pos and neg direction, but channel 1 looses counts in the negative direction.
    4.  If I connect any channel by itself (0,1,2 or 3), each one counts perfectly.
    5.  If I connect channels 0 & 4, everything seems to be fine.
    Like I said in my previous e-mail, if this hadn't already happened to me in a previous application, then I would chalk it up to a bad board.  If I didn't get good results on each individual channel then I would chalk it up to a bad encoder pulse train.  However, it definitely seems to have something to do with connecting multiple counters at the same time in a Motion Encoder Application.  I have read the 6602 User Manual backwards and forwards looking for a nugget of explanation, but have found none.  There was a section entitled "Counter Input Selections" on page 4-12 (table 4-2) that might offer some explanation, but neither me or my colleagues could understand what was being described.  Any help deciphering that would be appreciated.
    As of now, I'm going to proceed with my application, using channels 0 &4 (just as I've done in the past), however I don't feel comfortable not having an explanation for the 6602's behavior.  Any insight would be greatly appreciated.

  • 4 counter input & 6 signal input HELP

    Hello Friends,
    I have a little problem, would be great if someone can help me.
    I am using the counter inputs on my Data Acq. Harware to measure the pulse width of my input sigal.
    Since the hardware has only 4 counter inputs I can connect 4 channels, but I want to measure pulse width for 6 channels.
    Is there a way to use the available 4 counters and measure all of the 6 channels?
    Thank you
    Regards,
    Raj
    Solved!
    Go to Solution.

    In my (very basic) example, you could just increase the timeout to ~10+ seconds to ensure you acquire the pulse.  If it's possible that the pulse isn't present within the ~10+ second timeout you would also need to handle the timeout error so it doesn't wrap back around through the shift register and prevent the future reads from executing.
    The downside to this of course is that it could take up to ~60+ seconds to acquire from all 6 channels in the worst case scenario.  The example was really just intended to show how one might use a single counter to acquire from multiple channels in succession.
    The better way to do it with counters would be to run (up to) 4 counter tasks in parallel.  The first 2 tasks to finish with their original acquisition should then measure a second channel.  This could still take ~20 seconds if none of the signals are connected however.
    If you want to trade a lower measurement resolution (and more memory usage) for a lower upper-bound on measurement time you could instead acquire a 10 second window of time using clocked digital inputs and use software to determine the pulse duration by parsing the acquired array.
    Best Regards,
    John Passiak

  • FP-CTR-500 don't read external count inputs

    I have 4 frequency signal inputs (0-10 KHz) connected to ports 2,3,4,5 of one FP-CTR-500, but I can't read any change on counting values, using FieldPoint Explorer. The module is OK, all the LEDs are green, including those four inputs, the firmware version of FP-1600 is 4.11 and software version of FieldPoint Explorer is 3.0.0 I can view a fix value of 53xx counts on each input, after a power up sequence (the external frequency is 8.2 KHz aprox.). What can I do?

    There are several reasons that you may be having problems with the count. First, if the channel LED is always on, then the signal wired into the FP-CTR-500 may not be going low enough (below 6 volts) for the module to see the falling and rising edges. Second, if the inputs have been configured with the 200 Hz low pass filter setting, you may be filtering out your signal. Third, if you have configured the count channels for internal count inputs (1 kHz Reference or 32 kHz Reference) or previous count channel, then the module is not looking at your actual wired signals. Fourth, If you have enabled the Gate Inputs (channels 8-11) for any of the counters, then the count will not increment while the gate is low. Fifth, if the channel is configured for Reset On Read fu
    nctionality, every time the FP-1600 polls the FP-CTR-500, the channel will reset itself.
    Regards,
    Aaron

  • Counter Output/Counter Input PXI Signals Behaving Erratically

    Question for all your LabVIEW guru's out there,
    I am running a frequency loopback test using the NI PXI 6229 MIO DAQ card.  I am generating a "Counter Output" pulse train signal which feeds through my device under test and then back out of my device under test and back into the PXI 6229 for a "Counter Input" frequency measurement.  Both the "Counter Output" and the "Counter Input" are assigned different PFI lines using DAQmx in LabVIEW.
    I have 4 lines to test on my DUT.  All four lines run this same frequency measurement but with different PFI lines on the PXI 6229.  Each line is test independently.
    This is my setup for the 4 lines:
    Path 1: P2.0 (Counter Output - Pulse Train) -> DUT (Device Under Test) -> P2.1 (Counter Input - Frequency Measurement)
    Path 2: P2.2 (Counter Output - Pulse Train) -> DUT (Device Under Test) -> P2.3 (Counter Input - Frequency Measurement)
    Path 3: P2.4 (Counter Output - Pulse Train) -> DUT (Device Under Test) -> P2.5 (Counter Input - Frequency Measurement)
    Path 4: P2.6 (Counter Output - Pulse Train) -> DUT (Device Under Test) -> P2.7 (Counter Input - Frequency Measurement)
    where:
    P2.0 = PFI8
    P2.1 = PFI9
    P2.2 = PFI10
    P2.3 = PFI11
    P2.4 = PFI12
    P2.5 = PFI13
    P2.6 = PFI14
    P2.7 = PFI15
    I have a LabVIEW VI which generates the "Counter Output" and reads the "Counter Input" frequency.  I am seeing weird behavior from the PXI 6229 card. I can test "Path 1" and "Path 2" and the frequency I read is what I generated. No issue there. However, when I test "Path 3" and "Path 4" the frequency measurement is erratic.  The readings are two different frequencies repeated over and over again and none of those frequencies are the expected frequency which was generated out of the "Counter Output."  If I reset the card, and start by testing "Path 3" and "Path 4" the frequency readings are correct and the erratic behavior is gone.  However, when I try to then test "Path 2" and "Path 1" now those lines have the erratic frequency issue. I can continue resetting the card and see same issue. The PFI lines that I test first will always pass.
    To summarize:
    Steps Taken:
    1. Test Path 1 = SUCCESS
    2. Test Path 2 = SUCCESS
    3. Test Path 3 = Erratic Frequency (Two Frequencies repeated over and over again in my frequency results array)
    4. Test Path 4 = Erratic Frequency (Two Frequencies repeated over and over again in my frequency results array)
    5. Reset the PXI 6229 Card
    6. Test Path 3 = SUCCESS
    7. Test Path 4 = SUCCESS
    8. Test Path 3 = Erratic Frequency (Two Frequencies repeated over and over again in my frequency results array)
    9. Test Path 4 = Erratic Frequency (Two Frequencies repeated over and over again in my frequency results array)
    I am wondering if Port 2 (P2.0-P2.7) on the 6229 card has certain dependecies and this is why I am seeing issues.  I am trying to get around this issue so that I don't have to always reset the card.
    Are P2.0-P2.3 (PFI8-PFI11) and P2.4-P2.7 (PFI12-PFI15) treated differently or require different setup?  How do I resolve this issue?
    Thanks so much!

    I have a theory...
    The DAQ card follows a policy called "lazy uncommit" wherein the terminal used for the output will continue to be connected to the counter even after the task has completed (until the terminal is needed for something else).  So as you run more tests, the counter output will end up driving more lines.  This behavior should be easy enough to confirm.
    As the DAQ card drives more lines, I'd imagine this affects the actual signal.  You could scope it to check, but it sounds like either the rise/fall times are becoming longer or some extra noise is being introduced on the line.  
    The readings are two different frequencies repeated over and over again and none of those frequencies are the expected frequency which was generated out of the "Counter Output."
    This implies you are picking up an extra edge during transitions--this isn't too uncommon if the signal is noisy since there is no built-in hysteresis on the DAQ card.  I would expect the measured frequencies to have periods that sum to either the full period or the semi-period of your actual signal (depending on how many duplicate edges are detected).
    Suggestions are as follows:
    To stop the DAQ card from driving multiple PFI lines, it would probably be easiest to just programmatically reset the device in between your tests (using DAQmx Reset Device).  If you can't reset the device (e.g. because you are running some other task that can't be interrupted) then you can instead configure a dummy task that uses the PFI line in question as an input.
    To stop the DAQ card from picking up multiple edges during transitions, you should configure a digital filter on the input terminals.  If you reset the device it sounds like this might not be necessary... it's up to you if you want to configure this or not.
    Best Regards,
    John Passiak

  • Acroread 8.x CJK input problem

    See also https://bugzilla.novell.com/show_bug.cgi?id=353251
    CJK input doesnt work right in the English version of
    acroead 8.1.1 or the pre-release version 8.1.2.
    First of all, one needs to set
    export GTK_IM_MODULE=xim
    to make acroread react at all to the hotkey which triggers
    SCIM input (default hotkeys on openSUSE are Shift+Space and Control+Space).
    When GTK_IM_MODULE=scim or GTK_IM_MODULE=scim-bridge, acroread
    wont react to the hotkey which enables SCIM at all.
    With GTK_IM_MODULE=xim, the scim input method *can* be
    enabled by Shift+Space. But it doesnt work right.
    One can see correct Japanese in the popups shown by scim when
    converting phonetics to Chinese characters. But the predit string
    shows garbage which seems to resemble Arabic. And after comitting
    everything typed is converted to question marks (acroread 8.1.1)
    or boxes (acroread 8.1.2).
    I am talking about the *English* versions of acroread here, not
    localized Japanese versions like e.g.
    ftp://ftp.adobe.com/pub/adobe/reader/unix/8.x/8.1.1/jpn
    As it is not nice to have completely packages for each language, I
    hope that the different language versions can be merged into one in
    the long run.
    It would be very nice if there were only one basic version and to
    support other languages one only had to add fonts and translations and
    not exchange the binaries.

    Some more comments from: https://bugzilla.novell.com/show_bug.cgi?id=353251
    ------- Comment #5 From Gaurav Jain 2008-01-11 10:48:18 MST -------
    [ ] Private
    Mike,
    Could you confirm if everything is working fine with the Japanese Reader
    downloaded from the Reader website? That'll be really strange since the Viewer
    binaries should be identical in the English and Japanese versions. The only
    difference in the 2 installers should be in the fonts and the resource
    libraries.
    -vc
    ------- Comment #6 From Mike Fabian 2008-01-11 19:43:16 MST -------
    [ ] Private
    OK, I tried with the special Japanese version of acroread (8.1.1)
    as well.
    There is no difference in behaviour between the Japanese acroread
    8.1.1 and the English acroread 8.1.1 and the English acroread 8.1.1 as
    far as the input problem reported here is concerned! All of them show
    the problem as reported here.
    But I found that it depends on the locale. If acroead is started
    in ja_JP.UTF-8 locale
    LANG=ja_JP.UTF-8 acroread
    the problem occurs as reported here.
    However, if acroread is started in ja_JP.eucJP locale
    LANG=ja_JP.eucJP acroread
    the Japanese input works fine! Thats the same with the Japanese and
    the English version of acroread.
    As UTF-8 locales are the default nowadays on most Linux distributions,
    it is important that this works not only in legacy locales like
    ja_JP.eucJP but also in ja_JP.UTF-8.
    ------- Comment #7 From Gaurav Jain 2008-01-13 09:25:27 MST -------
    [ ] Private
    The screen-shot seems to indicate you are trying to enter japanese characters
    in a standard GTK+ edit field. The core Reader code actually doesn't interact
    much with the control during the process of entry of text.
    Could you try the following -
    1. When the default locale is eucJP, what happens in a standard edit field in
    some other GTK+ app., for instance gtk-demo? If you don't have gtk-demo, you
    could even try the same thing in the Open dialog in the Adobe Reader, where you
    type the file name.
    2. If you don't export GTK_IM_MODULE=xim, can you make the IME appear in some
    other GTK+ app. like the gtk-demo?
    My guess is this (atleast point 1 above) may be a problem with GTK+, though we
    are investigating this at our end as well. Maybe an issue with the fonts that
    get loaded when the locale is UTF-8, vs eucJP. That's the reason, the
    characters loaded from the IME are showing as question marks.
    -vc
    ------- Comment #8 From Mike Fabian 2008-01-14 05:18:46 MST -------
    [ ] Private
    Gaurav Jain> 1. When the default locale is eucJP, what happens in a
    Gaurav Jain> standard edit field in some other GTK+ app., for instance
    Gaurav Jain> gtk-demo?
    In gtk-demo, Japanese input works both for ja_JP.eucJP locale
    *and* for ja_JP.UTF-8 locale.
    And it works for all values of GTK_IM_MODULE which I tried
    (GTK_IM_MODULE=xim, GTK_IM_MODULE=scim, and GTK_IM_MODULE=scim-bridge.
    Gaurav Jain> If you don't have gtk-demo, you could even try
    Gaurav Jain> the same thing in the Open dialog in the Adobe Reader,
    Gaurav Jain> where you type the file name.
    Japanese input in the Open dialog of the Adobe Reader behaves
    exactly like in the search field of the Adobe Reader:
    - works fine in ja_JP.eucJP locale
    (for all values of GTK_IM_MODULE)
    - does not work in ja_JP.UTF-8 locale
    (not for any of the above mentioned values of GTK_IM_MODULE)
    Gaurav Jain> 2. If you don't export GTK_IM_MODULE=xim, can you make
    Gaurav Jain> the IME appear in some other GTK+ app. like the gtk-demo?
    In gtk-demo the IME appears and works fine.
    In acroread, the IME appears for all values of GTK_IM_MODULE (xim,
    scim, scim-bridge) and input works fine in ja_JP.eucJP locale. In
    ja_JP.UTF-8 locale, the IME appears as well and input seems to be
    possible but the result is garbage as in my screen shot.
    ------- Comment #9 From Gaurav Jain 2008-01-22 04:06:32 MST -------
    [ ] Private
    Hello Mike,
    I tried reproducing the bug on SLED 10, openSUSE 10.3, and openSUSE
    11.0(http://download.opensuse.org/distribution/11.0-Alpha1/iso/cd/openSUSE-11.0-Alpha1-GNO ME-i386.iso)
    but was unable to do so.I could see no difference in the behavior based on
    locale.Also,the problem of garbage predit strings in case of utf8 is not
    reproducible at my end.
    Could you please attach a screenshot of your SCIM setup settings,and the
    download location of openSUSE 11.0.
    Regards,
    Sanika
    ------- Comment #10 From Mike Fabian 2008-01-23 10:48:40 MST -------
    [ ] Private
    I found that the problem occurs *only* with GTK_IM_MODULE=xim,
    contrary to what I wrote in comment #8.
    That was my fault, because I still had
    # Workaround for http://rudin.suse.de:8888/show_bug.cgi?id=85416
    # (see comment #37):
    export GTK_IM_MODULE=xim
    patched into the beginn of the acroread start-script.
    Apparently this is not needed anymore, input using
    GTK_IM_MODULE=scim and GTK_IM_MODULE=scim-bridge seems to
    work fine now in acroread 8.1.2.
    *But* the problem I described here occurs with GTK_IM_MODULE=xim.
    Sanika,
    can you reproduce the problem with GTK_IM_MODULE=xim ?

  • 6251 Counter input signal

    Hello,
    I am acquiring pulses which are 0-5V with the counter of the PXI 6251. However, I would like to know if it is possible to acquire pulses that are, for example 0-12V or 0-24V without damage the device. In other words, which is the voltage range for the counter input in a PXI 6251?
    thanking in advance,
    CJMV

    Hi,
    You will not be able to use the counter directly but you can setup an analog level trigger for your signals. This will create a pulse that isTTL compatible  for you everytime the signal crosses a particular level. Then you can route this into your counter and perform any counter measurements on it. An example is this is shown here where it sets up a level trigger to make frequency measurements.
    Alternatively you can purchase an industrial strength digital I/O board such as the USB-6525 but this does not include a counter.
    Please let me know if this works out for you.
    Message Edited by Abhinav T on 07-06-2007 05:20 AM
    Abhinav T.
    Applications Engineering
    National Instruments India
    LabVIEW Introduction Course - Six Hours
    Getting Started with NI-DAQmx
    Measurement Fundamentals

  • Encoder position WITHOUT counter input

    Question:
    I have three incremental encoders connected to my M-Series DAQ board (PCI-6229) that has TWO Counter input channels.  I am measuring the position of each encoder.  How do I measure the position of the third encoder if I have used-up both counter inputs?  Is there a manual way to accomplish this using my older version of Labview (version 7 express)?  Any help is appreciated.
    -Clarkam1 

    clarkam1 wrote:
    Ben,
    I'm on an extremely small budget and can only use the items available to me at present time.  That being said, is there no way to use one counter for multiple encoders?  Or could an external device be used to count which the DAQ board would read?  I appreciate your timely responses.  I'm trying to explore all other options.
    So do you work for free?
    If you are determined to get all three counters going with that device, you have a big challenge ahead of you. I'll try to explain. At teh input of your counters you have signal conditioning that feeds the counter itself. To do the same thing using analog input channels (since all of the counters are already used) you will have to develop code that simulates the signal conditioning, converts the analog to digital (this may sound easy but if you need to implement over-sampling its not) and then do the work of the counter, again in software.
    If my customer was forcing this on me I would first review the behavour of the hardware and use it to establish the requirements of my code. So if you do not have an EE background, you will first have to learn the hardware so you can write software that does the same thing.
    So if you work for free then you may want to chase down the examples that NI ships for their FPGA targets that implement serial protocols and the like. You may be able to harvest some code and examples from there. If you don't work for free, then you really have to decide if you want to re-invent in software what you can purchase.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Benchmarks for Buffered Counter Input with X-Series Devices

    Hi,
    Does anyone know the maximum transfer rate (using dma) for the x-series cards? 
    I'm looking for data simillar to the one in this link:
    http://digital.ni.com/public.nsf/allkb/72A7E41EE5A8756A862571DA0076F1D7?OpenDocument
    More specifically I want to know the transfer rate for the PCIe 6343.
    Thank you,
    Eyal
    Solved!
    Go to Solution.

    I benchmarked 8MS/s on a single channel on a USB-6353 (should have similar performance to the USB-6356/66) with a buffered counter input task. This was only a 10 minute test on my Dell E6400 laptop ( Windows 7 32 bit, Dual core P8600, 4GB memory) so a sustained 24/7 rate is likely less. Also, I wasn't doing much with the data, just displaying it in an array. This is pretty much topping out USB streaming on this system (32MB/s) so I wouldn't expect to get higher. I wasn't running much else in the back ground (Explorer, Powerpoint, Lotus Notes) and CPU was at ~20%.
    Hope this helps,   
    Andrew S
    Getting Started with NI-DAQmx
    Measurement Fundamentals

  • Low Pass Filter Counter Input Compact DAQ

    Hello,
    I need to put a 10kHz Low pass filter on a counter input.
    I have a CDAQ 9178
    and a 9421 Digital Input module
    Acording to the documentation and my own experience I can't enable the filter on the Digital input card.
    Is there another way to do this?  I need to filter the signal in hardware.
    Thanks
    Dan

    Your filter might work, however it is build to filter power lines, with current rating 6A and powerline voltage. You pay a lot for a box with screw terminals and a lot of copper and high rated capacitors.
    Have you tried a simple RC lowpass (costs less than 50 cent, even when purchased in a pharmacy ) ? R=1500Ohm, C=10nF gives a coarse 10kHz first order lowpass. The C fits between the ground and input terminals of your DAQ, the R in the signal line to the input.
    Output impedance of your source?
    If you explain more of your application, type of signal, we might find other solutions.
    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 ǝɥʇ'

  • Graphing Encoder Counter Input in LabVIEW Signal Express

    In LabVIEW SignalExpress, using a simulated daq system with a counter input, I set up a DAQmx Acquire of an Angular measurement based on a quadrature encoder.  Acquiring N samples, I acquired a table of measured values.  I would like to plot the results, however, I am not given the option to view the data in any other format.  I can plot if I acquire one sample, but that does not allow me to sync the data with the analog input signal I would also like to acquire and view.  I had to use an external clock to take the encoder data, so the data is acquired a double datatype.  I would like to be able to view in realtime, encoder position with respect to time.

    HI,
    I want to obtain of this combination of hardware and software a system that  allow me acquire a signal of the load cell and the counts of the incremental encoder’s pulses  and represent in a graphic the force vs the distance.
     The distance is pick up to a incremental encoder in a worm gear that with its movement, move a load cell in a base. the reading of the position is in millimeters.
    In this moment, I can only represent the force, the position is only visible in a display, I want to take a samples of  the force and the count in millimeters, ten or more times per second and perform a graphic in a real time.
    Thank you for your answer
    Best regards
    Lizardo Laguna

  • Vbnet counter input channel read

    VB2005 Counter Input DAQmx Single Reading
    I have been tasked with upgrading a previous vb6 application using DAQ Legacy
    to .net using pre-existing components.
    6052E and 6601. I am a vb.net programmer, not an engineer,
    nor did I write the original application.
    - lots of deciphering and figuring out terms that I am very
    unfamiliar with.
    6052e = Dev1
    6601 = Dev2
    Encodertype = x4
    zIndexEnable = false
    EncoderPhase = AHighBHigh
    PulsesPerRev = 60
    SampleClockSource = “/Dev2/PFI39”
    Rate = 1000
    Samples = 25
    Taken pretty much straight from the example -
    myTask.CIChannels.CreateAngularEncoderChannel(counterComboBox.Text,
    encoderType, zIndexEnable, zIndexValue, encoderPhase, pulsePerRev, _
                    0.0, CIAngularEncoderUnits.Ticks)
    myTask.Timing.ConfigureSampleClock(sampleClkSourceTextBox.Text, _
    Convert.ToDouble(rateTextBox.Text), SampleClockActiveEdge.Rising, _
    SampleQuantityMode.ContinuousSamples, 25)
    I have installed DAQmx 8.5 and have been reading the help
    and scanning the samples to try and figure these things out.
    Specifically MeasAngularPositionBufferedCont_ExtClk, after calling
    and getting help, I was finally able to get this sample to work.
    In my application, I have my own counter object that I
    instantiate and each of the four has its own task, CIChannel and reader. When a
    channel is selected, the task is configured, the channel added, the task timing
    configured and the task started, when the object is unselected, I dispose of
    the task and channel. In my gui I have a timer event and if that channel has
    been selected, then I call its getcurrentvalue method, which calls the reader
    to get value asynchronously and pumps it to a textbox. This same type of scheme
    worked for me with the AIChannels, but trying to get counter angular position,
    all I am able to get is error -200284 pretty consistently.
    I have matched all my criteria to the working sample, but am
    unable to get a value returned. Better yet, after I start my app, even if I don’t
    enable one of my channel objects, I can no longer run the sample application.
    I have found that after I run my application I can use the
    original application (which is using the DAQ Legacy) and initiate a read and
    then close the original application and everything is reset aka I can
    successfully run the sample application again.
    QUESTIONS:
    Is there a way to test the start trigger to determine that it
    is configured correctly?
    I have the task set up for external timing and the clock
    works on the sample how can I verify this is working in code?
    Any idea of why I would have to go into the original
    application in order to get the sample to work again?
    Any know of other vb code examples that might relate that
    you could point me to?
    Thanks for any help
    CMWell, time to get back to the frustration...

    Hi,
    Is there a way to test the start trigger to determine that it is configured correctly? - Where are you using a start trigger? - I didn't see a mention of it in your description. When troubleshooting triggers I ussually end up checking 3 things. First, I confirm that my physical trigger source is outputting a TTL signal. Second, in Max I do count events on the PFI line I have the signal connected to in order to confirm my connections. Third, I try a simple example - if it will trigger in the example, then it will trigger in my code as long as the call is made with the same settings and configurations.
    I have the task set up for external timing and the clock works on the sample how can I verify this is working in code? I would start with the first two steps from above. In your case, PFI39 is an actual enoder signal if I recall correctly. With the error that you receive, -200284, one of the causes of that is when there is not external clock signal (do a quick search on ni.com for "200284" and check out the first link) - is your encoder moving when you take these readings? If there is no clock signal present, then the task will not latch in values. One good way to work around this is to use another one of your counters to generate a pulse train and use that output as a clock signal instead of PFI 39. Also, if you just want to grab single values, you don't have to do a buffered acquisition - you can figure timing for "on demand" and not have to woory about clocked values. Either method should work.
    Any idea of why I would have to go into the original application in order to get the sample to work again? That ones a little tougher. If somehow you are leaving the task in an undefined state (not stopping and clearing) it can cause some issues with the next iteration. You may want to try reseting the device at the beginning of your program.
     Any know of other vb code examples that might relate that you could point me to? I think you're already looking at a good shipping example, you may want to try modifying that before trying different setups in your application.
    Hope this helps, please don't hesitate to post back to this thread with additional questions,
    Andrew S
    National Instruments 
    Getting Started with NI-DAQmx
    Measurement Fundamentals

Maybe you are looking for

  • Want to send the Sales Order No  in Alert message

    Hi,      my scenario is  IDoc to File.  suppose due to sme validations my message got failed in any where. immediatley I'm  sending an Alert to End User . But as per the prsent devolopment End user is not understaning  that which Sale order got faile

  • Why can't i connect to my internet?

    When i go to connect my internet i enter my wifi password, and i know its correct, but it wont let me connect to it. How do i connect to the internet?

  • ORA-01652 and ORA-02063 in select with dblink

    Hello, I execute the following select in a Oracle database: SELECT HAC.ENT_ID, HAC.MAT, HAC.IDAC, NVL(HAC.DATINI, 0) AS DATINI, NVL(HAC.DATEND, 0) AS DATEND, HAC.TIP, GAP.IDAC AS IDAC_GAP, HAP.IDAC AS IDAC_HAP FROM USER1.GAP GAP, HAC@DBLINK HAC, HAP@

  • Mavericks Save As function gone!!

    This is the first time I've written in one of these but I'm so frustrated by Mavericks!  I updated and everything that I knew before has changed and has slowed my whole work load down.  First off.......where the **** is the "Save As" funciton now for

  • Use Stylesheet in Web Template

    Hi All, is it possible to use my own stylesheet in my Web Template? if yes, how? Thanks, Johannes