Create a melody with Labview/ Function Generator

Hi (first sorry for poor english, not my native language)
I have a project at school which is creating a melody using Labview and a function generator. I've worked on it for hours now and i still can't get through it.
I joined the vi file with my post so you can get a look at what i've done so far.
First, i do'nt know which loop i have to use (u'll understand soon enough if u just take a look at the vi file), the problem is that i want to create 4 arrays using 2 text files.
The first one is used as a reference : exemple the frequency to play an A is 440Hz, so my first text file looks like that :
A 440
B 493
the second one is my melody, which includes the notes and the tempo (in ms)
 , so it's like :
B 1000
C 1500
I used the first two loops to seperate each string lines of my files so I have at the end 4 different arrays. One containing the note's references, one containing the frequency, one containing my melody's notes and one containing the duration of each notes.
The problem is that when I use a while loop, it seems that my arrays are not containing every elements it should, it only has the last one. Just try to run the vi file.
Could anyone give me some help ? Don't hesitate to ask more questions if u didn't fully understand my problem !
Thx
Attachments:
PR.vi ‏19 KB

Hi claudeuntel,
Your array contains just the last note because at each for loop iteration a new table is created.
You have to send the table you created at one iteration to the next one.
To do this you can use shift register.
I didn't have tested the VI below but it should looks like that.
Valentin
Valentin
Certified TestStand Architect
Certified LabVIEW 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;}
Travaux Pratiques d'initiation à LabVIEW et à la mesure
Du 2 au 23 octobre, partout en France

Similar Messages

  • Quit LabVIEW function generates crash report in executable

    Hello,
    I am using the Quit labVIEW to close down an application when the VI is built into executable. If stop LabVIEW is used the application just stops and leaves the window open. When the Quit LabVIEW function is used in an executable the application closes down completely.
    In the current app I am developing (Windows 7 - LV2014SP1) I have isolated the Quit LabVIEW function as the source of the Crash Report I am receiving after I exit the application. I inpsected the crash report and there was mention of a thread that did not have appropriate access. So I ran the same executable with Adminstrator privledge and the error went away. It appears the application I am developing does not have sufficient privledge to close itself down and this is generating the Crash Report. 
    I have used the Quit LabVIEW function for many applications in the past without issue. I have not confirmed yet whether the problem is specfic to the current application I am developing or to LV2014SP!. 
    thanks for any help with resolving this issue,
    - Troy
    Solved!
    Go to Solution.

    TroyR wrote:
    Wasn't there previously some issue with using Invoke Node in executables?
    Not that I am aware of.  But here is my trick for shutting down an application.  I put the FrontPanel Close method inside of a Conditional Diagram Disable.  The invoke node only goes into the RunTime Engine == True case.  This way, the front panel is not closed if you are in the development environment.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Creating two sin signals using function generator.vi example

    hi all. i want to create two sin signals with different parameters using function generator.vi example. i tried to modify the example by copying the code and try to output two sin signals on different channels of the DAQ but error message saying that you are validating of the AO write buffer . attached is the file. how can i modify it to solve the problem?!
    Attachments:
    function_generator2.vi ‏123 KB

    Nidal,
    Below is an example that illustrates how to generate different sine waves on two separate analog output channels.
    Example

  • Create a View with Aggregation Function (COUNT)

    I've been looking up and down for a way to create a view with a few basic fields and some other fields containing aggregation function.
    For instance:
    To display a view that contain all the Contract Agreement and the corresponding count of the PO releases.
    Agreement Nbr, Total PO releases
    I need this view so that I can create a search help with this view.
    I found something about the "CREATE VIEW" statement, but I don't have any idea how to use it.
    Any helps toward this matter is very much appreciated, thanks.

    Hello Aldern
    I guess you have read about the SQL statement "CREATE VIEW". When we create a view in the dictionary this SQL statement is finally called to create the view on the DB. Thus, since we do not have any aggregation options in views you cannot achieve what you want using views.
    The solution for your problem is to create a <b>search help</b> having a <b>search help exit</b>. Within the exit you can do your aggregation functions and add these values to the displayed search help data.
    Regards
      Uwe

  • Creating a CIN with Labview 6.0.2 and MSVC++ 6.0

    Hello,
    I am a new Labview user. Does anyone know where I can find examples of
    creating a CIN? Preferably demonstrating use with Labview 6.0.2 and MS
    Visual C++ 6.0
    Thanks,
    J.White

    LabVIEW comes with a pdf file titled "Using external code in LabVIEW", which provide good references on how to do what you are asking. In case you don't have it, you can download it from ni.com:
    http://digital.ni.com/manuals.nsf/web_productcurrent/4F1447F7CD83D6D88625690D00637CED?OpenDocument
    There is a small issue with MS Visual C++ 6.0, which is addressed in the following link:
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/d7bdb30eef410056862569ab00724294?OpenDocument
    Here is also a full tutorial about CIN at ni.com:
    http://www.ni.com/support/labview/program/callcode/cinmain.htm
    Also check the following examples, which were very useful for me:
    Using a CIN to Create an Array of Strings in LabVIEW
    http://zone.ni.com/devzone/devzoneweb.nsf/ope
    ndoc?openagent&AD517F5DCCAF70228625683A000A570F&cat=2F4F574886553A62862567AC004F032D
    CIN that converts a LabVIEW String to a C String, Modifies it, and Returns it as a LabVIEW String
    http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&D978409908EA760D8625683A000B6B6E&cat=2F4F574886553A62862567AC004F032D
    Replacing a Portion of an Array
    http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&3B5B43568CF83D948625683A000C397E&cat=71359FBAD517F4CB862567E0007B6F6E
    Best regards;
    Vargas
    www.vartortech.com

  • Labview function generator bk precision 3011b

    Iam using bk precision 3011B function generator,labview 6.1,windows NT.please help me in transferring,reading data from the instrument to labview(like how to connect,drivers required).thanks.

    I found the instructions manual for the BK precision 3011B online but there was no indication of any type of communications port (like a GPIB, serial, or TCP/IP) or a command set that the instrument responds to. So it does not appear that the 3011B can be controlled remotely.

  • How can I create a Report with LabView Real-Time?

    With conventional LabView, I can create Reports in HTML, for example to document Errors.
    I need this feature in LabView Realtime. Is it possible?

    It is possible, but you got to put a name to the file with an extension of three letters. i.e. errors.htm
    Three letters on the extension is what the RT Operating system allows to use.
    Then you will need to do an ftp to your RT machine and get the file and maybe change the extensions.
    Not all the vis for Report generation can be used in the RT engine. The ones that use ACTIVE X will not work. i.e printting
    Another way to generate reports and the most recommended is to use the host machine to generate the reports.
    Regards,
    Blasioz Valenzuela
    National Instruments

  • Problem saving Reader extended PDF created in Livecycle with Javascript functions built in

    Afternoon
    I have created an interactive PDF in Livecycle with built in Javascript functionality.  I need users to be able to complete and save the PDF so have saved it as a Reader extended PDF.  The problem I'm having is that when a user completes the form,saves it, and then opens it again the Javascript functionality is not showing despite showing the original selection that the user has made.  The Javascript is simply a dropdown menu that will show a different table based on the selection so isn't anything major.
    I've trawled forums and this is driving me mad so I'd appreciate some help.
    I am using Adobe Pro XI.
    Thanks in advance
    Ben

    At the moment I can't sorry.  I've run the Javascript debugger in Adobe Pro and it seems there are some errors
    Acrobat EScript Built-in Functions Version 11.0
    Acrobat SOAP 11.0
    ReferenceError: Table is not defined
    1:XFA:form1[0]:TextFieldContainer[0]:#subform[3]:#area[1]:Button1[0]:initialize
    ReferenceError: Table is not defined
    1:XFA:form1[0]:TextFieldContainer[0]:#area[2]:Button1[1]:initialize
    ReferenceError: Table is not defined
    1:XFA:form1[0]:TextFieldContainer[0]:#area[3]:Button1[2]:initialize
    ReferenceError: Table is not defined
    1:XFA:form1[0]:TextFieldContainer[0]:#area[4]:Button1[3]:initialize
    Basically the form has been built in Livecycle Designer and have drop down menus that show or hide tables depending on the selection but when I Reader Enable the form and users make a selection and then save the form it is not showing the table when it is opened again.
    I appreciate your help

  • How to create an app with this function?

    Hi, people. Total beginner here.
    How can I create an application that auto-generates instantly downloadable PDF files with contents based on whatever the user chooses to click on or type on the front-end interface. I saw such Flash app before on a Facebook Page so I kinda believe it's possible.
    Any help would be appreciated. Thanks!

    you can try using an actionscript class like purePDF (http://www.sephiroth.it/weblog/archives/2010/02/purepdf_a_complete_actionscript_pdf_l.php) or use server-side code like fpdf (www.fpdf.org).

  • Create a package with one function - Error Ora-00907

    Hello,
    I want to create a package which should store one function.
    The code looks like this:
    Package Header:
    CREATE OR REPLACE
    PACKAGE "PCK_REPORT" AS
      TYPE t_varchar2 IS TABLE OF VARCHAR2(4000);
      FUNCTION f_tabtostring(i_varchar2 IN t_varchar2) RETURN VARCHAR2;
    END;Package Body:
    CREATE OR REPLACE PACKAGE BODY "PCK_REPORT" AS
      FUNCTION f_tabtostring (i_varchar2 IN t_varchar2) RETURN VARCHAR2 IS
                                o_string VARCHAR2(32767);
      BEGIN
        FOR i IN 1 .. i_varchar2.COUNT LOOP
          IF i != i_varchar2.FIRST THEN
            o_string := o_string || ', ';
          END IF;
          o_string := o_string || i_varchar2(i);
        END LOOP;
        RETURN o_string;
      END f_tabtostring;
    END;Comilation works fine, but when I try to use the function with the following example:
    SELECT pck_report.f_tabtostring(CAST(COLLECT(mytable.col1) as t_varchar2)) as column1
    FROM mytable;it only returns an error ORA-00902: Unknown datatype.
    When I add the package name to the datatype at the cast in the sql statement, it returns an error ORA-00903.
    What is my misstake?
    Thanks,
    Thomas

    create a global type, and not in the package :
    1* create or replace type t_varchar2 is table of varchar2(100)
    SQL> /
    Type created.
    1 CREATE OR REPLACE PACKAGE "PCK_REPORT" AS
    2 FUNCTION f_tabtostring(i_varchar2 IN t_varchar2) RETURN VARCHAR2;
    3* END;
    SQL> /
    Package created.
    1 CREATE OR REPLACE PACKAGE BODY "PCK_REPORT" AS
    2 FUNCTION f_tabtostring (i_varchar2 IN t_varchar2) RETURN VARCHAR2 IS
    3 o_string VARCHAR2(32767);
    4 BEGIN
    5 FOR i IN 1 .. i_varchar2.COUNT LOOP
    6 IF i != i_varchar2.FIRST THEN
    7 o_string := o_string || ', ';
    8 END IF;
    9 o_string := o_string || i_varchar2(i);
    10 END LOOP;
    11 RETURN o_string;
    12 END f_tabtostring;
    13* END;
    SQL> /
    Package body created.
    SQL> select col1 from mytable;
    COL1
    test1
    test2
    test3
    test4
    test5
    test6
    test7
    test8
    test9
    test10
    10 rows selected.
    SQL> select pck_report.f_tabtostring(cast(collect(mytable.col1) as t_varchar2)) as col1 from mytable
    COL1
    test1, test2, test3, test4, test5, test6, test7, test8, test9, test10

  • SUS: Vendor not created in SRM with partner function 19

    Hi,
    I am using SRM 5.0 MM-SUS scenario. The issue is related to vendor migration from ERP and updation in SRM.
    When i migrate a vendor with account group VEND from ERP then in SRM the vendor is properly created and a corresponding entry is updated in table CRMD_PARTNER. The vendor is alotted partner function 19.
    However when i migrate a vendor with acount group VEIN from ERP the in SRM vendor is getting created and is updated in vendor organisation but its entry in table CRMD_PARTNER is missing.
    Does this mean that only account group VEND is considered as vendor in SRM and thus assigned partner function 19 and gets a entry in mentioned table.
    Request your inputs.
    Regards,
    Ashish

    Vendor data is maintained in table CRMD_PARTNER only when transactional documents exist for the vendor.

  • How to create a trigger with Labview

    Hi all,
    i've this strobo lamp Perkin Elmer MVS 4100
    (http://pki8.mondosearch.com/cgi-bin/MsmGo.exe?grab_id=0&EXTRA_ARG=&host_id=42&page_id=20717&query=4100)
    and it does have a 9pin connector for the External Trigger.
    Do you think is possibile to connect it to the serial port of the pc
    and create via Labview the Trigger?
    The strobe needs a +5V, 20mA,10-100µsec pulse to be triggered.
    THanks in Advance.

    Hi COmpa,
    Do you think is possibile to connect it to the serial port of the pc
    and create via Labview the Trigger?
    The strobe needs a +5V, 20mA,10-100µsec pulse to be triggered.
    I think the 9-pin serial port on a PC swings between +/- 12V - if that's OK for your trigger, then a pulse of precise duration might be generated by configuring the port for serial output, a suitable baud-rate, careful selection of start or stop bit, and then sending a single byte byte where all bits are the same.  I've never done this, but I think it's possible!
    If the +/- 12V is a show-stopper, then consider using a parallel-port instead.  Its pins swing between 0 and 5V.
    http://zone.ni.com/devzone/conceptd.nsf/webmain/72C6FC6CE4AD4D1386256B1800794596
    Also, a "quick and dirty" way to control pins on either the serial port or parallel port is by writing to a VISA property node:
    Have fun!
    Message Edited by tbd on 06-28-2006 11:52 PM
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
    Attachments:
    VISAProp.jpg ‏3 KB

  • Creating a  query with group function and non group function

    Could anyone help me with creating a query that contain single row function and multiple row function in Report6i.
    what i want to do basically is to create a query that will display sum of certain columns according to a column in that table

    You can either calculate a sum yourself, or let Reports do it for you.
    1. select sum(column) from table where ....
    This will just display the sum, not the records.
    2. Make a query: select column from table where ...
    Create a summary field. You can do it manually or with the report wizard.
    That will create a report like this:
       Column
           10
           20
           15
       ======
    Sum    45                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Creating PHP pages with MaxDB PHP Generator (Access Database)

    Hi, I'am trying to create a webshop from an AccessDB, and while searching around I found MaxDB PHP Generator. However, how do I have to configure the Connection Properties?
    I know which database to use, but I don't know what I should put in @ 'host name' because the DB is on the same PC.
    I tried the computer's own name, but it didn't work. Have I missed something? I read through the tutorial quite carefully...
    The wiki's not very helpfull on this topic either, even with all the information.

    Better to be consistent.  You CAN have php,  htm, html and shtml pages in your site, but this could cause a server conflict if you accidentally upload more than one index page to the same folder.
    Simply rename your ***.htm pages to ***.php (F2).
    Remove ***.htm pages from testing and remote servers.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • SRM creates purchase requisition with wrong functional area

    Hi,
    We face the situation that we have postings to wrong functional Areas. These postings belong to a PO related GR. The PO originates  to a purchase Requisition. The functional area is can see there iw wrong, too. This seems the initial problem. If I create a PR using the same cost center and account it derives the correct funtional area. The PR is created out of SRM.
    We upgraded this year to EhP6 and it seems the issues started shortly after.
    Any idea how to correct?
    Thanks
    Exberliner

    Hi,
    Hope your BAdI is working now.
    MD51 is used for project. It creates replenishment orders against a WBS element. After this, you can run MD01 which will create replenishment order by material/plant level.
    If you have a question related to PS, maybe you can post your thread in this space:
    SAP Project Systems (SAP PS)
    Kind Regards,
    Mariano

Maybe you are looking for