Slow counting(PCI-6601)

Dear friends
I wish to count TTL pulses from my device(Avalanche Photo Doide) by using PCI-6601 for a certain time. Thus, I tried to use "Measure Period.vi" with "for loop" configuration.
And the gate frequency from another counter is 100 Hz ( 10 ms time binning). Unfortunately, the acquition time is so slow considering binning time (10 ms).
 We tried to modify this vi and found that the acquisition speed cound be fast when we remove "while loop" with "0" counting. As I know, the "while loop" function is to check  whether arming acutally occurs, which is quite questioning why this kind of function exist even though the control code already do it. 
 Can you guys help me ? ^_^
P.S. Pulse train has a role to generate gate pulse with 100 Hz.
Attachments:
SPM_NI.vi ‏98 KB

Hi yatintyagi,
This VI has two tasks, one for edge counting and one for pulse generation. When doing Edge Counting the task counts the rising or falling edge of your input signal using a counter channel. The read VI is reading the value of the counter task. In this case a Buffered Edge Counting is performed, so the actual count will be updated with every edge of the sample clock. I think the image on the Edge Counting of the LabVIEW Help might be really helpful, you can also find it here. The counter output task is generating a signal that is defined by the frequency and duty cycle specified in the “Create Channel – Co Pulse Freq” VI. This pulse train generated is used as the sample clock for the Edge Counting task. I hope this is helpful,
Ana P
National Instruments
Applications Engineer

Similar Messages

  • Slow counting time (PCI-6601)​-Single period measuremen​t

    Dear friends
    I wish to count TTL pulses from my device(Avalanche Photo Doide) by using PCI-6601 for a certain time. Thus, I tried to use "Measure Period.vi" with "for loop" configuration.
    And the gate frequency from another counter is 100 Hz ( 10 ms time binning). Unfortunately, the acquition time is so slow considering binning time (10 ms).
     We tried to modify this vi and found that the acquisition speed cound be fast when we remove "while loop" with "0" counting. As I know, the "while loop" function is to check  whether arming acutally occurs, which is quite questioning why this kind of function exist even though the control code already do it. 
     Can you guys help me ? ^_^

    Duplicate
    Ryan Verret
    Product Marketing Engineer
    Signal Generators
    National Instruments

  • Can PCI-6601 pulse signal over RTSI every Nth encoder count?

    Hi All,
    I have a PCI-6601 counter/timer connected to a quadrature angular encoder.   The 6601 is also connected to a PCI-1422 frame grabber with a RTSI cable.
    I want to be able to trigger the frame grabber by sending a pulse over the RTSI cable every N encoder counts (or X degrees).
    How would I go about do this using C++?
    Thanks in advance,
    Brad 

    Hi Brad,
              There are a few resources I think you may find helpful.  First, there's this DevZone article, " Generate and output pulse every no count an encoder traverses".  Generally, the way this would work is:
    If you want to output a pulse every 4 counts, you will need to take the
    total count size of the counter (2^32 bits) and subtract 4 from this.
    This will be the initial count to set, so that after 4 counts, the
    counter will reach Terminal Count and the Counter Output Event pulse
    will be fired. You can then export the Counter Output Event to a PFI
    line, and use this line as the Z index terminal. If you set the Z index
    value to be equal to the initial count, the counter will always reset
    to 4 ticks below the Terminal Count, and will output a pulse on every
    4th tick. The only drawback to this method is that it will require that
    only X1 decoding be used, and that the counter would have to be
    dedicated to sending out the Counter Output Event (if you want to
    actually count the encoder and keep track of position, another counter
    will have to be used).
    As for specifically doing this in C++, I would recommend referencing the DAQmx C Reference Help (Start»All Programs»National Instruments»NI-DAQ»Text Based Code Support»DAQmx C Reference Help).  Hope that helps, for more assistance on the frame grabber portion of your question, I would reference the post you put in the vision forum.  Have a great day! 
    aNItaB
    Applications Engineer
    National Instruments
    Digital Multimeters

  • I want to interface PCI-6601 with photoelectric sensors to count the number of PCB chassis.

    I want to interface PCI-6601 with photoelectric sensors to count the number of PCB chassis. Related this I have following problems-1)Where I can connect sensors(pin numbers)?
    2)How I can acquire data from that sensors(Is is necessary to write any program? If yes, what?)
    3)In which format I will get the output data?

    Hi,
    We're going to need a little more info about your application before we can get you a compete answer.
    Your 6601 is a counter/timer board that can count and measure TTL pulses.
    You can get the pinout for your board from the user manual found here: http://digital.ni.com/manuals.nsf/websearch/dd0dbb6404bc139886256721007cf16d
    In LabVIEW, you can find shipping examples for various counter measurements by going to Help >> Find Examples >> Hardware Input and Output >> DAQmx >> Counter Measurments.
    I would also suggest downloading and installing the latest NI-DAQ driver:
    http://digital.ni.com/softlib.nsf/websearch/90B60D5899BCCCDB86256FC700581B89?opendocument&node=132050_US
    -Sal

  • Issues with counters 3 and 4 on PCI-6601

    Hi All,
       I am using counters 1-4 on the PCI 6601 card with NI-DAQmx 8.0 to generate continuous pulses in Labview  8.0. After I configure the counters, I can see the pulses going out on a scope. If I then configure other DIO lines as digital outputs, the pulses on counter 3 and 4 goes away. Counter 1 and 2 is  still okay. Has anyone seen this before. Somehow the configuration on counter 3 and 4 is changing when I try to configure other DIO lines as outputs? For configuration of continuous pulses I  am using the Pulse Train Gen.vi  from the DAQmx PWM Examples.zip folder from NI website minus the while loop and the DAQmx clear Task.vi. The Pulse Train Gen.vi include DAQmx Create Channel(CO-Pulse Generation Frequency).vi, DAQmx Timing(Implicit).vi, DAQmx Start Task.vi, and  DAQmx Is Task Done.vi. For digital outputs I am using DaQmx Write(Digital Bool 1 Line 1 Point). Any suggestions as to why counter 3 and 4 configuration changes and not counter 1 and 2. I need to have these counter going before I configure output lines.   

    Hi @George1971 
    If possible please turn off magnify mode - to do this, go to Settings > Accessibility and toggle the Magnify Mode switch
    After doing this, test the keyboard and let me know if you are still having trouble with key detection. Thanks! 
    Did someone help you? Click Like! Did a post solve your issue? Click Accept as Solution!
    Follow me on Twitter or Google+ and subscribe to the Inside BlackBerry Help Blog

  • Some problems with 3 counters on PCI 6601

    Good afternoon,
    after a lot of time i'm here yet.
    The problem with the PCI 6601 aren't finished in sense that i have tried a lot of solution but my sistem crashed after some acquisition.
    The code that  had write on Visual Basic 6 are :
    'Inizializzo la scheda PCI-6601
    Public Sub init_6601(NumSens As Integer)
    Dim edge As DAQmxEdge1
    On Error GoTo ErrorHandler
        MyChannel(NumSens) = "My Channel" & NumSens            'Definisce il nome per il canale (optional)
        'Creo i tre task che servono per il funzionamento del programma
        DAQmxErrChk DAQmxCreateTask("", taskHandle(NumSens))
        'Questa funzione serve a creare il canale dalla quale poi viene effettuata la misura
        If (NumSens = 0) Then
            DAQmxErrChk DAQmxCreateCIPulseWidthChan(taskHandle(NumSens), "Dev1/ctr1", MyChannel(NumSens), 0.00001, _
            0.0009, DAQmx_Val_TimeUnits3_Seconds, DAQmx_Val_Edge1_Rising, "") ' DAQmx_Val_TimeUnits3_Ticks, DAQmx_Val_Edge1_Rising, "")
        ElseIf (NumSens = 1) Then
            DAQmxErrChk DAQmxCreateCIPulseWidthChan(taskHandle(NumSens), "Dev1/ctr2", MyChannel(NumSens), 0.00001, _
            0.0009, DAQmx_Val_TimeUnits3_Ticks, DAQmx_Val_Edge1_Rising, "") 'DAQmx_Val_TimeUnits3_Seconds, DAQmx_Val_Edge1_Rising, "")
        Else
            DAQmxErrChk DAQmxCreateCIPulseWidthChan(taskHandle(NumSens), "Dev1/ctr3", MyChannel(NumSens), 0.00001, _
            0.0009, DAQmx_Val_TimeUnits3_Seconds, DAQmx_Val_Edge1_Rising, "")
        End If
        DAQmxErrChk DAQmxSetReadReadAllAvailSamp(taskHandle(NumSens), False)
        'Con questa funzione si sincronizza il timebase della scheda con il segnale da leggere
        DAQmxErrChk DAQmxSetCIPulseWidthDigSyncEnable(taskHandle(NumSens), MyChannel(NumSens), True)
        'DAQmxErrChk DAQmxSetReadOverWrite(taskHandle(NumSens), DAQmx_Val_OverwriteMode1_OverwriteUnreadSamps)
        'DAQmxErrChk DAQmxCfgSampClkTiming(taskHandle(NumSens), "", 100000, DAQmx_Val_Rising, DAQmx_Val_AcquisitionType_ContSamps, 10000)
        'provare queste due funzioni per aspettare che il campione sia realmente disponibile.
        'La seconda èdovrebbe essere quella che da il migliore compromesso tra uso CPU e velocità.
        'DAQmxErrChk DAQmxSetReadWaitMode(taskHandle(NumSens), DAQmx_Val_WaitMode_WaitForInterrupt)
        'DAQmxErrChk DAQmxSetReadWaitMode(taskHandle(NumSens), DAQmx_Val_WaitMode_Yield)
        'Setta il numero di campioni da acquisire ogni volta che va in lettura e
        'il modo di lettura. Si è impostato "contsamps" per avere la lettura continua
        'La dimensione del buffer è determinata da quel 10000 che va messo così secondo le specifiche del daqmx
        DAQmxErrChk DAQmxCfgImplicitTiming(taskHandle(NumSens), DAQmx_Val_AcquisitionType_ContSamps, 10000) 'DAQmx_Val_AcquisitionType_ContSamps
        'La scheda NI PCI 6601 ha soltanto un canale per il DMA (Direct Memory Access) quindi non riesco a leggere
        'contemporaneamente tre task per volta. Quindi devo attivare un meccanismo diverso per la lettura
        'basato sugli interrupt, ogni volta che ho una lettura automaticamente leggo il dato
        DAQmxErrChk DAQmxSetCIDataXferMech(taskHandle(NumSens), MyChannel(NumSens), DAQmx_Val_DataTransferMechanism_Interrupts)
        'La funzione di seguito serve semplicemente per leggere il campione più recente generato
        DAQmxErrChk DAQmxSetReadRelativeTo(taskHandle(NumSens), DAQmx_Val_ReadRelativeTo_MostRecentSamp)
        'La seguente funzione è complementare ad una utilizzata nell'inizializzazione e serve per impostare la lettura
        'sull'ultimo campione generato
        DAQmxErrChk DAQmxSetReadOffset(taskHandle(NumSens), -1)
        DAQmxStartTask taskHandle(NumSens)
        taskIsRunning(NumSens) = True
    Exit Sub
    ErrorHandler:
        For i = 0 To 2
            If taskIsRunning(i) = True Then
                DAQmxStopTask taskHandle(i)
                DAQmxClearTask taskHandle(i)
                taskIsRunning(i) = False
            End If
        Next i
        MsgBox "Error: " & Err.number & " " & Err.Description, , "Error"
    End Sub
    For the reading i use :
            DAQmxErrChk DAQmxReadCounterF64(taskHandle(NumSens), -1, 0.5, temp(NumSens, 0), 10000, ReadSamp(NumSens), ByVal &O0)
    Well, my problem are very simple, I want an continuos acquisition on three channel and the input signal's frequency that i have to measure is 1 kHz .
    when i try to keep 2 channel after some cycles appears the error -200141 (buffer overwriting). Why?
    The read function is called some times every ms and evry time keep out an different value, even if that are impossible because the input signal is at 1 kHz, and why the buffer fill up? What is wrong in my code?
    Thanks in advance for your help
    Have a nice day!!
    Igor Piero Prato

    HI Igor84,
    Error 200141 occurs when the data acquisition device acquires data faster than the computer can read it from the FIFO (first-in-first-out) input buffer.
    You can see this document:
    Error 200141 Occurs When Doing Buffered Event Counting
    http://digital.ni.com/public.nsf/allkb/83656593DCF​1FB0F862570B6004D7222?OpenDocument
    and this forum :
    Buffer Overflow -200141
    http://forums.ni.com/t5/Measurement-Studio-for-VC/​Buffer-Overflow-200141/m-p/607234
    I hope that these links can help you.
    Regards

  • What are the 3-bit field choices for Hw_Arm_Sel in PCI-6601

    Hi,
    I am programming our own driver to operate the PCI-6601. For our application we need hardware arm option. I know it is possible to use 2 counters for that, but NI-TIO should support also hw_arm. Although it is not explained in the registry document at all, after some tedious check in the DDK examples I found that this bits are located in the Gi counting mode register. I know the position of the HW_enable as well as the position of the 3 bits for pin sellect options. What I do not know is What are the 3-bit field choices for Hw_Arm_Sel . I contacted NI support but got no support. How can NI sell boards and when a customer who is not using LAbview or Measurement Studio or DDK, but is implementing his own driver is then so arrogantly turned down from NI? Also, how can NI publish just part of the registers the board support, and when a customer contacs and asks for some registers get not at all support? I can not foretell the missing registers, and it is pretty unprofessional to document just partly the registers of 660x devices. And on request you got nothing.
    I hope someone from the community know about this Hw_Arm_Sel 3 pin options. Otherwise, there is just an option of error and trial. Or simply throw the board in the garbage.
    Dr. Kirco Arsov
    Solved!
    Go to Solution.

    Hi Kirco,
    I have some more information for you :-)
    I haven't been able to speak to the developer who is the most familiar with TIO programming since he's out of the office, but I have come across his notes from when he was writing support for the DAQmx driver.
    As I described earlier, the HW_Arm_Sel bits don't select a connector I/O pin, but an internal trigger signal. There are seven internal trigger lines, and the HW_Arm_Sel bits map directly to the internal trigger signal: 0b000 - 0b111 map to 0d0 - 0d7. In order to route an I/O pin to an internal trigger, you must also write to a few more registers.
    From what I've read, there are two more register families that need to be programmed: TG_x_LevelEdgeReg and TG_x_CombinationReg, where x is the internal trigger number. In your case, you only need one pin from the I/O connector to be your arm start trigger, so TG_0_LevelEdgeReg and TB_0_CombinationReg will suffice for your application.
    TB_0_LevelEdgeReg :: Offset 0x660
    TG_0_LevelEdgeReg is only 8 bits wide, and maps as follows:
    7..6: EdgeMode
    5..0: LESel
    LESel selects the I/O connector pin to use as the source for the internal trigger signal. 0d0 - 0d39 will select the I/O pin of the same number. NB: behavior for TG_x_LevelEdgeReg is more limited for triggers 1-7, and only a small subset of the I/O pins can be selected for those trigger signals. Trigger 0 can use any I/O pin. Setting these bits to 0d63 forces the trigger source low, and can be used as a way to 'unroute' it when you're finished with your program.
    EdgeMode determines whether the TIO will detect an edge of the incoming signal, or just pass the signal level straight through. When detecting edges, it will latch the signal and generate a single TIMEBASE3 pulse instead. 0b00 sets level mode; 0b01 sets rising edge; 0b10 sets falling edge; 0b11 sets either edge.
    TG_0_CombinationReg :: Offset 0x6A0
    TG_0_CombinationReg is 32 bits wide, and has three fields of interest:
    19..16: CombFunction
    5..4: CombTypeB
    1..0: CombTypeA
    CombTypeA controls which trigger subsystem to use as the source for the trigger signal. Since you're coming from an I/O pin and using the edge/level subsystem, you must set these bits to 0b01.
    CombTypeB is similar to CombTypeA, and although you won't be using trigger B, set it to 0b01 to be safe.
    CombFunction performs a simple logic function on A and B. Since you're only using a single I/O connector, you only need the A output, so set these bits to 0b1100.
    All of the other bits should be set to 0b0.
    Unfortunately, I'm unable to test these statements since my test machine is currently being used for another research project. Please let me know what happens if you decide to test.
    Joe Friedchicken
    NI VirtualBench Application Software
    Get with your fellow hardware users :: [ NI's VirtualBench User Group ]
    Get with your fellow OS users :: [ NI's Linux User Group ] [ NI's OS X User Group ]
    Get with your fellow developers :: [ NI's DAQmx Base User Group ] [ NI's DDK User Group ]
    Senior Software Engineer :: Multifunction Instruments Applications Group
    Software Engineer :: Measurements RLP Group (until Mar 2014)
    Applications Engineer :: High Speed Product Group (until Sep 2008)

  • PCI-6601 - Group Config error -10444 after 9 hours running

    We developed a vi in order to acquire from the unique dma channel of the PCI-6601 counter 4 multiplexed inputs for a period measurement. We use the national VI buffered_measured_period_TIO. Each cycle the VI is supplied with one of the 4 input line.
    Everything works fine until the 32211 second of measurement (about 9 hours) and after we receive the -10444 error on the group config block and the card freezes (not the software). We need to switch off and on again the PC to start again.
    The cycle of measurement is exactly the one from the original Ni Vi and each cycle the reset is performed.
    Looking in the database we found a similar problem after a long running (10hours) and a PCI-6602.
    We suppose that after s
    everal initialization some internal counter goes in overflow (maybe the TAskID counter?).
    Does exist any explanation and workouround to solve this?
    Is it possible initialize the card only one time for the 4 channel and how?
    Regards
    Andrea Pede

    Hi Andrea,
    What is probably happening is that your memory is becoming increasingly fragmented and after 9 hours there are no continuous blocks of memory available. If you are continuously reconfiguring your counters, that is what is morelikely causing the problem. I included an example that uses all 8 counters and only needs to configure them once. A couple other suggestions:
    1) What happens when you create a larger buffer? Can you run the program for longer?
    2) Have you tried running a disk defrag program on your memory? One suggestion I found on the net was mem-turbo from a shareware site.
    3) What happens if you only use 1 counter? Does the error still occur?
    4) Some issues (including error 10444) with the NI-DAQ driver and analog input were solved
    by upgrading to NI-DAQ 6.9.3. What is your current computer configuration (software, hardware, driver version etc.)? This might help narrow the problem down.
    Simultaneous Buffered-Event Counting on All Eight Counters of the 6602 or 6608 Devices
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3DC9F56A4E034080020E74861&p_node=DZ52325&p_source=External
    Hope that helps. Have a good day.
    Ron
    Applications Engineering
    National Instruments

  • Pci 6601 for decoding renishaw and new encoder

    i have a pci 6601 and scb 68 that was recommend for decoding a renishaw encoder.
    it works great for determing the position of the renishaw.
    the renishaw encoder type is
    rgh24x30a00a
    http://www.renishaw.com/en/rgh24-linear-encoder-system--6444
    i would like to try the pci 6601 on a similar encoder.
    With this new encoder, im not seeing any output from the pci 6601. 
    I can see the pulses on the oscilloscope so im alittle confused.
    The pulses appear center around 2.5 volts and are around 1v in amplitude.
    In the same manner as with the renishaw, B- goes to counter 0 aux, a- to 0 source, and grond to ground.
    I believe the particular renishaw has a 1v peak to peak sinusoid pair (sin / cos).
    The new servo has a build in encoder with one volt peak to peak sinsuoid centered at 2.5v.
    Any ideas on why no counter number is showing?
    Message Edited by jimmyinct3 on 11-14-2009 05:57 PM

    If the signal is centered around 2.5V as mentioned, then it sounds like you will have difficulty meeting the TTL thresholds for hi/low. A TTL input signal is defined as "low" when between 0 V and 0.8 V with respect to the ground termina...  Scope both encoders and compare the signals that you are seeing on both.  What are the differences?
    Regards,
    h_baker
    National Instruments
    Applications Engineer
    Digital Multimeter Resources

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

  • Cartes compteurs carte PCI 6601

    Bonjour,
    Je souhaiterais compter le nombre d'implusion d'un signal carré. Pour cela j'utilise la carte PCI6601 avec la carte de comptage SCB-68. Comment faire pour configurer la voie sur laquelle on récupère le comptage? et comment récupérer cette valeur, y'a t'il des configurations spécial?
    où puis-je trouvé des exemples sous labview 7?
    merci de votre réponse.

    Divers exemples sont livrés avec LabVIEW.
    Pour la version anglaise de LV 7.1 :
    Menu de LV --> Help --> Find examples --> Onglet "Browse" --> Browse according to : Task --> Hardware Input and Output -->
    Pour DAQ traditionnel :
    Traditional DAQ --> Counters --> NI-TIO --> Count Edges (NI-TIO).vi
    Pour DAQmx :
    Daqmx --> Counter Measurements --> Count Digital Events --> Count Digital Events.vi
    Ces deux exemples fonctionnent avec la PCI-6601 et donnent les indications nécessaires pour le câblage et vous serviront donc de point de départ pour réaliser votre application.

  • How do I read the firmware revision of a PCI-6601?

    I need to read the firmware revision of my PCI-6601 card. I cannot find any reference to this in the NI-DAQ Function Reference Help document nor in the Measurement and Automation Test Panel.
    Thank you for your help!

    My company's Quality Assurance people require that we know the hardware and software revisions of every card we use. Thank you for letting me know that there isn't a revision of the software in the PCI-6601 card. That explains why I wasn't able to read it.

  • How to switch multiple relays using PCI 6601 DAQ card

    What is the specification of the digital output value given from the PCI 6601 DAQ card?How to develop LAB VIEW code to switch a relay?Can anybody please explain?

    Hi hasi,
    did you read the manual and the specs of the PCI6601? It says: "5V TTL/CMOS compatible"...
    You shouldn't expect to much current from a simple DO pin - probably it's not enough to drive your relay!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Work with PCI-6052E and PCI-6601 simultaneously

    Hi, I'm working with PCI-6052 for bufered data output and PCI-6601 for read two encoders at same time, when I work with single board I don't have problems but when I work both simultaneously I have a problem only I can out data or only I can read the encoders but not both at the same time. How I make this?

    Hi,
    You probably have one task in LabView running in series after the other. Both of these tasks require a loop. Your buffered data output needs to be written in continuous fashion in a loop (I believe) and your encoder measurements are being read constantly as well (should be in a loop). Try experimenting with these two suggestions.
    I would copy both programs into 1 VI and keep them running completely separate. LabView will be able to assign each a different thread so they should be able to run completely in parallel. Therefore you would have 2 parallel loops that are not connected at all.
    You can also create two completely different VIs and run them in parallel. There is no reason why the two different programs would interfere.
    Hope that he
    lps. Have a good day.
    Ron

  • Is it possible to generate pulses on a ctr out and simultaneously read them on another ctr input using one NI PCI-6601?

    Hi,
    I am trying to output a pulse train on ctr0 OUT and I want to receive them on CTR1 SOURCE of the same NI PCI-6601 card, but no use! :-(
    The pulses are generated OK, but the acquisition fails within timeout (10 sec.). The generated signal has 1 Hz frequency and 20usec high time. I've studyed the NI examples for this.
    Can anyone help me, please?

    Hi Julien,
    I can post the code, but actually, it worked! I was making a loop between CTR0 OUT and CTR1 SOURCE and it didn't work. I made a loop CTR0 OUT <-> CTR1 GATE and it worked like a charm! As far as I read in the NI PCI-660x manual, I cand loop to either SOURCE or GATE pins and the pulses' acquisition should work anyway.... Maybe I am wrong. Can you explain me why it didn't work on the SOURCE pin?
    Thank you very much for your tine!
    Regards,
    Marles

Maybe you are looking for