DAQmx :: Continous reading of the last 10 values of a continous data-aquisition at a fixed point

Hello,
I am using a NI-PCI 6259 for generating and aquiring data.
The other configuration is:
- LabVIEW 7.1
- DAQ 7.3
I need to measure three anaolg channels, and generate an analog output. Additonally I need to read some values over the RS232. The whole activity should repeat every 30ms. To get this, I am using a timed loop at the moment. I generate a clock with counter 0 and read it with counter 1 for the timed loop. Inside the timed loop I start/stop a finite aquisition for the three analog channles and the RS232 reading. The fastest aquiring supported by the RS232 is an iteration every 30ms. Without the analog aquisition the system runs without any dropped loops. By adding the analog aquisition the timed loop dropps 2-5 loops every 1000 iterations.
I think the problem is the repeated start/stop of the aquisition. Maybe a solution is a continous aquistion by reading out the last 10 values of the buffer every start of the timed loop. But all my tests failed, because of the FIFO design of the buffer. When I start a continous aquisition outside the timed loop and read 10 values inside, I always have the first 10 values of the buffer, not the last ones.
Does anyone has an idea, how to read loop the last 10 values of a continous aquisition inside a timed ?
Thanks a lot for your help.
Best regards,
Michael
Attached you will find the actual state of the testprogram. Because the aqusition should be in the last quarter of the generated output value, the values of the loaded waveform (output) are four times resampeled and the clock has four times the speed of the aquisition, which generates a timing event every four clocks.
Attachments:
Datenerfassung.zip ‏3047 KB

To address your main issue you might try using the DAQmx control Task VI right after you call the Timing VI (outside the timed loop) and set its value to commit. This allows for more efficient starts and stops. Some other things I saw in your program which might make it a little easier and use less HW. First, you shouldn't need to create a CO task on ctr0 and then feed it to the timed loop using ctr1. Why don't you just use the Frequency personality of the timed loop? That way you will only use one counter. If you want to use the 2 counter method then to avoid using external wiring as the source for counter 1 in the timing source VI use CTR0/internaloutput. This is an advanced property for the terminal I/O control so you will need to right click on the constant and select I/O filtering. Finally, when you specify your create channel for the AI Voltage why are you doing this in a for loop. You can just have one channel string Dev1/Ai16:18 and that will create all 3 channels with the same information. Hope this helps
StuartG

Similar Messages

  • Is it possible to maintain the last AO value after the DAQmx task is done on device DAQ USB-6341 ?

    Hi all,
    I use the device DAQ USB-6341 to generate the desired voltage waveform by the "finite samples" sample mode.
    I notice that the channel resets to zero volts after the DAQmx task is done and the DAQ USB-6341 does not have 
    the property AO.idleOutputBehavior to select "Maintain Existing Value".
    How can I maintain the last AO value after the DAQmx task is done on device DAQ USB-6341 ?
    Thanks.
    Godel

    How many computers do you have in the network?
    What is the IP address and default gateway number on your computer?
    In order to connect to the wireless network, WVC80N should get valid IP address from the access point.
    If the access point has capacity to assign a private IP address to the computers and devices then I think you can use WVC80N.

  • How to get the last "reported" value in a cross tab

    Dear all,
    based on a BeX Query Universe I have built a report with a cross tab in webI.
    Maybe you can help me with the following issue. There I have a problem: I want to get in the Total-column always the last reported value, e.g. for Number Total Customers "66", not for Mar or Apr, because they are null.
    Calendar Month                      |Jan| |Feb| |Mar| |Apr| |Total|
    Number Total Customers         |54|    |66|  | |      | |       66
    Number Active Customers      |57|    |71|  | |      | |       71
    I hope that you understand my problem and could help as soon as possible.
    Thanks a lot in advance for your support.
    Best regards.
    Edited by: HOLWUE on Feb 8, 2010 1:40 PM

    Hi,
    If this question is related to Webi then post in the below forum.
    http://scn.sap.com/community/businessobjects-web-intelligence/content?filterID=content~objecttype~objecttype[thread]
    Regards,
    Sujit.

  • Using an index to access the last n values of a certain combination

    I have a large table of the following form:
    Name Typ
    ID NUMBER
    M_DATE DATE
    M_LOC NUMBER
    M_ARTICLE VARCHAR2(30)
    M_TYPE VARCHAR2(30)
    M_MEASURE VARCHAR2(50)
    VALUE NUMBER
    In this table there is only a small number of different locations, articles, types and maesures but a large number of m_date values.
    I want to access the last 10 values for a certain combination of locations, articles, types and measures.
    I have an index
    create index i_res_2 on results (m_loc, m_article, m_type, m_measure, m_date);
    In my opinion it should be possible to access the last 10 values directly by this index, but
    when I do my select in the following way it seems to me that first all datasets with the same
    locations, articles, types and maesures are selected, then sorted by date and then the last 10
    dates are selected. As those datasets are spread over the whole table it needs a higher number
    of physical reads. Is there a way to have an index on m_date and an other form of this query
    that selects the requested values with less phyical reads? (Database version is 10.2)
    SQL> select
    2 id,
    3 m_date,
    4 value
    5 from (
    6 select
    7 id,
    8 m_date,
    9 value,
    10 rank() over (order by m_date desc) r
    11 from results
    12 where m_loc = '14001'
    13 and m_article = '11211-00-00'
    14 and m_type = '0002'
    15 and m_measure = '032')
    16 where r <= 10
    17 order by m_date asc;
    ID M_DATE Value
    3931958 05.03.10 69.00
    3931960 05.03.10 69.00
    3905712 10.03.10 68.60
    3999535 10.03.10 69.70
    3985125 11.03.10 69.40
    3957851 11.03.10 69.60
    3949799 21.03.10 68.70
    4017369 21.03.10 69.00
    3951981 22.03.10 68.80
    3983554 22.03.10 68.80
    Abgelaufen: 00:00:03.00
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 48 | 6 (34)| 00:00:01 |
    | 1 | SORT ORDER BY | | 1 | 48 | 6 (34)| 00:00:01 |
    |* 2 | VIEW | | 1 | 48 | 5 (20)| 00:00:01 |
    |* 3 | WINDOW SORT PUSHED RANK | | 1 | 39 | 5 (20)| 00:00:01 |
    | 4 | TABLE ACCESS BY INDEX ROWID| RESULTS | 1 | 39 | 4 (0)| 00:00:01 |
    |* 5 | INDEX RANGE SCAN | I_RES_2 | 1 | | 3 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - filter("R"<=10)
    3 - filter(RANK() OVER ( ORDER BY INTERNAL_FUNCTION("M_DATE") DESC )<=10)
    5 - access("M_LOC"=14001 AND "M_ARTICLE"='11211-00-00' AND "M_TYPE"='0002' AND
    "M_MEASURE"='032')
    Statistiken
    1 recursive calls
    0 db block gets
    547 consistent gets
    474 physical reads
    0 redo size
    766 bytes sent via SQL*Net to client
    380 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    2 sorts (memory)
    0 sorts (disk)
    10 rows processed

    I found a solution, which is much better in terms of physical reads and consistent gets even if the optimizer calculates higher costs. But I still think, that there should be an easier way to do this:
    SQL> select
    2 id, m_date, value from results
    3 where
    4 (m_loc, m_article, m_type, m_measure, m_date)
    5 in
    6 (select m_loc, m_article, m_type, m_measure, m_date
    7 from (
    8 select /*+ first_rows(10) */ m_loc, m_article, m_type, m_measure, m_date
    9 from results
    10 where m_loc = '14001'
    11 and m_article = '11370-00-00'
    12 and m_type = '0002'
    13 and m_measure = '032'
    14 order by m_loc,m_article,m_type,m_measure,m_date desc
    15 ) where rownum < 10);
    ID M_DATE VALUE
    2495995 01.02.09 70,4
    2457657 19.01.09 66,9
    2556262 13.02.09 67,4
    2496232 01.02.09 67,6
    2465051 20.01.09 67
    2454994 19.01.09 67,4
    2545951 13.02.09 67,4
    2502216 01.02.09 67,5
    2497533 01.02.09 67,2
    9 Zeilen ausgewählt.
    Ausführungsplan
    Plan hash value: 3924867000
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 122 | 8 (25)| 00:00:01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| RESULTS | 1 | 39 | 3 (0)| 00:00:01 |
    | 2 | NESTED LOOPS | | 1 | 122 | 8 (25)| 00:00:01 |
    | 3 | VIEW | VW_NSO_1 | 1 | 83 | 4 (25)| 00:00:01 |
    | 4 | HASH UNIQUE | | 1 | 31 | | |
    |* 5 | COUNT STOPKEY | | | | | |
    | 6 | VIEW | | 1 | 31 | 4 (25)| 00:00:01 |
    |* 7 | SORT ORDER BY STOPKEY| | 1 | 31 | 4 (25)| 00:00:01 |
    |* 8 | INDEX RANGE SCAN | I_RES_2 | 1 | 31 | 3 (0)| 00:00:01 |
    |* 9 | INDEX RANGE SCAN | I_RES_2 | 1 | | 2 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    5 - filter(ROWNUM<10)
    7 - filter(ROWNUM<10)
    8 - access("M_LOC"=14001 AND "M_ARTICLE"='11370-00-00' AND "M_TYPE"='0002'
    AND "M_MEASURE"='032')
    9 - access("M_LOC"="$nso_col_1" AND "M_ARTICLE"="$nso_col_2" AND
    "M_TYPE"="$nso_col_3" AND "M_MEASURE"="$nso_col_4" AND "M_DATE"="$nso_col_5")
    Statistiken
    1 recursive calls
    0 db block gets
    36 consistent gets
    14 physical reads
    0 redo size
    748 bytes sent via SQL*Net to client
    381 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    1 sorts (memory)
    0 sorts (disk)
    9 rows processed

  • Formula to calculate the last active value in a row?

    When using a simpe table, what formula will display the last active value in the row? Some of the cells are blank. I want a column to show the most recent value, which in this case will be the rightmost, non-blank cell.

    B2 through J2 are your data
    B3 =IF(B2="","",COLUMN())
    Fill that to the rest of row 3
    A2 =INDEX(B2:J2,MATCH(MAX(B3:J3),B3:J3,1))
    If there are no values in the row, the answer will be an error triangle. You can put the IFERROR function around the formula and give it an answer when there is an error.

  • While P.O creation material automatic capture the last Purchase value

    Dear all
    Please guide me for the following :
    I need a scenario like while creation of new P.O if material already purchase then system automatic capture the last purchase value as per the given material....
    Thanks & Regards,
    Neha

    Prompt the last Purchase Order Price for the Material
    If you want the system to take the price from the last Purchase Order, then do not maintain the conditions in the info record because it has precedence over the last PO. This means that the netprice field in the info record should be left blank.
    In the case when you have already maintained the conditions in the info record (or netprice), try to delete them or make them invalid by changing the validity date.
    Even though no price was maintained, the info record will still keep track of the Order price history.
    To check the Order price history, go into the material info record and click Environment -> Order price history
    Edited by: Sachein on Oct 20, 2011 6:54 AM

  • New measurement starts with the last measurement value before program stop

    New measurement starts with the last measurement value before program stop. This is very embarrassing because we finish at a high measured value and start with small value, which can not be seen on the autoscale screen due to the memorized high first value. We use NI PCI-6220 DAQ board and software written in LabView 7.1 using Express VIs and running in the LabView environment. The program (attached) every half second measures 3 AI channels, filters and scales the data, visualizes, averages and saves it in a file. Please advise me how can I avoid this problem. Please note that I am not very experienced in LabView.
    Attachments:
    OLED_Monitor2.vi ‏785 KB

    I can not run your vi, but if you initialize your controls you should be ok.
    Look at the picture
    Attachments:
    Clipboard-2.jpg ‏16 KB

  • Making an average of the last 100 values?

    Hi everyone,
    I am acquiring a signal every 1000mS with Labview 7.1. I need to make an average of the last 100 values every 1000mS. I know how to do this with shift registers but it would be a bit long to do it this way...There must be a better way
    Would anybody have an example of an array that takes into consideration the new value that has just been acquired, so that I can make an average of the array?
    Thank you very much for your help,
    Toto

    Hi Toto,
    Here is the first thing I thought of.  Initialize an array of 1000 elements, and replace an element each iteration of the loop.  Use the Quotient and Remainder function along with the iteration count of the loop to replace the oldest element in the array.  Add the array and divide by 1000 in each iteration to get the current average.  I've attached the VI (saved in LabVIEW 7.1), along with a screenshot for anyone who wants to see it but doesn't have LabVIEW 7.1 or later.
    Good luck,
    -D
    Message Edited by Darren on 02-05-2006 07:40 PM
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman
    Attachments:
    Running_average.vi ‏11 KB
    Running_average.jpg ‏32 KB

  • How to find the last string value in dynamic object?

    Hi All,
    I am trying to find the last string value in dyanamic objects,Any one have solution for this.
    Ex:
    my data :12347-ebjdone-525-ecgfjf-25236-defdafgdeg
    And i want to show the output is :defdafgdeg
    Any ideas:
    Thanks
    Srini

    For oracle try using oracle function.
    e.g.
    SELECT  reverse(substr(reverse('12347-ebjdone-525-ecgfjf-25236-defdafgdeg'),1,instr(reverse('12347-ebjdone-525-ecgfjf-25236-defdafgdeg'),'-','1'))) from dual
    Object definition might look like:
    reverse(substr(reverse({ObjectName}),1,instr(reverse({ObjectsName}),'-','1')))
    Regards,
    Kuldeep
    Edited by: Kuldeep Chitrakar on Feb 12, 2010 8:12 AM

  • Getting the last selected value of the combo  - very very urgent...........

    On my panel i have a jcombobox in upper half(which displays say the address type.) and few text fields on the lower half(which displays the add details). when the user selects a value in the combo box the text fields are populated based on the selection. The user can change the values displayed in the text fields. So before setting the new values in the text fields the last displayed values need to be saved.
    I have an ActionListener for my combo which gives me the currently selected value by calling getSelecetdItem()
    How can i get the last selcted value of the combobox without using any variable of my own.

    To update the last displayed details(the address details say) i need to check what type of address the combo had previousely.....
    when i display the panel first time the home address is set by default and i have a variable to hold this value..as the user changes the selection i update the variable...I don't want to use this variable..instead if i can get the last selcted value from the event that would be great...
    thanks

  • Get every 10 sec a int.value and need to take the sum of the last 18 values

    Hi,
    i get every 10 sec a int.value and need to take the sum of the last 18 values (3 minutes).
    the programm should work permanently.
    I tried with a 1d-array but didn´t get a result. Could anyone help me?
    Best regards
    kasche

    Use the example in the posted link, then add another shift register for your sum of all elements. Dont add all the elements every time, add them to a running total when they come in. You will need to evaluate how big this number is going to get, however, and decide if you should use an I64 for your running total of all elements. Even this will overflow eventually. 
    So your code would look like that posted by GerdW in the above link, then add a shift register with a starting value of 0. Then add your input value to the value comming from this shift register and send the output to the shift register's output terminal. This creates your running total of all values. The code by GerdW provides your "last 18 elements" total in a very efficient manner, just change the 15 to an 18.
    I have attached a sample bit of code to make it clear. I saved it in LV 8.0 so more people can open it.
    CyberTazer
    Software Systems Engineer
    Attachments:
    Running 18 total.vi ‏11 KB

  • Read in the last line of a file

    Can I use the "Read from File " vi to read ionly the last line of the file? If so, how? Thanks in advance for the help
    [email protected]

    Reading the "last line" of a file implies that you are dealing with an humanly readable ASCII text file and there are special characters (/n or /r or a combination of the two) that signify line breaks.
    You can only start reading from a certain byte offset using file I/O. Unless all your lines are equal lenght, It is impossible to find the start of the last line without reading every character leading up to it in one way or another.
    So in the most general case, you would need to read the entire file and find the last linefeed.
    HOWEVER: Typically, lines are not infinitely long, so if you have an upper estimate of line lenght, you can read a slightly longer tail from the end of the file and find the last linefeed there. You can probably modify the VI I posted here for your purpose, just use an appropriate length. Message Edited by altenbach on 06-08-2005 10:42 AM
    LabVIEW Champion . Do more with less code and in less time .

  • How to retrieve the Last sequence value of a sequence ?

    Can anybody help me out regarding how to retrieve the last executed number or value of a sequence ? As dba_sequence.last_number does not show the original picture of that last value ?

    Rajesh Lathwal wrote:
    Last Number Selected From Sequence :
    SELECT sequence_name, last_number
    FROM user_sequences;That's wrong, this is taking the CACHE in account :
    SQL> create sequence seq ;
    Sequence created.
    SQL> select seq.nextval from dual;
       NEXTVAL
             1
    SQL> SELECT sequence_name, last_number
      2  FROM user_sequences where sequence_name='SEQ';
    SEQUENCE_NAME                  LAST_NUMBER
    SEQ                                     21
    SQL> select seq.currval from dual;
       CURRVAL
             1
    SQL>Nicolas.

  • Obtaining the last n values - possible to do non-procedurally?

    I'm not sure if the following is possible without using PL/SQL instead garden variety SQL.
    I'm looking for the last 4 or less (or some other arbitrary number) of LABVALUES for a PERSON. This is regardless of the time period in which they occur. Eventually I might AVERAGE these or do some other summary operation. The LABDATE might be a standard Oracle date, or might be a number (number of microseconds from 1/1/1960); however, these date forms would NOT be mixed in the same query.
    The base query is:
    SELECT DISTINCT
    PERSON.NAME,
    LAB.VALUE,
    LAB.DATE
    FROM
    PERSON,
    LAB
    WHERE
    PERSON.ID = LAB.ID
    Does this have to be done procedurally or can it just be done as a SELECT statement
    Thanks,
    Will

    Eric, Everything looks good assuming that we can go by Person.Id for order by clause, just couple of things,
    1. William's spec does not have Person_Id column.
    2. William also says he needs last 'n' rows for each Person, however he did not mention whether he passes 'Name' of the Person as a parameter. Following are couple of SQLs, one with Person Name as parameter and another one with out the parameter which brings all the persons with 'n' number of rows for each person.
    /* Please note that I have not used analytical fn here, only because we can get away with out having to use it. Just an alternative ONLY. */
    SELECT Name, Value, Date
    FROM
       (Select P.Id
              , P.Name
              , L.Value
              , L.Date
        From PERSON P, LAB L
        Where P.Id = L.Id
        Group By P.Id, P.Name, L.Value, L.Date
        Order By P.Id Desc)
    WHERE Name = :PersonName -- use Name of Person here as parameter
    AND ROWNUM <= :n; -- number of rows required for the given Person
    /* Please note that I have not used the group by here as PARTITION
    does that for us*/
    SELECT Name, Value, Date
    FROM
       (Select  P.Name
              , L.Value
              , L.Date
              , row_number() over(PARTITION BY P.Name ORDER BY L.Id desc) Rn
       From PERSON P, LAB L
       Where P.Id = L.Id)
    WHERE Rn <= :n; -- number of rows for each personThx,
    SriDHAR

  • Average of the last 1000 values

    Hello all,
       I am taking continous measurement and I wanted to average the last 10000 readings and stop the loop if the stanard deviation is less then 0.2. I couldnt configure how to delete the earlier data than the last 10000 measurements. 
    Thanks

    Look in the Signal Processing->Point by Point->Probability and Statistics PtbyPt palette.  There is a mean and a standard deviation in there.  It will do it all for you.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for

  • Firefox stops responding frequently; there is no specific pattern to these episodes which might identify the problem.

    Firefox stops responding frequently (2 or 3 times daily). There are no observable patterns to these episodes which might identify a specific task that causes the crash. It has been increasing in frequency for about a month now. == Crash ID(s) == Can'

  • Since upgrading to Mavericks, my works suite disappeared

    I upgraded to Mavericks on my MacBook Pro in April.  Since then, I no longer have my Works Suite.  I have no way to write letters, make notes, or anything to do with word processing.  I have read the reviews of the updated Pages and don't want to pur

  • Videos don't play when Captivate 6 project is posted to Web

    Hi all, I've read a lot of discussion of this problem but so far, not a solution. I'm working in Captivate 6.0.2.325 on Mac OS 10.6.8, and it's a .cptx file. It runs beautifully from my desktop, but when I post it to my website, it won't run the vide

  • Assets Reversal

    Hi Experts, We captilized a Assets in March 2011 and in April 2011 user reverse the asset transfer document on the march . Now in books Only depriciation amount  of the March is there in AW01N. How i write off this depreciation  and what is the impac

  • Problem in Portal Anonymous Login..Please guide

    Hello All, Am trying Portal Anonymous Login using EP7 SP9 Sneak Preview. Using link for this - http://help.sap.com/saphelp_nw2004s/helpdata/en/1e/e19f58136e654d9709befa464314f2/frameset.htm 1. Have added 2 users in the UME Property using configtool -