Can counter value be sampled

I am interested in the PCI-6133 card.  My sample interval can vary and so I need to know when each sample was taken.  Does anyone know if I can "sample" a high resolution timer to calculate the time between samples after the fact?
Thanks,
Scott

Hi Scott,
I am not quite sure what do you mean by "sample" high resolution timer or how you are varying the sample interval. I am assuming you are using an external clock for this. However, you can measure the time between samples using buffered period measurement. That way you can measure the time between each of the rising edges. Once the data is sampled you export it as 1D array of data samples and 1D array of time measurements between samples. From that point you make calculations with the time base and convert it in preferred format.
I hope this helps, but please give me more info about your setup if you have any further questions or concerns.
Regards,
Natasa

Similar Messages

  • Counter value jumps on occasion (PXI 6255)

    I am using a PXI 8108 controller (Windows) with a PXI 6255 AI card. A pulse generator (1 KHz) is incrementing the hardware counter of that AI card in order to have an external reference clock, i. e. having a timestamp for each AI sample value.
    I am reading 1000 AI values from several channels  (together with 1000 counter values) via DAQmx blocks with a higher frequency than the external clock's 1 KHz (e.g. AI Rate 5 KHz-> reading every counter value approx. 5 times). Every now an then I am losing counter values, e. g. counter value 6789 is followed by 6823.
    Shouldn't be the PXI card's counter buffer independant of Window's CPU load? Getting 1000 values from the card buffer, the jumps are even located in the middle of the 1000 values. Maybe there's a problem with atomicity while reading from the buffer, so that I get 500 values from the buffer, (pause), and 500 more values from a later point in time. Is this possible?
    I am sure, I can not blame the digital pulse generator (from Hameg Instruments) for dropping pulses.
    Attachments:
    counter-daq.png ‏20 KB

    Hello,
    If the first scan only places 4 samples in the AI FIFO (2 less than the number of channels requested), then I would expect this loop to run forever in aiex1.cpp (I added some debugging prints to make it easier to see the channels that should be getting returned).
           while ( m < numberOfChannels )
            if(!board->AI_Status_1.readAI_FIFO_Empty_St())
                value = board->AI_FIFO_Data.readRegister ();
                aiPolynomialScaler (&value, &scaled, &scale);
                printf ("Channel %d: %e,\n", m, scaled);
                m++;
        printf("\tEnd of Sample %d\n", n);
    How is the example able to proceed past this loop?
    I have checked the code for FIFO flushes and resets between aiStartOnDemand (board); and when the FIFO gets read.  I have also run the example with 6 channels, this time on Windows.
    To proceed we would need these items:
    1) We would need the exact output (with my added debug prints).
    2) A complete dump of all registers accessed during the example.
    Steven T.

  • Calculating the Count value

    Hi friends,
    I have personnel planning cube,i need to calculate the no.of Personal Id's for each cost center..and retreive the Count value and save it to a keyfigure with type Number.
    I know that we can do this in FOX,Can anyone please provide me with the sample code for the above requirement.
    Thanks In Advance.
    Regards,
    Ravi.
    Edited by: ravi kanth on Sep 15, 2009 12:34 PM

    Hi Ravi,
    Counter type I.
    FOREEACH PERSONAL ID.
    COUNTER = COUNTER +1.
    {KF, Personal id} = {KF, Personalid}.
    ENDFOR.
    (Count,personalid} = counter.
    Hope this gives you an Idea but let me know you need more information.
    Regards,
    Raj

  • Perturbation of counter value with NI 9401

    Hello,
    I send this message because I have a problem with a counter on an NI 9401on cDAQ-9178.
    I measure an angular position with two pulse signals (increment on channel A and decrement  on channel B). There is one signal and it is a relay that directs the signal to channel A or B.
    You can see details on the attached file.
    I purchased a sample of the counter every 10ms.
    Everything works fine except when an AC motor of the machine starts or stops.
    When the AC motor starts or stops the counter value change by an offset (see attached file). If the counter is counting, I observe a negative offset. If the counter is counting down, I see a positive offset.
    If they are electrical noises, why will not offset in the direction of signal?
    How to fix the problem?
    Thank you for your help.
    Bonjour,
    J'envoi ce message car j'ai un problème sur un compteur avec une carte NI 9401 sur un cDAQ 9178.
    Je mesure une position angulaire avec deux signaux impulsionnels (Incrémentation sur la voie A et décrémentation sur la voie B). Il y a un seul signal et c'est un relai qui oriente le signal vers la voie A ou B.
    Vous pouvez voir les détails sur la photo jointe.
    Je fais une l'acquisition d'un échantillon du compteur toutes les 10ms.
    Tout fonctionne très bien sauf quand un moteur asynchrone de la machine démarre ou s'arrête.
    Au démarrage ou à l'arrêt du moteur assynchrone le compteur prend un offset (voir fichier joint). Si compteur est en comptage, j'observe un offset négatif. Si le compteur est en décomptage, j'observe un offset positif.
    Si ce sont des parasites, pourquoi l'offset ne va pas dans le sens du signal?
    Comment corriger le problème?
    Merci pour votre aide.

    Bonjour,
    le sujet est en cours de résolution à l'adresse suivante :
    http://forums.ni.com/t5/Discussions-de-produit-de-NI/Perturbation-de-la-valeur-du-compteur-avec-NI-9...
    Bonne programmation à tous !
    MathieuT
    NIF AE
    Mathieu_T
    Certified LabVIEW Developer
    Certified TestStand Developer
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    LabVIEW Tour
    Journées Techniques dans 10 villes en France, du 4 au 20 novembre 2014

  • Disturbance of counter value with NI 9401

    Hello,
    I send this message because I have a problem with a counter on an NI 9401on cDAQ-9178.
    I measure an angular position with two pulse signals (increment on channel A and decrement  on channel B). There is one signal and it is a relay that directs the signal to channel A or B.
    You can see details on the attached file.
    I purchased a sample of the counter every 10ms.
    Everything works fine except when an AC motor of the machine starts or stops.
    When the AC motor starts or stops the counter value change by an offset (see attached file). If the counter is counting, I observe a negative offset. If the counter is counting down, I see a positive offset.
    If they are electrical noises, why will not offset in the direction of signal?
    How to fix the problem?
    Thank you for your help.
    Bonjour,
    J'envoi ce message car j'ai un problème sur un compteur avec une carte NI 9401 sur un cDAQ 9178.
    Je mesure une position angulaire avec deux signaux impulsionnels (Incrémentation sur la voie A et décrémentation sur la voie B). Il y a un seul signal et c'est un relai qui oriente le signal vers la voie A ou B.
    Vous pouvez voir les détails sur la photo jointe.
    Je fais une l'acquisition d'un échantillon du compteur toutes les 10ms.
    Tout fonctionne très bien sauf quand un moteur asynchrone de la machine démarre ou s'arrête.
    Au démarrage ou à l'arrêt du moteur assynchrone le compteur prend un offset (voir fichier joint). Si compteur est en comptage, j'observe un offset négatif. Si le compteur est en décomptage, j'observe un offset positif.
    Si ce sont des parasites, pourquoi l'offset ne va pas dans le sens du signal?
    Comment corriger le problème?

    Think you John,
    After some modifications, the problem has evolved. Now the offset signal (noise) is only on the signal connected.
    I'm downloading the NI-DAQmx version 9.40 to apply digital filtering on counting.
    The filter should be set in MAX or in LabVIEW? (my program uses Labview tasks set in Max).
    Could you give me more details on the configuration of the filter on the counter. (on image, the configuration of my task with DAQmx 9.2.3
    Best Regards
    Après quelques modifications, le problème a évolué. Maintenant l'offset de signal (le bruit) est seulement sur le signal connecté.
    Je télécharge la version Ni-DAQmx 9.40 pour pouvoir appliquer un filtrage numérique sur le comptage.
    Le filtrage doit-il être paramétré dans MAX ou dans Labview ? (mon programme Labview utilise des taches configurées dans Max).
    Pouvez-vous me donner plus de détails sur la configuration du filtrage sur le comptage. (en image, la configuration de ma tache avec DAQmx 9.2.3

  • DAQmx+6009: Reading the current counter value is too slow

    I have a thread that runs a software loop that I need to run as fast as possible. One of the things I need to do is poll the current counter value from my 6009, and branch if it's changed from the last time I read it. Over 90% of the time spent in my 1.2ms loop is doing this read. My goal is to get the loop under 50us.
    What I really need here is an accurate timestamp (20us or better) for every time the counter changes (up to 1kHz). When I detect a change, I currently get the timestamp by calling QueryPerformanceCounter().
    Here's how I create the task:
        DAQmxErrChk( DAQmxCreateTask("",&taskHandle) );
        DAQmxErrChk( DAQmxCreateCICountEdgesChan( taskHandle, line, "", DAQmx_Val_Falling, 0, DAQmx_Val_CountUp ) );
        DAQmxErrChk( DAQmxStartTask(taskHandle) );
    And here's the line of code that goes so slow in my loop:
        DAQmxErrChk( DAQmxReadCounterScalarU32( taskHandle, 10.0, &count, NULL ) );

    I updated a robot control from a Mac Powerbook with a PCI expansion chasis running Mac OS9, Labview 5 and DAQ to a Mac Mini (intell) with 6009 and 6501 USB cards  running Mac OSX, Labview 8.5, and DAQmx-base.  I have connected wheel encoders (pule train and direction) to a 6009 and a 6501.  It all seems to work, except the tuning of velocity control loops is not as good as before, indicating some delays.  The loops run every 100msec (10Hz update) so I expected a synchronisation problem rather than latency.  I did some measurements today and found that reading the 2 counters and the 2 digital inputs takes over 20msec.
     I get better performance from VISA with a serial to USB converter.  I have a program reading 25byte packets every 20msec.  Although I did run into the USB latency problem with another serial application.  I have a serial device that requires a response t changing CTS (clear to send) in less than 1.2msec, and VISA was taking 1.5msec.
    On the same machine I am reading 1024 samples from an analog input every 100msec with out any timing issues - (once I got the incredibly slow start and stop vis outside the loop - they take about 200msec each.  Taking the start and stop vis outside the loop reduced my loop time from 450msec (approx) to 100msec.  The only problem is that to do this I have to run in continuous mode and can't  use an external trigger (it has to restart on every trigger, so the start and stop vis have to be in the loop).
    So it appears that I have updated my technology by 10 years only to find that USB is incredibly slow - something that is not in any of the NI doccumentation that I can find.  Does NI have any documentation on what to expect in terms of performance from these USB devices and any suggestions on how to get better performance, apart from buying more expensive hardware?
    Thanks 

  • How to get counter values from pci 6221 card?

    Hii
     I am using PCI 6221 card .. In that i am using the ctr o .. In my application i am using Linear encoder to measure the Lift movement.. so from software how to access the counter values i.e how much mm it moves... 

    Measure Angular Position.vi in the LabVIEW examples will be a good starting point. Adapt it to Linear Encoder by clicking on the selector below DAQmx Create Channel.vi.
    You can also create a corresponding DAQmx Global Channel (or task) in MAX and then use it in your code.
    Feel free to post back if you need further help.
    Message Edité par JB le 10-31-2008 02:15 PM

  • How to get seeburger work bench counter value

    hi all,
    i want to get the current counter value in the seeburger workbech counter.
    i used the following function suggested in one of the threads in forum, but its giving the below error
    func used:
    try {
    VariableBean be=VariableFactory.getVariableInstance("");
    return be.getStringVariable(variableName);
    } catch (Exception e) {
    throw new RuntimeException(e);
    error:
    RuntimeException in Message-Mapping transformation: Exception:[java.lang.RuntimeException: java.lang.RuntimeException: VariableBeanServlet: Could not call getVariable() method of the Servlet. Cause=java.lang.ClassCastException]
    i guess this above function is to get variable value and not counter value. can any body give me code to get counter value.
    Thanks a lot in addvance
    Regards,
    Rashmi
    Edited by: Rashmi H S on Aug 12, 2009 2:30 PM

    use getCounter
       //write your code here
    try {
    CounterBean be=CounterFactory.getCounterInstance();
    return ""be.getCounter("counterName_"b"_"a );
    } catch (Exception e) { 
        throw new RuntimeException(e.getMessage()); 
    will return the same counter what you have ,I also had same scenario what you are facing recently
    HTH
    Rajesh
    Edited by: Rajesh on Aug 13, 2009 7:49 PM

  • Idoc to file scenario which involves accessing a persistant counter value

    Hi,
    Presently Iam dealing with an idoc to file scenario in which I need to map the idoc info and also a persistant counter value to a flat file. So in how many ways can we maintain a persistant counter value(either by variable/file/database)? Please can any one help me in overcoming this scenario by providing any implemented example.

    Hi,
    Please see the following links , you can use database is best.
    /people/prasad.illapani/blog/2006/10/25/how-to-check-jdbc-sql-query-syntax-and-verify-the-query-results-inside-a-user-defined-function-of-the-lookup-api
    /people/michal.krawczyk2/blog/2005/09/15/xi-rfc-mapping-lookups-from-bc-to-xi
    /people/morten.wittrock/blog/2006/03/30/wrapping-your-mapping-lookup-api-code-in-easy-to-use-java-classes
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    /people/alexander.schuchman/blog/2005/09/29/ipc-customization--add-additional-subtotals-and-include-rebate-conditions
    Regards
    Chilla..

  • DB adapter retry count value

    Hi gurus,
    I am using a db adapter for polling options. The option used is 'Delete the row(s) that were read' .
    Here the retry count by default is set to unlimited. Is this the recommended one? In normal db adapter options i see the retry count as '4'
    the property value seen in composite.xml is shown below
    <property name="jca.retry.count" type="xs:int" many="false" override="may">2147483647</property>
    Will this lead to any performance issues? Or what could be the correct retry count value?
    Please let us know.

    Hi,
    We have used the polling options using Logical delete vastly in our project and never faced any performance issues with respect to this property value being set to 'unlimited'.
    I believe there should not be any performance issues with respect to the 'Delete the row(s) that were read' option as well.
    According Oracle documentation:
    In the Auto-Retries section, specify the value for auto-retry incase of time out. In case of a connection related fault, the Invoke activity can be automatically retried a limited number of times. You can specify the following values in the fields in this section:
    To retry indefinitely, type unlimited in the Attempts field.
    Interval is the delay between retries.
    Backoff Factor: x allows you to wait for increasing periods of time between retries. 9 attempts with a starting interval of 1 and a back off of 2 leads to retries after 1, 2, 4, 8, 16, 32, 64, 128, and 256 (28) seconds.
    Thanks,
    Deepak.

  • How to dynamically set Min count and Max Count values in Adobe Print Form?

    How to set the Min Count and Max Count values dynamically in a Print Form?
    The values when set should over ride the values set in Binding Tab.
    This is all needed to print multiple Material Number labels on a single page - and the number of labels to be printed needs to be under user control - something like an Avery Address labels
    Please advise.
    Thanks,

    Here is a work around that works for me and may not be an intelligent solution .
    I kept the Min Count to 1 on the subform binding properties.
    Per the number of labels required, I appended the same item to the internal table so many times and passed it to the label.
    it works fine for my requirement.
    However - leaving out the post for a while to see if this can be done at the form level via scripting.
    Thanks,

  • How to get record count value in variable

    Hi,
    i wanted to capture record count value in the variable?
    Please let me know how to do this?
    Thanks,
    jag

    To determine count of records, use: count(field_name) -- replace field_name with your appropriate field.
    You don't have to save the record count value in a variable. You can directly use the condition <?if: count(field_name) > 0?> display table <?end if?>
    If you want to store it in a variable: use <?variable:record_cnt;count(field_name)?>
    Take a look at this post that uses a record count: https://blogs.oracle.com/xmlpublisher/entry/no_data_found
    Thanks,
    Bipuser

  • Can i have a sample BSP INTERACTIVE Reports with step by step.

    Hi Friends,
    Can i have a sample BSP INTERACTIVE Reports with step by step.
    Moosa

    Hello,
    Please find the sample Code below.
    FIRST PAGE
    Layout Code.
    <htmlb:label for="emp" text="Employee id" width="10"/>
          <htmlb:inputField id="emp"  value="<%= w_input1%>"/>
          <p>
    <htmlb:label for="Employee Details"/>
           <htmlb:button   id = 'get'
                           text = 'Display'
                           on Click = 'OnInput Processing' />   <p>
    <h1>Employee Details</h1>
    <htmlb:tableView id="Employee"
                     table="<%= ZTABLE%>"  <- Give the table name
                     selectionMode = "lineEdit"
                     design="ALTERNATING">
    ONINITILIZATION EVENT.
    data:
      fs_yhtable like line of TABLE.
        select * from yhtable into table ZTABLE.
    ONINPUT PROCESSING CODE:
    * event handler for checking and processing user input and
    * for defining navigation
    class cl_htmlb_manager definition load.
    case event_id.
      when cl_htmlb_manager=>event_id.
      data: event  type ref to if_htmlb_data,
            fs_yhtable like line of t_yh1205,
            selrow type ref to cl_htmlb_tableview.
      event = cl_htmlb_manager=>get_event_ex( request ).
      selrow ?= cl_htmlb_manager=>get_data( request = request
                                            name    = 'tableView'
                                            id      = 'Employee' ).
      data: tv_data type ref to cl_htmlb_event_tableview,
             t_tab type int4_table.
    *        tv_data1 type ref to cl_htmlb_event_tableview.
      tv_data = selrow->data.
       t_tab = selrow->selectedrowindextable.
      if  event is not initial
      and event->event_name = 'tableView'.
        w_int = tv_data->rowselection.
        navigation->set_parameter( 'Employee' ).
        navigation->set_parameter( name = 'w_int'
                                   value = w_int ).
        navigation->set_parameter( name = 'table'
                                   value = table ).
        navigation->goto_page( 'second.htm' ).
      endif.
    endcase.
    SECOND PAGE CODE:
    LAYOUT CODE:-
    <htmlb:content design="design2003">
      <htmlb:page title = "Employee Details">
        <htmlb:form>
    <h1>Employee Details</h1>
    <htmlb:tableView id="Employee"
                     table="<%= t_yh1205%>"
                     selectionMode = "lineEdit"
                     design="ALTERNATING">
    </htmlb:tableView>
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    Hope this is helpful.Let me know if you need any more help.
    Thanks
    kalyan

  • Accessing counter value on STARTTRIG/ACQ line for Dio-6533

    Hello,
    Using LabVIEW 6.1 for MacOS (on a laptop), NI-DAQ 6.9.
    I was wondering if there's any way to access the counter value assosicated with each control group for the dio-6533. Basically, I want to use triggered i/o; however, I don't want it to generate/acquire on each trigger, but wait for a set number of triggers. DIO boards don't seem to have a feature like certain E-series boards where you can specify that the board wait for a certain number of trigger pulses; I thought to circumvent this by accessing the counter and arming the trigger just before the pulse that I want it triggered off of.
    Thanks for any insight you can offer.
    Regards,
    jdk

    Hello;
    The only way to accomplish that is to use another board together with the 6533. You can even get a low cost E-series board, and use the available general purpose counters to create the necessary delay, and then enable the external pulse train to start clocking data in/out on the 6533.
    Hope this helps.
    Filipe A.
    Applications Engineer
    National Instruments

  • Connect by Level using count value from record collection

    Hello:
    PROBLEM:
    ) y,(select rownum MonthNo from dual connect by level <= Cnt)
    Causes ORA-00904 Invalid identifier. Why can’t I use “Cnt” from my main query as using a constant works?
    The count value is determined for each date range in How can I return the records I need?
    Thanks, Sidney
    BACKGROUND:
    I need to be able to display a list of tax returns to my users and the status of those returns. Physical returns do not exist so it is necessary to create the data records dynamically using appropriate selects. This is not difficult and I thought I could then just use a connect by level to give me the date information so I could calculate and display the individual returns. However oracle is giving me an ORA-00904 when I try to send the “Cnt” value to connect by level. Everything works fine when I provide a constant instead of “CNT”. The “CNT” value is determined by a complex process that computes the start and stop dates for multiple return types, etc. as well as the number of periods and filing frequency. The data has to be dynamically generated using a master record which then yields the coding history from which my basic record collection is selected. Here is the result of that process:
    TaxpayerNo,TaxClass,TaxCode,FilingFequency,StartDate,StopDate,Cnt,Frequency
    10 S 1 M 6/1/2007 11/30/2008 18 12
    10 S 2 M 11/30/2008 9/30/2009 10 12
    10 S 2 Q 11/30/2010 8/18/2011 3 4
    10 L 8 A 6/1/2007 9/30/2009 3 1
    10 L 8 A 11/30/2010 8/18/2011 1 1
    From this data, I need a record for each individual month,quarter,etc. ie:
    10 S 1 M 6/1/2007 11/30/2008 18 12 6/1/2007
    10 S 1 M 6/1/2007 11/30/2008 18 12 7/1/2007
    10 S 1 M 6/1/2007 11/30/2008 18 12 8/1/2007
    10 S 1 M 6/1/2007 11/30/2008 18 12 9/1/2007
    10 S 2 M 11/30/2008 9/30/2009 10 12 11/30/2008
    10 S 2 M 11/30/2008 9/30/2009 10 12 12/30/2008
    etc.
    DOES NOT WORK
    select y.*,MonthNo,Add_Months(StartDate,MonthNo*Frequency) from (
    select x.*,
    (case when FilingFrequency = 'M' then Ceil(Months_Between(StopDate,StartDate))
    when FilingFrequency = 'Q' then Ceil(Months_Between(StopDate,StartDate)/3)
    when FilingFrequency = 'A' then Ceil(Months_Between(StopDate,StartDate)/12)
    else 0
    end) Cnt,
    (case when FilingFrequency = 'M' then 1
    when FilingFrequency = 'Q' then 3
    when FilingFrequency = 'A' then 12
    end) Frequency
    from (
    ... complex code to calculate the values of the start and stop dates needed above...
    ) x
    ) y,(select rownum MonthNo from dual connect by level <= Cnt)
    ERROR MESSAGE
    This returns ORA-00904: "CNT": Invalid Identifier. I don't get an error if I use a constant:
    WORKS USING A CONSTANT BUT MUST HAVE THE ACTUAL CNT VALUE
    ... Same code to generate data ...
    ) y,(select rownum MonthNo from dual connect by level <= 3)
    How can I get this to work using the "CNT" value instead of a constant?

    A technique like this should fix your problem.
    TUBBY_TUBBZ?with data (col1, cnt) as
      2  (
      3    select 1, 3 from dual
      4      union all
      5    select 2, 2 from dual
      6  )
      7  select
      8    d.col1,
      9    t.column_value
    10  from
    11    data  d,
    12    table(cast(multiset(select level from dual connect by level <= d.cnt) as sys.OdciNumberList)) t;
                  COL1       COLUMN_VALUE
                     1                  1
                     1                  2
                     1                  3
                     2                  1
                     2                  2
    5 rows selected.
    Elapsed: 00:00:00.00
    TUBBY_TUBBZ?As opposed to what you have now, which is basically this
    TUBBY_TUBBZ?with data (col1, cnt) as
      2  (
      3    select 1, 3 from dual
      4      union all
      5    select 2, 2 from dual
      6  )
      7  select
      8    d.col1,
      9    level
    10  from
    11    data  d
    12  connect by level <= d.cnt;
                  COL1              LEVEL
                     1                  1
                     1                  2
                     1                  3
                     2                  2
                     1                  3
                     2                  1
                     1                  2
                     1                  3
                     2                  2
                     1                  3
    10 rows selected.
    Elapsed: 00:00:00.00
    TUBBY_TUBBZ?

Maybe you are looking for