Counter input using PFI0

Hi everyone,
I am trying to make frequency measurement using PFI0 or PFI1 in the cDAQ-9188 and DAQmx
is it possible to do so ???
can i have guide for that ?
thanks 

Hi Tareq-
You have specified your frequency input pin and its sample clock to be the same signal.  The -200284 error is a timeout, associated with the fact that you do not have multiple periods of your input signal for each sample clock cycle (since they are the same signal).
Are you actually trying to acquire a so-called buffered frequency measurement (buffering away measurement values on each tick of an external clock)?  My guess is that you just want to read a single frequency value per loop iteration judging by your use of the single sample DAQmx Read instance.  In that case, you can remove the DAQmx Timing VI from your task creation for the frequency measurement task.
Edit:  I should also mention that if you *do* plan to use an external clock, you should make sure that its rate and your 'samples to read' value of the DAQmx Read VI match in such a way that a read of that many samples can actually occur within the allotted DAQmx Read timeout.  You should probably also use a multi-sample instance of DAQmx Read in that case, too.
Tom W
National Instruments

Similar Messages

  • Multiple counter input using NI 6602

    I am using NI-DAQmx to write a VI  that will read 10 pwm measurements using 10 counters on 2 NI 6602 PCI interfaces.  It is my understanding that I must create a task for each respective counter.  I have attempted to implement a for loop to accomplish this, as shown in attached VI draft.  As it stands the VI will not write any data to file.  I suspect there are multiple errors in the VI.  I would ask if anyone could take a look at the attached VI and perhaps provide some insight?
    Saul LaCoursiere
    Attachments:
    MelexisMODdraft2.vi ‏41 KB

    Hi Saul,
    It looks like you had a subVI "Create Header" which needs to be included to run, so I deleted all of the report related code.  The Counter portion ran fine.  If you can't get the report generation portion to work, you may want to simplify your code (for example start with a single counter task) and build up from there.
    Please repost if you have further questions.
    Thanks,
    Luke
    Applications Engineer
    National Instruments

  • Using PFI0 as a trigger and PFI1 as an input on PCI-5114

    Hi,
    I have a NI-5114, and I'm currently using PFI0 as the trigger, and reading out the two analog channels.  I'd like to add a second digital input through the other PFI so I can simply test if something is on or off (already a digital signal).  So, when PFI0 triggers, it digitizes the two inputs and reads whether or not PFI1 is on or off (no timing necessary).  Is there a trick to get this done?
    Thanks,
    Karl 

    Hello Karl,
    Since the PFI lines are generally used as triggers, we cannot read a PFI line unless you are specifically triggering off it. What you could do is as soon as you receive a trigger you can export a trigger of PFI1 which you could connect to one input of an external AND gate and second one is the signal you want to monitor. or can use another DIO DAQ device like USB-6501 to monitor the status of external digital signal. 
    Good Luck
    NI-khil

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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • Creating multi counter plan using LSMW

    Hi,
    I am trying to create multi counter plan (transaction IP43) using LSMW. I am using direct input object 0460 for creating it. Object has IBIPMPLA structure as header. How can i pass multi counter data in it ? Problem is line item level values like 'Maintenance cycle' (ZYKL1) are at header level structure IBIPMPLA.
    Anyone has cretaed multi counter using this object, please help me with it.
    Thanks,

    Hi,
    creating multi counter plan using LSMW
    Try this link,
    http://www.sapfans.com/forums/viewtopic.php?f=7&t=217834&p=1059434
    It will helps to you.
    Regards,
    Sekhar

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

Maybe you are looking for

  • Error while registering database

    Hi, I get "RMAN-03008: error while performing automatic resync of recovery catalog" while registering a database which is located on my server. Following is the procedure i have done to register it. C:\Documents and Settings\yogeshn.RITPL>rman target

  • Using Elements Organizer with Photoshop CS2

    I have grown comfortable with Photoshop Elements integrated organizer and have upgraded to Photoshop CS2 and instead of using the CS2 file manager would like to continue to use the Elements organizer. The problem Im having is when I edit a photo in C

  • IPod b/w 4G 20GB - start up problem

    Now before anybody post things like restore the iPod, Reset it, or do the 5R's. I have done all of those about 25 times, on this iPod in the past, and that has not solved this problem. Normally when I start this iPod up it shows the folder with an ex

  • Oracle Forms : Master Detail : Cannot query detail block

    MY requirement is: when user enters records in master block, the corresponding records should be displayed in the detail block. (Detail block is just for viewing). Master block is a database block based on a custom table. All fields are enetereble in

  • Exporting Flash 8 to Quicktime?

    I am currently using Flash Pro 8. I publish Quick Time MOV file. I got a message saying : "The installed version of Quick Time does not support this type of Macromedia Flash movie. Quick Time requires Macromedia Flash version 5 or before. Please sele