6602: How to use 8 counters simultaneously in C++ using traditional Daq for frequency measurement

Hi Everybody;
I'm new to Ni-DAQ cards and working on NI PCI-6602 Card in Borland C++, I should use Traditional DAQ for my project. Now I want to use all the 8 counters simultaneously for frequency measurement.
1.Where should I connect my External signal, to source or gate, at present I have connected to source.
2. How to set parameters and start the counters simultaneously, what are the parameters to be set for frequency measurement.
3.How to start counting.(parameter settings)
4.Should I set any PFI Lines or by default are they set to counters.
status = GPCTR_Set_Application (1, gpctrNum, ND_SIMPLE_EVENT_CNT)
status = GPCTR_Change_Parameter (1, gpctrNum, paramID, paramValue)
iStatus = GPCTR_Watch(1, gpctrNum, ND_ARMED, entityValue);
status = GPCTR_Watch (deviceNumber, gpctrNum,ND_COUNT, entityValue)
what is the paramID in my case, Clear and appropriate answers would be very helpful and thanks in advance.
Message Edited by Pavan K on 07-11-2009 12:38 AM

  I have made a program with LabVIEW 5.1 based on NI 6602, in which four counters were used.
  Counter 3 is used to generate pulses, which are directed to the gates of counter 0, 1 and 2. 
  The source terminals of counter 0,1 and 2 receive pulses, individually, to count how many pulses appear during the time interval of each gate pulse.
  The results are stored in a data file.
  In order to test its performance, only one signal of ramdom pulses is sent to counter 0,1 and 2.
  But I find that at the beginning the counts for the three counters are the same, but the following counts are totally different!
  What's wrong? And how to solve such a problem? Does it have something related with synchronization?
  Thank you very much!

Similar Messages

  • How to simutaneously use 2 PCI cards, one with traditional DAQ, the other with DAQmx?

    Hi,
    I am currently trying to debug a system that used to work.. but sadly isnt anymore
    A single computer contains 2 PCI cards (6110 & 6036E). The 6110 card is controlled by a fairly old software, programmed in labview, and hence, using Traditional NI-DAQ. The 6036e card is controlled by a more recent soft, programmed in LV as well but using DAQmx.
    the AI/AO of the 6110 card is only momentarily used (20 sec consecutively, every minute) while the 6036E card is continuously receiving and sending data on its AI/AO.
    Now the problem: the program that control the 6036E card freezes every time that the old prog access the 6110 card.. and then it works again perfectly until the next time that the 6110 card is used.
    So my question: how can I make those 2 cards work simultaneously?
    I dont think that it is because of the software nor because of the computer lack of memory/CPU if it used to work in the past. It might be about a wrong configuration of cards in the MAX but I couldnt find anything wrong there (no problem when accessing AI/AO of both cards through "test panel")
    Thank you very much for you help.

    That's what bugs me. The only thing that those 2 cards share is an AO of the 6110 connected to an AI of the 6036.
    For the rest, nothing is common. The 1st program only deal with device1, while the 2nd prog only access dev2. There shouldnt be any problem and everything is working fine separately. Hence, why I was wondering if the traditional daq and daqmx might conflict on a same computer.
    I just cant find out why the 2nd program controling the daqmx card just freeze everytime the 1st program access the traditional card. It actually doesnt freeze completly but becomes soooo slow, with about only 2 iterations of the main while loop during those 15-20 sec (instead of the normal 3-4000 iterations during such a period).
    The computer specs are a 2.2ghz proc for 1G of ram and running XP, so it should be ok.. even though the computer does slow a bit down when the 1st prog access the traditional card.

  • How to use a photogate for frequency measurement using a NI USB-6211

    Hello, I am extremely new to LabView and am having trouble using the counter feature (or if this is even what I should be doing). I am trying to use a photogate as a frequency counter when a voltage spike is created by blocking the sensor. This will then be put into RPM and used to evaluate a small motor dyno I am creating. If anyone has any help or previous vi's they dont mind sharing it would be greatly appreciated. The photogate specifications are for an optek opb930l55. Thanks 

    Configuring a counter input task will be a little different depending on the type of DAQ card that you are using to read the digital pulses.  You just need to wire the voltage from the photogate to one of the counter pins on the card.  Then follow one of the many examples for measuring the frequency of pulses.  If your card allows it, I would suggest choosing the Counter Input >> Frequency measurement from the DAQmx Create Channel VI.  If you have questions about how to do this with your specific DAQ device, please provide more information
    Zach C.
    Field Engineer
    Greater Los Angeles

  • I want to acquire data for multiple channels using PCI 6120 that works on traditional DAQ. I cannot access more than one channel, can someone help me or if someone has data acquisition vi for PCI 6120, please send me over . Thanks

    I have PCI 6120 card and I want to acquire data for more than one channels. I'm using traditional DAQ to get it. But it does not work for more than one channels. If someone has a data acquisition vi for PCI 6120. Or some suggestion how to aquire data please let me know.
    Thanks

    Hello DSPGUY1,
    You can definetly acquire from several channels. For your convenience, I have appended below the content from help that tells you how to configure it:
    "channels specifies the set of analog input channels. The order of the channels in the scan list defines the order in which the channels are scanned during an acquisition. channels is an array of strings. You can use one channel entry per element or specify the entire scan list in a single element, or use any combination of these two methods. If x, y, and z refer to channels, you can specify a list of channels in a single element by separating the individual channels by commas, for example, x,y,z. If x refers to the first channel in a consecutive channel range and y refers to the last channel, yo
    u can specify the range by separating the first and last channels by a colon, for example, x:y."
    Hope this help.
    Serges Lemo
    Applications Engineer
    National Instruments

  • Doing Data acq. and buffered period measurement using counters simultaneously, gives an buffer overflow error

    Iam doing Data acquisition using NI-PXI 4472 and buffered period Measurement using NI-PXI 6602 simultaneously,my program gives an buffer overflow error

    murali_vml,
    There are two common buffer overflow and overwrite errors.
    Overflow error -10845 occurs when the NI-DAQ driver cannot read data from the DAQ device's FIFO buffer fast enough to keep up with the acquired data as it flows to the buffer (i.e., the FIFO buffer overflows before all the original data can be read from it). This is usually due to limitations of your computer system, most commonly the result of slow processor speeds (< 200 MHz) in conjunction with PCMCIA DAQ boards, which have small FIFO buffers (e.g., the DAQCard-500). Sometimes using a DAQCard with a larger FIFO can solve the problem, but a better solution is to lower the acquisition rate or move to a faster system. Another cause of the -10845 error could be due to an interrupt-driven
    acquisition. For example, PCMCIA bus does not support Direct Memory Access (DMA). If the system is tied up processing another interrupt (like performing a screen refresh or responding to a mouse movement) when it is time to move data from the board, then that data may get overwritten.
    Overwrite error -10846 occurs when the data in the software buffer that you created for an analog input operation gets overwritten by new data before you can retrieve the existing data from the buffer. This problem can be solved by adjusting the parameters of your data acquisition, such as the lowering the scan rate, increasing the buffer size, and/or increasing the number of scans to read from the buffer on each buffer read. Additionally, performing less processing in the loop can help avoid the -10846 error.
    See the NI-DAQ Function Reference Manual for a listing of all NI-DAQ error codes.
    Have a great day.

  • Sampling frequency when using USB6251 for SemiPeriod measurement

    Hi there.
    I am using the USB-6251 for frequency measurement. I use C# and the latest 8.5 drivers for .Net 3.5.
    My question is this:
    I have CounterInputChannel with MeasurementType=SemiPeriod.
    The TimeBaseSource is "80MHzTImebase" and Prescaler is 1.
    The reported minimum (CICHannel.Minimum property) is 25ns - 40MHz
    I am measuring frequency on a 32.768kHz crystal which should be pretty stable and accurate. The measurements suggest that the samplerate is actually 20MHz, not 40MHz. This also makes sense, because if I try to create a frequency measurement, I am forced to use a divisor of 4 or more - which gives a sampling rate of 20MHz.
    So my question is this: Is the reported minimum as read from CIChannel.Miminum wrong?

    Additional info,
    I downloaded and ran the DAQ diagnostic Utility v1.0 and got the following results, see below
    Regards,
    runson
    9/16/2005 6:54:58 PM
    Results saved to:  C:\Documents and Settings\Runson\My Documents\Diagnostic Results.txt
    Selected Device: Dev1
    Device Type: PCI-6250
    Serial Number: DE4115
    Device Support: (PASS)
    NI-DAQmx Version: 7.5 (PASS)
    Device Reset: (PASS)
    The device was last self-calibrated on: 9/15/2004 5:04:09 PM
    Running Calibration ...   (PASS)
    -------------------- Testing Counters... --------------------
    Testing CTR Buffered Pulse Generation...   (PASS)
    Testing CTR Single Pulse Generation...   (PASS)
    -------------------- Testing Analog Input... --------------------
    Testing AI Ground Reference...   (PASS)
    Testing AI Voltage Reference...   (PASS)
    Testing AI Finite Sample Clock...   (PASS)
    Testing AI Finite Sample Clock Frequency...   (PASS)
    -------------------- Testing Digital IO... --------------------
    Testing DIO Lines...   (PASS)
    Testing DIO Ports...   (PASS)
     ----- DIAGNOSTIC TEST COMPLETE -----

  • How can we substitute the invalid option "reset after read" in FP-CTR-500 + FP-1600 frequency measurement application?

    We nned to incorpore the values of 2 frequency signals (0-10 Khz)into a process controlled by a VisualBasic application running on 1 PC with W'95. Because the FP-CTR-500 working with FP-1600 hasn't the option "reset after read", the process of reading is a bit complicate, and sometimes, we receive wrong values of frequency from those devices. Could you help me? Is there any extremely reliable method of reading? Best regards,
    Puho

    For frequency measurement information on the FP-CTR-500/502 modules. Please see KnowledgeBase Article #1TB63SUS
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/d8db42f9fdc3607e862568640047f144?OpenDocument
    Ultimately, the FP-CTR-500/502 modules are not designed for frequency measurement, although it is possible to use them to measure frequency. The one thing is that it works best to do the measurements over relatively long integration periods (1/4 second or more).
    Regards,
    Aaron

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

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

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

  • PCI 6602:How can I use the digital lines of the board and in the same time to generate pulse train using a counter?

    Hello!
    My problem appeared when I tried to update my code from Traditional NI-DAQ Legacy to DAQmx.
    I am using 2 counters (counter 5 and counter 7)  from PCI-6602, to generate pulse train, and also the Digital I/O lines of the port 0 (the lines form 0 to 7). What I do in my application is that I am starting to generate the pulse train on the output of the 2 counters, and after that I am playing with the state of the digital lines.
    In traditional there was no problem using the counters and the digital lines in the same time, everything was going perfectly, but in DAQmx this is not possible.
    What happens: I start to generate pulse train on the output of the counters,  no errors encountered, but when I try to modify the state of one line of the digital port the generation of the pulse train is stopped. This is happening when I start the task associated to the digital port.
    My question is: it is possible to create a channel on the digital lines without altered the channels created for the counters?
    Another thing what I manage to see using the  "Measurement & Automation Explorer" and Test panels for PCI-6602, basically is the same thing, I generate pulse train on the output of the counter 7 and try to start a task on the digital line, but I get one error :
    "Error -200022 occurred at Test Panel
    Possible Reason(s):
    Measurements: Resource requested by this task has already been reserved by a different task.
    Device: Dev4
    Terminal: PFI8"
    Instead if I use the counter 0 or counter 1 to generate pulse train I don't encounter the same problem.
    Which resources are used by the counters 2 to 7 from the PCI-6602 board and the counters 0 and 1 do not use?
    Thank in advance for any replies!
    Ciprian
    Solved!
    Go to Solution.

    Hello Jordan, thank you for your reply.
    I am sorry but I can not see or run your example, I don't use LabView, I use Visual C++ for developing.
    Here is the code for generating the pulse train:
    GeneratePulseTrain(unsigned long ulCount1, unsigned long ulCount2)
        short nStatus = 0;
        nStatus = DAQmxCreateTask("",&m_taskHandle);
        nStatus = DAQmxCreateCOPulseChanTicks (m_taskHandle, "Dev4/count5", "", NULL, DAQmx_Val_Low, 0.0, ulCount1,ulCount2);
        if( bTriggerMode == true) // if hardware trigger is enabled
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_ArmStartTrig_Type, DAQmx_Val_DigEdge);
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_DigEdge_ArmStartTrig_Edge, DAQmx_Val_Rising);
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_DigEdge_ArmStartTrig_Src,"Dev4/PFI17" );
        //set the internal timebase
        nStatus = DAQmxSetCOCtrTimebaseSrc(m_taskHandle,"Dev4/count5","20MHzTimeBase" );
        nStatus = DAQmxStartTask(m_taskHandle);
        return nStatus;
    And the code where I try to set the digital line:
    SetChannelState(short nState)
        short nStatus = 0;
        uInt8 wrtBuf0[1]={0};
        nStatus = DAQmxCreateTask("",&m_taskHandle);
        // Configure line as output 
        nStatus = DAQmxCreateDOChan (m_taskHandle, "Dev4/port0/line0", "", DAQmx_Val_ChanPerLine);
        nStatus = DAQmxStartTask(m_taskHandle);
        wrtBuf0[0] = nState;
        nStatus =DAQmxWriteDigitalLines (m_taskHandle, 1, 0, 0, DAQmx_Val_GroupByScanNumber , wrtBuf0, NULL, NULL);
        nStatus = DAQmxWaitUntilTaskDone(m_taskHandle,10);
        nStatus = DAQmxStopTask(m_taskHandle);
        nStatus = DAQmxClearTask(m_taskHandle);
        m_taskHandle = 0;
        return nStatus;      

  • How to use counters

    I have a little problem. I need to use this formular in my query. I am working on Service orders (CS) based on a Technician.
    Hours per Callout = Total hours/ Number of Jobs
    I'm not sure how to get the Number of Jobs for a technician. I thought about using counters but not sure how since the counter (1ROWCOUNT) is in the ODS and I'm running the report from a cube which doesnt have the counter.
    Any step by step advise would be appreciated

    Hi Sriram
    Actually, i am still creating the design doc and I know 1ROWCOUNT is usually in the DSO by default. But I want to push the data into a cube. But I'm not sure if i should just add the counter as you suggest. Also, I saw this document and not too convinced how this works in relation to what I want. What I want to do is just count the number of occurences for the technician. Does it make sense?
    How to…
    Count the occurrences of a characteristic relative to one or more other characteristics

  • Using Counters as Input & Output simultaneously

    Hello All,
    I am using PCI 6221 (68 pin), I am using one of the counters as inputting pulses to a servo, can I use the other counter "Counter 2" for counting thoses pulses which I am generating from "Counter 1", also I want to make it synchronized.
    As soon as I generate pulses my reading counter should start, anyone help me with some example.
    Using LV 8.0
    Thanks

    Hello James,
    If you are outputting a continuous pulse train then you should be able to use the second counter to read them back in.  If you're doing a finite generation to the servo motor then that task is actually using both counters (one counter gates the other:  How Many Counters Does Each Type of Counter Input or Output Task Take?).  Assuming that you do have an available counter then you can run any of the single counter input tasks listed in the above KnowledgeBase article.  There are a number of counter input task examples in the LabVIEW Example Finder that you can access by opening LabVIEW and going to Help» Find Examples...  Then navigate to Hardware Input and Output» DAQmx» Counter Measurements.  From there you'll need to find the example for whatever type of measurement you want to do.
    Synchronization is a different issue.  In general synchronization requires that two tasks start at the same time and share a timebase.  In this case, you can start the counter input task first since it will be waiting on the counter output to start measurements.  Then, if you do a buffered counter input measurement (see example finder--you'll need to set up an implicit sample clock), you'll get exactly one counter input measurement for each period of the counter output.  This happens because for frequency/period/pulse width the counter latches one value on each rising or falling edge so the measurements are automatically synced.
    I hope this helps, and have a great day!
    Brooks

  • 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 to generate a delayed retriggerable pulse using only one counter with PXI 6070E card

    Hi
    I have a problem in generating a retriggerable delayed pulse with a single counter(triggered through a signal at gate) using PXI 6070E card. VI was developed in NI LabVIEW traditional DAQ Ver.7.1. I have used the "delayed pulse generator config" VI and a "Start counter" & "Stop counter" VIs for the purpose. But there is no output seen at the out terminal of counter. So I introduced a "wait" VI and set it to 1 sec. Now the pulse output appears but some pulses are missing mometarily after every 1 sec interval. (any solution for this)
    I have gone through a few similar requests in the forum but they suggest either to use two counters or to generate a finite pulse train which does'nt fit my application. Moreover PXI 6070E has only 2 counter timers. I am already using one counter to measure the frequency of a pulse train(signal 1). The application requires to generate a delayed retriggerable pulse for every pulse in signal 1. So I have only one counter left.
    Can I measure the frequency of signal 1 by analog means.? so that I can use two counters for pulse generation. (Signal 1 is a TTL signal).
    Request some help.
    Thanks in Advance
    Regards

    A finite pulse train (N_Pulses >= 2) does require the use of 2 counters on most of our older hardware including your 6070E.  If you're just talking about generating a single retriggerable pulse, you would only need one counter.
    Here's an example in Traditional DAQ that shows you how to set a retriggerable pulse generation (it also allows you to adjust the characteristics of the pulse on-the-fly).
    If you're writing a new program, you might consider switching to DAQmx as it supports NI's latest hardware and recent OSes should you ever need to upgrade.  Traditional NI DAQ is no longer in active development.  Here's an example of how to implement a retriggerable pulse generation in DAQmx.  You should take note that you can't use the two drivers to simultaneously talk to the same piece of hardware, although you should be able to go back and forth by resetting the Traditional DAQ driver before switching to DAQmx.
    Best Regards,
    John Passiak

  • Samples Not Acquired on NI 660x or NI 6624 Devices When using pulse width, semi-period or two-edge separation buffered measurements with the NI 660x and NI 6624 on counters 0 and 1, some samples may not be acquired under certain circumstances.

    In the DAQmx 9.4 Readme the following is stated:
    Samples Not Acquired on NI 660x or NI 6624 Devices When using pulse width, semi-period or two-edge separation buffered measurements with the NI 660x and NI 6624 on counters 0 and 1, some samples may not be acquired under certain circumstances.
    Could anyone elaborate on this? I am particularly interested in knowing under what circumstances this problem arises for the 6602 PCI devices.
    How should I understand 'NI 660x and NI 6624 on counters 0 and 1'. Is it only a problem on counter 0 and 1 for the 660x or does this only apply for the 6624 devices.
    /mola 

    Are there any NI Product Support Engineers out there who has an answer to this question and who are willing to share it with me?

  • Digital stimulus-f​requency response: Need to drive with digital output trigger. Using counters for response.

    I need to drive stimulus-response with a software driven digital trigger and NI-TIO counter based response. No analog I/O is really relevant, although I have a PCI-6035E multi-function DAQ as part of my gear. I intend to use the analog, but its timing is non-critical and can be software timed.
    The real trick is that I want to set the basic timing of the system (in the range of 1 - 50Hz) from the timer0 on the 6035E. This signal needs to be replicated to drive a trigger pulse and to route through RTSI (or a PFI) to trigger frequency counts using the four possible groups of counter/timers on the 6602.
    What I need is:
    while( enabled )
    Repeat at (
    software controllable rate = 1-50Hz)
    Trigger Sets a PFI line for 10-20us
    same trigger sets an RTSI line
    - Software Set Delay (usually zero)- stable is more important than the delay time!
    Count for software set time on 4 counters
    analog samples
    Post-process
    I want to do this in LabView. I have checked out the Advanced sychronization demos online, but the examples all use analog triggering and buffered digital I/O. This doesn't really address what I need to do.
    I have made some failed attempts which relied on software to sync up the trigger and the response frequency acquisition. This is definately flawed. I need to start the counting right after setting the digital output trigger, and stop the count after a fixed interval for frequency calculation.
    I am having trouble working through the signal routing to get the timing to trigger off the digital stimulus output pulse.
    Any help would be appreciated
    Thanks,
    Joe

    Joe
    What are you using the trigger from the 6035E for? I do not know what you mean by, "to trigger frequency countes."
    If you are having problems just routing the signal to the 6602, here is a vi that shows you how to route a signal through the RTSI cable to use as the source of a counter.
    Brian
    Attachments:
    Route_RTSI_to_Source.vi ‏67 KB

Maybe you are looking for

  • Opening and Closing balances in RG1 register

    Hi, We are facing one issue in RG1 register. When we update and extract the RG1 register from system, its showing Sales Qty and Excise duties properly. But opening and closing balances are not coming, its showing zero there. I checked J_2IRG1BAL tabl

  • How to reverse J2IUN transaction and re utilization of J2IUN?

    Dear friends At my client place user run the J2IUN transaction in current date for the month of April 2009 utilization by mistake. Now it needs to be reverse and re utilize on 30th April 2009 date. I tried in the following way in testing client. I ha

  • Get PublishingRollupImage using REST?

    Hii Guys, I am developoing  a listing page of News using REST, the custom list contains Title, PublishingRollupImage, and other fields which is provided in the $select http://xyz/_api/web/lists/getbytitle('News')/Items?$select=Title,Link,PublishingRo

  • UK iPhone 5 Model In United States

    Hi there, anybody know whether I can buy a UK model iphone 5 in the United States? I am going there for christmas and want to buy one as I am curently not living in the UK.

  • How do I uninstall a program that is not listed in add/remove​?

    Running Windows 7 Home Premium 32-64bit. Hp p6210f.  Installed SIIG USB 2.0 video capture device.  Program installed but did not work. Downloaded updated driver to my desktop. The following icons appeared on my desktop: Applications, DirectX9, Driver