Sequence hangs after LabWindows/CVI DLL execution

Hi there, I've written a DLL in LabWindows/CVI that I loaded and executed it successfully in TestStand, with the LabWindows/CVI adapter.
The weird thing is that, when the adapter is configured to debug DLL code with an external instance of LabWindows/CVI, the sequence just hangs after the DLL finishs executing its code.
If I turn off external LabWindows/CVI debugging, in the adapter configuration, it doesn't hang but other strange errors occur, even crashing TestStand!
I reviewed my DLL source code and I didn't find anything problematic. Is it possible that the DLL is overwriting a reserved memory region, thus breaking TestStand functionality?  Have you ever seen that?
Thank you very much.

Yes it's possible that the call is corrupting memory. The most likely way for that to happen is if the prototype specified in TestStand does not match what actually exists in the dll, or if you write more bytes to an array passed in from teststand than the step is specified to be passing from TestStand. Double-check that your prototypes match and that you aren't writing past the end of any buffers or accessing any pointers incorrectly.
Hope this helps,
-Doug

Similar Messages

  • Error transact.cpp when load LabWindows CVI DLL

    Hie,
    I'm a "newbie" about LabView, and I would like to call a simple LabWindows CVI DLL from LabView. Then for this
    I did also a very simple VI (I think : 2 buttons, the first to call my DLL function and the second to quit
    my VI). I define my DLL as indicated by NI, all seems OK. After placing and defining parameters about my
    DLL function in the diagram, If I "double clic" on the DLL icon in my diagrram, I obtain :
    "Failure Transact.cpp, line 1132 ...blabla...blabla".
    Another Time, I obtained a message (when I try to run) about
    "not enough memory"
    the solution is then to kill LabView Process or shunt Down !!!!!
    I've tried my "mini" projet on tow systems and I obtained the same results :
    Wind
    ows 2000 and Windows NT
    LabView 6.0 et Lab Windows CVI 6.0
    144 Ram and 256 Ram in the two PC and not another application running during my test :
    I think then I should have enough ram to do this !
    I did not see my problem
    thank a lot in advance for any help
    file attachement contain hardcopy of VI
    Thierry
    Attachments:
    Bug_Memory_LabView.doc ‏56 KB

    Hie,
    Now It's OK !!
    After submitting my problem to NI, NI has transmitted to me a simple program :
    a VI which simply calls a function in a DLL (which loads an UIR), and their solution runs.
    Their solution is the "same" as mine except in mine, I have added calls to "MessagePopup"
    just to study how running my program like this (see "// Here ->x" ) :
    Extract of my code in my DLL :
    int __stdcall DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
    int iValue=0;
    switch (fdwReason)
    case DLL_PROCESS_ATTACH:
    "// Here ->1" MessagePopup ("Avertissement", "DLL -> Init Ressources DLL LabWindows");
    if (InitCVIRTE (hinstDLL, 0, 0) == 0)
    return 0; /* out of memory */
    break;
    case DLL_PROCESS_DETACH:
    "// Here ->2" MessagePopup ("Avertissement", "DLL -> Free Ressources DLL LabWindows");
    if (!CVIRTEHasBeenDetached())
    CloseCVIRTE ();
    break;
    The problem is located to the line "// Here ->"
    When I drag the icon "Call Librairie function" in the diagram of my VI and I define parameters,
    immediately a "link" is established between LabView and the DLL, the __stdcall DllMain is called !
    then LabView Environnement failed !, you have then to kill the LabView Process !
    By changing the "MessagePopup" functions with tracks (*) in a file, I can "debug" my program and I will
    have never this artefacts.
    change line // Here ->1 with TraceMsg("DLL -> Init Ressources DLL LabWindows");
    change line // Here ->2 with TraceMsg("DLL -> Free Ressources DLL LabWindows");
    void TraceMsg(char *szBuffer)
    int iValue=0;
    int iHandle=0;
    iHandle = OpenFile("D:\\Thierry\\Formation LabView-LabWindows\\trace.log",
    VAL_WRITE_ONLY, VAL_APPEND, VAL_ASCII);
    iValue = WriteLine (iHandle, szBuffer,strlen(szBuffer));
    iValue =CloseFile (iHandle);
    Thierry

  • Installing of 2012 DS 1 hangs at Labwindows​/CVI Product 16 of 18

    Keep getting the error wrong volume in the drive. Insert 2012DS1DVD1. WHen I insert DVD1 I am prompted to insert 2012DS1DVD3.
    What's the fix?
    Mech.Mon

    Sorry, no error log to share; but I had the same problem:  Dev Suite installation ran fine up to same step (16 of 18), and then threw a 'Wrong Volume" error saying it wanted DVD#1 instead of #3.  When I put in DVD#1 and hit 'retry', it immediately threw the same error again, but this time asked for DVD#3.  After this second disc swap, the install proceeded, only to throw the same sequence of error messages when commencing to install the very next component.  In my case, it turned out the error messages were somehow being caused by my antivirus software, which I'd neglected to disable during the install.  The key hint was the title on the error popup:  'avgrsx.exe' is a component of my AVG antivirus software.  When I disabled the AVG antivirus, the remainder of the installation proceeded without interruption.  Oops...

  • Passing Engine Handle to LabWindows CVI

    Hi All,
    I have run into a situation in test stand where I want to use it in conjunction with a DLL that I have developed in CVI.  In order have them interact properly, I wanted to pass the current TestStand Engine handle into my CVI DLL.  Afterwards, the plan is to use that engine handle along with the tsapicvi activeX control to do what I need to do.
    However, I cannot seem to get this working correctly, as I keep getting an invalid handle error from my CVI activeX controls with the handle I have passed into it from teststand.  Here is what I have so far.
    In TestStand Sequence A calls the CVI DLL:
    Sequence A has a single parameter called Engine.
    Parameter Engine has the teststand Category TSObject with type TS::IEngine passed By Value.
    The value passed into the parameter Engine is RunState.Engine
    The CVI DLL has a single function GetHandle
    GetHandle has a single parameter which is TSObj_Engine *ts_engine.
    This function calls TS_EngineGetLicenseDescription (*ts_engine, NULL, 0, &desc); (just a random function that I use to test it).
    Any suggestions on where I might have gone wrong with this?
    CVI 7.0
    TestStand 3.1

    Hi Ray,
    Thanks for the quick response! 
    To answer your question, yes, I do set the Engine parameter in TestStand to RunState.Engine.
     However, all I know about the TS:IEngine containter is that it has one (or more) data fields that get passed to my DLL.  I don't know what those fields are, so on the DLL end I am not sure what I should be getting.  i.e. the function prototype in my DLL should probably contain some struct, but I don't know what the struct is.  The only guess I can make is that teststand is passing me a TS_IID_Engine type struct (defined in tsapicvi.h).  However there are 4 data fields in this struct convienently labeled Data1 - Data4, all of which i tried using as a handle, and none of which worked.

  • How to access the result list in teststand after execution using labwindows​/cvi

    I am developing a user interface in labwindows/cvi that runs multiple teststand sequence files and would like to combine their reports (generated in teststand) into a single file at the end of a UUT. What is the best way to do this? At the moment, I'm trying to access the result list local variable after the execution has ended using API calls from labwindows/cvi and an end-of-execution callback event but those run-time variables do not exist anymore. How do I get a hold of the result list array at the end of an execution? I would like to grab this variable and pass it along from sequence to sequence using labwindows/cvi and not teststand itself. Is this possible? Any help would be great.
    Thanks in advance,
    Luis

    Hey Luis,
    Check out the response to this thread at the NI TestStand board here!

  • The applicatio​n uninstalle​r ,created with Labwindows CVI, doesn´t work after upgrading to 2010 version

    Hi,
    I have been working with Labwindows CVI 2009 with no problem but after upgrading to 2010 version I have the following problem:
    When i´m going to execute the unistaller, either from Windows Control Panel or directly from the uninst.exe icon, it doesn´t work. The PC thinks a few seconds and does nothing, and it happens with all the applications I build with Labwindows CVi 2010.
    Thanks,
    Asier
    Solved!
    Go to Solution.

    Hello -
    Are you installing these distributions on a non-English operating system?  If so, the first thing to try would be the workaround listed on this known issue. 
    The known issue only lists Italian OSs as the troublesome OS, but it could actually happen on many different non-English OSs. I will update the text accordingly the next time I update the known issues list.
    NickB
    National Instruments

  • I want to call DLLs generated in LAbWindows CVI in Borland C++ (BCB 6)

    Hi,
    I want to call DLLs generated in LabWindows CVI in Borland C++, I am using BCB 6 and LabWindows CVI 8.
    I am able to call these functions in VC++, But getting following error in BCB
    ":[Linker Error] 'D:\GAJANAN\CVIDLL.LIB' contains invalid OMF record, type 0x21 (possibly COFF)"
    Please somebody suggest me how to solve this problem.
    Thanks and Regards
    Gajanan

    Duplicate post.

  • Using DLLs created with LabWindows/CVI 8.0.0 in LabWindows/CVI 8.0.1

    Hi,
    I have created a project containing some methods with LabWindows/CVI 8.0.0 and then build the project and generated the DLL and LIB files. These DLL and LIB files are working fine in another projects created in LabWindows/CVI 8.0.0 (even on another machines).
    But when I use these DLL and LIB files in a project created with LabWindows/CVI 8.0.1 on another machine and try to call the methods of these files, the following error occurs: -
    "The program has caused a 'Unknown' fault at 001B:7C812AFB"
    Is this error occurs due to ther version mismatch or there is some other problem?
    Please help me to resolve this issue.
    Thanks,
    Sarabjit Singh

    Judging from this, I don't think NI has a newer version of this tool:
    http://forums.ni.com/t5/Measurement-Studio-for-VC/Convert-project-from-LabWindows-CVI-to-Visual-Stud...

  • Q: Must one use special LabVIEW types (e.g. float64) for DLLs in LabWINDOWS/CVI?

    Hello,
    I have recently started compiling C code using LabWindows/CVI, and have successfully called a simple DLL function from within LabVIEW.
    I have a question about the types defined in LabVIEW's extcode.h file:
    These are defined to explicitly quantify the number of bits used for each data type (e.g. float64 instead of float) in order to eliminate ambiguity across compilers.
    When I am using LabWindows/CVI to compile, do I need to use the LabView numeric types defined in LabView's extcode.h, or can I use the standard C types (int, float, etc.)?
    Is there a distinction between having to use these special types for CIN versus shared library calls in LabVIEW?
    Thanks
    in advance,
    Frenk

    You do not have to use the defines in extcode.h, but you certainly can if you want to.
    The float64 is equivalent to CVI's "double", and the float32 is equivalent to CVI's "float".
    These correspond to the double- and single-precision types in the IEEE Standard for Floating Point Arithmetic, IEEE-754.
    I hope this helps.
    Brian

  • [Labwindows/CVI] Integration d'une DLL VC++

    Bonjour à tous,
    J'ai une DLL VC++ avec le .h et le .lib et je n'arrive pas à l'integrer correctement dans un projet CVI.
    dans le .h j'ai une fonction declaré comme suite
    GET_TX(const int FreqMhz, double& resultsevm);
    Labwindows n'accepte pas le passage par reference (double&) donc j'ai modifier la declaration comme suite à fin de l'integrer
    GET_TX(const int FreqMhz, double *resultsevm);
    c'est vrai que j'ai pas d'erreur de compilation suite a cette modif, mais il me semble que la valeur resultsevm retourné par la DLL pas correcte (valeur tres grand % au valeur attendu ) !!!
    Pouvez-vous m'expliquer comment faire pour integrer la dll correctement ?
    si non comment loader la dll dynamiquement ?
    merci d'avance

    Bonjour Tanite, et bienvenue sur le forum de discussins de National Instruments.
    Voici deux documents qui pourraient éventuellement vous aider à utiliser votre DLL dans votre projet CVI :
    1. Creating Import Libraries for a DLL in LabWindows/CVI
    2. FAQ: Using Dynamic Link Libraries with LabWindows/CVI
    Cordialement,
    Vincent.O
    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;}
    Été de LabVIEW 2014
    12 présentations en ligne, du 30 juin au 18 juillet

  • Testand will not convert my labWindows CVI sequence file to a TestStand sequence file.

    Testand will not convert my labWindows CVI sequence file to a TestStand sequence file.
    Attachments:
    ACC3.squ ‏3 KB

    If you are using an older version of the CVI Test Exec toolkit, check with your local Field Sales rep to see about getting the necessary software to use for temporarily upgrading your existing Test Exec sequences to version 2.0 for migrating to TestStand.

  • Labwindows​/CVI OI crashes when running sequence on the deployed system

    My Teststand Sequence runs fine on the development system. But when I run it on the target system using the Labwindows/CVI OI it sometimes just crashes and the Microsoft bugreporting tool comes up (see attached screenshot). If I run the OI out of the CVI development environment, it only shows a useless segmentation fault message when it crashes.  Any ideas, how to find the reason for the crashes ?   
    Is there any option ( other  than making screenshots) to save the information collected by Microsoft  and to use it for finding the bug ?  

    Hi Allen,
    Yes it is a popup panel used for input of serial and part number in a customized preUUT callback. 
    But installing But installing CVI runtime 8.0 doesn't solve the problem.
    It still sometimes crashes and sometimes the popup panel looks hosed (see attached pictures).  In that case running the sequence was OK and the during the next run of the preUUT callback the panel looked OK again. But when closing the OI ,there were error messages  ( see attachment) .
    It seems that there is some memory corruption going on, but where ?  The code in the preUUT callback seems to run fine on the development system ( neither crash nor corrupted panel) and is also used in two other sequences running on other PCs without showing that problem so far.
    Attachments:
    anweisung.png ‏7 KB
    numbers_damaged.png ‏4 KB
    numbers_normal.png ‏4 KB

  • Calling test sequence from CVI DLL that use ATL COM object does not work

    I am trying to call some DLL function writen in CVI from teststand. The CVI DLL is using ATL COM object(Written by me).
    The ATL COM object making instance of several ATL COM object inside it (including two controls that contains dialog). If I use a client writen in VC++ 6 and use the ATL COM (writen by me) works perfectly. But if I try to use it from CVI DLL it does not work any more.
    What is wrong? The client is passing an IUnknow interface to my component. Can anybody explain me what is wrong?

    It is not clear from your question as to what is specifically failing. If possible, one option would be to remove TestStand from the picture and see if the problem still occurs using a CVI EXE that invokes the CVI DLL.
    Scott Richardson - NI
    Scott Richardson
    National Instruments

  • Is it possible to step into a CVI dll when called by TestStand?

    As the question says: "Is it possible to step into a CVI dll when called by TestStand?"
    I am sure Ray F. may have a few tricks up his sleeves...  Hope you see this post, Ray!
    I compiled a dll using CVI.  The dll is called as a test by TestStand.
    I do have an "exe" version of the code that I use for debug with a testbed, but the behaviour is not the same as testing the actual target while running TestStand.  My goal is to get as close as possible to the real events.
    Thanks,
    JLV

    Sorry about that,
    There are two ways as I was saying:
    1. You can configure the CVI adapter to Execute Steps in a External Instance of CVI (requires CVI 6.0 or greater).
    Only go to Configure->Adapters and select the LabWindows CVI adapter and click on configure and select the corresponding option.
    After that set a break point in the step that you want to debug.
    An external instance of CVI will be launched where you can set break points and step into the code.
    2. From CVI Specifying an external process:
    In CVI go to Run Specify External Process and enter the seqEdit.exe as the program name (you have to browse to the location <TestStand>\Bin\SeqEdit.exe).
    As the argument you enter the name of the sequence file you want to debug.
    Now just select Run->Debug SeqEdit.Exe
    The Sequence Edtior will be launched and you can set break point in your CVI code and step into it when the step is executed.
    Check the Using LabWindows/CVI with TestStand reference manual for more information.
    I hope it helps you to get started.
    Regards.

  • LabWindows/CVI 2013 SP2 stops working when I try to open a file using the project file menu.

    I have windows 7 on my system and sometime late last year I starrted getting a Windows dialog telling me that LabWindows/CVI has stopped working when I try to open a file from the project file menu.  I also get an error when I run a project debug mode and use a selectFilePopup in the code.  The error says, "The program has suspended execution at address 0x75D5025E.  No source line information is available."  I've tried removing and reinstalling CVI to no avail.  Any suggestions?

    Constantin,
    Thank you for your response.  I've attached screnshots showing the version details for kernal32.dll and ntdll.dll.  I also looked at the updates to see which might have been installed when the problem started.  Unfortunately there are 15-20 updates every month.  I didn't take note of when the error started to occur.  At first it only affected my ability to open files from within the project (i.e. file->open->Source, etc).  Then I went back to modify a project that had a SelectFilePopup and found that that wouldn't work either. 
    Attachments:
    ntdll.dll version.jpg ‏15 KB

Maybe you are looking for

  • Satellite Pro A200-1NB - Can I use Windows 7 64bit?

    This is my laptop: Satellite Pro A200-1NB Part Number : PSAE7E-00V00CG3 http://eu.computers.toshiba-europe.com/innovation/jsp/autoDetect.do?service=EU&ACTION=PROCESS_DETECTION& TYPE=FORWARD&SOURCE=SMP&COUNTRY=&QSA=TRUE&MODEL=Sa tellite+Pro+A200&SERIA

  • Regarding Non-Cumulated Key figures

    Dear All, I wanted to create Multiprovider which includes infocube having Non-cumulative key figures .When I am including that Non-cumulative key figure in the Multiprovider , I am getting an error "Inconsistencies were found when checking MultiProvi

  • Lightroom 3.2 out of memory issues

    I had been using the beta version of Lightroom 3 without issues.  Once I installed the shipping version I get out of memory messages all the time.  First I noticed this when I went to export some images.  I can get this message when I export just one

  • Can't send email on my ipad

    I have set up my ipad and iphone to send/receive mail. My iphone works fine, my ipad, however, will not work. I can get emails, but when I go to send emails I get the 'whoosh' sound that the email is sent and a popup window that says "A copy has been

  • Custom shape library

    Hi all, is there a way to have the custom shapes library always open on a panel, like the brush preset panel? I am using them a lot and I don't understand why I still have to right click to select an other shape, and I cannot  have it on a panel like