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.

Similar Messages

  • 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

  • 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

  • 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

  • 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

  • 6601 CTR/TMR - problem reading multiple counters

    I'm developing some code for frequency measurement in Visual C++ using the
    NI 6601 counter/timer board. I am able to successfully read the counter
    for a single counter; however, my application requires reading multiple counters.
    I have code to the effect as follows:
    do
    nStatus = GPCTR_Watch( nDevice, ulCounter1, ND_ARMED, &ulArmed1 );
    nRetVal = NIDAQYield( nYieldOn );
    } while ( ( ulArmed1 == ND_YES ) && ( nStatus == 0 ) );
    do
    nStatus = GPCTR_Watch( nDevice, ulCounter2, ND_ARMED, &ulArmed2 );
    nRetVal = NIDAQYield( nYieldOn );
    } while ( ( ulArmed2 == ND_YES ) && ( nStatus == 0 ) );
    do
    nStatus = GPCTR_Watch( nDevice, ulCounter3, ND_ARMED, &ulArmed3 );
    nRet
    Val = NIDAQYield( nYieldOn );
    } while ( ( ulArmed3 == ND_YES ) && ( nStatus == 0 ) );
    I have tried a single do..while, but to no avail. In the above code, the
    first counter returns, but the next one just hangs there indefinately - not
    arming.
    Can anyone point me in the right direction on how to read multiple counters
    on the 6601?
    Thanks,
    Aaron Lukacsko
    [email protected]

    Your program is hanging because you are setup for a continuos read, which means your counter will never unarm. If the first counter never unarms, then your program will hang until the first counter is stopped. You need to either use one Do statement for all for of the GPCTR_Watches or use the Buffer Functions. If you want a continuos buffered operation then you need to use GPCTR_Config_Buffer and GPCTR_Read_Buffer functions. However, if you are just doing a finite number of counts then you use the GPCTR_Watch function, without any buffer functions.
    Kevin Bisking
    National Instruments
    www.ni.com/ask

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

  • I need to read multiple counters using PCI 6601 can I do this, and How?

    I am reading 4 TTL signals from a Magnetic Pickup how do I read multiple channels using PCI 6601?

    Not concerning my primary question, I would like to point out to an N.I. Rep. that there is a typo in the help section concerning "posting a message".
    I have built a large format, two axis digitizer using linear encoders, a 6601 counter/timer, and labview 8. In building my application program, I  initially am using two daq assistants, with each set up to accomplish  the task of reading two encoders simultaneously. In doing some research, It has come to my attention, that, with my current configuration, errors may result, due to one daq assistant attempting to access the cards driver while the other is acquiring data.  All attempts to get two channels working through a single daq assistant have resulted in an error message informing me that I can only have one task per counter.Thus far, I have not seen any noticeable errors, thought I would like to have this device "rock solid", as it will be used extensively.
    Is it possible, that I should have purchase  an "S" series board instead?

  • Checking Multiple Counters...

    Hi there.
    I have a website with about 40 different pages from my last trip.
    I placed a counter on each page - and am wonderig how I can acccess a page where I can see all the counters.
    My homepage only lists the top 5 pages - and I can't find a way to get at the others - other than going to the page itself...
    Thanks,
    SparkyCanada

    If counting page hits and taking a look at your webtraffic are something that you would be interested in, my recommendation would be to take a look at http://www.statcounter.com .
    This is a 3rd party (free) hit counter. You sign up for it online, then you are given a bit of HTML code that you insert into every page on your site that you want to keep track of. Fortunately for the HTML-challenged (like myself), there is a little software application called iComment that can insert the code to every page automatically...
    http://web.mac.com/cbrantly/iWeb/Software/iComment.html
    With statcounter you will have more information at your disposal than you ever imagined possible. Which pages and in what order people are clicking to and from. Where people are surfing from (country and website). People's IP addresses, screen resolution, browser version, OS version, etc, etc.
    Oh and best of all....you can set it so that it doesn't count any of your own visits to your own pages!

  • Sync Multiple Counters

    Hello,
    I want to start 3 counters on a 6624 board simultaniously. The counters should count edges from 3 diffrent sources. I am using Labview 8.0.1
    Can I start those 3 counters with a software generated signal (I have no external HW Trigger)?
    I was thinking about something like you start an AI and AO operation simultaniously. But it seems that there is no corresponding trigger event (ai/StartTrigger) for counters available.
    Thank you for your help in advance,
    Peter

    Hello,
    you have no software trigger like ai/StartTrigger which you can use. Attached you can find an example where 3 counters will be started from a 4. counter. The 4. counter generate a puls. The 3 counter are configured with a pause trigger.
    If you use this example be careful, the 6624 has inverted logic (see manual,
    TIO Series -> Device-Specific Information -> NI 6624 -> Input).
    For the 4. counter you need separate Source voltage (see manual) to generate the puls.
    hope this helps
    Michael
    Attachments:
    Count Digital Events-Pause Trig_6624.vi ‏63 KB

  • How do I trigger multiple counters in VB?

    I am using a 6608 card to measure frequency by counting a certain number of periods from my source and comparing that to the count from the 80MHz clock. My accuracy is not what it should be, because I haven't figured out how to trigger both counters simultaneously. I know I need to use a hardware trigger and the select_signal function, but I'm having trouble figuring out the exact function calls. Is there any code samples out there in Visual Basic that shows how to do this?

    Hi Nate!
    The function that you are looking for is GPCTR_Change_Parameter with paramID = ND_Start_Trigger.
    For an example, you can take a look at the: Program Files/National Instruments/NI-DAQ/Examples/VBasic/TIOgenSquareWaveStartTrig.vbp.
    Hope this helps.
    Regards,
    Erin

  • Getting multiple counters with get-counter ?

    Just trying to get a handful of counters for sql server monitoring.  but is there any way i can export-counters all  into 1  .blg file or am i not getting this ?  do they have to be in the same set i guess is the question.
    Counters like :
    Get-Counter "\\$computer\processor(_total)\% processor time"
    Physical Disk: Average Disk/sec Reads
    Physical Disk: Average Disk/sec Write
    SQL Server: Memory Manager >> Free List Stalls/sec
          SQL Server: Memory Manager >> Memory Grants Pending
    thanks,
    Chris

    Mike, once again, thanks.
    I guess i need to find out how to read the cmdlet powershell syntax.  from the documentation that you've sent, and which i've read before, i can't find where you can comma separate counters.  clearly, i need to decipher the syntax which is not
    too clear.
    That is why it is important to take a course or read a book or use the training materials on this site. The raining answers these obvious questions. It is like buying a new car - first you read the owners manual.
    In the first couple of lessons the syntax of the CmdLets are explained.
    You can also use help to discover how they work.
    The CmdLets shows you how to call a CmdLet with an array of strings.  A comma separated list of any kind is an array.
    (1,2,3,43,5).GetType()
    ¯\_(ツ)_/¯

  • How do I read 2 counters simultaneously using a PXI-6052E board?

    Labview help files seem to suggest that I should be able to use the "Group Config" vi to configure 2 counters within a single task ID so that I can read both counters simultaneously with a single read command, but I am having trouble doing this so far.
    The only way that I can read both counters is to run the group config vi two times, creating two separate task IDs. For each task ID, I can then run "Set Attribute" to set the attributes of the counters, and then "Get Attribute" to actually read the counter values.
    I need to configure the two counters separately (so that each looks at a different input), but I would like to be able to arm them and reset them together.
    Any help would be greatly appreciated! I've seen example vis that read them sequentially (in the way that I am doing now), but Labview help suggests that the "Group Config" vi can allow you to group several counters together so that you can address multiple counters with a single read command.
    Polly

    Hello Polly. Thank you for contacting National Instruments. If you right click on Group Config.vi and select Help, LabVIEW Help will open up. The description of the VI says, "Groups with multiple counters are not currently supported by MIO-16, E Series boards or NI-TIO-based devices." Some legacy boards that we don't sell anymore used to support this, but most of our current boards do not. The best way to do what you want is to configure one counter and then just copy and paste it to make the second one. Please let me know if you have any questions. Have a great day!
    Marni S.
    National Instruments

  • 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

Maybe you are looking for