Counter triggering

Hello,
I'm creating a program to control a gear tester. It works by driving a master gear which drives a test gear which is on a spring loaded slide hooked up to a linear probe. Both the motor's encoder and the linear probe have quadrature outputs. These are wired into a PCI-6602. Currently, I am reading from these simultaneously in a while loop that occurs at a set time interval. What I would like to do is set my program up such that data is taken from the linear encoder every 5 or 6 pulses from the motor encoder. I'm assuming I would use a trigger for this, but I can't seem to figure it out. Got any advice?
Thanks

Hello Wildcat,
I think a buffered counter program is the way to go.  There is a shipping example called Meas Angular Position-Buffered-Cont-Ext Clk.vi.  This example takes data from an angular encoder every time it sees a tick on PFI9.  You could modify this example to use a linear encoder by changing the DAQmx Create Channel to Counter Input > Position > Linear Encoder.  You could then feed the pulse from your motor encoder to PFI 9.  Now this setup will read data on every motor pulse instead of every fifth/sixth.  You can get around this by simply ignoring the extra data or by using another counter to divide down your motor pulses.  Give the example a look and tell us what you think.  
Best Regards and congrats on the Gillespie hire,
Jeff Tipps
Applications Engineer
National Instruments

Similar Messages

  • How to generate a delayed retriggerable pulse using only one counter with PXI 6070E card

    Hi
    I have a problem in generating a retriggerable delayed pulse with a single counter(triggered through a signal at gate) using PXI 6070E card. VI was developed in NI LabVIEW traditional DAQ Ver.7.1. I have used the "delayed pulse generator config" VI and a "Start counter" & "Stop counter" VIs for the purpose. But there is no output seen at the out terminal of counter. So I introduced a "wait" VI and set it to 1 sec. Now the pulse output appears but some pulses are missing mometarily after every 1 sec interval. (any solution for this)
    I have gone through a few similar requests in the forum but they suggest either to use two counters or to generate a finite pulse train which does'nt fit my application. Moreover PXI 6070E has only 2 counter timers. I am already using one counter to measure the frequency of a pulse train(signal 1). The application requires to generate a delayed retriggerable pulse for every pulse in signal 1. So I have only one counter left.
    Can I measure the frequency of signal 1 by analog means.? so that I can use two counters for pulse generation. (Signal 1 is a TTL signal).
    Request some help.
    Thanks in Advance
    Regards

    A finite pulse train (N_Pulses >= 2) does require the use of 2 counters on most of our older hardware including your 6070E.  If you're just talking about generating a single retriggerable pulse, you would only need one counter.
    Here's an example in Traditional DAQ that shows you how to set a retriggerable pulse generation (it also allows you to adjust the characteristics of the pulse on-the-fly).
    If you're writing a new program, you might consider switching to DAQmx as it supports NI's latest hardware and recent OSes should you ever need to upgrade.  Traditional NI DAQ is no longer in active development.  Here's an example of how to implement a retriggerable pulse generation in DAQmx.  You should take note that you can't use the two drivers to simultaneously talk to the same piece of hardware, although you should be able to go back and forth by resetting the Traditional DAQ driver before switching to DAQmx.
    Best Regards,
    John Passiak

  • Want to trigger event count from both counters (E) to buffer using FOUT (100kHz/16 or slower) as a trigger

    We are using a AT-MIO-16E-1 board. We would like to run an xy raster pattern from the buffer (AO) in order to reduce scan times (256 x 256 pt images). At each AO (voltage) point we would like to read from both onboard counters and store the number of events counted to memory, reading out the buffer say every 256 pts (1 scan line). In order to ensure accurate counting periods the counters need to be triggered to coincide with some "dwell time" at each AO voltage pt. We have thought of using FOUT for the trigger or perhaps out analog out scanning signal but are concerned that the FOUT freq is too high (6250 khz - we would like 100hz-10khz). Any suggestions or e
    xamples would be appreciated.

    Hello;
    The main problem there is going to be the counter triggering. I'm saying that because, there isn't a way for the Analog Input operation to send pulses that will trigger of the timer operation at multiple voltage levels. The only solution for this I can think of is, instead of having an analog voltage level which would indicate the position of xy, if you could have a device which would give a TTL pulse instead when the desired position is reached, then you could use the 6601 to have a triggered operation at the counter. Another constraint for your application right now is the fact that the E-series boards' counters don't have triggering features, only gated features.
    Anyway, you would need to have a TTL pulse either to trigger (in case of the 6601 count
    ers) or to gate (in case of the E-series board), when the desired XY position is reached.
    Meanwhile, you can refer to the Labview examples for Streaming to disk, Analog I/O and counter operations. You can go to Search Examples->I/O Interfaces->Data Acquisition->Data Logger ( for streaming to disk operations); Search Examples->I/O Interfaces->Data Acquisition->Analog Output ( for Analog Output Operations); and Search Examples->I/O Interfaces->Data Acquisition->Counters (for counter operations). Also; I'm including an Application Note which talks about synchronization of multiple DAQ tasks I think will be helpful for you also.
    Regards.
    Filipe
    Attachments:
    Advanced_Sync_Techniques_for_DAQ.pdf ‏189 KB

  • With DAQmx, how to use AO start trigger for AO/AI synchronization with finite AI sampling

    I am a new user to DAQmx and I am trying to synchronize AI (finite samples) with AO in LabVIEW 7.1 using a PCI 6229 card. I want to generate a finite waveform (AO) and, subsequently, collect a finite number of voltage samples (AI). I would like to repeat the AO-AI cycles in a while loop.
    Alternatively, I could use an infinite AO generation and collect finite number of voltage samples on AI but always exactly at the same spot of the AO buffer.
    Using traditional DAQ and a 6024E card, I used a counter triggered by AO start trigger signal (example attached). I have problems with translating this example into DAQmx.
    Please help!
    Ruber
    Attachments:
    AIAODelay_traditional_Eseries.vi ‏155 KB

    Lesley,
    Thank you very much for your suggestion. Late last night I actually tried a to use AI start trigger instead of AO start trigger and it worked (since I tried the AI & AO to start simultaneously, it does not matter what triggers what), even in the loop. The devil is in details, as I had to carefully wire the number of data points and what to place inside/outside the loop.
    The problem with shared clock is that I need to sample the AI and AO at different rates but using AO and AI clock separately did not seem to affect the performance.
    I still want to try to use the AO start trigger (as you suggest) because I would like to delay the AI by a few ms from the AO. Is there a simple way to to that?
    I suppose, switching from traditional DAQ to DAQmx requires your brain to be rewired - after playing with it for a couple of days and nights I developed a "feeling" for it. One of the differences was that, in order to use this example in the loop, one has to use 'stop task' inside and 'clear task' outside the loop.
    Thanks again!
    Radek Uberna

  • Capturing of time taken by a while loop in bpm

    Hi ,
    I have a busniess process ,and my receive step is defined in a while loop.
    so it starts with a while loop.
    I want to keep a condition on the while loop that it should receive the messages only for a period of 1 hour ,and if it exceeds this period it should end up the process triggeringa mail.
    I mean to say if there are 12 records to be processed through the while loop ...and if I receive only 11 records ..it will be waiting for that final record in an infinite loop ..so I dont want that ...instead if the total no of records are reached then it should move forward ..If it is waiting for the missing records for an hour ..I should stop the process and trigger a mail to the queue monitor saying that record is missing...I have finished the process without this processing time condition successfully..
    I am new to XI and I dont have any idea on how to capture this processing time of while loop.
    can some one please help me out in this issue...
    Thank you in advance...

    Hi Latika,
    Yeah I understand we can go with fork but why I am going with this is ,I have already designed a Payload dependent loop ,by using while loop.so it makes my job simple ...
    Now I am converting it to time dependent loop,so only the final question I have is...In the time dependent loop documentation ..they have taken it as infinite loop and only kept the time limit in the deadline branch...so when the deadline reaches they trigger something.
    If you go to the documentation of time dependent loop(http://help.sap.com/saphelp_erp2005vp/helpdata/en/08/16163ff8519a06e10000000a114084/content.htm) ..they took the infinite loop...in this loop if I mention the counter ..and if this record count triggers before the time limit...it should come out of the block...would it work this way ?
    Thanks a lot...

  • LabVIEW Software Developer/Hardware Integrator

    La Jolla, CA based automation and custom solutions provider seeking LabVIEW software developers.
    Job Description
    Seeking a National Instruments LabVIEW Software Developer/Hardware Integrator to join our team developing customized automated control and test equipment.
    The preferred candidate will have 1-5 years experience in software development and hardware integration using LabVIEW and some experience with embedded C. Candidate must have hands-on experience interfacing and calibrating various transducer signals to both National Instruments and Third Party data acquisition boards. 
    Software Experience
    Programming experience with an understanding of a majority of the items below:
    Labview Programming 1-5 years
    GOOP/LVOOP
    Database Connectivity
    RS232 and USB COM programming
    Real Time Systems
    AIO, DIO, Counter Configuration and Operation
    Producer/Consumer Architecture
    Queues, Events, Timed Loops, Objects, Multithreading, Hardware Triggering, Variants, Code Interface Nodes, PID
    ActiveX, DLL  APIs
    LabVIEW Application Deployment (building and deploying executables)
    *A preference will be given to candidates who have experience in both NI Data Acquisition hardware and Embedded Arm Development. 
    Hardware Experience
    Candidates  will have demonstrated experience (or at least a basic understanding of) in the integration of transducers and signal conditioning commonly used in Biomedical/Biotech industries into data acquisition and control systems including but not limited to:
    Temperature (TCs, RTDs, and Thermistors)
    Photodiodes 
    pH,DO,ORP Electrodes
    Liquid/Gas Valves
    Liquid/Gas Pumps/Compressors
    Motion (Stepper and DC Servo) including  Quadrature Encoders
    Pneumatic displacement cylinders
    Lighting (Bulbs and LEDs)
    Solid State and Mechanical Relays for AC/DC power switching
    Thermoelectric Coolers
    Digital Switching and Bus Communication (DIO, SPI, Counter, Triggering, etc.) 
    Education
    Some college-level experience in Electrical/Computer/Optical/Bio/Chemical Engineering and/or Computer Science.  A formal degree is not as important as capabilities and creativity. Previous Experience with National Instruments LabVIEW Training is highly desired.  Understanding of AC/DC circuit basics is a requirement and a preference will be given to candidates with more component level electronics experience.  
    Positions
    We have both part-time and full-time positions available in our La Jolla, CA office. We are a company specializing in the development of custom automation solutions for various clients primarily in the Biotech/Biomedical/Oceanography areas. We are a small, but growing company looking for individuals who like a diverse work environment filled with unique challenges that are constantly changing.
    If you enjoy using your creativity and talents in a fun entrepreneurial environment and like the idea of working in the beautiful surf-town of La Jolla, CA then we want to hear from you...
    www.labviewautomation.com

    Hey, I own a Canadian built sailboat, drink the occasional Canadian beer, watch CKWS on cable, can say Eh! with the best of them, had my first anniversary honeymoon in Ottawa. I even have a loonie in my pocket and $5cdn in my wallet You have to be Canadian?   Winters are milder there than where I live too.
    Fixed wire, that is for those posters in the other threads that insist on posting for the 3 -4 year old jobs! How else will he get them to apply in a timely fashion?
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Timing while needing more thn 2 clocks inboard

    I am using BNC-2120 to do the timing things, first I generate a anolog pulse whose falling edge is going to trigger another pulse which is digital to be genrated, and then the third pulse will be generated at the second pulse' falling edge. I found there was some sub-second delay when I get the second pulse, it's very serious because all the actins should be finished at microsecond level. Is there any solution to do the timing not using the computers' clock since there are only two internal clock on the BNC-2120, but I need one more?

    Hello;
    The only way to have a accurate timing DAQ task is by using the internal Timebase of the device to clock the tasks. In case you use any Software timed operation, your accuracy will rely on the OS, being therefore system dependent.
    For your specific application, the best way to go about that is to use the analog output pulse triggering one of the counters, and to have the output of that counter triggering the second counter.
    Both counters should be configured as retriggerable pulse generation.
    Hope this helps.
    Filipe A.
    Applications Engineer
    National Instruments

  • Doing something the DAQmx way that doesn't fit? (Triggered counter on PXI 6608)

    Hi,
    I want to create a counter with my PXI6608 that is triggered with an external input, then counts up. I then want to be able to read the count in LabVIEW and hence determine the time since the trigger. I have achieved this before with old-style code, but it is not clear how to do it the DAQmx way. In particular, I can't create a task because what I'm looking to do doesn't seem to fit in with any of the pre-envisaged DAQmx task templates.
    Can anyone help? I'm assuming there's some way to create an 'empty' DAQmx task so I can fill in the details with property nodes?
    Cheers
    Lee
    Solved!
    Go to Solution.

    You'll want to make an edge count task and set the source to be one of the internal timebases using a DAQmx property node (set it before starting the task):
    The trigging functionality you're looking for is called an "arm start trigger" in DAQmx.  It's configured through a property node (also before starting the task):
    I'm not sure what you're getting at with regards to the "empty" DAQmx Task.  Typically you'll use the standard API to set typical properties and the property nodes for more advanced functionality so you'll end up with a combination of the two.  In many cases you could replace the DAQmx API with property nodes (for a fun example of this, open up the DAQmx Timing VI), but odds are you might be forgetting something important so I would always suggest using the VIs and then tacking on property nodes for additional functionality when necessary.
    If you're using LV 2012, this example should get you started (or if not, the picture still shows you what the task would look like).
    Best Regards,
    John Passiak

  • How do I program a NI 6602 card to send trigger pulses, one at each output port, triggered by an input trigger signal, using only one counter for each output port?

    Hello,
    I have managed to program a NI 6602 card in LabView to send pulses on three different output ports, one pulse on each output port (with individually chosen delays) for each input trigger pulse coming on a separate input port. It is the DAQmx Create Channel (CO-Pulse Generation-Time)-VI that I have used for this, see attached code. However, this VI controls both pulse delay and pulse width, and therefore uses two counters for each output port (although you only specify one counter in the VI input signals), as I understand.
    In my application though, I only need to have the delay chosen, the pulse width can be arbitrarily short, and thus I should only need one counter for each output port. How do I accomplish to program this in LabView?
    Best regards,
    Claes
    Attachments:
    Configure Side Camera Flash 1 Triggering.vi ‏47 KB

    Well you're welcome to do that--it will work just fine as long as you are configuring a start trigger.
    <rant>
    However, personally I really don't like putting multiple counter outputs in the same task.  I have seen so many people assume that the counter outputs would be synchronized due to having them in the same task when this is not the case (you need to configure a start trigger in order to synchronize the counter outputs even if they are in the same task).  This is the only case I can think of where multiple channels in a DAQmx task are not automatically synchronized.
    As an example:
    Running this on my PCIe X Series gives a measured 2 edge separation of 1 ms + {7.78 us - 10.11 us}.  This would likely be much worse on a bus with more latency (e.g. USB).
    The resulting output is close enough to what you might expect that it might go unnoticed, but really these counter outputs are not synchronized and it would be easy to glance at the code and not even think twice about it.  For the small amount of extra work on my end to create a separate task for each counter, it really clears up some ambiguity about what the counters are actually doing.  For me it's worth it.
    So again, for your case there really isn't a problem with having the counters in the same task since you are using an external start trigger anyway.  I have just gotten in the habit of avoiding doing this.
    </rant>
    Best Regards,
    John Passiak

  • Count for item records reaches 999 the second idoc gets triggered!

    Hi Experts,
         I have an issue. Sender is file and receiver is idoc with a header and item  level records. Only one header and n number of records can be there.
    Now we want to make  this way that as soon as the count for item records reaches 999 the second idoc gets triggered.
      Hints / Solutions Pls.
    Regards,
    Arnab .

    incorporate mapping logic such that for every 999 item records create new IDoc node
    check with this UDF for IDoc node mapping, item records will be input to UDF
    int count = a.length;
    int k=999;
    result.addValue("");
    for(int i=0;i<count;i++)
          if (i>=k){
              result.addValue(""); // if records > 999, add IDoc node
              k=k+999;     
    Do rest of the mapping accordingly

  • Count number of triggered events

    I'm trying to continually retrigger a digital output; is there a way to count the number of times the trigger has occurred? 
    Right now I have it set up where it triggers off the 20MHzTimebase. Would using the counter CI Count Edges on the 20MHzTimebase give a correct reading? Or is there a better/known way to do it?

    CMW.. wrote:
    just one little addition to the vi provided in the previous post from Vij@y,
    I would place the Trigger-Button inside the eventcase of the Trigger.valuechange, so it will reset after it is read out without the toggeling.
    In addition, the count indicator belongs before the event structure so it correctly shows zero if the program is started but no button has been pressed yet. (another option would be to enable "clear indicators when called" on the vi properties...execution page).
    Still, this has nothing to do with the original question.
    LabVIEW Champion . Do more with less code and in less time .

  • Encoder triggering counter capture

    Hi, I'm doing some research into how I can implement the below application. From what I've read, I'm 95% sure I can do what I want with a timer/counter card. But I figured I'd throw it out there to make sure. My application is as follows:
    I have (or will have)  a scanning head that rotates through 180 degrees across the sky. The scanning head has a mirror on it that directs light into a PMT (photon-multiplier-tube). The PMT outputs a TTL pulse every time a photon hits it (sometimes you get double hits, but we'll ignore those for now). The idea is that we want to count the number of pulses from the PMT for incremental portions of the scan. 
    The scanning head will have an incremental encoder on it, outputing a quadrature signal - which I believe can be put directly into the timer/counter card. I need it so that for say every 1 degree of motion, the PMT pulse counter resets and I get a value for the number of counts from the previous 1 degree increment. The speed of the head will NOT be constant (it will be moving slower at low elevations and faster overhead) so the counting of pulses must be synchronized to the encoder input signal. Actually, there is also the possibility that the speed will be constant, and the position increment to trigger will change. Is it possible to setup events to that it triggers at 1 degree, 2 degree, 5 degree, 11 degree, etc? Obviously this would actually be based on the encoder count (not degrees) and there would probably be ~500 events per 180 degrees. 
    So, is this doable? Can I link events to the encoder count value and have them trigger the system to capture the current count and then reset it? I don't know anything about how you setup these events, so any advice would be great!
    Thanks!

    Actually, I should take a step or two back from the brink.  I still do foresee some monkey wrenches
    if you really need dead-on hardware sync of these signals and sampling times.  However, maybe I'm
    much too quick to assume the need for that kind of dead-on sync.
    If you can approach the app by capturing "sufficient" data within and across all these position bins,
    you can probably get a very good approximation with some fairly straightforward software post-
    processing, and simple interpolation/curve fitting.  Not sure how much "sufficient" is, but likely a
    manageable amount.
    And yes, "digital change detection" is simply the ability to detect TTL transitions.  When a transition
    is detected, a pulse is generated on the board, and tasks can be configured to use that pulse to
    sync up triggers, sample clocks, or other timing signals.  Both the M-series and X-series multifunction
    boards support it.  The 6602 doesn't.  If you're going for true dead-on hardware sync, I still suspect
    you'll end up wanting the change detection feature.  If the software post-processing is good enough,
    you probably won't need it.
    One last thing: the ability to filter digital TTL signals has been improved on data acq boards over the
    years.  I suspect the X-series will give you better filtering options than the other boards but I can't
    speak from direct experience.
    -Kevin P

  • Counter based maintenance plan triggered improperly

    Hi,
    we have created one counter based maintenance plan with cycle unit 1000 hours  offset unit 0 hours this plan was created on 21.04.2008 . But 68 orders triggered on 19.04.2011 why it was happend.
    how find start of cycle reading  for the Maintenance plan?
    Regards
    Ganesh

    Hi,
    Counter based plan will work based on the Measuring point assigned to that.
    In Measuring Point, you would have defined the Annual Estimate. Based on the Annual Estimate & Cycle value in Plan & Scheduling period in the plan, based on all these, call object would be generated.
    Doubt in Single Cycle Performance based Plan
    Regards,
    Maheswaran.

  • Linear edge counting and triggering an AI signal

    Hello,
    I am using a linear counter to count the edges from a vertical glass scale which  I converted counts to distance. When I reach a given distance, trigger an AI channel to measure the voltage from a load cell which  I  converted voltage to Newton and then write the distance and Newton value to file. The problem I am having is I am manually moving a lever attached to the linear scale and because the steps are 10 micros apart, I get more than one trigger which gives me multiple AI voltage readings. I have tried the In range for the trigger. Is there a better way to do this?
    Thanks
    Joe N

    Hi joe_n1,
    How many triggers are occurring for each step? How many unnecessary voltage samples are being made?
    Is there a problem with receiving the extra AI voltage readings? Or are you simply curious as to if reading only one sample after the trigger is possible?
    See if the links below offer any assistance:
    "How to use digital input to trigger analog input acquisition?"
    "Trigger and Gate Express VI"
    "Re: how to trigger from analog input channel"
    "If you just want one sample each time you receive a trigger, you can monitor the trigger lines and start an analog input task for the specific channel that you receive a trigger for."
    David B.
    Applications Engineer
    National Instruments

  • AM9513 counter single triggered pulse generation

    Can Componentworks 3 create a single external-TTL-triggered pulse from a AM9513 counter device (AT-MIO-16-F5) ? This needs to run simultaneously with data acquisition that is doing External Scan Start/Clock. The pulse trigger source can be the same as is being used for Ext Scan Start. Pulse width range is tens of microseconds. It is desirable also to be able to control the post-trigger delay to when the pulse is generated. I've been able to accomplish this with an E series board using two CWPulse controls. Can it be done with the AM9513 ?

    I have been able to get this to work using Delphi 6 and ComponentWorks 3 on counters 1 and 5 simultaneously. The input trigger polarity and output pulse polarity can be inverted through software if desired. Other than not calling CW Pulse methods only available for E Series boards, the software program is the same for E Series and this AM9513 board, i.e. CW (NIDAQ) is able to tell the correct calls to make.

Maybe you are looking for