How to use mathscript to operate on multi-chan​nel data?

I want to measure two or more channels at the same time, and then use mathscript to do some operations.
I used DAQmx Read and For Loop to do measument. The data was saved as "Analog 1D Waveform N channels N samples". The data was wired to the input of the mathscript block, which was outside the For Loop. However, the wire was broken and the data types were not compatible. 
So, I extracted each channel data in the For Loop, and form two seperate waveforms. For each waveform, I got the Y component which was used as the input of the mathscript block.
My question is: can I read the multi-channel data directly into the mathscript block?
Thanks,
Qifu
Message Edited by Qifu on 05-01-2007 02:49 PM
Message Edited by Qifu on 05-01-2007 02:49 PM
Attachments:
multi_channels_math_save.vi ‏242 KB

Adnan,
Thanks for your reply.
Here comes another question. The attached is the new .vi file. I compiled it to an executable file. Because the .exe file runs automatically when it is opened, I put a RUN button and a STOP button to control running. However, the .exe file didn't do everything that the .vi file did.
In the .vi file, after the run button in the toolbar is clicked, the file won't run until the RUN button is clicked. The RUN button can be clicked again and again based on how many times we want to do measurement. The file won't stop until the STOP button is clicked.
When the .exe file is opened, the run button in the toolbar is already in the status of running. Since I put a RUN button there, the file actually won't run until the RUN button is clicked. However, if the RUN button is clicked for the second time, there is nothing happened. It is same for the STOP button. Both works well only for the first click.
I am not sure if I explained my question clearly. Because the size of the .exe file is too large, I couldn't attach it. Could you guess what's the possible reason?
Thank you again for your consistent help and support.
Qifu
Attachments:
multi_channels_math_save_v3.vi ‏365 KB

Similar Messages

  • How to use ni-6008 and build a four channel data acquisition at a rate of 250 samples per channel and display all the data in a waveform chart

    how to use ni-6008 and build a four channel data acquisition at a rate of 250 samples per channel and display all the data in a waveform chart 

    Hi kdm,
    please stick in one thread for the same topic!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • I managed to transfer the music from 1 pc to 1 other pc (to be played by iTunes). Bit didn't fixe the transfer of the meta data (for example the rating). Does anyone know how to use your old playlists, etc..(= meta data) on the other PC? So, please help!

    I managed to transfer the music from 1 pc to 1 other pc (it is played perfectly on the other PC (Windows 7- pc) by the newly downloaded and installed iTunes, version 10.6.1.7). But I didn’t fix the transfer of the meta data (for example the rating). Does anyone know how to use (or import) your old playlists, etc..(= meta data) on the other PC? So, short: how to migrate the meta data from one pc to an other pc?
    It's a pity that it seems not to be possible to import on the new pc e.g. the ratings!!!
    I don't want to start again with rating my (beautiful classical) music!
    Thanks, from Amsterdam, NL

    Did you do the move via Home Sharing, astro?
    If so, perhaps try the instructions from the following post:
    Re: i transfered itunes to my pc playlists did not go

  • How to use Mathscript Node to calculate integrals

    How do you use the command quadn_trap within a Mathscript Node to calculate the integral 5x^4 dx numerically. The upper bound is 1 and the lower bound is 0. The answer should be 1.
    Solved!
    Go to Solution.

    Hey Wear,
    Cool. Never even heard of quada_nc8 function. Works like a charm, just don't forget the semicolons or single quotation marks.
    Thought you might be interested in where my question originated. I am studying the 'Hands-On Introduction to LabVIEW' by John Essick. Problem 5 in Chapter 3 reads:
    It is easy to show analytically that the integral (he has the elongated S symbol for the bounds with upper=1 and lower=0) 5x^4dx equals exactly 1. Open a Mathscript Interactive Window and then type help quadn_trap in the Command Window, After learning the syntax of the Mathscript command help quadn_trap write a VI called  Numerical Integral that uses quadn_trap within a Mathscript Node to calculate the integral (again elongated S symbol with same bounds) 5x^4dx numerically and then displays the result in a front-panel indicator with Digits of Precision equal  to 5. For your numerical result to be correct to five decimal places (i.e., the first five decimal places are all zero), how many x- values must be supplied to quadn_trap within the integration range x=0 to x=1?
    Thanks for your help!
    btfever

  • How to use mathscript node in server side with the parameter from the client side

    I tried to develop a server/client system with some algorithms written in matlab. So I included a mathscript node on the server side. The client will send the parameter to the server. According to these parameters, the sever will call the matlab functions to do some computings and then send the results back to the client. The server has to wait for all parameters received before the computings. How do I know this since I only connect the parameter variables to the inputs of mathscript node on the server. The sever cannot know whethere these parameters are the new ones or old ones since the client may send parameters multiple times?

    It seems to me you have two perfectly good options to start with. You could send all possible parameters in a single packet from the client to the server. This could be in the form of a cluster or an array of values. If by server/client you mean you are sending data over the network, then you could flatten this data to string before sending and unflatten it on the other side. Since all parameters come in one packet, you know all the data is valid every time you send data.
    The other option is to send the parameters individually, but include some extra information such as a timestamp or iteration count. The server keeps reading and storing parameter values until a packet arrives with the next timestamp. Alternatively, you could include some information such as an end-of-parameter-list boolean that is sent with every parameter. It would be false until the last parameter packet.
    Give it a thought. There are lots of solutions.
    Jarrod S.
    National Instruments

  • How to use dynamic action to fill multi item on a page ?

    Hi..
    I want to fill multi items on a page so I build a dynamic action ( Execute PL/SQL Code ) to do it .The problem is that when the page loads I can't see any data and I tried to see the session values using debug and I found data. Moreover when I save the row I got these data saved.
    So what is the magic there?
    Thanks

    Firstly, to get the multi-select populated with "pre-selected" values the easiest approach is to use Computation or Process at a process point On Load Before Header or After Header or Before Regions.
    All you need to do is populate your "Select List " page Item with : (colon) separated list of selected values. E.g is you want A,B and C out of A,B,C,D,E selected then get A:B:C into the Page Item.
    If you have used Dynamic Actions, what is your event on which the action fires? For Dynamic-Actions the page (HTML DOM) needs to be existing , so it must fire after the page has loaded.
    Regards,

  • How to use one dynamic connection managers for multiple parallel data flow tasks

    hi there:
       I have 6 databases residing on the same server. What I want to do is  call a store procedure with identical name on each database dbo schema and transport results to a centralized place. The key is to have those SPs run in parallel instead
    of in sequence as each SP may take around 10 mins to finish. 
    The simplest way is to create 6 OLE DB connection managers and create 6 DFT tasks. However, I do not want to maintain 6 OLE DB connection managers as there is a chance to have more connection  managers.
     What I did so far is to create a OLD DB connection manager and use expression to set up connectionString properties so that it will get populated by variables at run time. It is fine when running all SPs in a Foreach Loop Container. However, it takes
    around 60 mins to finish.
      When I try to run it in parallel ( basically created 6 DFTs but use only one Dynamic Connection Manager), the connection string gets confused therefore all DFT tasks failed.
       Does anyone here have some experience on this topic?
    Thanks
     hui
    --Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --

    Yes, basically, on the connectionString property of ONE OLEDB, you are using an expression to supply value and this expression is pointing to a variable. 
    In this case , you can update this variable from a table which contains many connection strings. It's good if you want to execute Store procedures in a sequential order. When in parallel mode, this will cause issues as connectionString gets overwritten. 
     I am thinking about using script task to exec sp.
     The whole idea is that I do not want to maintain a large number of Connection Managers. 
    Hope it helps
    --Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --
    So you are not able to run parallel executions using same conn mgmr, even with dynamic connectionstring, is that correct? Yes, script task will be a way to go if you wish to execute it in parallel, you may connect to SS and query the proper conn string with
    SELECT/WHERE clause in each script > pass it to a script variable > use that script variable and execute the proc. This will require only two things to change in each script, the WHERE condition to get the conn string and the proc name (you may even
    get the proc names the same way you get conn string) and everything else will be same. Let us know how that goes. 
    Hope no two or more procs doing insert/update/delete on the same tables.

  • How to use Cursor's Fetch to return multiple column Data

    Hi ,
    This is my Table :
    SQL> select * from Login;
    USERNAME PASSWORD CONFIRMPASSWORD
    RAvi SAI SAI
    Kiran Keyboard Keyboard
    VARNU JAINA JAINA
    This is my stored Procedure , for that Table , this is working fine , where he Cursor's Fetch is returning only a Single column of Data .
    CREATE OR REPLACE PROCEDURE getEmpName(EMP_ID IN VARCHAR2)
    IS
    EMPNAME VARCHAR2(50);
    CURSOR MYCUR
    IS
    SELECT USERNAME from login where USERNAME=EMP_ID;
    BEGIN
    OPEN MYCUR ;
    LOOP
    FETCH MYCUR  INTO EMPNAME;
    DBMS_OUTPUT.PUT_LINE(EMPNAME);
    EXIT WHEN MYCUR%NOTFOUND;
    END LOOP;
    close MYCUR ;
    END;
    Now , I have a requirement as , i need to get the Password also along with Username ,
    Please tell me how can i use FETCH of Cursor to populate Details into the Declared Variables
    FETCH MYCUR  INTO EMPNAME;
    CREATE OR REPLACE PROCEDURE getEmpName(EMP_ID IN VARCHAR2)
    IS
    EMPNAME VARCHAR2(50);
    PASSWORD VARCHAR2(50);
    CURSOR MYCUR
    IS
    SELECT USERNAME , PASSWORD from login where USERNAME=EMP_ID;
    BEGIN
    OPEN MYCUR ;
    LOOP
    FETCH MYCUR  INTO EMPNAME; // Help needed here**
    DBMS_OUTPUT.PUT_LINE(EMPNAME);
    EXIT WHEN MYCUR%NOTFOUND;
    END LOOP;
    close MYCUR ;
    END;
    Edited by: user10503747 on Oct 14, 2010 11:51 AM
    Edited by: user10503747 on Oct 14, 2010 11:52 AM

    1) I'm hoping that this is a homework assignment. You would never, in the real world, store a password in clear text. And you would never, from a database design, have separate Password and ConfirmPassword columns.
    2) The INTO clause can accept a list of variables. So
    FETCH your_cursor_name INTO local_variable1, local_variable2;would be valid.
    3) You would generally want to avoid having local variables that share the name of a column-- that leads to some pretty serious confusion related to scoping. One common convention is to prefix local variables with a "l_".
    4) You would generally want local variables to inherit the type of the column rather than explicitly declaring the length of a string in your procedure. That way, if you change the table in the future, your code will continue to work.
    5) And finally, a procedure that just calls DBMS_OUTPUT would cause all sorts of red flags in reality. It would make far more sense for this to be a function that returns a value than a procedure that tries to write to a buffer that the client application may or may not have created.
    Justin

  • How to use local variables in control files for loading data

    i want to count the number of records which have odd number like...
    Data in data.txt
    1 a
    2 b
    3 c
    So my count = 2, i will write this to another file.
    Plz help me how to achieve this

    If you want to extract some rows from a file and write them to another one, why do you need Oracle? What is your requirement?
    Or are you asking out of curiosity how can this be done in Oracle?
    You can create an external table for this input file, select the rows you want from it and write them to another file using utl_file.
    External tables: http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/et_concepts.htm#SUTIL011
    UTL_FILE: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#sthref14095

  • How to use SQL to display Datethat falls between the date range

    Hi,
    I'm figuring out how do i use SQL to select data
    that falls between the date range stated
    (for eg. 19/02/1955 to 19/02/2003)
    I've tried :
    sql="Select * From StudentRecords WHERE DOB BETWEEN #" jTextField21.getText() "#" +" And " +"#" +jTextField22.getText;
    Using BETWEEN statment , but Between Statement isn't doing what i want..
    even those out of range are displayed... any ideas how??
    Thank yOU in advance!

    oracle:
    sql = "Select * From StudentRecords WHERE DOB between TO_DATE('07/04/2003','dd/mm/yyyy') and TO_DATE('08/04/2003','dd/mm/yyyy')";

  • SUM(Case how to use this structure to get average values over date range

    I am using:
    Oracle SQL Developer (3.0.04) Build MAin-04.34 Oracle Database 11g Enterprise Edition 11.2.0.1.0 - 64bit Production
    How do I use the sum function with a case structure inside.
    so I have data that looks like has an ID, date, and value. I am looking to get the 7 day average for the date range of 4/1/2013 thru 4/20/2013
    with t as (
    select 1 ID_Key,to_date('4/1/2013','mm-dd-yyyy') date_val, 10 Value_num from dual union all
    select 1 ID_key,to_date('4/2/2013','mm-dd-yyyy'), 15 from dual union all
    select 1 ID_key,to_date('4/3/2013','mm-dd-yyyy'), 20 from dual union all
    select 1 ID_key,to_date('4/5/2013','mm-dd-yyyy'), 0 from dual union all
    select 1 ID_key,to_date('4/8/2013','mm-dd-yyyy'), 12 from dual union all
    select 1 ID_key,to_date('4/9/2013','mm-dd-yyyy'), 8 from dual union all
    select 1 ID_key,to_date('4/10/2013','mm-dd-yyyy'), 6 from dual union all
    select 1 ID_key,to_date('4/12/2013','mm-dd-yyyy'), 10 from dual union all
    select 1 ID_key,to_date('4/13/2013','mm-dd-yyyy'), 0 from dual union all
    select 1 ID_key,to_date('4/14/2013','mm-dd-yyyy'), 0 from dual union all
    select 1 ID_key,to_date('4/15/2013','mm-dd-yyyy'), 10 from dual union all
    select 1 ID_key,to_date('4/16/2013','mm-dd-yyyy'), 5 from dual union all
    select 1 ID_key,to_date('4/17/2013','mm-dd-yyyy'), 2 from dual union all
    select 1 ID_key,to_date('4/20/2013','mm-dd-yyyy'), 3 from dual union all
    select 2 ID_key,to_date('4/3/2013','mm-dd-yyyy'), 12 from dual union all
    select 2 ID_key,to_date('4/5/2013','mm-dd-yyyy'), 15 from dual union all
    select 2 ID_key,to_date('4/6/2013','mm-dd-yyyy'), 5 from dual union all
    select 2 ID_key,to_date('4/7/2013','mm-dd-yyyy'), 7 from dual union all
    select 2 ID_key,to_date('4/9/2013','mm-dd-yyyy'), 10 from dual union all
    select 2 ID_key,to_date('4/11/2013','mm-dd-yyyy'), 5 from dual union all
    select 2 ID_key,to_date('4/12/2013','mm-dd-yyyy'), 0 from dual union all
    select 2 ID_key,to_date('4/13/2013','mm-dd-yyyy'), 0 from dual union all
    select 2 ID_key,to_date('4/15/2013','mm-dd-yyyy'), 6 from dual union all
    select 2 ID_key,to_date('4/16/2013','mm-dd-yyyy'), 8 from dual union all
    select 2 ID_key,to_date('4/17/2013','mm-dd-yyyy'), 0 from dual union all
    select 2 ID_key,to_date('4/18/2013','mm-dd-yyyy'), 10 from dual union all
    select 2 ID_key,to_date('4/19/2013','mm-dd-yyyy'), 5 from dual
    )**Please let me know if the table does not load.
    I would like to get the 7 day average as long as there is date for that row has enough previous dates, it not then it will return null.
    the results should look like this
    ID_Key      date_val     Value_num     7Day_Avg     7Day_Avg2
    1     4/1/2013     10          null          null
    1     4/2/2013     15          null          null
    1     4/3/2013     20          null          null
    1     4/5/2013     0          null          null
    1     4/8/2013     12          6.71          11.75
    1     4/9/2013     8          5.71          10.00
    1     4/10/2013     6          3.71          6.50
    1     4/12/2013     10          5.14          9.00
    1     4/13/2013     0          5.14          7.20
    1     4/14/2013     0          5.14          6.00
    1     4/15/2013     10          4.86          5.67
    1     4/16/2013     5          4.42          5.17
    1     4/17/2013     2          3.85          4.50
    1     4/20/2013     3          2.86          4.00
    2     4/3/2013     12          null          null
    2     4/5/2013     15          null          null
    2     4/6/2013     5          null          null
    2     4/7/2013     7          5.57          9.75
    2     4/9/2013     10          7.00          9.80
    2     4/11/2013     5          6.00          8.40
    2     4/12/2013     0          3.86          5.40
    2     4/13/2013     0          3.14          4.40
    2     4/15/2013     6          3.00          4.20
    2     4/16/2013     8          2.71          3.80
    2     4/17/2013     0          2.71          3.17
    2     4/18/2013     10          3.43          4.00
    2     4/19/2013     5          4.14          4.83As you may notice, there are gaps in the dates, so the value are then treated as zeros for the 7Day_Avg and then ignored for teh 7Day_Avg2 (not counted as number of days averaged do to no valu_num row)
    I was trying something like this to start, but getting error "missing keyword"
    select
    t.*/,
    sum(
          case
            when date_val between :day2 - 6 and :day2
            then value_num between date_val - 6 and date_val
            else null
            end
            as 7Day_avg
    form tShould I have the case structure outside the sum function?
    Any thoughts??
    Edited by: 1004407 on Jun 7, 2013 11:06 AM

    Hi,
    If you want the average of the last 7 days, including the current day, then then RANGE should be 6 PRECEDING, not 7.
    Try this:
    WITH     got_min_date_val AS
            SELECT  id_key, date_val, value_num
            ,       MIN (date_val) OVER () AS min_date_val
            FROM    t
            WHERE  date_val BETWEEN TO_DATE ('04-01-2013', 'mm-dd-yyyy')
                             AND   TO_DATE ('04-20-2013', 'mm-dd-yyyy')
    SELECT    id_key, date_val, value_num
    ,         CASE
                  WHEN  date_val >= min_date_val + 6
                  THEN  SUM (value_num) OVER ( PARTITION BY  id_key
                                               ORDER BY      date_val
                                               RANGE         6 PRECEDING
                        / 7
              END  AS avg_7_day
    ,         CASE
                  WHEN  date_val >= min_date_val + 6
                  THEN  AVG (value_num) OVER ( PARTITION BY  id_key
                                               ORDER BY      date_val
                                               RANGE         6 PRECEDING
              END   AS avg_7_day_2
    FROM      got_min_date_val
    ORDER BY  id_key
    ,         date_val
    Output:
       ID_KEY DATE_VAL   VALUE_NUM  AVG_7_DAY  AVG_7_DAY_2
             1 01-APR-13         10
             1 02-APR-13         15
             1 03-APR-13         20
             1 05-APR-13          0
             1 08-APR-13         12       6.71        11.75
             1 09-APR-13          8       5.71        10.00
             1 10-APR-13          6       3.71         6.50
             1 12-APR-13         10       5.14         9.00
             1 13-APR-13          0       5.14         7.20
             1 14-APR-13          0       5.14         6.00
             1 15-APR-13         10       4.86         5.67
             1 16-APR-13          5       4.43         5.17
             1 17-APR-13          2       3.86         4.50
             1 20-APR-13          3       2.86         4.00
             2 03-APR-13         12
             2 05-APR-13         15
             2 06-APR-13          5
             2 07-APR-13          7       5.57         9.75
             2 09-APR-13         10       7.00         9.80
             2 11-APR-13          5       6.00         8.40
             2 12-APR-13          0       3.86         5.40
             2 13-APR-13          0       3.14         4.40
             2 15-APR-13          6       3.00         4.20
             2 16-APR-13          8       2.71         3.80
             2 17-APR-13          0       2.71         3.17
             2 18-APR-13         10       3.43         4.00
             2 19-APR-13          5       4.14         4.83
    Message was edited by: FrankKulash
    Sorry; I meant to reply to OP, not to Greg

  • How to use HTML or XML described visual forms for data entry in Java app?

    Hi,
    We are considering to use HTML as a mean of configuration for visual content and layout of data entry dialogs in our Java GUI applications. Java program will need to be able to populate/collect data into/from dialog controls. I am guessing that JEditorPane and FormView classes could be used for this but I have not figured out yet how to do this.
    I would really appreciate any help you could provide with respect to this. Please share any tips, utilities, references, etc. Maybe one can suggest non-HTML (e.g. XML, UIML, ...) way to achieve the same requirements and recommend some utilities respectively.
    Thanks.
    -Vitaly

    Just to clarify, we need a solution for Java application (no applet, no web server, no servlets, no JSPs, no EJBs).
    -Vitaly

  • How to use a bind variable in XE for accessing data from different sources

    Hi,
    I am new to XE and trying to create an application like this:
    (region source)
    Select * from v$session@:P1_DATABASE ;
    My intention is to give the name of the database at runtime to fetch the relevant data.
    But I am getting error like this
    1 error has occurred
    Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-01729: database link name expected
    Doesn't work even when I check the "Generic Columns" and run the query at the run time (same error).
    Can some one please help!
    Regards,
    Santosh Loke

    Hi,
    There are rules using names in SQL. I think you could use dynamic SQL to achieve the goal in your case. It is not clear for me what are you going to do. Moreover bind variable are difficult to use some times.
    You could start with something simple as a report and a form.
    Konstantin

  • How could a down-mix APOs receiving multi-channel audio data from the application

    Hello,
        Now I am integrating my DSP algorithm to the APO whichs convert to 7.1 input to stereo output(we call it virtualization), but the endpoint just supports stereo input. My first question is can my APOs receiving a 7.1 input data from
    application when the endpoint only supporting stereo input. The second question is if the scheme is feasible and what should I do.
    Thanks

    Ok so i order to help anyone who is interested.
    The only ironic solution to this problem i found was to use a plugin called xto7 to convert the xml to the old fcp7 format.
    i then imported this into premiere pro.
    this was then able to export an OMF that when imported into logic 10 that was using the correct 6ch mono setting as separate tracks.
    Insane but it works until Apple fixes the incorrect meta data import in FCPX that sets the xml export to the default import that is always surround.
    this is the only way i was able to send stems with all the edit points and fades for the sound editor.
    If you don't have premiere lying around you maybe able to do it with fcp7 too we just didn't have it in this studio.
    Fingers crossed Apple fixes the fcpx xml export.

  • How to use sql:query/ tag to retrive the system date?

    hi all,
    i want to know if i can use the <sql:query/> tag in jstl to get the database server time. please send me a code snippet to retrive n display the result. i'm new to jstl tags. please help.
    thank you,
    AM

    Check out the first hits: http://www.google.com/search?q=jstl+sql+tutorial+site:sun.com

Maybe you are looking for

  • Can I add a lossless file to my itunes library?

    Can i add a lossless music file to my itunes library? Usually what i do is drag the file or folder into music/itunes/itunes media/automatically add to itunes and it works fine, everything shows in my library and plays perfectly. But with this lossles

  • Why does my alarm on iPod classic fail to turn on

    My iPod classic's alarm fails to activate.  I have reset and even did a factory restore.  The one thing that I notice is that when the iPod is charging and I see the battery icon, the time is also displayed.  The time that shows here is inaccurate. 

  • Oracle Business Intelligence with big data

    Has anyone implemented OBIEE 10g utilizing a denormalized data model for a very large transactional data set? There is a potential to generate reports in the 100s of millions of rows, with the data warehouse storing fact tables that have ~1.5 billion

  • Force direct read instead of memory

    hi, is it possible via a hint or something to force oracle not to put a sql's blocks to buffer cache and read from directly from disk every time ? it is for a test issue. thanks all

  • Captivate CS3 / CS4 Compatability

    Hello, I work in a mixed environment.  The organization I provide eLearning to uses an organization-wide Captivate CS3 license and I use CS4 to create the content.  I haven't had to ensure the content I create crosses version lines so I was wondering