Counter/Ti​mer internal 80MHz using VC++ / DAQmx

Hello,
I would like to measure pulse width, using the internal timebase of a 6602 device with the DAQmx library availble in VC++.
So far, I managed to use the external PFI lines (using DAQmxSetCICtrTimebaseSrc function), but I need more precision and the internal 80MHz will be just fine.
--> How do I configure the counter to use the internal clock ?

You've posted this question to the wrong forum. This is for genreal feedback on the forums use and design. Try the Multifunction DAQ forum.

Similar Messages

  • Simultaneously run two counters with the internal 80MHz timing

    Hi, I have a programming problem about the NI PCI-6602 counter card. I want to use the internal timing signal (80MHz) as the source signal and feed two external signals to the two counters. The operation mode is the Buffered Period Measurement.
    I can succeed in one counter programming by using these old DAQ functions calls in sequences:
        iStatus = GPCTR_Control(iDevice, ulGpctrNum, ND_RESET);
        iStatus = GPCTR_Set_Application(iDevice, ulGpctrNum, ND_BUFFERED_PERIOD_MSR);
        iStatus = GPCTR_Change_Parameter(iDevice, ulGpctrNum, ND_SOURCE, ND_INTERNAL_MAX_TIMEBASE);
        iStatus = GPCTR_Change_Parameter(iDevice, ulGpctrNum, ND_GATE, ND_PFI_38);
        iStatus = GPCTR_Change_Parameter(iDevice, ulGpctrNum, ND_INITIAL_COUNT, ulInitCount);
        iStatus = GPCTR_Change_Parameter(iDevice, ulGpctrNum, ND_BUFFER_MODE, ND_CONTINUOUS);    
        iStatus = GPCTR_Config_Buffer(iDevice, ulGpctrNum, 0, ulCount, pulBuffer); 
        iStatus = GPCTR_Control(iDevice, ulGpctrNum, ND_PROGRAM);
        while(RunStatus)
           iStatus = GPCTR_Read_Buffer (iDevice, ulGpctrNum, readMode, readOffSet, NumPtToRead, timeOut, &NumPtRead, buffer);
           m_Chart1.DoPlot(); // Plot the data
      iStatus = GPCTR_Control(iDevice, ulGpctrNum, ND_RESET);
    But when using two counters, I tried to open two individual counter tasks by just doubling the codes above (each counter has independent DMA buffer). The program hanged forever. After debugging, the codes stop after it comes to read the 2nd DMA buffer (the 2nd line below).
      iStatus = GPCTR_Read_Buffer (iDevice, ulGpctrNum0, readMode, readOffSet, NumPtToRead, timeOut, &NumPtRead0, buffer0);
      iStatus = GPCTR_Read_Buffer (iDevice, ulGpctrNum1, readMode, readOffSet, NumPtToRead, timeOut, &NumPtRead1, buffer1);
    I also tried to check the labview codes that I have for the implementation of 2 counter measurement. There are two sets of function calls for each counter, "Counter Group Configure" -->"Source Slection" --> "Gate Selection" --> "Buffer Configure", in the same sequence structure, and two "Buffer Read" calls in a later, but also the same, sequence structure. My C programming is done just by following the labview codes above. But the labview program doesn't crash like the C program. Besides, one more question that I found is that I cannot find the fundtion "Counter_Group_ConfigInterface" inside the C function library. I tried to use the function "CTR_Simul_Op" but failed.
    So, my problem is that what's the problem about my C codes and how can I do the two counter measurement by the same internal timing base. Sorry to put all the problem in such a mess. If you need more information about my codes or my experimental requirement, please let me know. Thank you for your help!
    Sincerely,
    Jung-Cheng

    Hi Pavani,
    Welcome to the forums!  As a new LabVIEW user there are many helpful resources out there to get you started.  I would like to point you to the two links in my signature.  The first is a six hour LabVIEW course and the second helps you learn DAQmx.  Also take advantage of the shipping examples.  When you open LabVIEW select Find Examples to open the Example Finder.  Assuming you are using DAQmx, you can go to Hardware Input and Output>>DAQmx>>Counter Measurements and find many useful example programs that either do what you want or can be modified to perform the task you desire.
    To answer you question, two counters in the same loop do not affect each other.  The counters will gather data separately.  By putting them in the same loop, you just perform the reads in software at the same time.
    Regards,
    Ima
    Applications Engineer
    National Instruments
    LabVIEW Introduction Course - Six Hours
    Getting Started with NI-DAQmx

  • Frequency divide by N doesn't work on Counter-Ti​mer PCI-6602

    Hello everybody,
    I tried to do something basic ( ?) with this Counter-Timer 6602 Board, and it doesn’t work.
    So I hope some people with more experience than me could understand what happens here.
    1) What I need:
    I need to generate 4 synchonised clocks, whose periods will be multiple of 1 ms.
    2) What I have:
    LabVIEW 7.0 and a PCI-6602 Counter-Timer Board in a DELL PC running under XP pro.
    The PCI-6602 Counter-Timer Board has 8 counter timers named CTR 0, CTR 1, ... CTR7.
    3) What I have already done, and that worked:
    - Generate a 1 kHz “Master Clock” signal from CTR 4, configured by “Continuous Pulse Generator Config.vi” (found in “Data Acquisition, Counters...).
    - configure CTR 0 and CTR 1 to work as frequency dividers, by use of “Down Counter or Divider Config.vi”.
    - Apply the output signal of CTR 4 (OUT ) to the SOURCE inputs of CTR 0 and CTR 1 by means of physical wiring in the SCB-68 connection box.
    When I do this, I get two nice secondary clock signals on my oscilloscope screen, ( with periods = 3 ms, or 5 ms or whatever multiples of 1 ms I choose) from CTR 0 and CTR 1 outputs , very clean and perfectly in phase with the 1 kHz Master Clock.
    So far, so good...
    But I still need 2 more secondary clocks...
    One would say: “No problem, do the same trick with two other counters...” Well, not so simple, it seems...
    4) What I tried to do, and that didn’t work:
    When I try to do the same frequency division with any of the remaining counters, (CTR2 to CTR7), the program stops and I get an error “ –10020 : Time base not valid “.
    I can’t figure out what happens here: I thought any counter could be configured to work as a frequency divider, but it seems not to be so, and I am stuck here.
    Has anyone an idea about how to fix this type of problem?
    Attached file: hor_div02New.vi
    Attachments:
    hor_div02New.vi ‏123 KB

    karolik,
    I'm just adding a followup in English. As Marc L. mentioned, the particular vi named "Down Counter or Divider Config" isn't compatible with the 6602. While the 6602 does have the ability to generate 4 synchronized clocks, a different syntax is needed. Here's how I'd do it:
    Traditional NI-DAQ
    1. Configure a continuous pulsetrain on CTR 4. Route its output to, say, RTSI 4. Don't start it yet.
    2. Configure CTR 0,1,2,3 for continuous pulsetrains using RTSI 4 as their "timebase source." Start them.
    3. Start the CTR 4 pulsetrain.
    4. Now CTR's 0-3 should generate separate clocks with synchronized phasing.
    DAQmx
    1. Configure a continuous pulsetrain on CTR 4. Don't start it yet.
    2. Configure CTR 0,1,2,3 for continuous pulsetrains using "Ticks" for units. Use a DAQmx property node (probably Channel property node, but am not 100% sure and don't have a LV PC handy to check) to specify that the "ctr4 internal output" should be used as the timebase. Start them.
    3. Start the CTR 4 pulsetrain.
    4. Now CTR's 0-3 should generate separate clocks with synchronized phasing.
    -Kevin P.

  • Change pulse width in a continuous generation using an array of High/Low Times using NI-DAQmx

    Hi,
    I'm using a PCI 6259 (M-Series) Multifunction DAQ, and I want to use a counter to output a pulse train with changing low times. I want to use this output signal as an update clock, where values of Digital Output Channel, and the Analog Output channels updates to new values sequentially in the order specified in their repective 1D arrays in the front panel. I want the updates to happen at every rising edge of the clock pulse. The times when I want this update to happen are also user-specified by an 1D array of times in the front panel. So I'm trying to configure one couter to output this changing width pulse train.
    I'm new to Labview/Ni DAQ. I'm using NI DAQmx, so far its been really nice and readable, and easy to understand. Even though I have never used NI-DAQ, I can clearly see that NI DAQmx is certainly much more programming friendly than NI-DAQ. I looked at the VI's available in the example, and also through many simlar posts in these Forums, and some web documents for my problem. Most of the solutions have focussed on changing times on the fly while the application is running. I want to specify the different times before a "DAQmx Start Task" is called. I'm wondering wether this is possible.
    I was hoping I could store the pulse width values in a buffer, and the counter could keep outputing pulses with different widths in one continuous operation. The M-Series help file says that it is possible to do that "seamlessly", but I dont see yet how I can use the NI DAQmx to do that. Attatched is the part of the Help file where it says that.
    Any help will be greatly appreciated.
    Attachments:
    Counter_Change_Frequency_Help.pdf ‏21 KB

    Hi Kevin,
    Thanks for your message. Well, I would like to point you to the 'DAQmx Timing' vi, which has an instance for change detection applications with digital input. I'm new to LAbview, but I'm wondering wether you can use that for your applications. Yes, I have seen the Viewpoint boards and their programs.. I have actually also looked into their Vi you are talking about, Kevin, for ideas to use with my board, but the core of the program is in C, which is something I would use as a last option, specially since I bought Labview to make life easier.
    To get back to the subject of my post, their is a vi 'DAQmx Write", and one of its instance is 'Write Counter Single Channe SINGLE Sample', and there is no 'Multiple Sample" option available for writing counters, as is for the Digital Ports and Analog Outs. That seems to be a bit surprising. To refer the following example
    http://zone.ni.com/devzone/conceptd.nsf/webmain/90DFE241E571056C86256FA4004ABB63
    (pulse width modulation with NI-DAQmx)
    If one can change values of pulse widths on the fly, I would assume thats it should also be possible to pre-define a sequence of pulse width values in a buffer from which the counter 'banks' can access the next pulse width from. ('Banks' are the 2 load register pairs for the counters and is described in the part of the M-series help file attatched in my earlier post).
    Hopefully somebody from NI can address our problem. And yes Kevin, currently I have 2 options,... 1. to create a digital waveform before hand, which will use a large buffer ( I want an experiment to run for 1s, with 0.1us timebase, or
    2. To use the example in the above web document and modify it a bit. Here frequency is changed on the fly, and a while loop checks if the frequency is changed in the at regular intervals. I could instead use a for loop to keep changing the frequency values, but I tend to think that the speed will be limited by software. I'm not sure .. I haven't tries that out yet.
    Hopefully someone can send me a nice elegant solution.
    Thanks.
    Shomu

  • How can I Synchronize two counters in CVI using NI-DAQmx

    Hi, I am new to NI-DAQmx, and I would like to program counting of random digital pulses using two counters in LabWindowsCVI and a PCI6229 multifunction card. I have the evaluation copy for CVI 7.1
    I would like to set counter0, to count pulses from the 10MHz clock, to generate a single pulse (duration in the few ms timescale), that will gate counter1 in the same card.
    When I try to route the output from counter0 to the gate of counter1 I get an error code
    (-89137, "The specified route can not be satisfied because it requires resources that are currently in use by another route").
    How can one do the equivalent of the "Select_Signal()" in the traditional NI-DAQ?"
    I have also a hard time seting the counter0 to actually count a number of clock cycles from the 10 MHz clock.
    What is the NI-DAQmx equivalent of the function "GPCTR_Change_Parameter()" to program a counter to count a predefined number of clock cycles?
    Any suggestions are welcome.
    Fundadero

    Hi Fundadero-
    It sounds like you're programming for an M Series card with counter operations and need a bit of help with DAQmx functions.
    In order to count edges of the 10MHz reference clock you will need to use a format similar to that found in the CVI shipping example "CntDigEv.prj." This is found in the NI Example Finder (Help>>Find Examples) under Hardware Input and Output>>DAQmx>>Counter Measurements>>Count Digital Events. In order to measure pulses from a source rather than the default input terminal (ctrXsource where X is the counter number), you will need to use the function DAQmxSetCICountEdgesTerm(taskhandle char[] counter, char source terminal) as follows:
    DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
    DAQmxErrChk (DAQmxCreateCICountEdgesChan(taskHandle,chan,"",edge,initialCount,countDirection));
    DAQmxErrChk (DAQmxSetCICountEdgesTerm(taskHandle, "/Dev2/Ctr0", "/Dev2/10MHzRefClock"));
    What type of operation are you trying to perform on counter 1? The strategy for routing signals will change based on this. If you're trying to perform gated counting you can specify the the task similarly as above and use the terminal "/DevN/Ctr0InternalOutput" as before. If you are trying to perform frequency measurement you will need to use the DAQmxGetCIFreqTerm function.
    Other channel properties are listed conveniently in the NI-DAQmx C Reference Help found at Start>>Programs>>National Instruments>>NI-DAQ on your start menu. A search for "channel properties list" returns this list.
    Please let us know if you have any additional questions.
    Thanks-
    Tom W
    National Instruments

  • How to Upload Excel sheet in DB or internal table using SAP NetWeaver ABAP

    Dear All experts,
    Pls provide guidance  to Upload Excel sheet in DB or internal table using ABAP in  ( SAP NetWeaver stack  )
    Regards
    Machindra
    Edited by: Machindra Patade on Apr 8, 2010 3:07 PM

    Please search before posting.
    Thread locked.
    Thomas

  • Sample Project with ni hardware using NI-DAQmx Driver

    hi, i need a Sample Project with NIi hardware using NI-DAQmx Driver

    Please stick to one thread. You've created several that are asking the same thing and the answer remains the same - Help> Find Examples if using LabVIEW. Other programming languages come with their own set of examples.

  • Creating an application which uses NI-Daqmx driver

    Hello,
    I'm developing an application which uses NI-Daqmx driver and I need to deliver this application to end users.
    I currently have NI-DAQmx 9.7.0 installed on my computer which needed an installation of 1.55 GB.
    I got complaints from customers who want this application to run on a new machine without the need of installation of NI-DAQmx driver.
    My project contains the necessary dlls (NationalInstruments.Common.dll and NationalInstruments.DAQmx.dll) as referenced and I expect that build of the application along with these dlls work on a different machine somehow.
    Is there any way to provide such output that customers don't need to install NI-DAQmx?
    Do I have to add additional references to the project? If so, which ones should they be?
    Or can I have a smaller custom required installation of this driver which will not bother the customers?
    PS: I tried the output of the sample projects on a different machine which don't have NI-DAQmx installed. I got the same error.
    Thanks in advance.

    Greetings,
    You can have them install the DAQmx runtime engine which correlates with the version of DAQmx which is being used in the program you're distributing. This can be found on our website.
    Search "daqmx runtime engine x.x" and replace the x.x with your version number.
    Regards,
    Brandon V.
    Applications Engineer
    National Instruments 

  • Using one public ip for ssh`ing to different internal servers using port-redirections

    Hi, we are having a requirement to use the same public IP to ssh into different internal servers using port re-direction. So lets say from outside, if a user does ssh @ root 4.4.4.4 2222, it should go to a sshsrv1 and then ssh @ root 4.4.4.4 2223 to sshsrv2
    My config is like this:-
    object network sshsrv1
    host 10.110.100.10
    nat (inside,Outside) static 4.4.4.4 service tcp 22 2222
    And then i allowed the object "sshsrv1" in my inbound acl from outside.
    It dosen`t seem to work. Is this doeable?
    Any suggestions??

    Hi,
    Would need to see your NAT configurations.
    There is a possibility that you have a NAT configuration that might be preventing this from working. Then again you are using an extra public IP address for this so it seems strange.
    Could you try the "packet-tracer" command
    packet-tracer input outside tcp 12345 2222
    This should tell us if there is some problem in the ASA configurations.
    - Jouni

  • How to extract data from info cube into an internal table using ABAP code

    HI
    Can Anyone plz suggest me
    How to extract data from info cube into an internal table using ABAP code like BAPI's or function modules.
    Thankx in advance
    regds
    AJAY

    HI Dinesh,
    Thankq for ur reply
    but i ahve already tried to use the function module.
    When I try to Use the function module RSDRI_INFOPOV_READ
    I get an information message "ERROR GENERATION TEST FRAME".
    can U plz tell me what could be the problem
    Bye
    AJAY

  • Delete row from internal table using field symbol.

    Hi friends,
      I created dynamic internal table using field symbol. I want to delete some data using where clause.
    for example. i want to use like,
        DELETE <FS> WHERE KUNNR = WA_KNA1-KUNNR.
    Like the above statment it won't work. How i can use delete with where clause in field symbols.
    Hope any one can help me.
    Thanks and regards
    Srikanth. S

    hi Srikanth,
    I think you have to LOOP through the whole internal table and check each line and decide to delete or not:
    LOOP at <itab> INTO <wa>.
    ASSIGN COMPONENT 'KUNNR' OF STRUCTURE <wa> TO <field>.
    CHECK <field> IS ASSIGNED.
    IF <field> EQ WA_KNA1-KUNNR.
    DELETE ...
    ENDIF.
    UNASSIGN <field>.
    ENDLOOP.
    hope this helps
    ec

  • What kind of technology does the internal microphone use?

    Does the internal mic use USB, Bluetooth, or analog technology. (Rosetta Stone voice recorder/analyzer is crashing app)

    I am having the same problem with Rosetta Stone voice recorder/analyzer activity. RS told me to wait before going to the next window in the exercise but this did not help. I had the same experience with an older Mac laptop. I will follow up with Apple under warranty.

  • Internal table used by sap in a program

    Hi,
    I want to know the list of internal tables used in a program (including sap program).
    while debugging i want to view the data stored in it.
    I know the internal tables used by me. Before loading the program sap will load some information into internal table. How to know that.
    Advance Thanks.

    Internal tables, not transparent ones.
    In the old debugger, goto->system areas->internal information and look ITAB_HEADS.  This will show you the name of the tables in the system.  SYMBDATANM will show you all variables in memory.
    In the new debugger, it's even easier.  There's a global tab in the variables area, that tells you all variables in memory.  And you can see the variable type - i.e. if it is a table.
    matt

  • Final Internal Table used in MIGO Transaction

    Hi Experts,
              I need to know the final internal table used in the MIGO transaction. Why I want to know this is, I need all the records which are there in the table control (GODYNPRO) of the MIGO transaction. I have used the BADI BADI MB_MIGO_BADI to read the values. But since it is a table control the values are getting changed when the user scrolls down the table control. How can I get all the values shown in this table control. Is there any global internal table in the SAPLMIGO program?
    BR.

    Hi ABAP,
    Check the BADI MB_MIGO_BADI the example class CL_EXM_IM_MB_MIGO_BADI
    In attributes tab variable GT_EXTDATA contains all migo positions.
    Read the internal table to check items.
    in this method the internal table is filled.
    Therefore define your internal table in the class attributes.
    I hope you help.

  • Goods Issue Internal Order using MIGO

    Dear All,
    I want to do Goods Issue Internal Order using MIGO, but then an error message popup says
    "Order xxx not found or not permitted for goods movement"
    When i do the Goods Issue using MB1A, the transaction run well,
    So why MIGO transaction cannot run this transaction?
    Any one who can help to resolve this problem?
    Regards,
    Marufat

    Hi,
    Go to MB1A, enter Mvt type 261, Plant and S.loc.
    Don't click on order tab from the initial screen. This field is for "Production Order" Not for internal order.
    Then in the second screen on account assignment data, give your Internal Order number and enter the data and post the document.
    Or else, In mIGO, Goods Issue- Others.
    Check the configuration for the Order type in transaction code KOT2_OPA.
    Order Category should be 01
    If order belongs to order category 30,system will not allow to do the direct posting through MB1A.
    OR else try to create a reservation for these materials with movement type 261 and then do a goods issue for that reservation.
    Hope it will help you
    regards
    Siva

Maybe you are looking for

  • Hp 8560w booting into black screen, seems to be booting without display

    Hi, Ive got this elitebook 8650w from a friend who asked me to help him try to get it to run. First thing noticable that something was wrong with this machine  is when it started shutting down/rebooting randomly,  i suspected overheating since it had

  • 10.6.8 update running slow as sh*t

    Just did the netupdate to my iMac (running OSX 10.6.8) and now my MAC is running slow as sh*t... is anyone else having this issue? I checked the process level and nothing seems to be over consuming system resources... my question is this... has anyon

  • Custom Authorization Policy

    Hello Experts, I need to create new custom Authorization Policies, but seems that I can create or copy only Policy from these Entity Type: - User Management - Role Management - Authenticated Self Service User Management What about the other entity Ty

  • Error message upgrading Sun One Web Server

    We currently use Sun One Web Server SP 4. I have a RSA Cleartrust Agent to install that specifies SP 5. I downloaded SP 7. When I try to install it I receive the following message - "A previous release of the Web Server has been detected in the serve

  • Outbound RFC Adapter - Limit in Response

    Dear all! i face the following problem using a Outbound RFC Adapter: XI2.0: We call a RFC-FunctionModule which has an output-param of type XSTRING. The xml-Schema definition for this param in the XI-Repository is "base64Binary". As long as the output