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

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

  • 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

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

  • 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 synchronize two counters?

    Hi,
    I am using NI-PCI 6115 & BNC 2120. I want to generate two continuous pulse trains using the CTR-OUT0 and CTR-OUT1. I hope these two pulse trains have exact same rising edges, how can I synchronize these two counters? I attached my program here.
    Any suggestion will be greatly appreciated!
    Stephen
    Attachments:
    test.vi ‏33 KB

    Stephen,
    In order to generate two pulse trains on the two counters of your 6115, then you will need to provide a trigger to start both of these counters simultaneously. The counters on the 6115 are controlled via the DAQ-STC counter/timer chip.
    In order to perform these operations you will need to use the more advanced counter/timer VIs in the LabVIEW palettes. I would recommend taking a look at some of the shipping examples, such as Generate Pulse Train (DAQ-STC), in order to get a better understanding of how a single pulse generation works.
    Also, please take a look at the following websites to get a little more information as well:
    Triggering Multiple Counters with a Single Pulse
    http://exchange.ni.com/servlet/Redirect?id=10358279
    Using the Hardw
    are Start Trigger for Single Pulse Generation
    http://zone.ni.com/devzone/conceptd.nsf/webmain/7B2CAD8DD522049386256802007B8B51?opendocument
    If you have any other questions then please let us know.
    Regards,
    Michael H
    Applications Engineer
    National Instruments

  • How do I insert multiple rows from a single form ...

    How do I insert multiple rows from a single form?
    This form is organised by a table. (just as in an excel format)
    I have 20 items on a form each row item has five field
    +++++++++++ FORM AREA+++++++++++++++++++++++++++++++++++++++++++++++++++++
    +Product| qty In | Qty Out | Balance | Date +
    +------------------------------------------------------------------------+
    +Item1 | textbox1 | textbox2 | textbox3 | date +
    + |value = $qty_in1|value= &qty_out1|value=$balance1|value=$date1 +
    +------------------------------------------------------------------------+
    +Item 2 | textbox1 | textbox2 | textbox4 | date +
    + |value = $qty_in2|value= $qty_out1|value=$balance2|value=$date2 +
    +------------------------------------------------------------------------+
    + Item3 | textbox1 | textbox2 | textbox3 | date +
    +------------------------------------------------------------------------+
    + contd | | | +
    +------------------------------------------------------------------------+
    + item20| | | | +
    +------------------------------------------------------------------------+
    + + + SUBMIT + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Database Structure
    +++++++++++++++++
    + Stock_tabe +
    +---------------+
    + refid +
    +---------------+
    + item +
    +---------------+
    + Qty In +
    +---------------+
    + Qty Out +
    +---------------+
    + Balance +
    +---------------+
    + Date +
    +++++++++++++++++
    Let's say for example user have to the use the form to enter all 10 items or few like 5 on their stock form into 4 different textbox field each lines of your form, however these items go into a "Stock_table" under Single insert transaction query when submit button is pressed.
    Please anyone help me out, on how to get this concept started.

    Hello,
    I have a way to do this, but it would take some hand coding on your part. If you feel comfortable hand writing php code and doing manual database calls, specificaly database INSERT calls you should be fine.
    Create a custom form using the ADDT Custom Form Wizard that has all the rows and fields you need. This may take a bit if you are adding the ability for up to 20 rows, as per your diagram of the form area. The nice thing about using ADDT to create the form is that you can setup the form validation at the same time. Leave the last step in the Custom Form Wizard blank. You can add a custom database call here, but I would leave it blank.
    Next, under ADDT's Forms Server Behaviors, select Custom Trigger. At the Basic tab, you enter your custom php code that will be executed. Here you are going to want to put your code that will check if a value has been entered in the form and then do a database INSERT operation on the Stock_table with that row. The advanced tab lets you set the order of operations and the name of the Custom Trigger. By default, it is set to AFTER. This means that the Custom Trigger will get executed AFTER the form data is processed by the Custom Form Transaction.
    I usually just enter TEST into the "Basic" tab of the Custom Trigger. Then set my order of operations in the "Advanced" tab and close the Custom Trigger. Then I go to the code view for that page in Dreamweaver and find the Custom Trigger function and edit the code manually. It's much easier this way because the Custom Trigger wizard does not show you formatting on the code, and you don't have to keep opening the Wizard to edit and test your code.
    Your going to have to have the Custom Trigger fuction do a test on the submitted form data. If data is present, then INSERT into database. Here's a basic example of what you need to do:
    In your code view, the Custom Trigger will look something like this:
    function Trigger_Custom(&$tNG) {
    if($tNG->getColumnValue("Item_1")) {
    $item1 = $tNG->getColumnValue("Item_1");
    $textbox1_1 = $tNG->getColumnValue("Textbox_1");
    $textbox1_2 = $tNG->getColumnValue("Textbox_2");
    $textbox1_3 = $tNG->getColumnValue("Textbox_3");
    $date1 = $tNG->getColumnValue("Textbox_3");
    $queryAdd = "INSERT INTO Stock_table
    (item, Qty_In, Qty_Out, Balance, Date) VALUES($item1, $textbox1_1, $textbox1_2, $textbox1_3, $date1)"
    $result = mysql_query($queryAdd) or die(mysql_error());
    This code checks to see if the form input field named Item_1 is set. If so, then get the rest of the values for the first item and insert them into the database. You would need to do this for each row in your form. So the if you let the customer add 20 rows, you would need to check 20 times to see if the data is there or write the code so that it stops once it encounters an empty Item field. To exit a Custom Trigger, you can return NULL; and it will jump out of the function. You can also throw custom error message out of triggers, but this post is already way to long to get into that.
    $tNG->getColumnValue("Item_1") is used to retrieve the value that was set by the form input field named Item_1. This field is named by the Custom Form Wizard when you create your form. You can see what all the input filed names are by looking in the code view for something like:
    // Add columns
    $customTransaction->addColumn("Item_1", "STRING_TYPE", "POST", "Item_1");
    There will be one for each field you created with the Custom Form Wizard.
    Unfortunately, I don't have an easy way to do what you need. Maybe there is a way, but since none of the experts have responded, I thought I would point you in a direction. You should read all you can about Custom Triggers in the ADDT documentation/help pdf to give you more detailed information about how Custom Triggers work.
    Hope this helps.
    Shane

  • 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

  • How do I trigger video clips with MIDI, in Quartz Composer

    How do I assign clips to my MIDI board notes? And is it possible to trigger multiple pictures at once or effects like fade in out?

    Wow.. 48 views

  • Trigger Multiple Forms

    Hi,
    I am using Documaker studio 11.3 and my input file is a flat file. I need to trigger multiple occurrences of the same form in a single transaction. For e.g Form A needs to be triggered 5 times in a single transaction. The input file would have 5 occurrences of the same record (e.g FRMAREC), but each time with different variable data. Suppose Form A is a single page with 2 conditional images, IMGA and IMGB . The first occurrence, should have IMGA triggered and second occurrence of form should have IMGB triggered.
    Please let me know how to implement this scenario
    Thanks,
    Akhil
    Edited by: Akhil on Jul 25, 2011 3:28 AM
    Edited by: Akhil on Jul 25, 2011 3:30 AM

    Hi Gregg,
    Thanks for the response. I tried your given inputs. I am able to create multiple occurrences of FORMA using Subform, but I am not able to get the data from corresponding record. i.e Every time the data is taken from 1st record. And also the Triggering logic is not working. It takes the image inside subform as unconditional. This is what I did.
    1. Add FORMA in .GRP file (formlist) and add a manual trigger to it. (e.g, 17,FRMAREC)
    2. Create FORMA with one unconditional image and 1 SubForm (SUBFRMA)
    3. Add a manual trigger to SUBFRMA (17,FRMAREC)
    4. Add conditional images inside this SUBFRMA with manual triggers.
    I am not sure if I am missing something in doing a subform. Or should I set some Occurrence Flag or other checks.
    Thanks,
    Akhil

  • 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 TRIGGER GROUPS IN AN EXS24 INSTRUMENT VIA MIDI FROM THE SCORE

    HOW DO I TRIGGER DIFFERENT GROUPS IN AN EXS24 INSTRUMENT VIA MIDI CONTROLLER MESSAGES FROM THE SCORE - PLEASE ? WHERE DO I GO IN DOCUMENTATION AS HAVE GIVEN UP FOR TIME BEING WITH MULTI INSTRUMENT WHERE I CAN'T SEEM TO DEFINE CUSTOM BANK SELECTS BECAUSE I CAN'T FIND THAT OPTION. BUT MAYBE I'M ON THE WRONG TRACK ANYWAY! WITH THANKS

    For those who are following this thread I have received the following info from LPH: it hasn't dealt with this through midi controllers but with key switches in a v. easy to work with fashion, though I would still like to have a result with former, if there is anybody that can give me a clear proceedure. Christian thanks for your help and if you are offay with MC's then I love to hear from you!
    METHOD #1
    Create a duplicate track for those instruments which you're keyswitching. Let's just focus on one instrument for now, flute. Create a duplicate track assigned to your flute instrument ("new track with same instrument/channel"). Next, copy all of the regions from the original track onto this track and merge (glue) them to create one contiguous track. Of course if you have only one region for the part, just copy the region over to the new track.
    Then go into the piano roll editor and swipe the keyboard on the left in the range of your keyswitches. Then use the command "toggle selection" and hit DELETE. Now you have a region that contains only your keyswitches.
    Or, of course, you can just swipe the range that the instrument plays in. Then hit DELETE. Either way...
    The final step here is to untick the "score" checkbox for this keyswitch-only region (region parameters). Now, both tracks will still play, except only the actual flute part will appear in your score.
    METHOD #2
    In the score editor, open the staff style for the part. Set the highest note/lowest note range to (visually) filter out the keyswitch notes. This may seem like the easiest way to do things, but it will require you to have a distinct staff style applied to each part. For example, if you're using the Treble staff style for multiple parts (picc, flute, bass clarinet) and their key switches are in different ranges of the keyboard (as is the case with some libraries), you will need to create duplicates of "Treble", name them accordingly (picc, flute, b.clarinet), assign them to the various regions playing those parts, and then set their highest/lowest note values accordingly.

  • How do i creating multiple icloud accounts for one itunes account

    how do i creating multiple icloud accounts to access one itunes account?

    Perhaps you could explain a bit more what you want to do...
    iCloud accounts don't access an iTunes account.
    iTunes account is used to make purchases.

  • How do I add multiple apple id's to one account

    How do I add multiple Apple id's to one account for billing and Icloud use?

    You don't. You can't combine Apple IDs.

  • How can I have multiple users on iTunes (in order to connect to a shared office iPad)?

    How can I have multiple users on iTunes (in order to connect to a shared office iPad)? Currently each of us has our own iTunes account, so I've made an "all office" Apple ID. However, I can't seem to get two different accounts (my personal and the office) to work on my machine. Even when I login as "the office", my personal library is still showing. Additionally, when I try to setup with a first-time use in iTunes, I get an error that I don't meet the minimum age requirement - no matter what birthdate I enter!

    The library exists regardless of which user is logged in.
    The only way around that is to create different user accounts on the computer.
    There is no way to have 20 unique iTunes users access a shared iTunes under a single login on the computer.

Maybe you are looking for

  • Microsoft Lync closes after click on "Send Location" button on Apple's devices

    Hello, I found a problem using Microsoft Lync client on Apple's devices running iOS 5.1. I tested on an iPhone 3GS, 4S and New iPad. All of them running iOS 5.1. When I tested on a devide running iOS 5.0.1 this feature works fine. I don´t think that

  • Dual Monitor alignment

    I have 2 Apple Aluminum framed Apple 30" monitors. With my 2007 MacPro, the graphics card supported two DVI attachments. The monitors were aligned...a window spanning both monitors was perfectly straight. My new 2010 MacPro (with the ATI Radeon HD 58

  • Bulletin Board for A505-6980

    Does anyone know how to find the Bulletin Board on a A505-6980?  The advertisement for this machine says that the Bulletin Board in available on this machine but I cannot find in on the computer.

  • My macbook pro starts up slow

    HI, My macbook pro (less than 6 months old) has all of a sudden started to turn on very slowly. is there anything i can do? Regards, Aaron

  • Gumbo text elements and embedded fonts

    Hi again, ok I found the solution. The first time, I searched in the "CSS Advanced Selectors" spec document for the solution and I found nothing about it. Then I had the "great" idea to look in the only right place which is of course "Text Primitives