I get "dynamic memory is corrupt" when I call HarmonicAnalyzer function

Hello,
I am using a PCI-6025E to acquire analog signals. I want to measure the THD of some of them, so I have copied the function "Total_Harmonic_Distortion" from the THD_Analyzer.prj example of NI.
Sometimes, my program crash when it tries to execute the HarmonicAnalyzer function.
My program is multi-threading, the acquisition and the THD measurement is made in the same thread.
Someone can help me to fix this problem?
Thanks

Dear SebastianN,
thanks for your suggestion. I have tried to call the "CVIDynamicMemoryInfo" before the HarmonicAnalyzer function, but it has no effect on the program itself (I get always the memory corrupt message).
Yesterday I tried to call the Total_Harmonic_Distortion only if the RMS value of my buffer is greater than 1.0, and I replaced all my malloc functions by calloc functions. Till now it seems to work, but I cannot understand why, and I'm not sure that really I fixed the problem...

Similar Messages

  • Memory card corrupted when transfering large size ...

    I get my memory card corrupted when I transfer large size files to it (usually movies)...
    and it doesn't return to bormal unless I format it.
    What can I do? I want to stay having these videos on my memory card to watch them on my n73.
    Thanks in advance.

    can any one help?

  • Dynamic memory is corrupt (Labwindows/cvi 2010)

    I have a multi threaded application....where I have a buffers allocated ineternally in the threads,,...A user interface is present to abort the therad execution.
    Here is the code in one of the threads (NOTE: status is set by a user button to EXIT the program):
    int EthernetDataStructureThread (void *functionData)
        CmtSetCurrentThreadPriority (2);
        EthernetData GetData={0}, *data=NULL;
        data = &GetData;
        /* Use a buffer to read the data from the queue which is coming from TCP read with fresh data */
        const void *BufferEth;
        int BytesRead=0;
        int BytesWritten=0;
        char ReadErrorMessage[256];
        BOOL bitset = FALSE;
        if ( (BufferEth = (EthernetData*)malloc(EthernetDataSize)) != NULL)
            while ( !status )
                BytesRead = CmtReadTSQData (Queue_TCPRead_EthernetData, BufferEth, EthernetDataSize, TSQ_INFINITE_TIMEOUT, 0);
                memcpy (data, BufferEth, EthernetDataSize);
                /* Empty the queue so that we don't have data in next time. */
                CmtFlushTSQ (Queue_TCPRead_EthernetData, TSQ_FLUSH_ALL, NULL);
                //Pass on the data to the Main thread
                BytesWritten = CmtWriteTSQData (Queue_EthernetData_Main, BufferEth , EthernetDataSize, 1, NULL);
                if ( BytesWritten != EthernetDataSize)
                     free(BufferEth);
                    BufferEth = NULL;
                    exit(0);
                Delay(0.02);
            if (status && !bitset)
                free(BufferEth);
                BufferEth = NULL;
                bitset = TRUE;
        return 0;
    My problem is: free(BuffEth) always says Dynamic Memory is corrupt......When I put a breakpoint and keep seeing the resource tracking window, I can see it getting executed fine as the resource tracking window greys out the memory block....but then suddenly free wants to exceute again...and causes the "dynamic memory is corrupt" error.
    I am using LABWINDOWS /CVI 2010 SP1 in WinXP.
    Please help me ASAP....very much appreciated.
    Regards
    NITIN
    -Nharish

    Thank you for your reply Jackie.
    I am calling Free only once...there is an If condition there.
    See the attched video for my problem...Free frees the memory block (see the greyed out portion in resource tracking window but still the statement controls remains there and free executes again, throwing error).
    Do you  think it is some sort of bug in LABWINDOWS.
    See the attached video.
    -Nharish
    Attachments:
    FreeproblemLabwindows.avi ‏4781 KB

  • How do I get the light to flash when a call comes in on my iphone?

    How do I get the light to flash when a call comes in on my iphone?

    Settings > General > Accessibility > LED Flash for Alerts ON.

  • How do i get the phone to ring when someone calls, it seems to only vibrate and I can't figure out how to turn on the ringer

    how do i get the phone to ring when someone calls, it seems to only vibrate and I can't figure out how to turn on the ringer

    look in settings:sounds and be sure you have a ring tone set, and both vibrate buttons are off.  Also be sure the volume slider id as far right as is comfortable.

  • HOW DO I GET PICS TO SHOW UP WHEN SOMEONE CALLS

    HOW DO I GET PICS TO SHOW UP WHEN SOMEONE CALLS
    it only comes up in a small box in the corner, please help thanks

    Pics assigned directly on your phone to contacts will appear full size. Pics assigned to contacts on your computer will only appear as thumbnails.

  • How do i get MYpicture to show up when I call people?

    I recently changed my phone number and the former owner's facebook picture shows up on my daughter's phone when I call her

    She needs to change her contact for that person in her contacts, in other words add your name and picture to your contact information. 

  • LabVIEW PDA reports COREDLL.DLL error when using Call Library Function Node

    I'm trying to build a LV PDA app that calls an external DLL file built using embedded visual C. When configuring the Call Library Function node I select the stub DLL, configure the I/O parameters and select OK. When the configuration dialog closes I get the following error:
    LabVIEW: LabVIEW.exe - Unable to Locate Component
    This application has failed to start because COREDLL.DLL was not found. Re-installing the application may fix this problem.
    I do not get this error when using the configuration dialog in the example VIs.
    Any suggestions as to the cause and/or the solution?
    Thanks,
    Ryan

    Hello -
    When you create a PDA VI that calls a DLL, you must include the .c or .lib file that corresponds to the DLL. Take a look at these documents:
    LabVIEW PDA Module Build Errors with VIs that Call DLLs
    Why Do I Receive Errors When Calling a C++ DLL from a Call Library Node Using the LabVIEW PDA Module...
    How To Call External Code in LabVIEW PDA for Palm OS
    H
    ow To Call External Code in LabVIEW PDA for Pocket PC
    Hope this helps!
    S Vences
    Applications Engineer
    National Instruments

  • What is an element,when we call a function write_from?

    what is an element,when we cal a function write_from what to assign for ELEMENT  and WINDOW...?
    Edited by: Alvaro Tejada Galindo on Feb 20, 2008 4:37 PM

    Hi shekar,
    The main reason of specifying the Function module Write_Form is to make the values visible in the particular window of the form.
    For Ref, see the Below Function Module:
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
        ELEMENT = 'HEADER'
        WINDOW =  'MAIN'
    EXCEPTIONS
        ELEMENT = 1.
    In the above example, I need to declare a element in the Main window. So I have passed 'MAIN' in window and 'HEADER' in element.
    REASON OF SPECIFYING:
    Suppose you want to display the values the internal table say suppose it_itab. If you specify this in the sap script like &it_itab-f1& or &wa_itab-f1& without using write_form wont work.
    So this will be specified as,
    SE38:
    Loop at it_itab into wa_itab.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
        ELEMENT = 'HEADER'
        WINDOW =  'MAIN'
    EXCEPTIONS
        ELEMENT = 1.
    endloop.
    Inside Script:
    Inside the Main window:
    /E     HEADER
          &wa_itab-f1&
    what happens is after the loop statement as soon as it encounters the write_form, it searches for the element 'HEADER' in the Main window and values become visible in the form.
    If u need any more details, please tell.
    <REMOVED BY MODERATOR>
    Thanks,
    karthik
    Edited by: Alvaro Tejada Galindo on Feb 20, 2008 4:36 PM

  • Layout - not recognize the element when i call the function write_form

    Hi experts,
    I got a layout(se71) that not recognize the element that i add in the MAIN window when i call the layout from a program.
    what could it be?
    i add the element in se71.
    any help will be appreciated.
    Michal.

    Hi!
    the write form that u are calling should be as below....
    CALL FUNCTION 'WRITE_FORM'
       EXPORTING
          element                  = 'ELEMENT'
          window                   = 'MAIN'
        EXCEPTIONS
          element                  = 1
          function                 = 2
          type                     = 3
          unopened                 = 4
          unstarted                = 5
          window                   = 6
          bad_pageformat_for_print = 7
         spool_error              = 8
          codepage                 = 9
          OTHERS                   = 10.
      IF sy-subrc <> 0.
        MESSAGE 'MAIN window not called properly'(006) TYPE 'E'.
      ENDIF.                               " IF SY-SUBRC NE 0
    in the layout see if the code there with data element is proper as...
    /E  ELEMENT
       &var&
    Also this write_form FUNCTION MODULE should be called  b/w OPEN_FORM and CLOSE_FORM Function Modules.
    Regards

  • Failed to run parallel path when using call library function node in LV2009

    I have a problem with two parallel paths not being run in parallel on LabView 2009.
    See the image below.
    This code initializes an external device, the upper part contains a call library function node to download my code into the device. When done, the function returns and the "Done" flag is set to True.
    The lower part contains a call library function node to check the download status, reporting the percentage of downloaded code.
    This updates a progress bar that is referenced by the calling VI module and this works fine in LV 7, 8 and 2011. The lower path of the VI updates the progress bar while the CLFN in the upper part is still downloading code to my device.
    Somehow, in LV2009 this does not work when running this inside my application. When running just the calling VI (the window showing the progress bar) it works but not when that VI is called by my application.
    Is there some limit on parallel threads that is different in 2009 than in other versions ?
    Or is there some other problem in 2009 that might cause this problem ?
    My labview version is 9.0f3 (32-bit).
    Regards,
    Rob

    I've just installed the DETT tool and checked what the different versions of LabView do.
    In LV2009 the application instance runs in a thread (5) but the modal dialog (the VI above) then drops to thread 0 and stays in thread 0.
    In LV2011, stays in the same thread as the application instance and only a trigger event (this could be the progress bar reference?) is executed in thread 0.
    So it seems there is a 'feature' in LV2009 where modal dialogs are by default not following the preferred execution system set in the VI properties ...
    When I change this from "same as caller" into another thread (I used "other 1") then my progress bar works as expected.
    I'm not a LabView thread expert (not even a novice ) so I'm just guessing that "other 1" as a thread is OK. This VI only runs during startup of the application to download the code to my device.
    To answer Ben's question: "What thread does a modal VI run in?":
    In LV2009, the modal VI runs in thread 0 (UI thread ?). When the preferred execution system is set to another thread, the modal dialog still starts in thread 0 but then switches over to the other thread.
    In LV2011, the model VI runs in the caller's thread (preferred execution system set to "follow caller") from start.
    Thanks,
    Rob

  • System.AccessViolationException Attempted to read or write protected memory. This is often an indication that other memory is corrupt. when executing compiled query

    Hi,
    In our company we have a very large application that has thousands of compiled queries, and we've been getting randomly AccessViolation exceptions randomly that crashes our process.
    This error happens randomly in several locations, always with the same top stack trace (data and queries are always different). do you know what could be causing this issue? or what we can do to trace the problem?,
    I have collected memory dumps of the error to get the stack trace and next are the stack lines that always show at the top of it:
    System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object, System.Object[], System.Object[])
    System.Delegate.DynamicInvokeImpl(System.Object[])
    System.Data.Objects.ELinq.QueryParameterExpression.EvaluateParameter(System.Object[])
    System.Data.Objects.ELinq.CompiledELinqQueryState.GetExecutionPlan(System.Nullable`1<System.Data.Objects.MergeOption>)
    System.Data.Objects.ObjectQuery`1[[System.__Canon, mscorlib]].GetResults(System.Nullable`1<System.Data.Objects.MergeOption>)
    System.Data.Objects.ObjectQuery`1[[System.__Canon, mscorlib]].System.Collections.Generic.IEnumerable<T>.GetEnumerator()
    System.Linq.Enumerable.FirstOrDefault[[System.__Canon, mscorlib]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
    System.Data.Objects.CompiledQuery.ExecuteQuery[[System.__Canon, mscorlib]](System.Data.Objects.ObjectContext, System.Object[])
    System.Data.Objects.CompiledQuery.Invoke[[System.__Canon, mscorlib],[System.Guid, mscorlib],[System.__Canon, mscorlib]](System.__Canon, System.Guid)
    The following is the windows version data:
    0:222> vertarget
    Windows 8 Version 9600 MP (64 procs) Free x64
    Product: Server, suite: TerminalServer SingleUserTS
    kernel32.dll version: 6.3.9600.16656 (winblue_gdr_pres14.140305-1700)
    Machine Name:
    Debug session time: Wed Feb 11 14:24:12.000 2015 (UTC - 6:00)
    System Uptime: 79 days 11:26:23.395
    Process Uptime: 2 days 3:21:31.000
      Kernel time: 0 days 0:46:05.000
      User time: 0 days 17:09:10.000
    .Net version: 4.0.30319.34011
    Thanks in advance,
    Israel

    Hi,
    try to set the
    ProxyCreationEnabled property of dbContext is set to true.

  • Getting message "download appears corrupted" when downloading any app from CC.

    I get this message with every app I try to download from CC. I am on Windows 7. How do I "uncorrupt" this? Does FlexNet have anything to do with this issue? If so, how do I install the correct version of it-FlexNet?

    Hi long86,
    It seems to be a problem with network, please follow the below steps:
    1) Disable Firewall.
    2) Disable Anti - virus from the computer.
    3) Open Internet explorer>> Tools>> Internet options>> Connections>> Lan Settings>> Only Automatic detect settings should be checked, rest will be unchecked.
    Is it an office network?
    -Ankit

  • Call is getting disconnect after 3 min when the caller is in queue

    Hi,
    I am using icm 7.0 with ip ivr 7.0. when all the agents are busy and caller is in queue,call is automatically getting disconnected after 3 min with the message " We are experiancing system problem and unable to process the call. please try again later" .
    Icm and ivr script are attached
    Regards,
    Dinesh Joshi

    Hi Chrish,
    you are right. the timer was for 180 sec only. now things are working fine after increasing the timer.
    Thanks a lot for your reply.
    Regards,
    Dinesh Joshi

  • How do I get a full ID picture when contact calls?

    How do I get a full contact picture on the screen when I get a call? I used to get it and know I get a small round picture.
    I've tried going to edit picture but no luck.

    You don't. It's a design change in iOS 7.1. you can join the legions of people that seem to be unhappy with the change by communicating your dislike for it at http://www.apple.com/feedback/iphone.html

Maybe you are looking for

  • BI Report error in Web-UI

    Dear CRM Gurus,   I am calling a report from CRM 2007 Web-UI and I get an error message " Error loading template 0TPLB_0CSALMC02_Q010_1 ". The logical connection to the BI System has been created. This is a standard report. How can I debug where is i

  • Why do my mts video files go into final cut pro

    from my sd cards and my camera but not if i transfer it to my hard drive then try to pull them off a seagate hard drive or a my book studio that both work for mac

  • Implmenting Reminders for a Notification - What is the correct method?

    Hi, I am trying to implement sending out reminders to a person who has a notification open. A Manager(UserA) gets assigned a notification(NoteA) to approve/reject. After 7 days, he should get a reminder saying that NoteA is waiting for his decision.

  • Click a button,a selection-screen box come out

    hi experts:     when I click one button in the dialog screen,a selection screen come out,I can input the parameters.how it come true?thanks!

  • Error in  T-CODE MIRO

    HI guru's very urgent have error in the posting the INVOICE VERIFICATION T-CODE MIRO HAVE A ERROR MESSAGE IN GREEN . MESSAGES IS INVOICE DOCUMENT STILL CONTAINS MESSAGES THIS DOCUMENT IS NOT SAVE PLS CLARIFIED OF MY ISSUE REGARDS SHIVA