Alignment of memory with CVI 2013 problem

Hello

I just installed 2013 CVI from CVI 2010 and opening my old projects, I'm in trouble with the alignment of the memory.

Not in all the projects that I opened, I get the problem, and I'm quite confused about this.

I used to keep in line with the limits of 1 byte of memory and I have thousands and thousands of saved file with this method.

I have prepared a very simple project (attached to this post) to illustrate the problem, consider that the result would have been with CVI 2010 'occupation of 5 bytes.

Pragma pack() change his behavior?

Y at - it a flag set in the Options menu or elsewhere?

If anyone has a suggestion please help me.

Thank you

Sergio

Hello

I found the problem, there's a semicolon that follows the directive of preprocessor #pragma pack (1), and it causes the pragma is ignored.

Remove the semicolon, everything works fine.

Sorry!

Sergio

Tags: NI Software

Similar Questions

  • Alignment Sidebar only with IE 8 problem

    OK, all the rookie here.  I worked in BrowserLab and Dreamweaver CS5 to set up the Web site.  In the browsers Firefox and IE 6, 7 and 9, the Web page looks available to Dreamweaver.  However in IE 8, the sidebar moves more to the right, in the region that should be the main body content.  After about 12 hours of watching this and try to find key by myself, questions its time to throw in the towel and ask the experts.

    Please take a look and say where I'm wrong.

    http://www.pacificshotgunacademy.com/index.html

    Thank you.

    Additional to that John was published in regards to the Doctype you also have a tag not closed in the ' header

    After the tag img src in your code)

    Pacific Header

    To do this:

    Pacific Header

  • Performance of CVI 2013 SP2 with CVI 2015 - Windows XP problem

    I see that XP isn't an operating system in 2015 of the CVI.

    Most of our PC are Win7 now, but we have some legacy units which require XP due to a limitation of external controller processor.

    Is is possible to generate executables in 2015 CVI which will work correctly with the runtime of 2013?

    Alternatively, CVI SP2 from 2013 and 2015 CVI co-exist on the same PC development?

    I would not get stuck with CVI 2013 SP2 for the future just to maintain a few predictable XP-based PC.

    Hi Shr,

    I recommend reading through this community's message: https://decibel.ni.com/content/docs/DOC-23955

    Essentially, you can develop a code in CVI 2015 but set the executable to run on previous versions of the Run-Time Engine. Note that the older version of the RTE of Side-by-Side CVI is 2012. You can indeed install previous versions of the CVI on the same computer. The shared runtime will be set to the latest version. Other versions will be side-by-side. The code is not guaranteed to work with previous versions of the RTE so be sure to test the code locally before moving on to another computer.

  • CVI 2013 SP1 - function calls repeated with pointer on a variable array parameter causes a shift of the index

    I have some functions will be pointers as parameter and CVI 2012 SP1, they work as before without problems but with CVI 2013 SP1 they are now incorrect.

    Here the description of what is happening - I found a cure, but a duty adopt the old code and I think it's clear that nobody don't "captures" all lines in a 'big old code' which are affected (maybe):

    I have functions

    'function_XYZ(int *p_paraArr) '.

    with 'p_paraArr' as pointers on a table (int).

    Suppose I have another function

    "fct_TOP (void)".

    where is a local array variable which is inizialized by

    "int TheArray [25] = {0};

    and inside of this "TOP"-function-body I call a function ".

    "function_XYZ (TheArray).

    There are no complains of the compiler (CVI 2012 or 2013) and the code works (but the CVI 2013 only once!).

    But if I put 'fct_TOP' loop I have a lag in the "TheArray' -memory.  (The loop surrounds the function "TOP"! "")

    This means that the result "TheArray" obtained from "function_XYZ (TheArray)" starts at index '1' not on the index '0' - as the first time that the function "function_XYZ (TheArray)" was performed. ".

    The solution is:

    I only replaced

    "function_XYZ (TheArray)" (<1>)

    by

    "function_XYZ (&(TheArray[0]))" (<2>)

    overall the program now works every time (in the whole loop)-the first time (in the loop).

    In the second version (<2>) everything is necessary to "work well":

    The '&' and parentheses "(...)", which contains the element that may be designated by the '& '.

    And I hope that you believe me: I've tested several times, it was only "little" change that solved the problem.

    So it seems that the ICB 2013 (SP1) is a kind of internal offset index by a repeated execution of the

    "function_XYZ (TheArray).

    but I don't know how or why but I see in debug mode by observing the expected against the values in the table received!

    At the first time the (implicit) internal index of 'TheArray' is '0', but the following times (during the execution of the loop) the internal index passes to '1' (seen in the debugger because that all the expected values were shiftet like that!).

    So there's an explicit index in the table ("function_XYZ (&(TheArray[0]))") necessary to make the first time of this clear code execution.

    There are some good improvements in 2013 CVI (SP1) and I like this environment more than the 2012 version - but:

    There are other "changes" also, in the compiler (or linker...?) that are more rigid than "in ancient times.

    The problem of this kind of error is always the 'old code '!

    It is expected of such behavior.

    The compiler/linker do not complain (a complaint would be good!) writing but he made this mistake (in a loop).

    By the way: my 'compilation Options' are set to 'Extended' (without change in the "..." ("- button - Options) and that all of the boxes, except the" OpenMP_support "-box are checked!"» So I think that I put the very rigid compiler - maybe there are some «...» ' - button - settings to get rid of this problem, but I have not found them/it.

    My request:

    -Check the stiffer compiler by the need of an explicit index

    - or switch to the 'old' behavior with "function_XYZ (TheArray)" always refers to implicit index '0' of the element "TheArray". "."

    Thank you for your messages, comments and suggestions.

    -As I wrote before - maybe it's the style of programming or error"self made"... maybe...
    .. But if I replace 'function_XYZ (TheArray)' by "function_XYZ (&(TheArray[0]))" and
    then it works... Why so and not, if bothe the same? ...

    But as long as I do not post sample code, nobody is going to accept - I accept it. So consider this post more as an allusion to the fact that of the LW/CVI 2012-2013 LW/CVI more changed than just the LW - GUI or certain features: the compiler changed its 'way to'... or almost.

    For this problem, I think that I will use the solution 'use no implicit and explicit pointers'.
    Who should be a good idea taking into account
        http://forums.NI.com/T5/LabWindows-CVI/fatal-run-time-error-dereference-of-out-of-bounds-pointer/TD-...

    mybe also only caused by wrong code... who knows... but for me it is a sufficient reason to act as I suggest above.

    Best regards,
    F.

  • CVI 2013 can be found at #include &lt; rs232.h &gt;

    Hi, I'm a newer version of the CVI.

    my program works well in 2010,

    Initially it alos works well in 2013.but now it has the folloing error.

    the following instructions are needed in 'rs232, c', #include you want to add to the top of the file. (RS232.c) is the name of the c file).

    I click Yes, but it does not work

    the c file was already a "#inclue ".

    is there something important that I get bored?

    TKS

    Build status (rs232.prj - Debug)
    RS232.c - 8 errors
    29, 5 error: implicit declaration of function 'OpenComConfig' is not valid in C99. Make sure that you include the prototype for the function.
    31, 5 error: implicit declaration of function 'SetCTSMode' is not valid in C99. Make sure that you include the prototype for the function.
    31, 18 error: the use of the identifier not declared "LWRS_HWHANDSHAKE_OFF".
    35, 5 error: implicit declaration of function 'FlushInQ' is not valid in C99. Make sure that you include the prototype for the function.
    36, 5 error: implicit declaration of function 'FlushOutQ' is not valid in C99. Make sure that you include the prototype for the function.
    80, 20 error: implicit declaration of function 'GetInQLen' is not valid in C99. Make sure that you include the prototype for the function.
    83, 18 error: implicit declaration of function 'ComRd' is not valid in C99. Make sure that you include the prototype for the function.
    180, 14 error: implicit declaration of function 'ComWrt' is not valid in C99. Make sure that you include the prototype for the function.
    Build failed.

    Hello shayisi,

    CVI displays the error dialog box, because it has detected that some functions declared in rs232.h are used in your source file, so he offers to include the header file.

    I would like to ask you to provide some more details about your configuration, so that we can determine if there is a possible bug with CVI 2013:

    1. You are able to build the projects in the sample from the file \rs232?
    2. You have a rs232.c file that is part of your project?
    3. I understand that your project used to build without errors in CVI 2010. Is this correct?
    4. What options have you selected in the Options of language C, one of the options"Compiler Options?

    Thank you!

  • Crash of CVI 2013 with the debug version

    Hello

    I'm trying to migrate a large enough project of CVI 2012SP1-CVI 2013 and feels the clang compiler crash when I try a debug on some files.  Clang will also plant (' Labwindows/CVI the Clang compiler has stopped working... ") so I am just trying to compile the file (ctrl-k) in the editor.  Here's what I found:

    • A release not crushed

    • By turning the C99 power button has no effect

    • Change the warning level has no effect (other than the types of warnings that I get, of course)

    • Change the ' debug ' on 'No run-time check' eliminates the crash.

    • 'Enable. Option of obj"eliminates the crash.

    • By turning precompiled headers power has the effect.

    Here is the long message I get from the compiler when this happens (including all the warnings that are always displayed when the level is set to 'None'):

    Any thoughts?  Unfortunately it's a pretty big project that I can't post and it doesn't seem to be an indication of the or the lines in the file that he has problems with it, so I can't limit, although it seems to hint that he has problems with the structures of some sort.  The PC is running Windows 7 Pro 32 bit if it matters.

    Thank you.

    Hi tstanley,

    We could find the cause of the accident of the compiler from your code. We will settle in the next update and you can follow with bug ID 422577.

    The issue occurs when in a function, you have a call to a function that returns a structure in a global variable and then refer to this world in another function. For example:

    struct Foo foo; global variable foo

    Sub FuncA()
    {
    foo = GetStructFoo();
    }

    Sub FuncB()
    {
    do something with foo / / crash
    }

    In this case is because we are bad associate information of temporary pointer with foo in FuncA. Then in FuncB, clang will crash when it tries to access this pointer information.

    There are two workaround solutions, but both require changes in the code.

    1. modify the function that returns the structure, GetStructFoo in my example, the return via a pointer parameter:

    void GetStructFoo(Foo *foo);

    2 use a temporary local variable to manipulate the structure returned and then assign its value to the overall structure:

    struct Foo tempFoo;

    tempFoo = GetStructFoo();

    foo = tempFoo;

    In our next update, we will include the fix for this bug.

  • Where are the models of 'New project' when you use Visual Studio with labwindows/cvi 2013 2012?

    Background:

    Platform: windows 7 X 64

    Visual Studio 2012

    LabWindows/cvi 2013

    First install Visual Studio 2012.  Then follow this installation Labwindows 2013.  In the installation options, I check 'visual studio 2010' (there is no option for VS2012).

    Question: After the installation of Labwindows, I expect to see patterns added to the "New project" dialog box in Visual Studio.   For several years I used labwindows.  Changed the method for using Labwindows with visual studio?

    Thanks in advance for any help.

    Hello jsut64,

    Unfortunately, there is no option to integrate with Visual Studio 2012 yet LabWindows/CVI. We plan to add in a future release.

    Best regards

    = Nelu F. | National Instruments.

  • problems of memory with T3500

    Hello

    I have a T3500 with the following problem.

    I get 'error of memorry in DIMM 2' but only after a reboot.

    No one knows what may cause this?

    I cleaned the memory locations with electric contact spray, but the problem remains.

    It looks like a problem of maotherboard but I wonder if it is possible to fix such a problem

    Thank you.

    One or more pieces of ram you are using is bad or not Tricanale compatible or one or more sockets for ram is physically damaged. The ram should not be ram Joes Crab Shack or mixed.  They should be matched 3 sets where wait States and the manufacturer are exactly the same.

  • Compiler of CVI 2013: increment / decrement operator assessment

    Trying to pull an old project forward to 2013 CVI, I met a challenge, which is documented as follows:

    «In the summons, the value of the right operand is evaluated before indexing table is made in the left operand.» Expressions, such as a[i] = i++; will assess differently in LabWindows/CVI 2013 compared to previous versions. »

    (There is a somewhat related thread here to do with the order of function arguments are evaluated).

    This change in the order of evaluation is shocking to me. I guess there is some C history behind it, and I won't be able to change that.

    So my question is: what is the way easiest to identify all sites in my code where this could concern me? I ~ 75 000 lines of legacy code. Maybe some regex magic?

    Thank you

    Ian

    Hello

    I'm happy to help you.

    I have test the latest version of clang (3.7 builded SVN), and I can confirm that it detects this 'problem' as a warning (and many other warnings too).

    Also it can integrate with the IDE CVI as external compiler, so it is easy to switch from a regular compiler CVI and this one. I can write a few small "guide" later, if you are interested.

  • CVI-2013 SP1 and FDTI development libraries

    We use a test adapter that uses internally a FDTI converter USB to serial. To control the unit, we generate code using FTDIs ftd2xx.lib. Copy the following code compiles and works very well with CVI-2009. But when trying to build the project with SP1 CVI-2013 the linker complains, that ftd2xx.lib is not an archive valid lib.  Any ideas how to fix this?

    Your problem seems to be a 'problem' and already has a workaround solution.
    See the following forum thread:

    http://forums.NI.com/T5/LabWindows-CVI/CVI2013-quot-not-a-valid-archive-quot/TD-p/2525174

    I hope this helps...

  • Satellite R20 - Memory Stick PRO Duo problem

    I looked and saw a lot of similar posts from users with a similar problem. Unfortunately, most of the answers suggested by looking at the user manual and taking note that the phone does not support the Memory Stick PRO Duo. Technically, that's true. However, many Sony cameras come with an adapter that turns the PRO Duo stick a Memory Stick PRO. These include very well in Flash Media Bridge adapter. The manual also indicates that the drive supports this stick.

    What's weird, is that Windows Vista recognizes the insertion of the memory stick, but he then told me that I need to format it before so I can use it. I don't remember what I used the term, but there was a time eventually (with an older driver and/or the installation of XP?) when I could operate using a tip of reboot or something. No, however, I get boor. The stick (and its adapter) work very well. I can read it using another USB adapter. (Connected to my dell monitor 24 "... so not exactly a portable solution)

    My laptop is the Satellite R20 Tablet and my OS is Vista Business

    Thanks in advance for your help.

    -Michael

    Duo cards have been gradually were they not? I'm sure that the Duo do not support Toshiba laptops. The only solution is a USB adapter, preferably a compact.

  • Printer driver crashes when printing with Office 2013/8 64-bit Windows

    Printer: HP Color LaserJet CM1312nfi

    Printer driver: V5.1 (to date, downloaded from the HP support Web site) or generic V5.6

    OS: Windows 8 Professional 64-bit

    When I try to print an Excel document with Excel 2013 and V5.1 printer driver, the program freezes and must end with the Task Manager. This always occurs with the same document, but not with all the documents. Program also crashes when opening the preview before printing to the same document.

    The same document prints fine with V5.6 generic print driver and with the driver supplied with Windows 8.

    The same document prints fine with the driver version 5.1 on Windows 7 and Office 2010. The combination of Windows 7/Office 2013 has not been tested. Windows 8/Office 2010 combination has also not been tested.

    When I try to print an empty document with the word 2013 and the generic printer V5.6, the program driver crashes and must end with the Task Manager.

    My conclusion is that the HP printer drivers have a problem with Windows 8 or office 2013 or a combination of both.

    The printer driver supplied with Windows 8 and is installed automatically is useful as a temporary workaround, but it lacks some options, e.g. manual duplex.

    Upon request, I am ready to send the Excel document by e-mail for verification of the problem.

    For any help or suggestion will be appreciated.

    Thanks in advance,

    ULI

    It worked!  Thank you very much.

    Where others have difficulties to find the offending setting, here's another way to track him down.

    -> control Panel-> devices and printers-> (select printer-> right mouse)-> printer properties-> settings-> tab Installable Options (bottom)-> Printer Status Notification-> change on 'off '.

    Thank you!!

  • CVI 2013 SP1 crashes when opening file

    LabWindows 2013 SP1 has suddenly stopped working on my PC.  Any time I try to open a file, or by clicking Browse on the home page, by clicking the open file icon, or by selecting file - open or file - save as from the main menu, I get the message popup that says ' LabWindows/CVI 2013 has stopped working '.

    By clicking on "display characters invisible problem" shows this:

    Signature of the problem:
    Problem event name: BEX
    Application name: cvi.exe
    Application version: 13.0.1.201
    Application timestamp: 52d6eeab
    Fault Module name: CVI.dll
    Fault Module Version: 13.0.1.201
    Timestamp of Module error: 52d6eea1
    Exception offset: 00a4ecd0
    Exception code: c0000409
    The exception data : 00000000
    OS version: 6.1.7601.2.1.0.256.48
    Locale ID: 1033
    Information has additional 1: 417
    More information 2: 417afcd3ce602885d582521ac0f0405e
    3 more information: 39bb
    Additional information 4: 39bb24ea28d79f3c45538f96792cdc59

    These values are always the same.

    I am running Windows 7 Professional, SP 1.

    If you just did a normal installation of CVI 2015, it might still be interesting to try a force reinstall. It is possible that there is a corrupt file of CVI 2013 somewhere.

    Take the information to the same post here, it seems that this issue might be specific to your Windows configuration.

  • CVI 2013 generate invalid code

    Hello

    CVI 2013 generates an invalid code for the function pointer.

    For example, this code works very well in 2012 CVI, but not in CVI 2013. Any idea?

    #include 
    #include 
    
    struct FunctionType
    {
        const char *name;
        void *func;
    };
    
    static const struct FunctionType functions[] =
    {
        { "func", GetFullPathName },
    };
    
    typedef DWORD (WINAPI *GetPathFunc)(LPCSTR, DWORD, LPSTR, LPSTR *);
    
    int main(int argc, char *argv[])
    {
        char buf[256];
        GetPathFunc f = (GetPathFunc)functions[0].func;
    
        if (f != GetFullPathName) {
    
            puts("Invalid ptr");
    
        } else {
    
            if (f(argv[0], sizeof(buf), buf, NULL) > 0) {
    
                puts(buf);
            }
        }
    
        return (0);
    }
    

    Hello hglee,.

    Your code looks fine. I filed the bug report #423480 to follow up the matter.

    Our new compiler important GetFullPathName of inconsistently. The main function, it refers directly to the implementation in the kernel32.dll module. In the static variable, it designates the pointer 'import' for the function (a pointer to the implementation). Interestingly, in CVI 2012 refers us to the 'import stub' in both cases (a jump through the pointer to the implementation).

    As a temporary workaround, you can manually cancel the extra level of indirection by changing a single line in your code:

       GetPathFunc f = *(GetPathFunc*)functions[0].func;
    

    However, it is DANGEROUS because, depending on how we decide how solve the problem, the workaround solution can become a bug itself in the future, and it may crash your program. So please keep that in mind when you change your code (for example, add a comment and a link to this post to remind you).

    Thank you

    Peter

  • 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?

Maybe you are looking for

  • Selection/change colors in series without closing/reopening of color palette

    I use Keynote much more and it drives me crazy that I can't change the colors in series without closing and reopening of the color palette. I'm doing something wrong?

  • Portege 4000 conflict between WiFi and Bluetooth on Windows 2000

    I recently replaced XP with Win2000 on my Toshiba Portege 4000. I also downloaded the latest drivers from the Toshiba site, using pref to Win2000 and Portege 4000. When you start the Bluetooth Stack V4.00.30 he wiped out the wireless LAN feature. I k

  • I need to hear my MIC volume in the speakers-Satellite A200 - 1ñ3

    HelloI have Toshiba Satellite A200-1ñ3I changed to Windows XP. I got all the drivers & BIOS. Everything works fine except for 1 small thing, but it's annoying me insofar as I can change the laptop My MIC volume does not appear in the output!I use bot

  • In media player keyboard have stopped working

    Original title: keyboard in media player I have the digital media keyboard 3000 and my buttons in Media Player (play/pause, next/previous track, and stop) have stopped working with media player. Any ideas on how I can get them working again? I am cur

  • (Redirected) Short screen freezes on XPS12

    I need help. I've looked everywhere and tried several things but my screen freezes for a short period (5 to 10 seconds in general) every few minutes. I have: -updated my touchpad of Cypress software at latest as Dell (2.5.1.72) -reinstalled my mouse