Use dll in VC ++ in CVI

Hello world

When I use a dll file in the CVI, I have a problem.

Whe I try to start my project, it displays an error message from the uart.h (my dll). As the picture of blowing:

Can someone tell me how do slove this error?

Thank you!

It's my project files: http://d.99081.com/a710756/My project.rar

your DLL is fine, the problem is in uart.h where some identifier are not defined, namely: WORD and REMINDER.

This is the standard definition of windows. #include before including the 'uart.h' and everything will be ok.

(or better: Add to include it in the uart.h).

Tags: NI Software

Similar Questions

  • Using a DLL built with LabWindows/CVI

    Hello world

    I'm pretty new in the environment, LabWindows/CVI, until present excuses for any silly question. I have a real-time application running in a PXI, but I want to "complete" by adding new features, I have in the C Code generated from Dymola. I thought about creating a DLL of this code (using LabWindows) and then insert it in the .vi (the one I have running in the PXI) using the library function call so that I could have the new .vi running in PXI.

    Will it work?

    Thank you

    Hi all

    I S is true, you can find this knowledge base and really useful related links. This tutorial looks also interesting. However, take into account that the code runs on a real-time platform (such as the functions will work with the same priority as the appellant threadand, many other issues). Remember to FTP the file *.dll for PXI.

    Hope this helps,

  • How to pass a pointer in calling labview library using dll programmed in Labwindows?

    Hello

    I'm trying to interface a camera with Labview.  However, the camera can only be programmed in C, so I use Labwindow CVI.

    I need to pass a handle from the camera of a function to another, for example. leave an opencamera function to function setparameter.

    / * Loading the Qcam driver and open the first camera * /.
    Sub DLLEXPORT LoadDriverAndOpenCamera()
    {
    QCam_CamListItem cameraList [10];
    unsigned long cameraListLength is sizeof (cameraList) /sizeof(cameraList[0]);.

    load the driver
    QCam_LoadDriver();
    a list of cameras
    QCam_ListCameras (cameraList, & cameraListLength);
    listLength is now the number of available cameras

    QCam_Handle CMAH;
    Open the first camera in the list
    QCam_OpenCamera (cameraList [0] .cameraId, &hCam);)
    }

    Apparently, the caemraId is a long unsigned (unsigned 32-bit by 32-bit Labview 2012?) and QCam_Handle is defined as void *, so it is a pointer that points to a non signed 32 bit.

    When I only use C for programming, I can pass variable CMAH to other duties so it is declared as a global variable.  Ex, the following function can be Sub SetParameter(QCam_Handle hCam).  However, here, I trying to do a Labwindows/CVI dll and then call LoadDriverAndOpenCamera() through library function call in Labview.

    My question is: How can I switch CMAH to other functions in the same dll?  I have to add the parameter to the function? For example:

    Sub DLLEXPORT LoadDriverAndOpenCamera(unsigned long cameraId, QCam_Handle* cameraHandle)

    And then add two lines:

    cameraId = cameraList [0] .cameraId;
    cameraHandle = CMAH;

    in the service?  So I spend cameraHandle out?  However, the CMAH will always have kind of vacuum.

    Even if this is the case, how can I configure node call library on Labview?  In the arg parameter set up, I do not see pointers?  It seems that I can not put in place an exit node to be a pointer that points to an unsigned long.

    Thank you very much for your help!

    Best,

    Charles

    Hello Charles,

    I noticed that you posted something similar here. you have questions about the use of the call library function node?

  • DLL of enforcement in CVI 8.0

    I never work with DLL bevore, but I want to learn it. So I create a program with a static DLL without big problems in LabWindowCVI 8.0
    Now, I want to understand the manipulation of dynamic dll. I read this article (http://digital.ni.com/public.nsf/websearch/8AE57BDA995ACCB486256AEA0062B3C6?OpenDocument) and build my own program as in the example, but it does not work and show a lot of mistakes. I changed only myFunction and MADLL. DLL with my own names. ICB does not understand the instructions.

    It could be that I understand the misdirection. I don't really understand the code wxample. Can you help my and esay to explain?

    Hi Susay,

    As a first step, you must include stdio and windows headers to access the Windows SDK functions you'll need for the call of the dynamic DLL:

    First you load your dll - Make sure you have a correct path to the LoadLibrary function.

    Then, you will find the function in the dll call GetProcAddress and passing the name of the function you want to call.

    You can call the function by using the typedef would function pointer. (You need to define one for every function call)

    You should start with an example, that you can find here: call a CVI DLL: explicit linking vs implicit linking (dynamic and static)

    The example is explained on this page: call a DLL of CVI (tutorial). These pages also contain links that can help you decide which method of binding to use.

    Do not hesitate to ask if other issues arise. Good luck!

    Peter

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

  • do not call the dll of Labview in CVI

    I have a Labview dll should call for the CVI. but it always shows error.

    void __cdecl Idx_RW_Reg (uint16_t registry, int32_t RegLength,
    [LVBoolean Data_in], uint8_t OperationRd1Wr0, TD1Hdl * read_reg_table_in,.
    uint16_t PortAddress, TD1Hdl * Table_of_reg_out, LVBoolean ControlFrame [],.
    uint16_t * PortAddressOut, int32_t len2, int32_t len);

    TD1Hdl * read_reg_table_in: what is it, who can tell me

    typedef struct {}
    int32_t dimSizes [2];
    LVBoolean Boolean [1];
    } TD1;
    typedef TD1 * TD1Hdl;

    Any help is greatly appreciated.

    Thank you.

    Hello

    What is your calling code?

    I suggest you read: call a LabVIEW DLL in a CVI or other C/C++ project

    Kind regards

  • I need to use the device of the CVI drivers in VC ++

    I need to use the Labwindows/CVI driver in VC ++. It gives me error linker outstanding. I built a file lib Measurement Studio, but it seems that the CVI files was not included. but when I try, what libraries I should include in my Visual Studio

    1 > MHD_hp859xe.lib (hp859xe_mhd.obj): error LNK2001: symbol _Scan unresolved external

    1 > MHD_hp859xe.lib (hp859xe_mhd.obj): error LNK2001: symbol _CVI_OpenFile@16 unresolved external

    1 > MHD_hp859xe.lib (hp859xe_mhd.obj): error LNK2001: symbol _CVI_CloseFile@4 unresolved external

    1 > MHD_hp859xe.lib (hp859xe_mhd.obj): error LNK2001: symbol _ScanFile unresolved external

    1 > MHD_hp859xe.lib (hp859xe_mhd.obj): error LNK2001: symbol external science pending

    1 > MHD_hp859xe.lib (hp859xe_mhd.obj): error LNK2001: symbol _FmtFile unresolved external

    1 > MHD_hp859xe.lib (hp859xe_mhd.obj): error LNK2001: symbol external _NumFmtdBytes @ pending

    LabWindows/CVI evaluation Version Limitations answers your questions.  More details are available in the LabWindows/CVI Assessment Guide.

  • Should I recompile all the code by improving the CVI environment

    Hello

    My Poudel is something that can help me to eliminate a bug in code that I have generated.

    I just upgraded from CVI 9-2009 CVI. After upgradingI began to get an intermittent Windows error when I run a program I wrote and compiled and depolyed with CVI 2009. My program has been distributed using the runtime of the last. It's difficult to say where these errors as it seems to be linked to an external application that my application is linked with a couple of DLL files that have been written and compiled by a colleague with CVI 9.

    Are there any potential risk with me using the DLL files compiled in CVI 9 with my code which is compiled and ran with the latest runtime engine?

    Thank you

    Hi hybrid,

    Welcome to the Forums of Discussion OR. Avoid problems by using DLL files compiled in CVI 9 or any previous version with the last execution engine. I'm afraid you will have to keep the program debugging.

  • How can I build a dll containing that a callback function, the callback function is used in CVI.

    Hello

    Case is that LABVIEW receive external data and produce an interrupt, then sends the data to the CVI.

    Can I generate a dll containing a callback function, use the callback function in CVI. Or there is a better way?

    Thank you


  • 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

  • Problems using "Appellant library function Node" statements with a DLL compiled by LabWindowsCVI

    I'm calling a simple C routine to a VI by using the node call library feature.  The example of ANSIdouble.vi, found inside the example called DLL.VI given in the help files does not work.

    But when I replace it with the same program (the source code is given in the DLL.VI call) compiled by LabWindowsCVI, it does not work.  In fact, it blocks Labview.

    I use LV 8.2.1.

    In addition, LabWindowsCVI does not compile the example as written code. I had to change the Sub _declspec (dllexport) in front of the function declaration cancel DLLEXPORT DLLSTDCALL and #incude the file "C:\Program NIUninstaller Instruments\CVI81\include\cvidef.h".  The compiler produces errors if not.

    The DLL.VI program to call is:

    #include "extcode.h".

    _declspec (dllexport) void ANSIdouble (double entry, double * output);
    _declspec (dllexport) void ANSIdouble (double entry, double * output)
    {
    * output = entry * entry;
    }

    The program compiled by LabWindowCVI is:

    #include "C:\Program NIUninstaller Instruments\LabVIEW 8.2\cintools\extcode.h".
    #include "C:\Program NIUninstaller Instruments\CVI81\include\cvidef.h".
    #include "TestC.h".

    DLLEXPORT DLLSTDCALL ANSIdouble(double input, double *output) Sub
    {
    * output = entry * entry;
    }

    where TestC.h is the statement:

    Sub DLLEXPORT DLLSTDCALL ANSIdouble(double input, double *output);

    The program has been compiled in a DLL that can be debugged with box of determination of objectives, copied as an attachment.

    Thanks to all those who can help you.

    TJ

    Solved with a call to Al on the help line.

    The correct procedure can be found by searching for "creating DLL" on the Web site of NOR.

    Using the page found by searching for "creating"DLL"helping within the CVI, is TOTALLY FAKE!  At least with my worm 8.1.1.

    Tom J

  • How to get the result of the test of CVI DLLs in teststand!

    I write a driver dll to test a source, I want to get the tension of world SERVERS (the instrument of the RS) and I used to call DLLs that written by CVI, teststand

    My question is what is the best way I can get the result of the test and show the user to teststand. the code below is fair? When I used to call this dll document, teststand

    "" I just get the result by setting in TS.this is a good meathod, and what should you do in teststand, I put the "outputVoltageV" point to an object?

    /*===========================================================================*/
    / * Function: read voltage/current output * /.
    / * End: this function returns the output and actual output voltage * /.
    / * current instrument.                                      */
    /*===========================================================================*/
    ViStatus _VI_FUNC rsngsm_datReadOutput (ViSession instrSession,
    ViPReal64 outputVoltageV, ViPReal64 outputCurrentA, ViPBoolean statusPeakCurrent)
    {
    ViStatus rsngsm_status = VI_SUCCESS;
    Bruno buf [BUFFER_SIZE];
    ViInt32 retCnt;
       
    FMT (buf, "%s<>
    If ((rsngsm_status = viWrite (instrSession, buf, NumFmtdBytes (), & retCnt))<>
    Return rsngsm_status;
           
    If ((rsngsm_status = viRead (instrSession, buf, 50, & retCnt))<>
    Return rsngsm_status;
    If (Scan (buf, "%s > %f [p2];")) %f [p2]; %i [b2] ", outputVoltageV, outputCurrentA, statusPeakCurrent). = 3)
    Return rsngsm_status;
           
    Return rsngsm_status;
    }

    sean_tan,

    Yes, you just pass a value of digital TestStand (e.g.; locals.number).

    If you use the adapter of the ICB, it might make more sense that you can use the Flexible DLL adapter for this type of function, that you do not use the standard settings of tTestData and tTestError. While TestStand will correctly recognize the function prototype, you want to make sure you that include the type library of your function Panel (you will need to create one if you have not already done so) in settings target of LabWindows / CVI-> type library.

    I hope this helps.

    -Jack

  • Deploy using the DLL startup ".» CDF files.

    Hello

    I'm new to Labview and I would like to deploy startup DLL on a PXI target to help '. " CDF files.

    I already read this tutorial: http://www.ni.com/white-paper/12919/en/

    But there is no mention of deploy the DLL.

    As you can see on the screenshot below I have included the *. DLL file in the source files.

    When I build the application, I can see that the path of my dll has been added to appbuilder.cdf:

    ""

    But after the deployment, the target does not launch the DLL in any case.

    Finally when I manually add the path of my DLL in the StartupDLLs key in th or - rt.ini and then restart my target, it works fine.

    But the idea is to do it automatically using '. '. CDF files.

    Thanks for your help.

    Problem solved.

    I just paste the path to my DLL in my "." CDF file"between:

    [LVRT]

    StartupDLLs=c:/ni-rt/cvi/My_DLL.dll

    It seems that FTP helped my DLL in the folder "CVI".

    For this, I changed the value of 'Record of Support' of ' / or-rt/start/data "to"c:\ni-rt\cvi"in the properties of my real-time Application, section"Destination. "

  • DLL and global variables

    OK, here's a strange problem.  I am very new to create the dll, so I don't know that I have just an installation problem.

    But I'm trying to pass a global variable of a host program to its attached DLL.  I got this job when I was the CVI 2014. I recently upgraded to 2015 and then started getting "undefined symbols" errors.  With some struggle I managed to compile again, but broke the variable connection in the process.

    I have compiled my DLL in debug mode so that I walk in from the test project.  Right now, my global variable exists in the test project, as well as in the DLL.

    Can I export the variable and the use of DLLIMPORT/DLLEXPORT?  Confused and curiously not to find anyone quite like this on the forums.

    EDIT: this post stack overflow described pretty well from my experience.  I am linking statically.

    Well, what do you know?  I found my problem.  This draft article and example WERE vital to the solution.  This article called, "using the Export method qualifier"was also useful.  I'll cut to the Chase...

    If you use a qualifier of export on the definition and the import on the declaration, LabWindows/CVI identifier export symbol.

    This is the right key.

    So in my example, it should look like this:

    DLL fichier.c

    int DLLEXPORT varName = 0;

    Header.h DLL

    int DLLIMPORT varName;

    Project that uses DLL.c

    #include "header.h DLL.

    varName! = 1 ;  a method to change this variable for local use

    Pretty easy, huh?  But wow, it took some time to find.

  • DLL to call a subsidiary static library

    I have compiled a DLL using labwindows calling a subsidiary static library. I added a step to test that calls this DLL.  On my development station, everything is good.  The subsidiary library is named.  But, on a deployed workstation, I get a "cannot load the DLL.

    According to the reference manual, I can preload subsidiary attendance using the adapter of the CVI.  I get the same error on my deployed station...

    You get an "Unable to load a DLL" error when a dependency is missing.

    Please check this way:

    Download the tool free dependency walker- http://www.dependencywalker.com/

    Select the DLL (deployed machine).

    It will show you which component of the dependency is missing in the deployed machine.

    For CVI.

    Since you are using a static libarary - include you in the build when you build the project?

    It should be incorporated in your DLL. (help to add files to the DLL option in the CVI target settings).

    I hope this helps.

Maybe you are looking for