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

Similar Messages

  • How do I read DAQ at every state change on a quad encoder over RTSI

    I have successfully routed either A or B encoder phase to the DAQ card over RTSI, but this gives you 1/4 of your encoder counts to the DAQ. Is there a way to trigger the DAQ clock with both the rising and falling edges, A and B signals so you get a DAQ reading with every encoder count?

    mikema111,
    From your explanation I am assuming that you are using an X4 encoder. Unfortunately there isn't a way to combine both Phase A and Phase B (rising and falling edges) into a DAQ scan clock without external circuitry.
    However, one possibility would be to use a sort of XOR circuit to merge the two phases into one signal and then pass that signal into one of your analog input channels. You could then setup that analog input channel for windowed analog input triggering. As the TTL pulse rises through the window an AI Start Trigger pulse is generated and then another pulse is generated as it passes back down through this window. Pass the AI Start Trigger pulse into a counter setup for retriggerable single pulse generation and you will have your DAQ scan cloc
    k on the output pin of the counter.
    If you are just interested in counting the pulses in both Phase A and Phase B you can configure one counter to count on the rising edge and the other on the falling edge as described in the following Knowledge Base:
    http://digital.ni.com/public.nsf/websearch/15170E05F0F4B65C86256E2400812CD9?OpenDocument
    I also recommend reading the following document that discusses several different options when using a quadrature encoder with an E Series board (DAQ-STC).
    http://zone.ni.com/devzone/devzoneweb.nsf/Opendoc?openagent&36BD71244BB26FC886256869005E541B
    Ames
    Applications Engineering
    National Instruments

  • (pci-6052E) I want to genarate a pulse every time the counter is zero.

    I'm using the counter on my pci-6052E to count the number of pulses on a line. The count goes up and down since I have a direction signal. Now I need and indication (a pulse) every time the count reaches zero. This is similar to the breakpoint function on your motion controllers. Is this possible....

    Yes you can, and here's an example that worked with DAQmx on an E-series board. Ctr0 counts edges of the internal 20 MHz timebase, rolling over to 0 a little more than once a second. It uses the DAQmx Export Signal property node to program the counter to Pulse on reaching TC (terminal count). The pulse signal is sent to a terminal that Ctr1 uses as its source, so Ctr1 increments each time Ctr0 reaches terminal count (0 value).
    -Kevin P.
    Attachments:
    TC Pulse.vi ‏81 KB

  • 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

  • How can I use counters to read the difference between two expernal pulse signals?

    I generated a pulse signal and sent it to a sensor which in turn gives me a pulse signal back. I need to read the time from which the sent the signal goes high to the time that the signal is returned. How can I read this? the diagram is attached
    Attachments:
    Timing_Diagram1.doc ‏256 KB

    Hello;
    The way to accomplish that is by using one of the 660x boards, and configure the counter to do "Edge Separation Method".
    That method will increment the counter event count value every time a pulse comes into its source input. The counters only increments between the rising edge of the aux line and the rising edge of the gate. The current value of the counter is read when the counter is finished or an error occurs. You need to wire the out pulse to the AUX line, and the return pulse to the gate line of the counter.
    Hope this helps.
    Filipe A.
    Applications Engineer
    National Instruments

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

  • Ramping a pulse signal using PCI-6602 card

    I'm controlling a stepper motor and need a continuous pulse output with variable frequency. I need to accelerate and decelerate teh motor (It can't start immediately at a high frequency but needs to be ramped up to it). I can't have any hiccups in the signal or the motor can stall. It seemed I had my own ramp program written (which gradually increased the frequency value sent to the counter) to solve this problem, but when I switched to Office2000 I started getting hiccups in my signal. I also have a PCI 1200 card and could use A/O but I think using the counter signals would be better. If I'm wrong let me know. Once I have the motor up to speed I am reading in a pulse signal to analyze with FFT.
    thanks for y
    our help.

    A few thoughts & musings, hope some of them are useful:
    1. The sequence for setting a new frequency should be to first load up the new pulse specs (use 1 & 2, not 3 & 4), then issue the "switch cycle" command to 'Counter Control.vi' You can look at NI's example program called 'Pulse Width Modulator' to verify syntax.
    2. If your frequencies are low enough and your loop time is fast enough, you may be trying to update the pulse specs before the previous specs have completed a full cycle. This has traditionally been a no-no, though I'm not 100% sure that it remains one with the latest NI-DAQ drivers.
    3. No ideas about the possible interaction with MS Windows and/or Office 2000. Haven't used either.
    4. (My own latest installment in a multi-year running gripe at NI): Wh
    en oh when will we be granted the ability to perform buffered counter OUTPUT operations? Just as in the analog world, one can acquire a signal with AI and then reproduce it with AO, it would be REALLY REALLY handy in the counter world to measure with buffered semi-periods and then reproduce the same pulse train with a buffered output.

  • How can analog signals are measured every several counters from Quadrature Encoder using USB-6221

    how can I sample analog signals every counters from quadrature encoder using usb-6621?

    There is a well documented example of what you are trying to do at :
    http://zone.ni.com/devzone/explprog.nsf/webmain/DD85F07A7CA99F8F862568690062DE54?opendocument
    Don't be afraid because of the BNC-2120. It is just used in this example to simulate the pulses from a device. So it is not needed in your case. Obviously, you will need to change the number of increments/rev according to your encoder to get correct RPM values.

  • How can I use counters to read the difference between two external pulse signals?

    I generated a pulse signal and sent it to a sensor which in turn gives me a pulse signal back. I need to read the time from which the sent the signal goes high to the time that the signal is returned. How can I read this? the diagram is attached
    Attachments:
    Timing_Diagram1.doc ‏256 KB

    There is vi called "Two Edge Separation Mesurement (NI-TIO).vi". In LV6.1 it is in "c:\...\LabVIEW 6.1\Examples\DAQ\Counter\ni-tio.llb".
    Unfortunately this function has no timeout. This means that your program will hang on if there are no pulses. I have attached an improved version of this vi with a timeout(sorry for the french text in the description). There are also some other improvements like the calculation of the edge separation in seconds (not only clock counts).
    This function will only work with NI-TIO cards (like 660x).
    Attachments:
    Two_Edge_Separation_Measurement_with_Timeout_(NI-TIO).vi ‏103 KB

  • HT204407 I updated to the latest IOS (5.1.1) today and since then Find my friends hang at "signing in" hangs during signing in. I can't back up & start over, every time I open the app, it's hanging there. Can I clear this without losing everything?

    I updated to the latest IOS (5.1.1) today and since then Find my friends hang at "signing in" hangs during signing in. I can't back up & start over, every time I open the app, it's hanging there. Can I clear this without losing everything, including the friends that have already accepted me?

    The Basic Troubleshooting Steps are:
    Restart... Reset... Restore from Backup...  Restore as New...
    Restart / Reset
    http://support.apple.com/kb/ht1430
    Backing up, Updating and Restoring
    http://support.apple.com/kb/HT1414

  • HT4623 I still can't update, i get error 3252 every time, after over 500mb is downloaded, not happy to waste all the data i could use for other things

    I still can't update, i get error 3252 every time, after over 500mb is downloaded, not happy to waste all the data i could use for other things.
    is there another way i can download the update? it just never work, tried multiple time

    The most common causes are:
    Your antivirus, firewall or router security is blocking access to Apple's servers - try temporarily disabling them - if you have Kaspersky this is definitely the problem
    At some time in the past you used this computer to jailbreak, unlock or otherwise hack ANY iPhone, iPod Touch or iPad - if this applies to you your hosts file is corrupt and you will have to edit it and remove any lines that contain "gs.apple.com"

  • Can NI 6601 (PCI, 4-channel) card be used with Lookout 5.1?

    I need a fast counter like NI 6601 PCI Card to work with Lookout 5.1. Is there any driver for this card? Any other computer card like this one can be used with Lookout?

    No, the NI 6601 cannot be used with Lookout. The reason is because Lookout uses the the NI-DAQ OPC server to communicate with DAQ devices through virtual channels, but you cannot have a virtual channel for a counter. Therefore, counters (such as the 6601) cannot be used in DAQ OPC, and hence cannot be used in Lookout. The following KnowledgeBase discusses this topic:
    http://digital.ni.com/public.nsf/websearch/505D2E9A1617B5F686256A1B00574777?OpenDocument
    LabVIEW would be an excellent software option for counter applications using the PCI-6601.
    Regards,
    Jeff M.

  • 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

  • Can I generate pulse trains on more than one counter output at the same time?

    I have a PCI 6601 card with a BNC 2121 to connect the signals to two devices. The card is used as a trigger for both devices and I want to be able to generate pulse trains on two output channels at the same time, with a time delay between the two. How do I do that in Labview 7.1 Development with DAQmx?

    I feel foolish for not being able to figure this out, but it still doesn't work. Attached is the VI I use now. Counter 0 generates a finite pulse train and I programmed Counter 1 to generate a retriggerable single pulse triggered by CtrOinternaloutput. I still get the same error message: -50103 The specified resource is reserved. The operation could not be completed as specified.
    The same happens if I set the trigger for counter 1 at PFI36 (default output of counter 0) or any other PFI line. If I try a pulse train generation on only one of the counters, both work fine.
    If I try the example in traditional DAQ for multiple counter outputs with phase delay, it works fine.
    Can you tell me what I'm doing wrong?
    Attachments:
    Shutter_AND_lamp_trigger.vi ‏103 KB

  • 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

Maybe you are looking for

  • I deleted some apps in Firefox 4, opened 3.6, closed it, and opened 4 again. But now Firefox 4 is having some severe problems.

    After doing what I described in the thread title, Firefox 4 presented the following issues: 1- Tabs would not close. 2- The "forward" and "back" button would not be lit or clickable, as if I didn't visit any websites. Although pages did load, I could

  • Capturing Issues

    Setup: Mac Pro 2X2.26 Ghz Quad Core Xeon Mac OSX v. 10.6.5 FCP: v. 7.0.3 AJA Kona LHi Capture Card AJA KLHi Breakout Box Problem: Whenever I capture anything through my AJA Kona LHi Capture Card, I have an issue of a thin strip of distorted lines at

  • XSLT Mapping Senario

    Hi Experts! How can  achive this through XSLT Mapping??? My Source  XML file : --<ROOT>           --<A>                <A1> </A1>               <A2> </A2>         </A>        --<A>                   <A1> </A1>                   <A2> </A2>            

  • Unable to Access the home page of oracle  10g express edition.

    I have installed enterprise manager 10g and also express edition 10g .But after installing the enterprise manager 10g and trying to access the url http://127.0.0.1:8080/apex .The xdb username and password is prompted.I deleted the entry in init.ora f

  • Fi terms

    Hi Experts, Can you explain the meaning of the following FI terms in detail... CO PCA Aged Debt Supplier Payment Shared Accounts Customer Balance Thanks for all your help.