Saving all data from a while loop

I already asked a similar question but it might not be very clear and there were some concepts that I could not well understand.
1. I have a key pad to generate DTMF stream signal (I call it stream because it contains multiple tones which make up of a complete phone number)
2. I would like to save it as a wav file but I guess other format is okay and because the write to wav file does not support append so for this particular case, I use write to waveform instead of write to wav
My approach is to have a queue structure so I can write each iteration result to a file.
i)When I try to retrieve the data, there is nothing but 0.
ii)my intention is to get 8000 sample per second (fs = 8,000) but it save the data so fast
I attached the file so if there is way to solve the problems, please help me. 
Solved!
Go to Solution.
Attachments:
SignalGenerator.vi ‏52 KB

I believe what is happening is that your producer loop is iterating even when there is no key press and sending blank or default data to the consumer and overwriting the test.wav file.  
Easy way around this is to put an event structure in the producer that only enqueues data when there is a key press.   I can't see into the Mathscript node so I'm not sure what's going on there, but I suspect the default output (e.g all of the Booleans are false) is for zero-length arrays on f1 and f2 and this is getting enqueued and overwrites any real data that might have been in test.wav.
It should be possible to append to a .wav.  I have attached a proposed method.  Caution that this in your consumer will take longer and longer as the file grows as it needs to read in the file every time.  
Attachments:
Untitled 3.vi ‏8 KB

Similar Messages

  • How can I write waveform data from a while loop?

    Alright, I have a NI-5122 high speed digitizer that I need to acquire 10,000 waveforms. I am currently using the NI example code "niScope EX Multi Record Fetch More Than Available Memory.vi" to do this and then onto that later. I set the Number of Records to 10,000, min record length to 8192, and the min sample rate to 100M (S/s). On the Fetch vi,  I set it to get a 1D Dbl array and then send it to the while loop edge for auto indexing. What I want is to take each waveform and write it to a file next to the previous waveform not append it to the bottom of the previous one. I can do 100 and sometimes 1000 waveforms with my current setup and then use "write measurement to file.vi" to save the data, but at 10,000 it says that the memory is full. I have 256 MB on the NI-5122 and 4G of memory on my host computer. My reasoning is that if the NI-5122 can hold all that data then why can't my host computer. I have tried to fetch using 2D Dbl and transpose that matrix and send the data to "write measurement to file.vi" inside the loop and append the data that way, but when I do this the card does not acquire any data. Which seems like a software problem. I know this is probabaly worded poorly, so just post a response if further explanation is needed.
    Thank you.

    Hello,
    It sound like you might have received a LabVIEW: Memory is full message.  Are you also graphing this data as it is being acquired?  Are you building an array inside the loop?  At the 100 MS/s rate, you are using a lot of memory to acquire, graph, build and transpose array data, and then write to file.  If you are saving to file and do not necessary need to see the data, I would suggest taking the graphical indicator out of the code.  Please review some of the KnowledgeBases linked below about the LabVIEW: Memory is full.
    KB 36QD14V3: Why Do I Receive a "Memory is Full, VI Stopped at Loop Tunnel 0xXXXX" Error?
    KB 3ZNDGRS9: LabVIEW "Memory is Full" Error
    Samantha
    National Instruments
    Applications Engineer

  • How to export a continous waveform data from a while loop?

    Hello there,
    I need to add noise signal to my waveform which is read from a binary file. I use noise generate vi (deleted the density part) from NI example as my sub VI, and put it into a while loop in order to get the continous noise signal, but I don't know how to export this data. There's no waveform come out from the noise waveform output tunnel (on the while loop). I used output tunnel, didn't work, tried shift register, didn't work... Can anybody help?
    Also, how to fix the dt problem for the noise generate vi and my original data ( from binarty file)
    Thanks in advance!
    Wendy

    hi
    I think notifier can do the trick (an example is shown in the master-slave template).
    Another possibility can be a FG (or action engine, look for the nugget ActionEngine, it will change your LV-coding life !)
    N

  • Getting data from a while loop while running.

    Hello,
    I did a program that call a sub-VI which is doing experiment and have its own timer.
    The sub-VI is a while loop and the stop condition of this loop is the elapsed time of my timer.
    What I want to do is to be able to get the elapsed time in my main program during the execution of the sub-VI (every second of its execution).
    First I assign the elapsed time in the sub-VI as an output of it. But of course the elapsed time is only updated in the main VI only when the while loop has finished. So I tried several solution: property nodes, local variable, global variable.
    When I am using global variable, I can see the elapsed time being updated during the while loop when I open the global variable VI. But the result is always the same: in the main VI the elapsed time is only updated at the end of the while loop.
    I think that is the global variable is updated every time, I could be able to get its data to my main VI?
    Does anyone have an idea?
    Thank you,
    Meach

    I tried using shared variable and reference without succes.
    I will keep searching.
    I enclose my VI that I simplify the most but with still keeping the shape of my real program. If you can take a look I will really appreciate.
    The goal is on the top-level VI to be able to see the updating data time in real time.
    Thanks,
    Meach
    Message Edited by Meach on 07-23-2008 04:13 PM
    Message Edited by Meach on 07-23-2008 04:14 PM
    Attachments:
    Elapsed Time.zip ‏25 KB

  • Best way to copy ALL DATA from song to song?

    Hello everyone,
    I'm in the middle of scoring a film and have ran into what seems to be a corrupted song, and want to attempt to transfer all data from this song into a new file.
    I'm running multiple global tracks with changes in tempos and time sigs all over, multiple audio tracks, and various Virtual instruments. I also have an extensive environment in which I use instrument tracks to access my exs instruments, as well as multi-instrument tracks for kontakt 2. Of course I have this saved as a template, but as you know as projects progress, the current song rarely looks like your autoload. So simply copying and pasting will not work, as I have many new instruments and audio files in different places in my arrange page. Thus when I try to copy and paste, logic sees that the current tracks are not "correct" and asks to "create new instruments" which seems to randomly throw all the instruments to the bottom of my arrange page, making it all out of whack!
    With some help from the audio config window and some manual editing of the arrange page, I was able to get my song pretty much back to normal, but for future reference, what is the best way to transfer all of my data to another song, while still keeping the look and functionality of the song intact?
    Thanks in advance for your help! If it helps to see what I'm talking about, I'm willing to post my song file for reference, just ask.

    I'd LOVE to somehow avoid #4 if possible. As I stated
    above, my projects always change from the templates
    due to extra audio tracks, audio instruments, etc, so
    a simple "copy and paste" does not seem to work.
    Is there something I'm missing?
    Yup, I was missing something really simple. If you choose NOT to copy instruments, it will ask you to keep the instrument or create a new track. If you keep the instrument (since my instruments names remained the same as the template) logic will connect the tracks with the instruments and only put the additional tracks (i.e. extra audio tracks etc) on the bottom. WAY COOL!
    Now my process is a little easier, however if you have any other tips so share please feel free to post.

  • Fetching all data from MS access PROBLEM !!!

    Hi all,
    I am having problem of fetching all data from MS ACCESS, ie, I have 112 rows of data, yet when executing query SELECT * ... only 70 items are retrieved. Don't know why, but the retrieval prcess stops on item 69 and want get the rest of the data.
    I am executing the query in a WHILE loop, don't specify the number of loops !!! so I should be able to get all of the data. Why then I always only get 69?
    Second q.
    What is the right SYNTAX for retrieving specific data. ie. SELECT id from images WHERE size = 58
    is this correct? ie. size is declared as number?
    ANy help would be much appreciated.
    Thanks

    1. Where from you are fetching the data? Is it from bean or JSP or servlet? Can you post the code?
    2. Yes. the sql syntax is correct.

  • Re: exit from a while loop in sub vi

    I think the mail didn`t get through first time. Repeat posting - Sorry if
    this occurs twice
    Shane
    Hallo,
    Can the use of occurrences solve this problem?
    The Main program can create an occurrence which can be passed to the
    sub-VIs. Upon pressing the button to cancel the loop, the occurrence can be
    set, instantly transmitted to all other VIs sharing which were passed the
    same occurrence. Of course a small handling routine has to be written (say
    a sequence parallel to the executing while loop waiting for the occurrence
    and then setting the exit parameter to "true") but this is trivial.
    I have checked this with a small program splitting an occurrence to three
    seperate VIs and it works.
    If you want, I can send a cop
    y of it.
    It may well be possible with notifiers or something else, but I have far
    less experience with them.
    Hope this helps
    Shane
    >pcu schrieb in Nachricht
    ><[email protected]>...
    >>Main vi has several sub-vi's. Each sub vi has a while loop and Boolean
    >>button. When program runs, sub-vi front panel appears, and I can
    >>stop/continue the while loop. But when I stopped a while loop in a
    >>sub-vi, I cannot control other while loops in other sub vi.
    >>I need exit function from a while loop, not stop function of entire
    >>program.
    >>Thanks.
    >
    >
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

    The notifier is probably better than occurence at this case - than it is not neccessry to write a parallel sequence.
    The use of notifier is very simple, just follow an example in Help/Search example -> Advances -> Execution control -- Synchronization -> SubVI notification.
    Good luck
    Ferda

  • Exit from a while loop in sub vi

    Main vi has several sub-vi's. Each sub vi has a while loop and Boolean button. When program runs, sub-vi front panel appears, and I can stop/continue the while loop. But when I stopped a while loop in a sub-vi, I cannot control other while loops in other sub vi.
    I need exit function from a while loop, not stop function of entire program.
    Thanks.

    Hallo,
    Can the use of occurrences solve this problem?
    The Main program can create an occurrence which can be passed to the
    sub-VIs. Upon pressing the button to cancel the loop, the occurrence can be
    set, instantly transmitted to all other VIs sharing which were passed the
    same occurrence. Of course a small handling routine has to be written (say
    a sequence parallel to the executing while loop waiting for the occurrence
    and then setting the exit parameter to "true") but this is trivial.
    I have checked this with a small program splitting an occurrence to three
    seperate VIs and it works.
    If you want, I can send a copy of it.
    It may well be possible with notifiers or something else, but I have far
    less experience with them.
    Hope this helps
    Shane
    pcu schrieb in Nachr
    icht
    <[email protected]>...
    >Main vi has several sub-vi's. Each sub vi has a while loop and Boolean
    >button. When program runs, sub-vi front panel appears, and I can
    >stop/continue the while loop. But when I stopped a while loop in a
    >sub-vi, I cannot control other while loops in other sub vi.
    >I need exit function from a while loop, not stop function of entire
    >program.
    >Thanks.
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

  • How can I transfer data between two while loops in parallel

    Hello,
    I have two while loops in parallel and I want to transfer data from the first to the second loop. The problem isthat data are transfered only when the first loop ends. I tried with queue but it doesn't work. How can I do, preferentially without global variable ?
    Thanks.

    I join a very simplified VI's because the real works with PXI, RT, ...
    When you run the "secondVI.vi", no data comes in array from the "firstVI.vi".
    As I said in my first message, I tried with queue too but it doesn't work, because when the terminal go out from the while loop, while loop have to be ended to send data.
    Attachments:
    transfer_data.zip ‏20 KB

  • Transfer all data from blackberry bold 9780 to iPhone 5

    I have a iPhone 5 16 GB recently purchased, I need to transfer all data from the Black Berry Bold.
    I need all contacts, documents, pics, E-Mail set-up etc. basically everything.
    I need a seamless transition from one to the other. I have not even opened up the iPhone box yet.
    Does anyone have a simple easy way to do this?
    Only thing I have to work with is the iPad!
    Was thinking of iCloud but have no Wi-Fi connection here.
    Please help?
    F

    If anyone is still struggling with this problem for the iphone 5 I just figured out how to fix it! it wasn’t easy because google sync doesn’t work on a blackberry anymore and outlook doesn’t help if you don’t got it so I had to go the long way and spend 2hrs of my time figuring it out while the actual solution only takes 5 mins!
    So I downloaded an app called "Phone to Phone transfer" there’s other apps like this one but this is the only one that’s available on both blackberry and iOS so its the one I used and it worked, read: 3 steps to transfer all contacts from BlackBerry to iPhone 5
    1) Download the app on your blackberry and sign-up for an account i used an email i barely use and its free so it was all quick and easy
    2) Sync your contacts on your blackberry using the app
    3) Download the same app this time on your iPhone and use the same log-in details as you used when you signed up on your blackberry
    4) Sync contacts again and press download and... that’s it! all your contacts are now on your new iPhone.

  • How can i delete all data from treo 750 - where is the hard reset button for the treo 750

    I'm giving my phone to my brother and want to delete all my data from the treo 750 (AT&T).  All the other posts I read doesn't tell me where the reset button is.  Please Help!
    Post relates to: Treo 750 (AT&T)

    Hello and welcome to the Palm forums.
    A hard reset wipes everything off your device. A hard reset is performed by holding down the power/end call button while removing the battery from your device for a few seconds. Keep your hand on the power/end call button until you put the battery back into your device. After you put the battery back in, the screen will say "Palm Powered." Take your hand off the power/end call button. You will now see a screen in 5 languages prompting you to erase all data from the palm. The screen will say "erase all data? Yes - up, no - down" and you need to click on the up arrow (button on the 5 way navigator on the bottom of the treo). This will erase all the info from your device.
    I hope this was helpful!
    Post relates to: None

  • I would like to transfer all data from my iPod classic to my new computer with windows 8.1. My old computer's cpu died. Utilizing iTunes which only allows iTunes albums purchased at iTunes store. The cd's were loaded via iTunes originally.

    I would like to transfer all data from my iPod classic to my new computer with windows 8.1. My old computer's cpu died. Utilizing iTunes which only allows iTunes albums purchased at iTunes store. The cd's were loaded via iTunes originally.

    Install disk drive from old computer in an external enclosure.
    Then copy the complete iTunes library from the disk drive to the disk drive in the new computer.

  • Selecting all data from employee where foreign key = null and show it in view

    Hi guys i have view like following :
    SELECT dbo.Nationality.NationalityName, dbo.Employee.DriverName, dbo.Employee.DriverID, dbo.Employee.NationalityID, dbo.Employee.ResidentNo,
    dbo.Country.CountryName, dbo.Employee.CountryID, dbo.Branch.BranchName, dbo.Employee.BranchID, dbo.Employee.JoinDate,
    dbo.Employee.ResignDate, dbo.Employee.HealthCarNo, dbo.Employee.JobID, dbo.Jobs.JobName, dbo.Department.DepartmentName,
    dbo.Jobs.DepartmentID, dbo.Employee.PlaceIssue, dbo.Employee.Deduction, dbo.Employee.ExpireDateMedical, dbo.Employee.PolicyNumber,
    dbo.Employee.Owner, dbo.Employee.Version, dbo.Employee.ExpireDateResident, dbo.Employee.Salary, dbo.Employee.SexID, dbo.Sex.SexType,
    dbo.Sex.FlagSex, dbo.Employee.MiritialID, dbo.Miritial.MiritualStatus, dbo.Status.StatusType, dbo.Employee.StatusID, dbo.Employee.UnactiveReason,
    dbo.Employee.BirthDate, dbo.Employee.DateToday, dbo.Employee.UserID, dbo.Employee.PassportNo, dbo.Employee.Period,
    dbo.Employee.AccountNo, dbo.Employee.Bonus, dbo.Employee.AccountType, dbo.Employee.PlaceOfBirth, dbo.Employee.EmplyeeName,
    dbo.Employee.ExpireDateresidentHijri, dbo.Employee.PassportDateStart, dbo.Employee.PassportDateExpire, dbo.Religon.ReligonName,
    dbo.Employee.ReligonID
    FROM dbo.Nationality INNER JOIN
    dbo.Employee ON dbo.Nationality.NationalityID = dbo.Employee.NationalityID INNER JOIN
    dbo.Country ON dbo.Employee.CountryID = dbo.Country.CountryID INNER JOIN
    dbo.Branch ON dbo.Employee.BranchID = dbo.Branch.BranchID INNER JOIN
    dbo.Jobs ON dbo.Employee.JobID = dbo.Jobs.JobID INNER JOIN
    dbo.Department ON dbo.Jobs.DepartmentID = dbo.Department.DepartmentID INNER JOIN
    dbo.Sex ON dbo.Employee.SexID = dbo.Sex.SexID INNER JOIN
    dbo.Miritial ON dbo.Employee.MiritialID = dbo.Miritial.MiritialID INNER JOIN
    dbo.Status ON dbo.Employee.StatusID = dbo.Status.StatusID INNER JOIN
    dbo.Religon ON dbo.Employee.ReligonID = dbo.Religon.ReligonID
    suppose i need to show all data from Employee table (NationalityName,BranchName,JobName) where
    NationalityID =NULL OR BranchID=NULL OR JobID=NULL
    WHAT I DO
    Notes : I mean in topic(selecting all data from view not table
    meaning i need to show all data in employee table by view
    in case of forign key(any forign key)equal null

    I think you need to change 
    FROM dbo.Nationality INNER JOIN
    dbo.Employee ON dbo.Nationality.NationalityID = dbo.Employee.NationalityID
    to
    FROM dbo.Nationality
    LEFT JOIN
    dbo.Employee ON dbo.Nationality.NationalityID = dbo.Employee.NationalityID
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to get all data from nokia to i5s

    how to get all data from nokia E71 to i5s???

    if you can put those data in your computer then add it in iTunes. your iPhone 5s should get it thru syncing.

  • How to out from infinite while loop in sub VI

    Dear Sir,
    how to out from infinite while loop in sub VI from main VI
    attached photo for solution but I can't understand it and i can't find the function in photo 
    please help
    Attachments:
    stop_subVI_frm_main.JPG ‏36 KB

    Asking how to get out of an infinite loop is like asking how to find the end of a circle. I'm not trying to be sarcastic but by definition, if there is a way out of the loop, then it is not infinite. I think what you are asking is how to avoid creating an infinite loop. Is there something about the suggestions you have been given that you do not like? My favorite suggestion is the notifier but maybe you just need an example. Turn on context help and read about the notifier functions in the code below.
    This is your top level VI
    And this is your subVI
    If this seems too complex then a global variable will work too. But what seems simpler can cause much more complex bugs. You can code fast and spend lots of time debugging or you can code slow and spend less time debugging. Personally I perfer writing productive code than looking for bugs any time.
    =====================
    LabVIEW 2012

Maybe you are looking for

  • Select in stored procedures 11g

    I come from MS Sql Server, so select statements in Oracle are confusing, I have only 3 days experience with Oracle 11g I have managed to use SELECT INTO in my SP Can anyone provide an example of select using a for loop_+  AND  an example of select us

  • Enable Recipient field in Service PR

    Dears, The requirement is to enable the 'Recipient' field for 'Service' (item category 'D') PR.  In other PRs it is enabled, however for service it is coming as display only.  We checked in the 'Define screen at doc level' but this field is not there

  • Report run very slow

    Hi From the SE30, the system call 'fetck MKPF' consume a lot of time, the code is like below. Could anyone please advise how to improve it? Thanks clear lt_temp1[].    select "a~mblnr          a~budat          b~matnr         b~MBLNR         b~zeile

  • Camcorder Compatability

    Hi We have just bought a MacBook pro with iMovie HD 6 and were wondering which camorders were compatible. We bought a JVC HDD camcorder and it would not work with iMovie as it recorded in mpeg 2. The apple web page showing compatability does not seem

  • I can't record straight into iMovie with my built in iSight

    My built-in iSight works with iChat and Photo Booth, but not iMovie. How do I fix this?