DAQmx Counter Input Measure a single pulse's pulse width

Trying to measure a single pulse's pulse width. It appears that the DAQ only makes the measurement on the read command instead of after starting the task. I just get a timeout error. Is there any way to arm to counter for measurement or am I better off making a seperate thread to trigger my single pulse?
double measured;
int numSamp;
TaskHandle taskHandle;
DAQmxCreateTask("", &taskHandle);
DAQmxCreateCIPulseWidthChan(taskHandle, "Dev1/ctr0", "", 0.025, 0.120, DAQmx_Val_Seconds, DAQmx_Val_Rising, "");
DAQmxSetChanAttribute(taskHandle, "", DAQmx_CI_PulseWidth_Term, "/Dev1/PFI10");
DAQmxStartTask(taskHandle);
//Trigger the single pulse here
DAQmxReadCounterF64(taskHandle, DAQmx_Val_Auto, 10.0, &measured, 1, &numSamp, NULL);
Thanks,
Dan

Which device are you using?
If you configure implicit timing (DAQmxCfgImplicitTiming) your measurements will be buffered and will begin when the task is started.  The minimum buffer size is usually (always?) 2 samples, but that doesn't mean you have to read two samples back.  
Best Regards,
John Passiak

Similar Messages

  • NI-DAQmx Counter Frequency Measurement

    I need to measure the number of pulses obtained within a time period (3 secs).
    So if i use channel 0 to generate a gate pulse for channel 1 how can i do other other things while waiting for my 3 seconds to be up ?
    Has anyone got any VB6 code to do it. At the moment i have a task in Max to generate the pulse train with two leading edges every 3 secs.
    I use this output to gate the second counter channel. I then have a task created in VB to count edges. Then i would like
    DAQmxReadCounterU32 to NOT hold up execution while reading two samples.
    something like......
    while waiting for two samples
    loop

    Assuming you're doing buiffered event counting, you can monitor the status of the buffer without blocking by using the Read Properties.  I don't know the exact VB syntax, put the equivalent C funtion you need is:
    DAQmxGetReadAvailSampPerChan(TaskHandle taskHandle, uInt32 *data)
    You can use this function to poll within a loop and then call read only after a certain number of samples are available.  You can also continue to use the Read function but pass in a timeout of 0 or pass -1 for the number of samples to read.  Passing -1 will tell the driver to read all samples that are currently available and then return.  Depending on the method, you'll either have to handle timeout errors or check the actual number of samples read to see if you actually read anything, but neither method will block until samples become available.  You could also register a callback funtion for the Every N Samples Acquired Into Buffer Event and perform your read in that callback.  I hope this helps.

  • What is the best way to assign time stamps to counter input data?

    Compact DAQ
    NI 9411
      Hi Everyone,
      I am creating a chart recorder for collecting various engine data.  I need to plot engine speed, crank angle, and various analog data on an XY graph.  I am using a counter and a mag pickup to continuously measure the frequency of the flywheel teeth.  From this data I create an array of timestamps based on accumulated periods for each frequency measurement.  My problem is, how do I determine the absolute timestamp for the first frequency of the buffered data?  I need to sync the frequency data with the analog data so I can plot it all vs time on an XY graph.  The flywheel has 201 teeth and the engine runs at 600 RPM.
      I am using a second mag pickup and counter to measure a single index pulse on the flywheel.  This will be used to determine the crank angle.  I also need to create a timestamp for each index pulse.  What is the best way to do this?
      Is it possible to treat the two mag pickups as an encoder and not use the B phase (direction) pulse? 
      I am fairly new to LabView and any help would be greatly appreciated.
      Thanks in advance,
      Kris

    Hi Kris,
    With analog and digital input tasks in DAQmx, it is possible to acquire data of the type 'waveform'.This includes timestamp information for the acquired data. This example is a good one to reference to understand how this is done: http://decibel.ni.com/content/docs/DOC-3749 . 
    With counter tasks in DAQmx, however, your best bet would be to use the 'Get Date/Time in Seconds' VI to obtain the absolute time. You can set this up so that the absolute time value is obtained right before the DAQmx read function is called, as shown below:
    Are you trying to use the 9411 to read from the mag pickup? What type of data does it output?
    For information on programming with NI-DAQmx, please refer to the following webpage: http://zone.ni.com/devzone/cda/tut/p/id/5438 . It is a very useful resource to get started on DAQmx applications! I hope this helps. 
    Vivek Nath
    National Instruments
    Applications Engineer
    Machine Vision

  • 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.

  • How to measure the frequency of a pulse being generated by a counter

    Hi,
    I am using labview 8.6 to generate 5 evenly spaced pulses for every 1 revolution of my shaft. However, I would also want to know the frequency of these pulses so I can determine the shaft speed. Since I am already generating the pulses using one of my counters, can I still tap into that or task another counter to measure the pulse frequency? If so, how? I have attached my code for generating the pulses and I am using an Ni 9401 module and an NI 9172 chassis. If someone can helo me modify the code to measure and tell me the pulse frequency as well, that would be really appreciated
    Attachments:
    autotrain2.vi ‏19 KB

    You'd probably get a more coherent answer if you didn't bounce around from thread to thread so much...
    How can I generate a pulse train from shaft encoder? (5/13)
    pulse train from encoder (5/15)
    how to measure rpm (5/20)
    How to measure rpm using shaft encoder and labview (5/23)
    This thread (also 5/23)
    I see you ignored my suggestion from the other thread--Kevin's solution is good too but using an encoder task offers more noise immunity (I think this is probably the cause of the problem you reported on the other thread).  You can fix it with digital filtering if you want to keep using a counter output instead of an encoder task.  Noise during transitions is pretty common for a quadrature encoder.
    A finite counter output task uses 2 counters on the 9172 (although you said 9174 earlier at one point--this wouldn't be the case on a 9174) so you wouldn't have one left to make your frequency measurement.  With the solution you have now, you can change to continuous to free up a counter if you don't care about outputing an exact number of rotation's worth of pulses (I'm not sure if you do or not--I didn't read through all of the various threads relating to this application to find out).
    For your actual question in this thread...  Have you tried running one of the frequency measurement examples?  From the code here I can't tell what you have tried (it just looks like a mangled version of the code Kevin gave to you in your other thread).
    Best Regards,
    John Passiak

  • 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

  • How do I use a counter to measure frequency and multiple analog signals in the same VI?

    I have a PCI-6071E, an SC-2345 with multiple modules, and a PXI-8184 (with a PXI-1002 Chassis).
    My goal is to monitor pressures, flows, temperatures, and speed in one VI.
    I am using Measurement and Automation Explorer version 3.1.1.3004 to manage my channels.
    My speed is a PWM signal which I recently rewired through the counter 0 of my board.
    I was hoping to configure this to read frequency directly in measurment
    and automation, have this scale the value to RPM, and then feed it
    directly in to my labView program.
    In labView, it will not except this signal though.
    I get error -200300 from the DAQmx Start Task.vi
    Possible reasons(s):
    Invalid timing type for this channel.
    Property: SampTimingType
    You Have Requested: Sample Clock
    You Can Select: Implicit, On Demand
    After doing some research, it seems that the counter wants "Implicit"
    selected for the DAQmx Start Task.vi, but then I cannot use my other
    channels. Also, counter is included in the "Sample Clock" option
    description, so I do not understand why it is not working.
    Does anyone know how to work around this problem or a way to configure the counter so that it will work in this way?
    All my other channels are Analog.
    Thank you.

    I am working on getting just the counter working by using
    the program posted previously, and I am running into issues. Periodically I get
    the error:
    Error -200141
    occurred at DAQmx Read (Counter DBL 1Chan 1Samp).vi
    Possible reason(s):
    Data was overwritten
    before it could be read by the system.
    If Data Transfer
    Mechanism is Interrupts, try using DMA. Otherwise, divide the input signal
    before taking the measurement.
    It seems to work better if I use cascaded counters, but I need timer 0 for
    analog channels when I run this code along with the program for the other
    measurements.
    I have tried averaging, and selecting different values for the millisecond
    timer, and these did not seem to have an effect.
    I tried different DAQms configurations and "Counter DBL 1Samp" seemed
    to work the best.
    The program will work for a while and then it will give me the above error
    message.
    If I use counter 0 as a cascaded counter input, the program runs fine. If I run
    this with other analog channels, it errors out because the analog channels use
    counter 0.
    If I use counter 1 as a cascaded counter input, it seems to work better than a
    single channel, but it will still error out with the above error.
    If I use only counter 1, I get the error above even faster.
    Also, none of the
    configurations give measurements outside the While Loop.
    The only place I can add a speed dial for the front panel is within the While
    Loop.
    Is there someway to get the signal to continuously send out of the while loop?
    I thought if I could get the signal out of the while loop, I could condition it
    anyway I wanted without the program erroring out.
    Any suggestions would be much appreciated.
    Thank you.
    Attachments:
    Counter_error.jpg ‏45 KB

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • How to convert the counter input as a RPM

    Hello NI,
                          Could you tell me. how to convert the Counter input to the RPM. I am using Rotary encoder has a 5V amplitude with 500 PPR. i am going to measure the Engine speed as a rpm.
    I am using third party hardware, from the hardware i can get the Count as well as Frequency also.
    Could you suggest to me...?  i looked out some disscussion in these forum but i cant able to understand.
    can you please explain with simple way....
    if you have any simulation send me....
    Regards,
    Balaji DP

    Hi balaji,
    [email protected] wrote:
    ...I am using third party hardware, from the hardware i can get the Count as well as Frequency also.
    If you're able to read frequency as X pulses/sec(?) that seems to convert RPM as follows:
    X (pulse/sec) * 1/500 (rev/pulse) * 60 (sec/min) = X * 60/500 RPM (???)
    Cheers!
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

  • Two counter inputs and counter output NI 9401

    I am trying to configure two counter inputs and one counter output on one NI 9401. I have looked and found how to configure digital lines in booth directions but it seems like I can only do two counters in all on one module. Can someone verify this for me or let me know how to get all three on to one module?
    Thank you

    Hi mschoenwald,
    The counters are actually located on the backplane of whatever chassis you are using--I'll assume you are using cDAQ and not cRIO.
    If you have the older <link no longer exists>, then there are only 2 counters available in general.  You can access both from a single parallel (8 lines or less) digital module in slot 5 or 6 of the chassis.
    The 2nd generation Compact DAQ chassis (including 9174, 9178, 9181, 9188, etc.) includes 4 counters.  You may access them from any slot with a parallel module.  There is no restriction preventing you from accessing all 4 simultaneously from a single module.
    The 9401 is bi-directional and configurable by nibble (line0:3 may be configured one direction, and line4:7 another).  However, it is quirky in that it requires the line direction to be configured before any of the tasks are started.  This is because the data lines themselves are used to set the line direction behind the scenes.  The best way to work around the behavior is to use DAQmx Control Task to explicitly reserve your tasks before any of them are started (see here).  Keep in mind that the counter output should use the opposite nibble from the two counter input tasks.
    Best Regards,
    John Passiak

Maybe you are looking for