Buffered aquisition with multiple counters on 6602

Here's the scenario: I have a 6602 card, and I need to do buffered event counting on five counters at once.
I can't use DAQmx, because the drivers don't support the 6602 yet.
The traditional DAQ drivers don't support multiple counters per group...
...so I'm left with needing to create five independent tasks, each responsible for it's own buffered counter operation. However, when I do this, each task gets assigned the same taskID, so I can't figure out how to differentiate between the tasks when it comes time to reading their respective buffers. I attached a quick example VI that shows the taskID problem.
Anyone know how to run multiple buffered counting operations at once?
-Michael
Attachments:
StartCTRsTIO.vi ‏80 KB

Hi M.J.
This example VI should exactly do what you want:
http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3DC9F56A4E034080020E74861&p_node=DZ52325&p_source=External
Hope this helps,
Luca
Regards,
Luca

Similar Messages

  • Error -200141 when doing buffered events with DAQmx and PCI-6602

    When doing buffered events with DAQmx and PCI-6602 I get error 200141 - Data was overwritten before it could be read by the system.
    This error is generated ONLY with random inputs >200/sec.
    My setup is :
    DAQmxCreateCIVCountEdges(taskhandle,"Dev1/ctr3"....
    DAQmxCG+FGSampClkTiming(taskhandle,"/Dev1/FPI35",...
    DAQmxSetCICountEgdesChan(taskhandlem,"", "/Dev1/80MHZTimeBase")
    DAQmxSetChanAttribute(taskhandlw,",",DAQmx_CI_DataXferMech,DAQmx_Val_DMA,0);
    Can somebody help ?

    i'm getting the same Error-200141, while reading semiperiods. (Meas_Buffered semiperiod continous)
    while loop ex.rate seems to be pulsewidth*no.Samples to read. in my case PW=60ms
    Input buffer size measured with Property node= 10000
    why this error happens?? i cant use any mode other than implicit timing for semi-period measurement right??
    more info: all the ai channels are used ~ 16 differencial.
    i found one solution which is _ reinitializing the whole task if an error occur. is this the right way??
    Kudos always welcome for helpful posts
    Attachments:
    Counter_1_Meas Buffered Semi-Period-Continuous_main_lv09.vi ‏34 KB
    SemiPeriod_Reconnect Counter on Error.vi ‏35 KB

  • How do I export a counter from a task with multiple counters

    Hi All,
    I have a quadrature output VI that works 100%, outputting the frequency on the default pins (I'm using a NI-6284, so the default CTR0 and CTR1 pins are PFI12 and PFI13). During my development, I made a silly mistake and routed the encoder pins to PFI 12 and PFI14.
    What I need is to move the signal from the PFI13 to PFI 14, which is supposed to be simple.
    I've tried a few ways of doing it, including DAQmx dis/connect terminals (very clunky),  and DAQmx Export Signal which gives me trouble because there are two counters in the task and the function can only export 1 counter.
    Please take a look at the attached VI and let me know what solution I should implement.
    Best,
    Adrian

    Hi S,
    Thanks for the reply. I also came to that page, which is helpful.
    What I've ended up doing is using the counter property node to specify the output pin of the counter that I need to move, and left the other counter at the default.
    I'm not sure if this is the best or most elegant solution, but I haven't had any problems with it as yet.
    I was hoping to hear from the community what the safest and most elegant solution would be, as the "Export Signal" VI looks like quite a nice option, but may well be overkill for my purposes.
    Thanks!

  • How to use multiple counters in the 6602 to measure cycle length, calculate delay and generate triggered pulse.

    Hi,
    I need to measure the cycle length of a pulse, calculate a delay based on this value, and then generate a triggered pulse with that delay value. The input and output pulses will be continuous. The best case would be to use the cycle length from one pulse in the calculated delay for the next pulse. One of my biggest problems has been getting the calculated delay value into the pulse specs.vi for the triggered output.
    This output pulse will be used to trigger an IMAQ video acquisition; therefore, the solution to this problem will be part of a larger video acquisition application. This has posed a problem, in that accessing the counters has interfe
    red with the triggered video acquisition.
    Any suggestion will be welcome.
    Thanks
    Dave

    Filipe,
    The overhead is the problem I'm trying to get around.
    Specifically, what I need to do is to generate an output pulse after a trigger pulse, which is a given percentage of the cycle length. The input pulse is from heart rate, so it will have some variance, and the output pulse will be at a stationary point in the cardiac cycle. For example, for an input pulse of 2 Hz (500 ms) the user would likely request the output pulse be delayed by 75%. Therefore, the generated pulse will have a 375ms delay after the trigger.
    In the past I have had hardware built to do this, but I am hoping I can accomplish the same thing with multiple counters on the 6602. I have been able to accomplish this with 3 counters (2 to measure period and 1 for output
    ) but the overhead prevents adequate triggering of the IMAQ video acquisition. I am hoping another method would solve this problem.
    Thanks
    Dave

  • NI 6602 buffered pulse width and buffered period measurement with 2 counters synchronized

    I modify the example buffered event counting with 8 counters for use with 2.I obtain error 10600 or 10455 and never the waited values.Can you give me a VI example . Thank you for your help

    What changes did you make to the VI? If you attached the altered example I could take a look at it. The example program for using 8 counters performs some configuration that you won't need for just two counters. For instance, if you just want to use counters 0 and 1, you won't need to perform pad synchronization.
    I've altered the program to use with two counters and attached it to this response. Hopefully this will work for you.
    Regards,
    Todd D.
    NI Applications Engineer
    Attachments:
    Buffered_Event_Counting_(2).vi ‏126 KB

  • Samples Not Acquired on NI 660x or NI 6624 Devices When using pulse width, semi-period or two-edge separation buffered measurements with the NI 660x and NI 6624 on counters 0 and 1, some samples may not be acquired under certain circumstances.

    In the DAQmx 9.4 Readme the following is stated:
    Samples Not Acquired on NI 660x or NI 6624 Devices When using pulse width, semi-period or two-edge separation buffered measurements with the NI 660x and NI 6624 on counters 0 and 1, some samples may not be acquired under certain circumstances.
    Could anyone elaborate on this? I am particularly interested in knowing under what circumstances this problem arises for the 6602 PCI devices.
    How should I understand 'NI 660x and NI 6624 on counters 0 and 1'. Is it only a problem on counter 0 and 1 for the 660x or does this only apply for the 6624 devices.
    /mola 

    Are there any NI Product Support Engineers out there who has an answer to this question and who are willing to share it with me?

  • Acquire data continuously (buffered semiperiod) with the 6602 board

    Hello,
    I post this qestion again because I think in my previous thread it will be wraped. :-)
    I use an PCI6602 card and 3 or 5 counters on it in buffered-semiperiod measurement.
    The planned measurement can last one day or longer so there will be a lot of values.
    What is the best way to process the values? Maybe calculate something and
    write these results to a file.
    I've read something about double buffered acquisition. Also something about
    a circular buffer.
    In the document "Lab VIEW Data Acquisition Basic Manual" the circular buffer is described.
    But I can't find any examples for double buffered acquisition and circular buffers.
    Has someone an example?
    Will I need such a t
    echnique? Or is there an other possible solution to handle the
    amount of data continuously?
    And when will be the best point of time to do the analyses of the data.
    Inside the while-loop or outside?
    Is it a problem to do this with the 3 counters simultaneously?
    I would be thankful for any tipps.
    I attached an file (library), where you can see the configuration (Measure Buffered SemiPeriod.vi).
    thanks in advance
    Peter
    Attachments:
    Measure_Buffered_SemiPeriod.llb ‏949 KB

    Peter,
    If your measurement will last for a day, you will need to log the data to file. Otherwise, it is very likely that you program will be unable to store that quantity of data. A double-buffered acquisition and a circular-buffered acquisition are the same operation. They refer to a continuous acquisition where a finite buffer is used in a circular fashion (new data is continually written over the current data as the buffer is filled). Of course, this requires the user to read data from the buffer before it is overwritten. In the program you attached to this post, you are already performing a double-buffered acquisition because you have the Buffer Mode controls set to "Continuous". With regards to analyzing this data, it would be best to do this
    after the acquisition is complete. Furthermore, you should be able to do this with three counters without any problems. Of course, if you need to perform more than three buffered measurements simultaneously, the additional counters will need to use interrupts.
    Good luck with you application.
    Spencer S.

  • Buffered high-speed capture with multiple axes

    Has anyone succeeded in using buffered high-speed capture (on 7350 boards) with multiple axes?
    The capture works really well for me on a single axis, but when I try to use it on 2 axes simultaneously it behaves very strangely.  There seems to be some kind of unwanted interaction between the two buffers which means data points are lost and they often stop updating altogether.
    A very similar question was posted here over a year ago (http://forums.ni.com/ni/board/message?board.id=240&thread.id=4087), which includes a more detailed explanation and an example VI.  Can anyone help?  I'm using LabVIEW 8.5 RT with NI-Motion 7.6 and a 7358 board.
    Thank you,
    Ian

    Hi Ian
    I have been asked working with kostas on this problem for you and just wanted to give you an update as I know its been a while and is an important issue for you. I have been chasing up our specialists in the field and resently had responses of  the kind:
    "Hi Graham
    The issue was found out to be a bug in our motion driver. The issue is being examined by motion R&D right now. I do not know a time frame on when this will be fixed as it is proving to be a tricky problem. I am copying Stuart and Lorne on this since they have been working on it as well.
    Thanks,"
    Be assured that I am chasing it as closely as I can. From your end what is the situation, do you have a work arround that will suffice or are you still waiting on this.
    Thanks for your understanding and I look forward to hearing from you with your current situation.
    best regards
    Graham Green
    Technical Marketing Engineer
    National instruments UK & Ireland

  • Rajouter le nombre d'implulsion sur l'exemple "Multiple Counters with Phase Shifts.llb"fournit par NI

    Bonjour,
    J'utilise une carte PCI6601 NI DAQ traditionnel avec LV6 et je génère 4 signaux à l'aide de "Multiple Counters with Phase Shifts.llb"fournit par NI. Cela marche très bien néanmoins je voudrais pouvoir rajouter le nombre d'impulsion. Ce nombre serait le même pour les 4 signaux.
    Merci d'avance

    Monsieur,
    Dans cet exemple vous ne pouvez fixer le nombre d'impulsion puisque c'est une generation d'impulsion en continue. Vous devez donc modifier cet exemple afin que le compteur 0 ne genere pas en continue notamment en prenant comme exemple le VI finite pulse train qui utilise un compteur comme gating du compteur qui genere.
    France.support

  • Simultaneously latching multiple counters (AKA "strobe")?

    How do you simultaneously latch values in multiple counters, at arbitrary times, for later reading?
    A physical system generates several kinds of events to be counted by different counters, none of which events are strictly periodic or mutually synchronized (most of them are radioactive decay events, on the order 10^-3 to 10^5 per second average). It is critically important to count them all. At somewhat irregular intervals a few dozen milliseconds apart, I have the opportunity to read the counts, and it is also critical that whenever I read them, the counts are all captured at the same time, though it is not important exactly when this time is or how close in time I read them. Note: it is defining the end of one count period and start of the next that is time critical - not returning the count value to the calling program, which can happen whenever convenient.
    I've used other counters that have a strobe-and-latch feature in past versions of this system, including Advanced Micro Devices' Am9513 and the good old 8254. When a read opportunity happens, I programatically strobe the counters then read each one's latched values at leasure, while the counters themselves continue counting. But I haven't found strobe-and-latch in either of my two NI hardware systems or in any of the LabVIEW vi's, properties, or examples. Is it there someplace, maybe by a different name?
    I haven't found an example vi that simultaneously buffers counts in different counters. But it looks like some combination of the "Count Digital Events-Buffered-Continuous-Ext Clk.vi" example vi and the "Duplicate Count Prevention" method described in my DAQPad-6259 docs might get me what I want, but I'm not sure. I've attached one of my attempts to make this work, "SimultaneousCountBuffering01.vi". I have a single benchtop signal generator sending a 1 kHz signal to my DAQPad, where it's wired to both counter source terminals. This vi reads both counters at slightly different times on an irregular schedule repeating at about a half second. But it also first drives a digital output line high and low. This output is physically wired to both counter gate terminals. The DAQPad docs say that when counting in this mode, the counter is always counting regardless of the state of the gate, but at every positive edge on the gate, the count is buffered for subsequent reading. It's not important whether the readings are cumulative or get rezeroed because it's easy to use a shift register to change this anyway.
    But I haven't gotten this vi or others like it to do anything useful. In this particular version, the counter reads time out. Maybe this means there's nothing sitting in the counter buffer? The examples don't seem to show anything making the counter buffer counts, so I guess that's done by the property node selecting Duplicate Count Prevention counting mode. I've checked various combinations of the digital out line state in this vi, by the way, but still the timeout happens. In my other attempts the counts are always zero, or occasionally jump by thousands, or only one counter will occasionally see only one count. Simpler vi's (that don't attempt the Duplicate Count Prevention and don't get synchronized count values) do work, and the counters both count at the expected rate.
    Am I on the right track, using Duplicate Count Prevention?
    If not, what approach should I be taking?
    Even if this is the wrong approach, I still wish the vi did something, and am curious what I'm leaving out. Anybody know?
    Thanks!
    Attachments:
    SimultaneousCountBuffering01.vi ‏64 KB

    I don't have LV handy here, but I took a quick look at your OneLoop and TwoLoop attachments.  If I remember correctly (I may be mixing those up with a couple other things I looked at), you face the following significant issues:
    A. Need dataflow sequencing to help enforce execution sequence.  With multiple data acq tasks, it's very typical to use the wind the error cluster from one task to another as a means to enforce execution sequence.
    B. Need an overall scheme that doesn't keep configuring, running, and clearing each task in a software loop.
    Let me roughly describe an approach I'd suggest:
    1. Create a "dummy" AO task solely for the purpose of using its sample clock as a strobe for buffering your edge counts.  Configure it for Continuous Samples using DAQmx Timing.vi   The sample rate you choose will determine how often count values are captured ("strobed").  You may also need to set the property to "Allow Regeneration", found under one of the DAQmx Property Nodes (probably either the Channel or Write node).  Write an array full of 0 values to the output buffer using DAQmx Write.  (The actual value doesn't matter to the program, but 0 volts should be a safe value if you've got anything wired to your analog output terminals.)
    2. Create 2 similar edge counting tasks with your counters.  Both should be configured to use a digital "Arm Start" trigger using a DAQmx Trigger property node.  That will guarantee that they are sync'ed at time=0.  When you call DAQmx Timing.vi, wire in the input that lets you specify sampling using the AOSampleClock.
    3. My personal choice for getting them all started in the right order would go like this.  The counters would use the falling edge of the AOSampleClock as an "Arm Start" trigger and the rising edge of the AOSampleClock as their sample clock.  The counter tasks are started before starting the AO task.  After starting the AO task, the falling edge of the 1st AOSampleClock will "arm" the counters to start counting their edges simultaneously.  The rising edge of the 2nd AOSampleClock will "strobe" the count values into the counter tasks' data acq buffers.  Each subsequent rising edge will buffer the next counts.
    4. Duplicate Count Prevention may need to be specified if there's a chance you might not see any edges to count between 2 consecutive sample clock strobes. 
    5. When you read from the counter tasks, be sure to read the same # of samples from each task.  Then you can subtract the arrays to get your count differences, knowing that the counts correspond to the exact same interval of time.
    -Kevin P.

  • How do I output a finite pulse train through multiple counters?

    Hello,
    I have used LabView examples to create a VI to use with my TIO 6602 that generates a finite pulse train with varying duty cycle, frequency, number of pulse, and initial delay.  I can also have it output the pulses through multiple counter channels, but all the channels have the same delay, and are output at the same time.  I need each channel to have a specific delay from the first one.
    In my VI, I use DAQmx to create a retriggerable finite pulse train by gating a counter with another counter.  I have all the neccessary controls over the pulse train, but I can not seem to find an easy way to just copy this waveform and output delayed versions of it to other channels.  The delay is very important because these signals will be used to drive ultrasound transducers in a linear array, and for the waveforms to focus at one point, the signal driving the transducers with a shorter distance from the focal point need a larger delay, so that the same waveform arrives from each transducer at the same time.
    Any help with how I might do this would be much appreciated.
    Thanks!

    Hey Sneaky,
    Here's a screenshot of the code I put together on how to use multiple counters.  Also, take a look here for more information on how to sync multiple counters. 
    Message Edited by Knights Who Say NI on 02-02-2009 10:36 AM
    Message Edited by Knights Who Say NI on 02-02-2009 10:36 AM
    Message Edited by Knights Who Say NI on 02-02-2009 10:38 AM
    -John Sullivan
    Analog Engineer
    Attachments:
    4xcount.jpg ‏67 KB

  • Dividing source signal with 2 counters

    I have a C/T 6602.
    I want to divide by n(>=2) one external signal with my two counters at the same time. But the problem is that I cannot make the two Counter outputs  in-phase whenever I set the counters up. Whenever the order is made, the two output phases are random. I think that there is way to do what I want.
    Thanks, GraceSun

    Hello GraceSun,
    Have you tried any example programs?  You have not said what programming language you are using, but if you are using LabVIEW 7.x you can go to help >> find examples >> hardware input and output >> DAQmx >> Generating Digital Pulses and find a VI called Gen Dig Pulse Train (either continuous or finite).  You can simply put in for your counter channel "Dev1/ctr0:1" to have multiple counters in the task.  Your outputs will then be synchronized. 
    Thanks,
    Laura

  • Multiple counters

    Hello,
    We are using a 6602 board and would like to do buffered counting on
    three counters. As this board does not allow multiple counters in a
    group, we have modified the example 'Single Buffered Event Counting-Adv
    (NIO-TIO)' by adding two additional sets of the counter subVI's (group
    config, buffer config, set attribute, control, read buffer). We are
    using the internal timebase and have the gate connected to pin 38 on a
    SCB-68. When the program is run, counters 0 and 2 will count while
    counter 1 does not. We are getting an error code 10123 in the counter
    control for counter #1. Does anyone know what the problem might be?
    Also is it necessary to be wired to each counter's gate pin on the SCB?
    Additionally, we would like to write the buffered da
    ta to a binary file
    and are having trouble figuring which vi to use. We are currently using
    Write File+ (I16) which is giving us errors.
    Thanks in advance,
    Kristie Elam

    post your example code.
    Stu
    Stu McFarlane
    Viewpoint Systems, Inc.

  • Strategy Plan-with different Counters??

    Dear Experts,
    I had a scenario, which my client want :
    There are many similar equipments say "Pumps". So, for 5 similar pumps, they want a single plan which will include all 5 pumps (say in OBJECT lists). Now the thing is that 2 of the pumps are standby for some period and can be brought in running after some time or some running hours.
    So, they would like to attach counters to each pump(equipment) and based on measuring documents, call object /order should generate only for those which have completed stipulated running hours.
    As I didn't find to assign more than one counters in a plan, so i am unable to fulfill this demand.
    Is there any way to complete this scenario???
    Regards,
    Rajesh

    Hello Rajesh,
    You can assign multiple counter  by defining the cycle set for multiple counters defined for equipment.
    SAP does support Maintenane planning for equipment with multiple counter.You can define the and/or condition for multiple counters.
    Let me know if you need more details.
    Thanks
    Vinay

  • Measure frequency with 2 counters

    Hello,
    I'm measuring a digital frequency signal using a PXI-6602 module using the 'high frequency with 2 counters' method.  From the examples I have found, it seems that you specify only the counter which is doing the measuring and the measurement time.  How does LabVIEW know which counter is used to generate the HF pulse reference train, for example:
    ctr 0 - measuring 200kHz signal
    ctr 1 - generating  50kHz signal
    Do I independently set up and start the ctr1 generation, and as log as it starts before the measurement commences, does LV then sort it all out without any other input?
    Thanks
    Dave

    You should connect the signal (whose frequency needs to be measured) to Ctr-1, and there gonna be an internal connection between the output of the first counter and the gate of the second counter (as described here).
    You may want to check this link as well.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

Maybe you are looking for

  • Do I need a new Wireless Card?

    Please bare with me while I tell the whole story... Ever since I installed Leopard, my MacBook has been having a big problem. 25% of the time, when you closed the lid, it would crash instead of going to sleep. It seemed to even be getting worse. So l

  • Why does my iPhone screen glitch up?

    My iPhone at times does this random thing where the screen glitches. My screen ends up looking a bit like the crystal have burnt with weird multi-coloured vertical lines all over my screen, making the iPhone unusable for 5 mins before returning to it

  • Replace FM GUI_DOWNLOAD with CL_GUI_FRONTEND_SERVICES= GUI_DOWNLOAD

    Hi, I want to replace FM GUI_DOWNLOAD with CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD in one of our old program, however parameter FIELDNAMES is used, and this parameter is no longer available in CL_GUI_FRONTEND_SERVICES. Any idea is there any other para

  • When I make a call, i can't hear the other person, when I get a call, I can hear them and they can't hear me. What's up?

    when i make a call, i can't hear the other person but they can hear me. when i get a call, i can hear the caller, but they can't hear me. what's up?

  • Automatic packing for sales document

    Hi all, i have created a sales order with BAPI BAPI_SALESORDER_CREATEFROMDAT2. Is there a BAPI or a FM that generate automatic packing for the items in the sales document. I want something like VA02, extras | packing proposal, Automatic packing. Rega