LabWindows CVI RS-232 is not fast enough


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
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;
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

Tags: NI Software

Similar Questions

  • Satellite A300d-17f not fast enough?

    Don t you think Satellite A300d-17f series are not quickly even if high memory, high processor?
    Mine is not fast that other machines that have low properties!
    I put t understand what kind of problem a± do! Thank you masters

    What do you mean by not fast?
    Fact the laptop start slowly or what?

    I think that you should not compare the speed of different specifications if the same software, the same operating system and the same applications were not installed.

    If Notepad starts slowly, then go to the msconfig-> Startup tab and disable some processes is not necessary.
    The background process may significantly slow down the books the boot process.

  • Firefox is late and refreshing not fast enough

    I noticed this first with a Google map that was slow to update. It seems to be deteriorating, and when I have several tabs, many do not update. In addition, when I look at a page like Google News and scroll down, several times the entire Central column is a black box and does not always load images.

    I tried refreshing and it did not help. I started in Safe Mode, and it seems to be a lot better, so I think it's a problem with add-ins? I am currently scanning of malware as well.

    Any suggestions?

    You can try to disable hardware acceleration in Firefox.

    • Tools > Options > advanced > General > Browsing: "use hardware acceleration when available.

    You will need to close and restart Firefox after enabling/disabling this setting.

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem.

    • Put yourself in the DEFAULT theme: Firefox/tools > Modules > appearance
    • Do NOT click on the reset button on the startup window Mode safe
  • 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 But the Office is installed, and ActiveX Control Pad is obsolete and incompatible for Windows7 64 Bit and is no longer available from Ms.


    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?

  • How implement not checking in LabWindows/CVI interchangeability?


    I'm creating a driver of IVI - C using LabWindows/CVI 2012. I used IVI Instrument Driver Tool Wizard and he created most of the code to support inherent attributes and functions of the IVI.

    I do not plan to support the verification of interchangeability in option and according to the specifications of the IVI (IVI-version 2.1, 3.2 section 5.21):

    «If the IVI specific driver does not implement verification of the interchangeability, the specific driver returns the unsupported value error when the user attempts to set the attribute Interchange check true.»

    It would be a simple task if I could change the reminder of the writing of the Interchange attribute check. However, LabWindows/CVI does not any change of an inherent attribute. How can I make the driver returns the value not supported error when the user attempts to set the attribute Interchange check true?

    Any help is appreciated!

    Thank you.

    Hello buckhorn,.

    From your statement, I tried to 'Edit' the reminder of the writing of_ATTR_INTERCHANGE_CHECK attribute and seems it worked. Here is part of the codes.

    1. Create a ViBoolean write callback function:

    static ViStatus _VI_FUNC agx2k3k_InterchangeCheckWriteCallback(ViSession vi, ViSession io, ViConstString repCapName, ViAttr attributeId, ViBoolean value)

    2. Add the callback function to ATTR_INTERCHANGE_CHECK:

    checkErr (Ivi_SetAttrWriteCallbackViBoolean (vi, AGX2K3K_ATTR_INTERCHANGE_CHECK, agx2k3k_InterchangeCheckWriteCallback));

    I hope that it might help for your case.

    Thank you


  • NOR tkds5000 LabWindows/CVI IVI driver not work for TDS5104, TDS5054B

    I'm trying to get the driver NI LabWindows/CVI IVI (tkds5000 version 1,212) working for the Tektronix TDS5054B scope.  When I execute the following functions, I have the warning 'Is not a valid value for the parameter or property' of 0xBFFA0010:




    This is not an exhaustive list of the functions that do not work, but just that I currently see.  There are several functions that work (see this joint SPY OR file).

    The strange thing is that everything works fine when I have an oscilloscope Tektronix TDS5104 connected (file SPY OR see attachment).  The code also works when I have an oscilloscope connected and selected through MAX TDS3054 driver tkds30xx IVI of NOR.

    Is it possible that the driver of version 1,212 tkds5000 does not support fully the TDS5054B?  I looked through the files tkds5000.c and tkds5000.h, but has not seen any dependencies on the model of the oscilloscope for these functions.  Any ideas?

    Thank you!


    So, then I thought about it.  The tkds5000 driver AND works very well.  The problem is that the Tektronix TDS5054B scope do not "initialize" some of the attributes.  For example, I had a problem reading the value of the attribute of slope of relaxation because an invalid value was returned.  If I set the slope of the trigger, first of all, then read it, it works fine.

    Its strange because most of the attributes is set to the correct value corresponding to what is displayed on the oscilloscope screen and the Panel, but not ALL of them.  In addition, other Tektronix oscilloscopes did not require a writing before reading.

    Anyway, thanks a lot NathanT.  I appreciate your help.  You saved me a bunch of time to have to go back and add in a dedicated driver.


  • Why can I not use my labview controls created dll in labwindow CVI?

    I created a DLL in LabVIEW for run of LabWindows/CVI.  The DLL is started very well but I have no control on the GUI.  Why and how can I use this GUI controls?

    I found the solution on the following thread.

  • LabWindows/CVI cannot compile a simple code

    Hi all!

    It's looks funny but LabWindows/CVI-9.1.0(427) cannot compile a simple C code


    void f();


    #include 'xml.h.

    typedef struct
    int bar;

    } foo;

    void f()
    int Baz = 0;
    If (!) Baz) baz = 1;
    foop foo;

    It's not a bug, you make a statement block to a variable foop which is not allowed in the standard ANSI C89.

    You can activate the C99 extensions with a pragma if you want this to work in CVI 9.1


  • 6632A HP - tension - Labwindows CVI

    Hi all

    I'm trying to settle the tension of HP 6632 A with Labwindows CVI. The initialization succeeds (1) If no application ID and no reset command is sent and fails (2) if the two is sent (error occurred during the transfer of Bus) (see update below). Then when I try to set up/set the output by using the function below, I get an error BFFF0038 code - Bus error occurred during the transfer (1) or BFFF000E - invalid session handle (2).

    I checked tha MAX and match the GPIB address there with what is represented on the food. It also responds to the request to id it.  I use the driver of instruments provided by OR to talk to the device by the USB-GPIB converter of NOR.

    Am I missing a step here? I set up the device in a certain way before use?

    Thank you!

    Initialization (send request Id and reset the order)
    int error_int = hpe363xa_init ("GPIB::0 (', VI_ON, VI_ON, & g_instrumentHandle1);
    char chaine_erreur [100];
    FMT (chaine_erreur, "%x", error_int);

    MessagePopup ("Return Value Init", chaine_erreur); <- error="" bfff0038="" bus="" error="" occurred="" during="">

    Config to activate the output
    error_int = hpe363xa_configOutput3632 (g_instrumentHandle1, VI_OFF);

    FMT (chaine_erreur, "%x", error_int);
    MessagePopup ('Return value Config', chaine_erreur); <- error="" bfff000e="" invalid="" session="">

    Set the voltage to 12 V
    error_int = hpe363xa_outputSetOperate3632 (g_instrumentHandle1, VI_OFF, 12.0, 1.0, VI_ON);

    FMT (chaine_erreur, "%x", error_int);
    MessagePopup ('Return Value Set', chaine_erreur); <- error="" bfff000e="" invalid="" session="">

    Device: HP 6632 has DC power supply by Labwindows CVI.

    Connection: NI GPIB-USB connection Cable

    Pilot: Labwindows Plug & Play

    Language: Labwindows 2013

    OS: Windows 7


    I just realized that I'm not sends a request id and a reset command during initialization of the device. I've updated the code above. Unfortunately, I get an error code if I do and the devicehandle is not set! The game features following fail later.

    You also use the bad for a HP6632A instrument driver. The hpe363xa driver is for models E3631A, E3632A and E3634A.

    You must instead use the driver available to ... .

  • Where can I find NEITHER-HSDIO SMU 6556 LabWindows CVI examples?


    I am looking for examples LabWindows CVI or a help file that shows the function or api calls to control the attributes of progrannable of the HSDIO SMU 6556/6555.

    Ken Grohman

    Hi Ken;

    "' You can find examples for the NOR-HSDIO in the example LabWindows CVI Finder by clicking on help > NOR example Finder and navigate to the material input and output" Modular Instruments ' NOR-HSDIO; "" "" or you can search in Start "all programs" National Instruments "NOR-HSDIO ' examples.

    Just make sure that when you installed the driver, you have also installed the Application Development Enviroment Support for LabWindows CVI, otherwise the examples will not be there.

    Best regards;

    Pedro Muñoz

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


    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).


  • 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

  • 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


    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


    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?


    Hello again, Naumann!

    Microsoft Visual C++ 2010 represents Boolean using 1 byte, as stated by MSDN:

    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!


  • passage of data container of teststand labwindows/cvi handle error


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

    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.


    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.


Maybe you are looking for

  • help with the new option of memories

    Sorry for my English Please help me with the new option of memories no memories option appears me I have an iphone with IOS 10.02 5

  • Audio tracks ritardando

    It is possible to program a ritardando in Logic Pro X 10.2.2 file that uses audio only (no lunch)?

  • Migrating data with external box HD

    Ok. I'm a novice here... I had a Unibody MB (2008) running Yosemite and the screen is out. I bought a new MB Air and it is running El Capitan. The Apple local store in the city told me that I had to get an external HD case, insert the old Mac to the

  • Performance wise, it is sensible to switch to iPad Air starting from an iPad 3?

    Hello world I'm looking for a replacement for the iPad 3 (Wifi, 32GB) that my family uses for simple tasks (surfing, netflix, e-mail). I thought an Air 32 GB Wifi iPad, which should be much faster. But now, I saw that this model has only 1 GB of RAM,

  • UDP with two ethernet of the Compactrio system

    Hello Here's my problem, I have to do a UDP data transfer, I want to write on another computer using two ethernet of a compactRIO (9022) .txt I'm doing a schema to be more clear: http://www.hostingpics.NET/Viewer.php?id=470011reseaujpg.jpg I have to