Calling DLL using LabVIEW 7.1

so, i have this DLL which might be compiled using Visual Studio 2003 or Visual Studio 2005.NET.
question is: Can i call DLL functions using LabVIEW 7.1? has anyone tried it and has any issues loading the DLL?
i think i have everything right, as far as the configuration of 'Call Library Function Node' is concerned, but i get the
'error loading DLL - application has failed to start because application config is incorrect'.
can you please verify if .NET is not causing me issues? i think DLL assembly should be the same wheather it's VStudio6
or .NET, but can anyone confirm that's not the issue? Thanks...

Yes.
If you dll is generated by C/C++, using Call Library Function node.
If it is generated by .net, using constructor node.
http://forums.ni.com/ni/board/message?board.id=170&message.id=206959#M206959

Similar Messages

  • Calling and using LabVIEW VI's in a C# application : user manual ?

    Hi everyone,
    I am working on a project (actually a proof of concept) where I need to call and use LabVIEW VI's in a C# application.
    I downloaded the example available on this page : Calling LabVIEW VIs from Other Programming Languages.
    This example (joined) is working fine, but I would like to know if there is an associated documentation concerning the .NET classes that I can use in C# when I use the namespace "LabVIEW" (using LabVIEW; in C#).
    I need to know a little more about the properties and methods that are available (what it does and how to use it).
    I looked for it on NI's website and the LabVIEW help but could not manage to find anything interesting.
    Is there an official documentation released ? How can I get those informations ?
    Thanks for your answer(s).
    Regards,
    Da Helmut
    Attachments:
    CallingLabVIEWFromCSharpUsingActiveX.zip ‏114 KB

    Hi,
    The class browser is usefull (ctrl + shift + b), but I am not developing the C# application on the same computer than the LabVIEW application.
    The *.chm file has all the informations in it but I am not finding it well organized. I am drowning in all the informations. I supposed there was a specific help file / manual for the ActiveX methods and properties (a kind of hierarchical view like in the class browser).
    Also I supposed that there were different methods and properties that the one available in LabVIEW.
    For example when I browse the class in C# I get those weird methods :
    Regards,
    Da Helmut

  • Calling MSP430 functions in MSP430-TI.dll using Labview

    Hi
    I have few questions about implementing the MSP430-TI.dll functions in LabVIEW and I greatly appreciate your help
    I would like to read MCU through JTAG and then update the firmware
    1- I can see all the dll functions in LabVIEW but I couldn't find any documentation for these functions like what are the parameters and return values. Could you please let me know from where I can find the user guide for these functions
    2- Can I use MSP430 Flasher command lines instead of using the dll in LabVIEW
    3- I don't have the updated firmware but one my boards has the MCU updated. When I use FETPro-430 , can I click on Read-Copy and then save the txt file and use it to update the FW of the other boards?
    Thanks

    I'm looking into this issue too. TI provided an executable with graphic user interface for loading firmware, I'm thinking whether I can use LabVIEW to automate the process, it will be appreciated if anyone with this experience can provide some suggestions. 

  • Call dll in labview

    "Hi All,
    I have to get data from USB camera, I have following functions in DLL.
    DLLINOUT HANDLE WINAPI CC_Open( LPCSTR CameraName , ULONG CameraNumber , CC_CAPTURE_MODE CaptureMode ) ;
    and
    DLLINOUT BOOL WINAPI CC_CaptureSingle( HANDLE Cam , PVOID Buffer , ULONG TransferSize , CC_TRIGGER_MODE TriggerMode , USHORT TimeOut , OVERLAPPED * pUserOverlapped );
    When I open hardware with function cc_open I am getting handle to an object. How can I store this object and pass it to CC_CaptureSingle function?
    Another question is when I call CC_CaptureSingle I am getting pointer on the 2 dimension array �PVOID buffer� how can I get this array in Labview?"

    hi,
    you can do this two thing.
    1. Create your new DLL with (your DLL will call camera's DLL) one big function my_capture_image() and insert you do CC_Open(), CC_CapruteSingle() and CC_Close(). And to LabView you pass only Array whit image data. And you don't have problems with HANDLE. But you must allocate memory for image array in LabVIEW before you call this DLL!!! [Or use LabVIEW C function for reallocating memory]
    2. You must identify type of HANDEL variable. And you can change type of this variabile. But when HANDLE variable is structure it is hard pass this structure to LabVIEW.
    If you use LabVIEW 7.1 look example 'Call DLL.vi' it is great!
    Have a nice day.
    JCC

  • Calling Dlls from LabVIEW

    LabVIEW Gurus:
    I am working with some software engineers who have no experience in LabVIEW. Unfortunately I have little experience in C/C++ to make sense of their inquiry.  
    Basically we are dealing with “Data Marshalling”. I will call a DLL and issue a command (string) and get back a 2-D array and an integer. So far so good.
    The C/C++ programmer requested that I provide them with a pointer/memory address in which they will store data, so I can read it once the dll returns the array and integer. I browsed through the example online http://decibel.ni.com/content/docs/DOC-1690 and thought that if I wanted to read from the dll, the process is a simple as calling the appropriate function and configure the parameter (no pointers needed).
    So, is there a specific way that they need to write the C/C++ code to be used in LabVIEW? Or what else to I have to take into consideration?
    Thank you,
    Santiago 

    That example is pretty simplistic as it only deals with integers. In this case no pointers are required since everything is returned by value. When you're dealing with arrays, however, you need to deal with pointers. If you open the Example Finder (Help -> Find Examples) and search for "dll" you will see the "Call DLL" example. That contains many examples of how to call DLL functions with a wide variety of datatypes. I strongly suggest looking at that example. There is also a chapter in the LabVIEW Help on calling DLLs (Fundamentals -> Calling Code Written in Text-Based Progamming Language).
    You have 2 things to consider:
    You're dealing with arrays - this means you typically need to pre-allocate the memory in LabVIEW, and it sounds like that's what the DLL expects you to do. This amounts to using the Initialize Array function to create your 2D array of the appropriate size and datatype.
    You may be dealing with a C++ DLL. LabVIEW can only interface to C DLLs. This doesn't mean that you can't create a DLL in C++, but it does mean that the C++ programmers need to add an extern "C" modifier to the function calls, otherwise you get name mangling, and LabVIEW won't be able to call the DLL. The DLL programmers should know what that means.

  • Calling DLL using "Call library function"

    I am trying to combine labview with my previous fortran functions using Intel Visual Fortran 12.1 and labview 2012 by below steps.
     1. Compile Fortran functions as DLL file.
     2. Call Fortran function from LabView via "Call library function"
    In step 2, DLL file without linker option "/DLL delayimp.lib" cannot be loaded. That is "delay load" is needed for DLL file.
    Are there any limitation or constraint in Call library function?

    Hi Vishnu,
    There's no problem using the Malloc function in C and call it as a DLL in LabVIEW.
    But LabVIEW has a different memory management than C.
    It is probably not recommended to allocate array memory in C for labVIEW arrays
    You can use initialize array in LabVIEW instead.
    Good luck
    Van L
    NI Applications Engineer

  • Freeing Called DLLs in Labview

    Hi,
    I am using Labview to process a Batch of files. i have written a C++ program and compiled it as DLL using VC++. I call this DLL in a for loop that processes each file. My problem is that with every iteration this will create a new memory space for the program. I dont know how to free up the DLL so that in the next iteration it would not allocate a totally new set of memory but should free up the memory used before and then proceed with the new iteration. I am Using Labview 6.1 and windows 2000 pro. When I tested my DLL in VC++ I put a free library command and it doesnt give me the same problem. Is there a way to free the libraries in Labveiew???
    Thanks,

    To dynamically call the VI, you will need to use VI Server. (See this for more info.)
    If you mark your VI as reentrant and you have not marked you DLL as reentrant in the Call Library Function Node, then the VI will not truly be reentrant. For the DLL to be reentrant, it should be thread safe.
    Reentrancy allows more than one copy of a VI to be in memory at a time and be executing.
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • Error calling DLL in LabVIEW, but works in VC

    I compiled a DLL from Matlab, and then compiled a wrapper DLL in VC++. I tested the wrapper DLL in VC++, and it works fine, generating the correct output as in Matlab. 
    But when I call the wrapper DLL in LabVIEW, the first thing I noticed was that it only ran once. The second time I ran the VI, it returns an error. And the output is always a single number instead of an array when it runs. 
    I followed the examples how to create a wrapper DLL for Matlab compiled code. One of the examples said three functions Initialize, run and terminate should be implemented so that the DLL function can run continuously. I did all those, but it still does not work. 
    Here is the test code in C++. I explicitely loaded the DLL and ran the functions. It worked fine. Why the VI in LabVIEW does not do the same thing?
    // contourWrapper3.cpp : Defines the entry point for the console application.
    #include "stdafx.h"
    #include <Windows.h>
    #include <iostream>
    typedef int (*InitFunc)();
    typedef void (*TerminateFunc)();
    typedef void (*contourFunc)(double*,double*,int,int,double);
    int _tmain(int argc, _TCHAR* argv[])
    InitFunc _InitFunc;
    TerminateFunc _TerminateFunc;
    contourFunc _contour;
    HINSTANCE hInstLibrary = LoadLibrary("contourcWrapper.dll");
    if(hInstLibrary)
    _InitFunc=(InitFunc)GetProcAddress(hInstLibrary,"c​ontourcInit");
    _TerminateFunc=(TerminateFunc)GetProcAddress(hInst​Library,"contourcTerminate");
    _contour=(contourFunc)GetProcAddress(hInstLibrary,​"contourcGenerate");
    if(_InitFunc)
    _InitFunc();
    if(_contour)
    double image2DArray[] = {1,2,6,4,6,8,0,5,1,3,5,4,7,8,8,9,10,0};
    int width = 3;
    int height = 6;
    double c[sizeof image2DArray] = {0};
    _contour(c, image2DArray, width, height, 0.6);
    for (int i=0; i<width*height; ++i)
    std::cout << c[i] << std::endl;
    _TerminateFunc();
    else
    std::cerr << "Could not initialize libcontour properly."
    << std::endl;
    return 0;
     This is the output window of the above C tester code. It displays the correct output of array. 
    And this is the VI that does not work. 
    In the attached files, 'libcontour.zip' contains the matlab-generated dll and wrapper dll. 
    Attachments:
    contourcWrapper_test.vi ‏12 KB
    libcontour.zip ‏50 KB

    But LabVIEW does.  The declarations (in C) for different types of arrays are not the same.  I think you are passing extranious data to the DLL which is causing the issue.
    I will defer to your expertise however.  Over the years my knowledge in this area has waned.  Perhaps you are correct (in which case I am not sure what is wrong).
    Examples:
    typedef struct
        int dimSize;
        double data[1];
      } t_LvArrayDbl1D, *p_LvArrayDbl1D, **h_LvArrayDbl1D;
    typedef struct
        int dimSize[2];
        double data[1];
      } t_LvArrayDbl2D, *p_LvArrayDbl2D, **h_LvArrayDbl2D;

  • Calling DLL on LabVIEW for Linux

    I have a vi that calls a dll made with Visual C++ on windows enviroment. What are the steps for calling this same dll on Linux ? Do we need to generate another dll?

    In article <[email protected]>, Labviewguru wrote:
    > First, I don't know if LabVIEW for Linux can even call a DLL. I
    > suspect that since this technology (as obsolete as it is, at least for
    > an operating system - thank you Windows) has been adopted by Linux,
    > that you can. I don't have my linux workstation on at the moment, but
    > if you need to know, I can check.
    >
    > As for the DLL itself, I suspect you will have MAJOR problems getting
    > it to work right in Linux, and that you will almost definitely have to
    > rebuild it with a Linux native compiler. It sounds like you have the
    > source code, so it should be a matter of just porting it over, and
    > stripping out all of the platform dependent calls a
    nd substituting all
    > of the necessary function calls.
    >
    > Good luck, and please keep us up to date on your progress. Not many
    > of us use Linux, and any and all information on the matter is gold.
    In linuxland isn't a dll called a shared library? You'd basically have to
    get the source for the dll and beat on it until it turns into a shared lib
    (better still, see if you can get an already built linux library). Actually
    hooking into the library from within LV should work the same in either world.
    NI, by the way, has app notes on this subject. I haven't gotten around to
    reading any of them yet, though.
    That's my story and I'm sticking with it.

  • Error while using LabVIEW 8.2.1 Dll from Visual C++ 6.0

    I am getting an error while using a LabVIEW 8.2.1 dll from Visual C++ 6.0 application. This is what I am doing:
    1) Created a dll using LabVIEW 8.2.1 (I used a tutorial from NI knowledge base: "Creating DLLs from 6.0i". It is a temperature conversion VI; input DegreeF and get DegreeC out). Instead of LabVIEW 6.0i, I used 8.2.1. It created the dll Convert_Temp.dll successfully.
    2) Then I created a Visual C++ 6.0 application (used a tutorial from NI knowledge base: "Calling a DLL from Microsoft Visual C++ that was Generated by LabVIEW 6i). I could build the project and create an executable application F_To_C.exe.
    3) Then copied the LabVIEW dll Convert_Temp.dll into the folder where F_To_C.exe resides. Using windows explorer, went into that folder, and executed the application.  I got the following error:
    System Error 998 while loading the LabVIEW run-time engine (C:\Program Files\National Instruments\Shared\LabVIEW Run-Time\8.2\lvrt.dll).
    Convert_Temp requires a version 8.2.1 (or compatible) LabVIEW Run-Time Engine. Please contact the vendor of Convert_Temp to correct this problem.
    I checked the folder: C:\Program Files\National Instruments\Shared\LabVIEW Run-Time\8.2\. It has the file lvrt.dll.
    So why am I getting this error?
    GKB

    sounds like you need to install the LabVIEW 8.2.1 runtime. Not the 8.2 runtime engine.
    Paul <--Always Learning!!!
    sense and simplicity.
    Browse my sample VIs?

  • The problem about call dll from VB....

    Dear All.
    I have a device and  VB dll file.I want to use labview to call  dll.But Labview show "An Exception occurred within the external code ..."
    Below is  to call this dll details.
    1、FindHardware:
    Call it at beginning when load program first, it can let program auto detect printer port address and model of dso scope.
    parament
    winversion:
    winversion = 2  "Windows NT,XP"
    UIP: open UIP(2048) array
    UCP:open  UCP(1023, 1023 + 11, 6)  array
    return:
    board_model:
    dso2902_128 = 27
    Then is my program
    Could somebody tell me what's wrong?
    Attachment file is this dll.
    http://us.f1.yahoofs.com/bc/500cf3ac/bc/dll/dll.ra​r?bfd1QSDBkHPgKI9c
    Thanks.
    由 Samyang 在 10-09-2005 07:14 AM 上編輯的訊息

    I can't say I understand the documentation snippet you provides, and I also can't access the DLL, but here are a couple things...
    1. I doubt very highly that a VB DLL is built with the C calling convension. I believe you should try the stdcall instead.
    2. You have the winversion being passed by pointer, but the docs make it look like a regular integer. Is that correct?
    3. Your board model is being passed by value, but it is listed as a return value in the docs. That would indicate an actual return value or a parameter passed by reference.
    My guess is that one or more of the above is causing the stack to get corrupted or an invalid pointer to be accessed and that is generating the error. Is there anyway to see the document (pdf or webpage)?
    Brian Tyler
    http://detritus.blogs.com/lycangeek

  • 1097 error calling DLL

    Hi,
    I am a student currently doing an internship, and I may need some help. First of all, I am a beginner with LabVIEW, so maybe what I am asking is silly but I am completly lost.
    In my project, I have to command a CD/DVD reader manually (speed of rotation, data transmitted...), and for this I am using a free DLL file I find download on this website.
    http://www.frogaspi.org/
    So I do not have access to the source code, just to the header file and the DLL. When I am calling it, I get the error number 1097.
    As I understand in several posts on this forum, the reason is probably that the buffer used by the Call Library Node is not correctly sized. Indeed, the parameter is a pointer to a cluster that contains numbers and strings. But how exactly can I do a allocation of memory on Labview?
    Also, I understand that writting a C++ wrapper could be a solution, but can I do that whithout the source code? (I only know a little bit about C and not about C++, but I understand that both are similar so I hope I will manage to do it if you think it is possible. Still if it is, could anybody send me some documentation about it).
    If anybody could have any idea that would be useful or at least could advise me some documentations, I would me more than grateful.
    The header file and the DLL files are available on the link I post (it is not my work so I am a little uncomfortable posting it here)
    Thanks a millions,

    Hi,
    First of all, thanks for your answer. Sorry for answering just now, but I was trying to advance by my own too, and also I was asked to work on other things in my internship. I will try to explain you what I have done so far.
    Thanks for explaining me the difference between an API and an ASPI, I have to recognize that I did not get the difference between both before you told me, and that makes everythink clearer to me now. Still, the "dll" I find on this website seems to be a ASPI Manager, and they say
    "The ASPI Manager for the SCSI host adapter processes these function calls and generates the appropriate SCSI commands to the SCSI peripherals".
    So, maybe I misunderstand that again, but it seems to me that the first step you recommend to do is already done by the creater of this DLL.
    Also, I am now using Labview 2011 instead of 2010, but I don't think this change a lot in my problem. I send the labview code I made, it is currently very basic but if I cannot access the basic function of the DLL, there is just no point trying to make a code more complicated. I am for now just trying to call one of the function of the DLL and see what is happening.
    For this first function, the parameter to send to the node is a pointer on this structure:
    typedef struct
    BYTE SRB_Cmd;                 // ASPI command code = SC_HA_INQUIRY
    BYTE SRB_Status;              // ASPI command status byte
    BYTE SRB_HaId;                 // ASPI host adapter number
    BYTE SRB_Flags;               // Reserved, MUST = 0
    DWORD SRB_Hdr_Rsvd;     // Reserved, MUST = 0
    BYTE HA_Count;                // Number of host adapters present
    BYTE HA_SCSI_ID;            // SCSI ID of host adapter
    BYTE HA_ManagerId[16];    // String describing the manager
    BYTE HA_Identifier[16];      // String describing the host adapter
    BYTE HA_Unique[16];         // Host Adapter Unique parameters
    WORD HA_Rsvd1;             // Reserved, MUST = 0
    SRB_HAInquiry, *PSRB_HAInquiry;
    It is not really working so as I read on this NI webpage: http://digital.ni.com/public.nsf/allkb/DCB90714981A1F148625731E00797C33
    "Note that if your complex data type is a struct with more than primitive data types (int, double, char), it is easiest to create a wrapper DLL from a C-based language."
    So this is what I have been trying to do, and maybe it is very basic, but if anyone could send me a link on how to create a wrapper DLL, it would be very useful. I already download the one National Instrument made, but I did not really understand it.
    The DLL seems to work fine as I manage to call it from a C console programme. (I send the code too). But I tried to followed some tutorials but I just cannot create a DLL that I could use, so maybe there is something badly set in my IDE (I am using Code::Blocks). So if anybody has any idea of what is going on I would be very grateful. Again, the DLL I tried to make is very basic but if the basic are not ok, there is no point going further.
    This is what is happening right now : I create the dll file following the instruction but when I compile I get this warning:
    "warning: 'int addition(int, int)' redeclared without dllimport attribute: previous dllimport ignored"
    and then I just can't compile the test programm because I get the error: altough I did set the file.a as a linker.
    "undefined reference to `_imp__addition' "
    I send the compressed files that I made, I think there should be everything that is needed to answer me, except the DLL file that is available here http://www.frogaspi.org/download.htm
    Again sorry, but the owner of this library explicitly asked not to purpose a local download so I feel very unconfortable doing that, so please, just click on the link and download it from there.
    I do not know if anybody has ever done what I am trying to do, and I am not asking for someone to do it instead of me, I am sorry if I sound like it in my previous message, this was definitly not my intention.
    Still, the problem of having to write a wrapper seems to be a commun issue for people calling DLL in Labview, and I didn't find answer very clear on how to create a dll. I guess I could eventually find out by myself, but if anybody can help, that would make me save a lot of time.
    Maybe what I am asking is very easy, but again my knowledge about C language is basic, I am not  a computer science student so...
    Anyway, thank in advance,
    Adrien
    Attachments:
    Problem Wrapper.zip ‏31 KB

  • Calling  dll method from oracle forms

    Hi,
    This is my first post in this forum. I don't know whether this is the right place to post this topic here.
    i wana call DLL method from the button click event of my form.
    I new to oracle development any help will be greatly appreciated.

    Calling DLL using form 6i
    Regards,

  • CALL dll FROM form 6i

    Hi I have to call a dll which returns some message by accepting a file name as input.
    The plateform is Oracle form 6i deployed on oracle AS , and Oracle 8i DB as backend.
    Kindly suggest , what can be best startegy-
    call dll using form 6i in client server .
    call dll using 3 tier deployement.
    or make an ASP or JSP application
    Please suggest.
    Prashant

    Calling DLL using form 6i
    Regards,

  • "HOW to use Labview call Dll compiled by VC++"

    "hello,I use VC++ compile a DLL,and i want to call DLL Function in LABVIEW program.But there is a dll function
    when i call it in labview.There is error.The prototype of Dll Function that make error is "USHORT DLLFUN __stdcall IBWRT(unsigned short dev_address,const char *pstrWrite)",The second paramenter is a char pointer,
    and the paramenter pass a command which content is
    "MEASURE:CURRENTC? 1A,0.001MA".
    When i use VC++ to call this function,i program followed:
    CString m_wrt;
    int ReturnW;
    m_wrt="MEASURE:CURRENTC? 1A,0.001MA";
    char buffer[40];
    strcpy(buffer,m_wrt);
    ReturnW=IBWRT(4,buffer);
    and this call is correct.
    But when i use labview to call this function.ther
    e is
    error.So, who can help me,to tell me how to call this
    function.Thanks."

    Are you asking about porting code or calling C++ code in LabVIEW?  As far as porting code, there's no easy way to move code back and forth between LabVIEW and C++.  However, if you are trying to call C++ code in LabVIEW, you can compile it as a DLL and call it in LabVIEW using the Call Library Function node.
    Chad B. » National Instruments » ni.com

Maybe you are looking for