Gated semiperiod counting DaqMY LV7.0 + NI6602

I am converting an application form traditional DAQ to DaqMX and am having trouble with the new conventions.
The application uses a common gate to count gated events on multiple counters (5 total counters employed). An event causes 5 pulses of 500us 0.5 duty cycle and the counters must share this gate source and count TTL pulses coming from 4 different photon counting PMT. Essentially I am measuring a optical decay curve (10 points of each 500 microseconds)when each event occurs. This was easily accomplished using traditional DAQ but I cant get it to work under DaqMX (version 7.2). My solution for this scheme under traditional DAQ was to set up 5 tasks, Task 1-4 used counters 0-3 on the 6602 set for semiperiod buffered counting from the source terminal of each counter and the gate was configured to share a common PFI line counter 5 also shared the common gate but used the internal 80MHz clock as a source (This was so I could have a time stamp of each event since the freqency of everns is not a constant. When setting up a semiperiod under DaqMX I can not get the source to change from the internal clock to the PFI corresponding to a counters "source" pin. Any help would be greatly appreciated.
-Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA

Thanks for the help, I was able to get my application to work perfectly, I created a semi-period counting channel then set the timing to implicit continious timing and modified the following channel properities:
1. CI.Dup.CountPrevention = True (I need to allow for zero counts to be valid)
2. CI.SemiPeriod.Term = gate pfi (this allows me to gate multiple channels on a single pfi line)
3. CI.CtrTimeBaseSrc = Source (Pfi line wiered to my PMT ttl line, this is what I need to count)
4. CI.CtrTimebaseRate = 200000 (Maximum expected rate of TTL source pulses, is actually usually much slower ~1-1000kHz)
5. CI.CtrTimeBaseActiveEdge = rising (probably not needed)
6. CI.DataXferMech to DMA (since the 6602only has 3 DMA channels and I configured 4 channels in this mannor, I had to set the last channel to Interrupt, but the application has no trouble keeping pace with the data.
After configuring the channel I start each channel then read them in a loop, now everything is working great, thanks for pointing me in the reight dirrection
-Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA

Similar Messages

  • SR 400 gated photon counter

    I don't have a ton of experience with Labview, but I'm trying to get the Stanford Research Systems SR400 gated photon counter to use a fixed gate mode to count.  I looked at the example driver that I found and realized that it isn't capable of doing anything more than a cw sweep.  I found this driver in the forums (http://forums.ni.com/attachments/ni/40/1879/1/sub​vI.vi), but in the process of updating to labview 8.2 (from labview 7.1 it said), it is missing some connections somewhere.  I was wondering if anyone knew how to find the problem pieces in it and how to fix it.  I have another question about the SR400.  Is labview capable of trigging it through the software, or do I need to have an actual physical trigger going in to the trigger input.  Thanks for your help.
    JOn

    Hey Jon,
    I'm unsure if the SR400 is able to trigger externally, but if in the manual for the SR400, you're able to find the command for it, you should be able to easily implement it. If it's GPIB communication, just open labVIEW, and go to Help->Find Examples->and Search for GPIB, and you should find a nice example called "labVIEW<->GPIB.vi". If it's serial communicaiton, just search "Serial" and you should be able to find a nice example called "Basic Serial Write and Read.vi". Just copy the triggering command if it's found in the manual into the write field, and you should have no problem implementing it. I like these two examples a lot, because they're easy to build from.
    Regards,
    Nick D.

  • Gated event counting for a finite time

    I am using a PCI 6110 card for gated photon counting. The digital signal is coming from a single photon counting module, which generates a single TTL pulse upon receiving a photon.  It also generates ~100 dark count /sec.  To get rid of the dark counts, I use gate pulses with very small duty cycle.  In this way, the dark counts are suppressed.  I want to operate for a fixed time interal with a resolution of ~1ms.  My gate pulses are at 800kHz.  Their duration is on the order of 10ns. Is there a way that I can perform gated counting for only 10000 gate pulses?  Thanks.

    Hi UMeng,
    Your question stirred up an interesting discussion at the office.  You can't do gated, buffered counting as the gate input is used to trigger the latch to the buffer.  We came up with a couple of ideas here, but neither are perfect.  It is important to also consider that you are running right at the specifed minimum pulse durations for the gate and source pulse durations for the 6110, which is 10 ns. 
    NI PCI-6110/6111 Specifications
    http://digital.ni.com/manuals.nsf/websearch/A9694D34EF10469386256E3000539747
    With that in mind, you could use an external high speed AND gate to generate a signal for a simple event counter to read using the laser gate and the photon detector output as input to the AND gate.
    Otherwise, you could try doing gated event counting on the signal and simple event counting on the gate as long as the gate frequency is consistent.  Then you could use the frequency of the gate and number of counts of the gate to get the total acquisition time.  This will require that you start and stop both counter tasks at as close to the same time as possible.  The start could be triggered with an Arm Trigger.  Getting the values from the counters would always require 2 software calls, but the longer the acquisition, the less important this error would become.
    Let me know if either of these sound appealing.
    Regards,
    John Bongaarts
    AE Specialist - Test Products

  • Gated-event counting using analog triggers?

    I'd like to software trigger gated-event counting with analog signals. eg. Use a comparison to check analog input levels to a 6024E card, once a trigger level is reached send a digital out from the 6024E to a 6601 gate to commence and terminate a counter of the 6601 card.
    I have found that the counter on the 6024E card is not stable enough for this application, but the NI-TIO cards work reliably.
    Any tips greatly appreciated,
    Alan

    Alan;
    In case you want to trigger a finite pulse train generation of an analog hardware trigger, you can still accomplish that with an e-series board only.
    You will need to use both general purpose counters available on the DAQ device though. The first counter needs to be configured as retriggerable pulse generation, having its gate being routed to the AI Start Trigger pulse of the Analog Input task. With that done, the counter will generate a pulse at its output at every time the Analog Trigger level is met. You, then, configure the second counter to execute a continuous pulse train and route the first counter output to the second counter gate input. That will make the second counter to generate a pulse train that will be "enabled" by the first counter. The p
    ulse train will be generated while the output of the first counter is on its high state level.
    Knowing that, you can configure the pulse width of the first counter to be as wide as you need the second counter to generate the pulse train.
    Hope this helps.
    Filipe A.
    Applications Engineer
    National Instruments

  • Gated event counting on 6602

    I am trying to use gated event counting or single pulse width measurement techniques to count TTL pulses on two counters during an external gate pulse. The problem is that if zero TTL pulses (a possible condition) go to both counters during the gate, the "armed" attribute does not seem to change from "yes" to "no", allowing the vi to kick out of a while loop and read the value that the counter stored.
    Is there a way of setting up the counters so that
    1) both counters only collect counts during an external gate
    2) zero counts are allowed
    3) the counters change state from "armed" to "not armed" at the end of the gate pulse regardless of whether there were TTL pulses on the source channel during the gate?
    Thanks,
    -Martin

    Based on your description of the application, I assume that you are using traditional DAQ. If you have an application where you sometimes expect to have zero source pulses between gates, you should enable synchronous counting (ND_COUNTING_SYNCHRONOUS) (referred to as "duplicate count prevention" in DAQmx). Many of the examples in traditional daq have this as an option that can be enabled on the front panel.
    I hope this helps!
    gus....

  • Serious bugs in the SR400 gated photon counter LabVIEW drivers

    Hi
    I am developing an application with SR400 and came
    across what I think is a bug in the LabVIEW driver. Essentially, none
    of the VI's allow you to set the preset counters. For instance, if you
    call Read VI and choose mode A, B for preset T, there is no way to
    specify preset T, which means that the count period defaults to some
    factory default, not a situation you want. This might also explain some
    of the timeouts some people are getting to SRQs that come later.
    Further,
    if you look at the block diagram of Read VI, the line selector string
    is set to "CM 0" for two distinct choices of the count mode. This is a
    serious bug. I do not know who wrote this driver, but it does seem, at
    least to me, that they did a rather shoddy job of it. How this driver even got certification to be posted at IDN is something I cannot explain.
    Comments welcome from those that use LabVIEW with SR400 and have used this driver.

    Hi. Dwell time of 2ms is good for me. It would be great if you can send me this file to circumvent the 2000points/measurement. Also, If i understand it right, if I set the Gate to CW, then my gate should always be open for the count period, they why do I have to set the gate parameters at all. I want to change the integration time, but for some reason I am not able to change it in your setup 2.VI at all. I made some changes in setup 2.vi. I removed the setting for channel B as I am not going to use it and I integrated the readchannel.vi into this file. I am not sure if I made a mistake in doing this. Now, I am able to write some data to a file, but I not as I want. If it helps, I am uploading my modified VI file and an example data file (Gate A width is 0.992s, Gate A delay and delay step are 0, Gate A mode is CW, Dwell time is 0.002s).
    Attachments:
    SR400-V.vi.vi ‏125 KB

  • Minimum pulse width needed for gating the counter

    Hi,
         I have TTL pulses of 20 nanosecond width coming out from the two detectors at random times. I want to count the number of coincidence pulses.I am trying this with NI PCI 6259 M series card, by giving one signal to the gate of the counter and other as a source of the counter (Single Point (On-Demand) Edge Counting with Pause Trigger). When both source and gate are high then it should give the coincidence count.Can anyone suggest  
    1) Whether this is possible to gate the counter with 20 nanosecond width pulse?
    2) If above thing is possible is this the right way for looking coincidence counts?
    Any help regarding this is highly appreciated. 
                                                                                                                                                                                                                                             Regards
                                                                                                                                                                                                                                              surya
    Research student

    I'm sorry I could figure out what was the problem.
    And I also find the minimum output pulse width on the catalog (12.5nsec).
    Thanks,
    Kaoru

  • How do i develop code in LabVIEW 7.1 for configuring and performing gated edge counting using NI-DAQmx

    Hi,
    My application requires DAQ counter channel to count the rising edge of the input signal connected to the source pin of the counter. This counting has to take place only when there is a high pulse in gate pin of the same counter.This can be developed easily using traditional daq vis.
    Please let me know how to develop code using DAQ mx.
    Thanks,
    Sudha

    There is an example that demontrates how to do this in DAQmx called "Count Digital Events-Pause Trig.vi".
    gus....

  • Using a counter on PCI-6023E DAQ card

    Hi there,
    I'm about to use a 6023 card to measure a periodic pulse signal. I need to count the number of the pulses. But...I've heard that the counters on my card are unusable in that case. Is that correct? Do I have to chage my card? Or can I do it with 6023E?
    Thanks in advance;
    Radek

    Hi DAC,
    The counter on your 6023E board is the DAQ-STC counter/timer. This counter fully supports counting the number of pulses. Depending on your application development environment, if you search the shipping examples you will find examples that perform this function.
    This is so long as your digital pulses are 0-5 V or TTL compatible.
    Other applications supported by your counter are:
    Simple event counting
    Gated-event counting
    Single-period measurement
    Single pulse-width measurement
    Single pulse generation
    Single triggered pulse generation
    Retriggerable single pulse generation
    Continuous pulse-train generation
    Buffered event counting
    Buffered period measurement
    Buffered semi-period measurement
    Buffered pulse-width measurement
    Fre
    quency measurement
    Buffered frequency measurement
    Finite pulse-train generation
    Quadrature encoders
    Hope that helps. Have a good day.
    Ron
    Application Engineering
    National Instruments

  • How to disable (turn off) a counter output

    I have a similar question up on the the board but I thought I would ask it in another way to make it simple and straightforward. 
    Can an E-series counter output be disabled (and enabled) quickly through some software command?  When I say " disabled" I mean switched off to a TTL low state.  I have tried both the "disable" counter control command and gating the counter with a TTL signal.  Both methods leave the output pin in whatever state the output happens to be in at the time of the command or gating.  I need a disable function where "disabled" automatically sets an OFF or LOW on the output.  I am using this to generate a pulse train where the pulse train switches off at certain times, and I cannot have the output remain high at these times.
    I am using traditional DAQ but if there is a method in DAQmx that works I'd be willing to try it...

    Have you tried using the following vi with a reset command (search in help, it works with the E series counters)
    Counter Control
    This VI controls groups of counters. Control operations include starting, stopping, and setting the state of active acquisitions. This VI works with DAQ-STC and NI-TIO-based devices.
    Control code 1 (reset) reinitializes the counter back to the default settings.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    "It’s the questions that drive us.”
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

  • DAQmx gate counter output

    Hello,
       I am trying to convert an existing legacy application developed in LabVIEW 6 (Traditional DAQ) into LabVIEW 2012 (DAQmx). The operation requires generating one counter output that is gated by another counter output. I have attached a fully functional example using Traditional DAQ. In the example you can see the Carrier Frequency output (4550 Hz or 5525 Hz) is generated by Counter 1. The counter Gate Frequency is generated by Counter 0. Counter 1 output is now gated by Counter 0 output in which you end up with bursts of the Carrier Frequency at a rate set by the Gate Frequency (from 3 to 21.5 Hz). This works fine but I cannot replicate this in DAQmx. The DAQ board I am using is an NI DAQCard-6062E (in a PCMCIA Slot).
       Any sugestions are appreciated.
    Thank You,
    Mike Westgate
    Attachments:
    Traditional DAQ Counter Gate Output.zip ‏32 KB

    Hi Mike,
    I wasn't able to properly look at your code since I have not install the Traditional DAQmx (Legacy) driver yet.
    But I do have the following links that can help you in transition from Traditional DAQ to DAQmx:
    Answers to Frequently Asked Questions about NI-DAQmx and Traditional NI-DAQ (Legacy)
    Transition from Traditional NI-DAQ to NI-DAQmx in LabVIEW
    Ee Lim
    See that button on the left side of this post...
    If you feel my post is helpful, all you need is just (at most) 2 seconds to click that button, to show your appreciation. Thank you~~

  • Sr 400 photon counter (stanford research system)

    hi,
    i need help regarding sr400 two channel gated photon counter(SRS)
    my problem is:
    i open getting start wizard ,it shows.
    hardware presence verified
    software  "        ''          ' '
    interface sequential verified
    upto here it is ok .but when i goto max and open NI488.2 communicator and write string in send string(*IDN?), IT GIVE ERROR
    iberr=EABO
    i tried the same with interactive control and when i write
    GPIB0: ibwrt" *idn?"
    it gives
    [c100] <errtimo cmpl>
    error: EABO
    count : 0
    so can u plz tell how to tackle that problem.
    thanks

    You need to understand the difference between the GPIB bus commands and instrument commands. You seemed to have looked at the basic example that's in the manual. The first line in the example does some things to the GPIB bus's interface management lines like interface clear (IFC) and remote enable (REN). You do not issue these commands in MAX's communicator when you want to program the instrument. Those sort of commands are available but you don't normally have to do any of that. You do need to issue the commands that are listed in the section on remote programming. The very first example listed is the command "CM". As the manual states, if you send CM {j} where {j} is 0-3, you set the counter mode. If you send just "CM", the instrument returns the counting mode. You will not get a response back from the instrument when you set something. You will only get data back from the instrument when you issue a specific command that tells the instrument to return something. Instruments designed within the last 20 years have better command sets than what you have to work with. These "newer" instruments use a "?" at the end of every command that tell the instrument to return data.
    Before you do much more, I would recomend that you do a little studying on the GPIB bus. There are some tutorials and app notes at : http://zone.ni.com/devzone/devzone.nsf/webcategories/3992D796622FADB1862567BD006DBD98.

  • Goofy quantizati​on error in edge counting

    Hello,
    I have an issue with my counter that I hope someone can help me
    resolve. Essentially, all I want to do is turn the counter on, wait for
    a period of time that I specify, read the counts (coming from a TTL
    pulsetrain with a variable frequency of 0 to 100 kHz) that have occured
    over the elapsed time, and turn the counter off or reset it. This
    sounds simple and I have been able to get it to work, however I am
    experiencing a quantization error of sorts. The digit in the ones place
    of the number coming out of the counter has a funny dependence on the
    time that I tell the VI to wait. For example, if the wait time is 250
    ms, the ones digit is only an even number; for 200ms, the ones digit
    will only be 0 or 5; for 100ms, the ones digit is only a 0. I have
    tried a number of things, including changing the clock source and
    gating the counter with a pulse from another counter, all to no avail.
    I have attached my VI to illustrate what I mean. If anyone else has had
    a similar problem or has any ideas, please help! By the by, I am
    running a 6229 board with Labview 7.1.
    Thanks,
    ~Glenn Wolfe
    Dept. of Chemistry
    University of Washington
    Attachments:
    read_counter.vi ‏78 KB

    Hi Glenn,
    This appears to be a problem with that specific piece of code.  I did see what you were seeing, and I found that you could get a change in the 1's place if you shifted to either 199 or 201 ms of wait.
    I then decided to start from scratch and see if this is an actual software problem, a hardware problem, or a particular quirk.  Fortunately, it looks like this will fall into the last category. 
    I went ahead and created an almost identical program that should accomplish the same thing for you.  I hope this helps. 
    Also keep in mind that you are doing software timing in this program, so you may not get a very accurate count.  For more accurate counts you may want to do something like look at the Count Events with Pause Trigger and then create a pulse that is the desired length of time.  When it comes to accuracy in timing it's generally not a good idea to trust your OS.
    Regards,
    Otis
    Training and Certification
    Product Support Engineer
    National Instruments
    Attachments:
    762051-Count Digital Events.vi ‏53 KB

  • Gated measurements

    Hello All,
    I have PXI 6602, and I need to perform gated event counting as well as pulse width measurements.
    As of now I am trying out the example, by running the generate pulse train program(NI supplied), pulse train is generated on CTR 0 pin and this I am connecting to CTR 1 source pin and performing simple event counting and I am achieving what I need,. BUT
    Q1. When I connect CTR 0 output to CTR 1 Gate Pin how do I perform event count and pulse width measurement, and according to the manual (link attached)
    http://g-line.chess.cornell.edu/G-lineStatus/G-lineManuals/PCI-Boards/NI-6602-Manual.pdf, we need to connect the input signal to GATE terminal to measure the pulse width.
    Q2. Whenever I perform counter operation I can see only CTR 0.....CTR 7 in the list, how can I program induvidual pins of each CTR i.e. CTR 0 SRC, CTR 0 GATE.
    Thanks in adv

    Faheem,
    Can you store measurements how you want when you are just using the device, and not necessarily using LabVIEW at all?  If so, how?  That will be the first step to find out if you can do it while controlling the device with a driver.  If you are not sure if you actually are given control over that, then you might get more ideas from the manufacturer.  If you find out that it is something that you can programmatically control and what commands do it, then that should give direction for how to do it in LabVIEW.
    Hope this helps,
    Jen W
    Applications Engineer
    National Instruments
    ni.com/support

  • Sharing an external sample clock between PCI-6722 and PCI-6602

        I need PCI-6602 work with PCI-6722。6602 shares 6722’s ao/SampleClock as external clock and triggered by 6722’s ao/StartTrigger。The master device is 6722, which refered as Dev1, and the slave device is 6602, which refered as Dev2. A RTSI line is used to connect the two devices correctly.
        I use C API to finish my program and my code is as follows:
    //config 6722 analog out task
    1、DAQmxCreateTask("NI6672", &hAOTask);
    2、DAQmxCreateAOVoltageChan(hAOTask, "Dev1/ao0", "", -10.0, 10.0, DAQmx_Val_Volts, "" );
    3、DAQmxCfgSampClkTiming(hAOTask, "", 1000.0, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000);
    4、DAQmxWriteAnalogF64(hAOTask, 1000, 0, 10.0, DAQmx_Val_GroupByChannel, data, NULL, NULL);
    //config 6602 counter task
    5、DAQmxCreateTask("NI6602", &hCounterTask);
    6、DAQmxCreateCICountEdgesChan(hCounterTask, "Dev2/ctr0", "", DAQmx_Val_Rising, 0, DAQmx_Val_CountUp);
    //use /Dev1/ao/SampleClock for external clock
    7、DAQmxCfgSampClkTiming(hCounterTask, "/Dev1/ao/SampleClock", 1000.0, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000);
    //use /Dev1/ao/StartTrigger
    8、DAQmxSetTrigAttribute (hCounterTask, DAQmx_ArmStartTrig_Type, DAQmx_Val_DigEdge);
    9、DAQmxSetTrigAttribute (hCounterTask, DAQmx_DigEdge_ArmStartTrig_Src, "/Dev1/ao/StartTrigger");
    10、DAQmxSetTrigAttribute (hCounterTask, DAQmx_DigEdge_ArmStartTrig_Edge, DAQmx_Val_Rising);
    //start counter task first
    11、DAQmxStartTask(hCounterTask);
    //start 6722 task
    12、DAQmxStartTask(hAOTask);
    I run it on the MAX virtual Device, and the Step 11always returned -89120。
    I try to slove this problem, so I change the Step 7, use /Dev2/PFI9 to instead of /Dev1/ao/SampleClock.
    7、DAQmxCfgSampClkTiming(hCounterTask, "/Dev2/PFI9", 1000.0, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000);
    The code runs well, but I don’t know which terminal is connected by /Dev2/PFI9. Does it connect to /Dev1/ao/SampleClock?
    I use another API DAQmxConnectTerms to ensure that, I add a Step before Step 11.
    DAQmxConnectTerms( "/Dev1/ao/SampleClock", "/Dev2/PFI9", DAQmx_Val_DoNotInvertPolarity );
    The program also run well. But I am still not sure that 6602 is sharing /Dev1/ao/SampleClock。If not, which terminal of Dev1 is connected by /Dev2/PFI9?
    Is my code right? If not, hwo to fix my code or supply some example for me? Thanks.

    Hello Shokey,
    From looking over your post, it looks like you want to program in C, using simulated instruments, a master/slave design with a PCI-6602 and PCI-6722. The PCI-6722 is the master device and the PCI-6602 is the slave device. In order to implement this with the real cards, you would need a RTSI cable between the 2 cards in order to pass the triggers and the sample clock. Unfortunately with simulated devices you can't implement this so parts of your code won't be able to work exactly like if you had the instrument.
    If you did have the instrument, you can implement this by performing the following steps:
    Master Device:
    1.) Export the ao/SampleClock and ao/StartTrigger to a RTSI Line. (See DAQmx C Reference help for DAQmxExportSignal to export these)
    Slave Device:
    1.) Set the Sample clock and the trigger to the RTSI.
    There is another forum that I think will help you out to implement this correctly. In this forum, the customer was trying to export a trigger through a RTSI and the problem he was experiencing was a broken RTSI cable. His code, he states, works. I hope this helps you with this and if you have any more questions, feel free to post.
    Jim St
    National Instruments
    RF Product Support Engineer

Maybe you are looking for