passage of data container of teststand labwindows/cvi handle error

Hello

I'm moving a container of teststand parameter to labwindows/cvi using this UI API messages following this code created by Peter-r. example:

https://decibel.NI.com/content/docs/doc-23332

It is a great example to start with, but as I run using worldwide debbugging lying on the build options, I see that the handle of the containerData object is not released. If I add the CA_DiscardObjHandle (containerData) anywhere in the project, it gives me a FATAL_RUN_TIME_ERROR. This handle must be released? If I call a bunch of these user interface Messages, it will cause memory problems? My code runs right now, great, but I don't want to face a problem of memory later.

Any help on this will be great!

Thanks in advance.

-Luis

When you add throw it? Maybe you add it to the wrong place. You must add it just after the CA_FreeMemory() called as follows:

CA_DiscardObjHandle (containerData);

It should work.

You can also try the following instead of the functions:

CA_CreateObjHandleFromInterface (var, & IID_IUnknown, 1, LOCALE_NEUTRAL, 0, 0, & containerData);

I think that you will still need to get rid of the objhandle when using this API.

-Doug

Tags: NI Software

Similar Questions

  • LABWINDOWS CVI 2013 error: bad image in IValidateImage

    Hello

    travel form CVI 2012 to CVI 2013 I Get a sequence of the below errors in the application log.

    The errors seems to be generated whenever I have fly over the screen of the GUI of my application. After a sequence of these errors the application hang.

    Note that:

    -J' already installed the latest patch available for 2013 CVI

    -l' error was not present when compiling with CVI 2012

    -l' error is present also, when you distribute the application o windows XP

    Thank you

    Ezio Riva

    ERROR in widows application log

    The description for event ID 0 in source CVI could not be found. Either the component that triggers this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

    If the event is on another computer, the display information had to be saved with the event.

    The following information has been included in the event:

    [15:24:52.119] [IValidateImage] [FATAL] [.. \mgsource\image.c:9085 assertion failure]: FALSE (bad image in IValidateImage)

    Hi calou,.

    Do you agree with the workaround solutions provided by Daniel?

  • Passing a struct LabWindows/CVI TestStand

    I'm passing a struct in a dll written in CVI.

    Here's the problem: the code is written in CVI (c code) if I use "struct MyStruct * MyData" as the definition of parameter in the TestStand dll works fine. But if I set my struct using a typedef (i.e. typdef struct MyStruct) then use MyStruct * MyData as TestStand parameter generates a warning.

    I have a way to the adapter C\C ++.

    It's too late in the programming in order to go back and remove the typedef.

    So, how do TestStand accept the typedef?

    Thank you

    Carmine

    In ANSI C, struct names and type names belong to separate namespaces. You can declare the structs several different ways:

    (1) struct structName {int x ;};

    (2) typedef struct {int x ;} typedefName;}

    (3) typedef struct structName {int x ;} typedefName;} Note: structName may be identical to typedefName.

    I assume you are using the 2nd example above in which case LabWindows/CVI automatically generates a struct name (something like __unknown_1) which uses Testand.

    Even if you said it's too late to remove the typedef, you can add a struct name as in example 3 above? You can use the same name as the typedefName and TestStand will recognize.

  • DLL for LabWindows/CVI 8.0 with the bool data type

    Hello

    I want to use a new SWIR camera in LabWindows/CVI 8.0 (Windows XP 32bits).

    The company delivered with the camera produced a 32-bit dll by using Microsoft Visual C++ 2010. The .dll and .lib and .h files include a working SDK/API (some functions with the bool data type)

    Compilation-online syntax error, variable Boolean is not a data type in LabWindows/CVI 8.0

    Generate the import of DLL-online syntax error library

    I tried to convert bool char (typedef unsigned char bool => no more syntax error but the functions does not work.)

    What can I do?

    Martin

    Hello again, Naumann!

    Microsoft Visual C++ 2010 represents Boolean using 1 byte, as stated by MSDN: https://msdn.microsoft.com/en-us/library/tf4dy80a(v=vs.100).aspx

    I guess that you import C++ functions using the syntax for extern "C". Otherwise, because of the C++ name mangling wouldn't you able to bind C++ library against your code CVI.

    You can also specify how you import C++ functions?

    In addition, because you have not described the problem as a corruption of heads or runtime error, I guess the C++ library function is called correctly the CVI. That said, I tend to believe that the problem is not really in the mechanism of interaction of C/C++, but in the C++ library. If you would start calling a dummy C++ function returning an integer from a simple CVI application that should work, because redefine bool in CVI 1 byte must ensure that settings are correctly transferred onto the stack.

    If you need to create a wrapper function of C++ that is not using bool and calls the C++ function, I expect to return the same result.

    Maybe you are missing a few prior initialization steps required? The provider of the camera also comes all example code?

    Best regards!

    -Johannes

  • Are there examples of DataSocket up-to-date for Labwindows/CVI

    I am in the process of taking data to return data from test equipment using WiFi.  I want to use DataSocket, but all the examples I found for Labwindows/CVI are using data functions API DataSocket.  Are there more recent examples available to show how to put in place a socket connection and transfer data?

    Hello

    You want to take a look at this example transfer a DataSocket of using ASCII text file and see if it helps?

  • How to make a manager of UIMessage of PostStep of TestStand in LabWindows/CVI 8.1?

    How to make a manager of UIMessage of PostStep of TestStand in LabWindows/CVI 8.1?

    Hi all

    I have a problem of capture UIMessages motor TestStand for a DLL called from a sequence.
    A search on the forum gave rise to 2 posts on this topic or a similar problem, but with LV and unfortunately, they were not solved.

    TestStand Event 13 - UIMsg_StartInteractiveExecution is not captured by LV operator Interface

    Problems with ActiveX in LabVIEW 7 reminders

    In detail, I want to activate a DLL access the TestStand SequenceContext (variables) in phase of execution of the step.
    A pop-up Panel could then display variables such as the spy does, but more flexible user defined Panel window.

    He is currently working with a periodic timer that causes racing with TestStand conditions while monitoring the variables.
    It works 99%, but I want it to work 100%.

    I found the
     TS_ExecutionAddPostStepCustomUIMessage()
    to indicate to the engine, I want to be informed of one end of the stage with my private UIMessage.
    Next is to implement a callback with
     TS_EngineRegisterUIMessageCallback()
    to retrieve all UIMessages and filter my private.

    Sounds good - works for the capture of events, but TestStand locks and does not continue execution and not to carry out handling
    any operation of the user interface. I have tried 4 solutions (see code), no difference in the result.

    I must kill TestStand to get out of it.

    Attached you will find a stripped down a simple example to reproduce the problem.

    I'd appreciate any help.
    Thanks in advance.

    Kind regards
    Tom

    TestStand 3.5.0
    LabWindows/CVI 8.1.0

    Hello Nick,

    Thank you for your quick response!
    Yes, you are right. That works, I tried today, but...
    isn't this practice as I want it to be. The programmer of a sequence (not me) should take care of the good implementation of a reminder of PostStep to make it work, although he just wants to make a popup. It is not a real problem, but if you use a TestStand MessagePopup command, expected to implement another somewwhere command to make it work. Don't get me wrong, it's just that I don't think that it is a clean solution. And... at least, it is slower.
    I found a tutorial OR a LabView solution for this and two people were asking a LabWindows version. Of course, some are
    interested in this solution. These 2 functions, that I mentioned in my post should work somehow, otherwise they are fools.
    I would really like to know how.

    Thanks again anyway. I'll use your suggestion, if I don't get the problem solved at the root.

    Kind regards
    Tom

  • difference of initial value of string between the steps in the process and an external instance of LabWindows/CVI

    Hello

    I'm curious to know what I see using TestStand, LabWindows/2013 2013 with regard to initial in TestStand string values when you perform the steps in the process or an external instance of LabWindows/CVI.

    I have a step (CVI) string value that is used to check an array of characters stored in an EEPROM to test.  I pass on the Step.Result.String in the CVI by reference.  I then read the table charater of the EEPROM in the chain (Step.Result.String).  The string is then compared against the limit as specified in the test step breast.

    When I run this test step to perform the steps in the process selected in the popup Configuration of the adapter of LabWindows/CVI, it seems that the memory allocated for the string is filled with null characters.  Which is what I expected.

    When I run this test step to execute the steps in an external instance of LabWindows/CVI iselected of the Configuration of the adapter of LabWindows/CVI popup, it seems that the memory allocated for the string is filled with something else.  That is not what I expected.  For example what I see in the memory, it's the first characher is one byte NULL but the remaining bytes are some other values, as shown below:

    F0 00 AD BA 0D F0 AD BA 0D F0 AD BA 0D AD BA 0D AD BA 0D BA 0D AD F0 F0 F0
    F0 AD BA 0D F0 AD BA 0D F0 AD BA 0D F0 AD 0D AD BA 0D AD BA 0D F0 F0 F0 BA...

    In my code I make sure to write a null character in the following location table charater I just write in the chain so I have no problem with the test is working properly.  I have remove the writing from my code null character and was able to verity that the test passes when executing the steps in the process and fails during execution of the steps in an external instance of LabWindows/CVI.

    The returned string contains what I wrote for her, and then the rest of the string is filled with the values that are in the memory allocated for the string.

    Here's my Question: is this the expected behavior for the original string values in TestStand between both types of stage performances?

    Thank you

    Chris Young

    In general teststand not Initializes the unused portion of the string buffer, so it is expected that the values of the memory after character no endpoint will be different, or even to each call. If you happen to be get zeros after the null terminator which was probably due to random character (i.e. the memory allocated just arrived already having zeros in there) or perhaps a debug setting you use perhaps in the Visual C runtime (if you are debugging the process in visual studio or modify visual C runtime heap parameter). TestStand is not initializaing memory after the null terminator character in both cases (I checked the code).

    -Doug

  • table dynamic allocation labwindows CVI

    LabWindows CVI there a way to create a dynamic table? A table that contains a variable amount of memory.

    calloc () can be used in CVI to dynamically create a table of desired size, or a standard data type (int, double...) or a data type custom as a struct.

    Dynamically allocated memory must be released with free () when it is no longer used.

    Double * array = NULL;    Set the table pointer

    Array = calloc (numElements, sizeof (double));    Allocate memory and elements of al inizialize 0

    ... to use the elements in the array

    free (matrix);     Allocated dynamically free memory

  • LabWindows CVI and debugging dll MSVC ++

    We use a written LabWindows/CVI DLLS in the code for Teststand module. This DLL calls a DLL written in MSVC ++.  Is it possible to use the debugger of Labwindows/CVI debug this DLL MSVC ++ (if this DLL MSVC ++ is built with 'good' options)?  Or is possible only using the environment of development MSVC ++?

    Hello mkossmann,

    The CVI compiler generates different types of than MSVC debugging information.

    The debugger CVI doen't understand the debugging information generated by MSVC, so you cannot debug the dll compiled in MSVC.

    Constantin

  • LabWindows CVI RS-232 is not fast enough

    Hello

    Is it possible to write a C program which takes RS-232 data buffers and prints it on the screen?

    I ask this question because I write a program in LabWindows CVI and the data is not correct. I used SimpleTerm Gold to see what data are supposed to look like, but CVI misses some. I believe it is not fast enough and therefore lack of data.

    A C program (do not use the functions or reminders CVI) would be possible and better?

    Is it possible to make the CVI to work faster? I changed the environmental policy of the previous "do not sleep". There are two ComRdTerm because we're not getting all the other packages.

    Rate 115200 baud, no parity, 8 data bits and 1 stop bit. Most of the data I receive are 313 bytes and the smallest is 17.

    Any help would be MUCH appreciated as I am completely puzzled.
    Thank you

    Code is below.

    OpenComConfig (com, "COM9", 115 200 Baud, 8, 1, 0, 1024, 1024); / /< opens="" serial="" ports="">
    SetComTime (com, 0); / /< sets="" serial="" port="" to="" never="" time="" out="">
    T0 = clock(); / /< calculate="" how="" fast="" comrdterm="" is="">
    bytes_read0 = ComRdTerm (com, & buffer0 [0], 314, 10); / / read com and store it in the buffer
    sprintf (p_check0,"%.4s" & buffer0 [0]);
    T0 = clock() - t0;
    Double time_taken0 = ((double) t0) / CLOCKS_PER_SEC; / / in seconds
    printf("%d\t%f\t%s\n",bytes_read0,time_taken0,&buffer0[0]);
    Memset (buffer0, 0, strlen (buffer0)); / / Clears the buffer

    T1 = clock();
    bytes_read1 = ComRdTerm (com, & buf1 [0], 314, 10);
    sprintf (p_check1,"%.4s" & buffer1 [0]);
    T1 = clock() - t1;
    Double time_taken1 = ((double) t1) / CLOCKS_PER_SEC;
    printf("%d\t%f\t%s\n",bytes_read1,time_taken1,&Buffer1[0]);
    Memset (buf1, 0, strlen (buffer1));

    Thanks for all the help guys. I finally found the solution. The program was running too slow because I kept opening and configure ports (not shown in the code) I simply kept open ports and it works fine.

    I appreciate all the comments and insight. Each of them will definitely help me still to develop with CVI.

    Kind regards
    Keegan.R

  • LabWindows CVI Full recommended OI does not start

    I made an installer of deployment Teststand-2013. On a target PC (Windows 7 64-bit) it works fine. But on another target PC starting the Labwindows/CVI Full IO recommended (attached screenshot) fails with an error-145 when trying to load testexec.uir. Both targets have Windows7 64-bit and Office 2010 installed. How will I know what ActiveX control is missing or damaged on the second PC?

    I found http://digital.ni.com/public.nsf/allkb/9894BE2B832B7FDE86256ECD00041172. But the Office is installed, and ActiveX Control Pad is obsolete and incompatible for Windows7 64 Bit and is no longer available from Ms.

    mkossmann,

    You can use the option "Hide the license dialog box" on the Installation Options tab. This will not prompt the user to activate TestStand until they try to open the software after installation. What is the desired behavior?

  • Error selection LabWindows CVI Card Configuration

    I am trying to enter the Lab Windows CVI 2012 of TestStand 2012.  When I try to configure LabWindows CVI adapter to

    c:\Users\Public\Public Documents\National Instruments\TestStand 2012\Adapter Support\CVI\tscvirun.prj the window changes the path to

    c:\Users\Public\Documents\National Instruments\TestStand 2012\Adapter Support\CVI\tscvirun.prj and displays the message that it cannot find the file.  I use Windows 7 if that makes a difference.

    Hi herbertwatson,

    I have attached my tscviprj.ini. I have two TestStand 2010 and 2012 TestStand, installed on my machine but the ini is only in the 2010 directory. It is possible, he just needs to be an ini for TestStand work with all facilities CVI. Try to place it in the same directory as your tscvirun.prj for 2012.

    If this does not work, it may be useful CVI, TestStand and then reinstall.

    Kind regards

  • Announcement: LabWindows/CVI 2015 beta program

    Hello world!

    I am pleased to inform that the beta program of LabWindows/CVI 2015 is now open for new applications for registration. As a member of the beta program, you'll be among the first to use the next version of LabWindows/CVI, giving you the opportunity to give feedback of NOR and test your existing projects against the latest features of LabWindows/CVI.

    If you are interested in participating in the program, we encourage you to the request to participate by visiting www.ni.com/beta and choosing to sign up for the beta of LabWindows/CVI 2015 in the menu dropdown. All previous beta users must re-register for the beta of LabWindows/CVI for we ensure that have up-to-date information.

    We look forward to hear from you!

    Best regards,

    Hi all!

    The beta version of LabWindows/CVI 2015 concluded.

    Thank you

  • Question of curiosity: several versions of LabWindows CVI can be installed on the same PC?

    I'm curious.  Several versions of LabWindows CVI can be installed on the same PC?

    I'm used to LabVIEW, where Yes, it is possible.  However, with CVI, other than the additional support with newer versions, there may not be a problem to return to an earlier version.  I still wonder.  Several versions can coexist in the same PC?  Or they affect each other?

    Curious...

    R

    You can, BUT only one (the last) version of the CVI runtime will be installed - this behavior began with CVI 6 or more.  Before that date, you have completely installed parallel to several versions of the CVI.

    This can be a problem if you ever find that you have applications depend on a particular version of the RTE.  Theory of NI is that this editor is always backward compatible.

    And you might ask what is simply the RTE - the answer is that it is a set of DLLS and stuff that NEITHER really cares to list for you.

    Menchar

  • DirectInput with LabWindows/CVI

    Hello

    I'm trying to use DirectInput to obtain data on the position of a USB joystick in LabWindows/CVI. CVI 2013 comes with headers and libs for direct entry into its subfolder of the sdk and the DirectX SDK comes with a very simple example.

    However, already the first step in opening creating a directinput handle fails to compile - it is essentially copied verbatim from directInput documentation or the joystick sample provided with the DirectX SDK.

    #include
    #define DIRECTINPUT_VERSION 0x0800
    #include 'dinput.h.

    int main (int argc, char * argv [])
    {
    LPDIRECTINPUT8 di;
    HRESULT hr;

    HR = hr = DirectInput8Create (GetModuleHandle (NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, (VOID *) & di, NULL);

    return 0;
    }

    60, 42 error: from 'const GUID' (aka "const struct _GUID") to the inconsistent type parameter ' const IID *' (aka ' const struct _GUID *')

    18, 1 in file included from c:\Users\tpaprotta\Documents\National Instruments\CVI\Command-line Application.c:18:

    "dinput.h" (2682,83) c:\program files (x 86) \national instruments\cvi2013\sdk\include\dinput.h:2682:83: Note: passing argument to the parameter "riidltf" here ".

    The same code compiles without problem under Visual Studio 2012.

    Therefore, it is / was a number of questions. Yes, the example in question is C++, so instead of the call

    DirectInput8Create (GetModuleHandle (NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, (VOID *) & di, NULL);

    To call

    DirectInput8Create (GetModuleHandle (NULL), DIRECTINPUT_VERSION, & IID_IDirectInput8, (VOID *) & di, NULL);

    (IID_IDirectInput8 is defined differently depending on if C or C++ calls).

    However, if we make this change, the _IID_IDirectInput8 symbol is not found. The symbol is not in dinput8.lib (which is included with CVI), but rather in the dxguid.lib (which I couldn't find in the records of OR). It is distributed with the DirectX SDK - so I'm now a link against it. I'm curious, however, why NOT distribute dinput8.lib / dll and not other required libraries, which seem to be necessary to use.

Maybe you are looking for