Create dll from labview

Hi all:
I am using labview 8.5 , i want to create dll for spacific vi , to use its output in another program like C++,
can any one help me to learn the steps to create dll from labview
thanks

You need the application builder (which is part of the professional distro).
In general you should every VI that you want as a function set to 'top-level'
If you right click on the builds in your project you have an option to build a DLL (if you have the application builder), from there on the help is available.
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be!

Similar Messages

  • Create DLL from labview and calling it from other application

    I have an application built using Labview. I wanted to create DLL out of it. The application has
    two String inputs start and stop buttons and two status indicators.
    1. How to itegrate start and stop buttons from function prototype?
    2. Does Labview created DLLs requires labview runtime engine when it is to be called from other application?
    Can some one help on this.
    Solved!
    Go to Solution.

    Hi Yuvish,
    1) They should be boolean inputs to your VI. But does it makes sense to provide a stop button input at the start of your VI? (THINK DATAFLOW!)
    2) Yes, the LV-RTE is needed...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Creating dll from Labview for use in VB

    In this document:
    Accessing LabVIEW 6.0 Strings from Microsoft Visual Basic
    It mentions you need to input a length for your string inputs. When I create my dll no len is available for string parameters only Arrays. Is this a typo?
    Also, In my LV code I have a path input. Can VB work with this? I have already converted my LV code to accept path as string...just wondering if I really have to do that.

    Drugar,
    Only string outputs (indicators) that are wired on the connector pane will show the length parameter selection when you try to build the dll.
    I don't think VB accepts paths, so you should convert the path to string in LabVIEW before building the dll.
    Zvezdana S.

  • Calling 64-bit dll from labview 8.2 on Windows7

    Hello,
    I have tried the LABview driver from the OMNIDRIVER (OceanOptics) package. But when calling functions from the “OmniDriver32.dll” , LABView is crashing and  says that the memory is corrupted.
    I am using LABVIEW 8.2 (32-bit) running on Windows 7 (64-bit).  I have tried some LABView code examples given for LABview 7.1 and 8.0. These example are using the OmniDriver32.dll (not the OmniDriver64.dll).
    But maybe these example are assuming that you are on a 32-bit operating system, which is not my case.
    So I have tried calling the OmniDriver64.dll. but LABView seems not to recognised the dll and can’t read the included functions.
    Is there a way to call some 64-bit dll from LABview 8.2 ?
    Or do I need to buy a new license for LABVIEW 64-bit ?
    Thanks,
    Pierre

    There is no virtualization support for DLL bitness issues outside of the Windows standard directories. The Windows and System directories that an application "sees" depends on its bitness. All other directories are not mapped depending on the calling process' bitness.
    So if you have installed 32 Bit LabVIEW and are not calling one of the system DLLs, you have to point the path of the DLL to the real 32 bit DLL. Pointing it to a 64 bit DLL should not even be able to get the VI compilable, since Windows will refuse to load the DLL into the 32 bit process as being an unknown file format, and that should make the VI broken.
    If you need to call a system DLL you simply enter the DLL name without path and Windows will find the according DLL for LabVIEW.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Can I create a dll from labview with more that one function name

    I know that when I create a dll from C and then call it in labview using the call library function node I can see the different functions on the configuration screen. Is there a way to create a dll in labview to have more than one function name? No matter how many functions happen in my VI it seems to build into a dll under the same function name requiring inputs for every function, can this be avoided somehow?
    Thanks,
    Dave

    Each function corresponds to a separate VI. When creating the dll, on the Source Files tab of the app builder, click the Add Exported VI for each VI that you want. SubVIs of a main are not automatically exported and will not be available as separate function calls.

  • How do I call a LabVIEW created DLL from within Microsoft Excel (VBA)?

    Hi,
    I'm trying to get Microsoft Excel 2003 to call a function stored in a dll that I created using LabVIEW 7.1.  The function is very simple and is called "binary_file_to_ascii".  Basically it just reads a LabVIEW created binary spreadsheet file and outputs the columns as float arrays.
    The function arguments are as follows:
    INPUT : String that contains the path to the binary spreadsheet file
    OUTPUT : Number of rows in the spreadsheet
    OUTPUT : Number of columns in the spreadsheet
    OUTPUT : Float array containing the elements in column 1
    OUTPUT : Float array containing the elements in column 2..
    OUTPUT : Float array containing the elements in column 11
    However, for some reason there is something wrong with my VBA code and/or the way I created the DLL in LabVIEW because Excel crashes when it loads my DLL.
    What do I need to change in my VBA code or my LabVIEW DLL build settings to fix this?
    I've attached to this post a ZIP file that contains all my code and a sample binary file.
    Your help with this will be much appreciated.  Thanks!
    Richard
    P.S.  Here is the VBA code I'm using:
    Private Declare Function binary_file_to_ascii Lib "C:\temp\binary_file_to_ascii\binary_to_ascii.dll" _
    (ByVal binaryFile As String, ByVal nrows As Long, ByVal ncols As Long, ByVal column1 As Variant, _
    ByVal column2 As Variant, ByVal column3 As Variant, _
    ByVal column4 As Variant, ByVal column5 As Variant, _
    ByVal column6 As Variant, ByVal column7 As Variant, _
    ByVal column8 As Variant, ByVal column9 As Variant, _
    ByVal column10 As Variant, ByVal column11 As Variant)
    Private Sub load_binary_spectra()
      Dim nrows, ncols As Long
      Dim col1(), col2(), col3(), col4(), col5(), col6(), _
          col7(), col8(), col9(), col10(), col11() As Variant
      Dim lRetVal As Long
      Dim spectra_path As String
        spectra_path = "C:\temp\binary_file_to_ascii\sample_binary_file\sample_binary_file.dat"
        lRetVal = binary_file_to_ascii(spectra_path, nrows, ncols, _
                  col1(), col2(), col3(), col4(), col5(), col6(), _
                  col7(), col8(), col9(), col10(), col11())
        MsgBox (spectra_path)
    End Sub
    Message Edited by Richard Ballantyne on 07-25-2007 02:39 PM
    Message Edited by Richard Ballantyne on 07-25-2007 02:39 PM
    Attachments:
    binary_file_to_ascii.zip ‏192 KB

    Hi,
    I don't know anything about Visual Basic, but here's my guess.
    When you load the DLL with this line of code
    Private Declare Function binary_file_to_ascii Lib "C:\temp\binary_file_to_ascii\binary_to_ascii.dll" _
    (ByVal binaryFile As String, ByVal nrows As Long, ByVal ncols As Long, ByVal column1 As Variant, _
    You are defining how the parameters are sent. It seems that all are sent by value (ByVal), but in the DLL header, some of the function's
    parameters are defined as pointers(see the function prototype below, look for asterisk(*))
    void __stdcall binary_file_to_ascii(PStr binaryFile,
                                                    long *numberOfRows,
                                                    long *numberOfColumns,
                                                    float column1[],
                                                    float column2[],
                                                    float column3[],
                                                    float column4[],
                                                    float column5[],
                                                    float column6[],
                                                    float column7[],
                                                    float column8[],
                                                    float column9[],
                                                    float column10[],
                                                    float column11[]);
    Can you define in VBA that you want to use pointer instead? Maybe by using ByRef (as by reference).
    Hope this helps.

  • 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 LV created DLL from LV

    Howdy-
    I'm trying to call a LV DLL from within LV (seperate project).  Once the DLL has been comppiled I'm using the Import Shared Library to create the node.
    However when I try this I get an error message with the import that appears to have trouble with LVBoolean and int32_t.
    I've created a simple DLL (adds a DBL to an INT 32 and creates a Bool when the sum is > 0). 
    Compiling this DLL and trying to import it has the same issue.
    Any clues?
    Attachments:
    Import Shared Lib.png ‏49 KB
    My DLL.zip ‏34 KB

    nathand wrote:
    This does mean LabVIEW will create the datatypes with U8 instead of booleans, which you can replace yourself with a boolean after importing.
    Except that the Call Library Node doesn't allow for configuration of an explicit boolean type (for obvious reasons as there is no standardized boolean datatype in C before C11 and even then the standard says nothing about if it should be a byte or the prefered integer size for the current platform or anything else). LabVIEW then uses Adapt to Type instead, which forces the skalar parameter to be always passed by pointer!
    Most simple solution is to still use an explicit integer that is properly sized and convert between the LV Boolean and the integer on the diagram.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Creating dll in Labview

    Hello All,
    How do i create a dll in labview? I want to use it as a plug in into an application.
    Demmy

    Hi Demmy
    What LabVIEW version are you using? If you are using version 8 and higher then you have to have your VIs loaded into a LabVIEW project and you use the project build specification. You can access the LabVIEW 2009 help on how to build a dll here.
    Here is a quick summary:
    In the project window right click build specifications and choose New -> Shared Library (DLL). This will open the window to create the dll.
    Go to the Source Files category and use the arrow to take the VIs that you want into exported VIs, a dialog will then come up to define the function prototype for that vi. Do this for each vi you want to access in your dll.
    You will need LabVIEW professional version to create dlls and the target computer where you are using the dll must have the LabVIEW run time engine installed.
    Message Edited by Karissa on 03-03-2010 09:05 PM
    Systems Test Engineer
    Certified LabVIEW Architect (CLA)

  • Trying to create DLL from VI to use in TestStand.

    I trying to create a DLL out of an existing VI file.  The VI has about 4 inputs and about 3 outputs.  If I go to Tools >> Build Application and select the Build Target as a "Shared Library (DLL)" i get a dll after the build; but when I try to call that DLL from teststand, it doesn't recognize any of the inputs or outputs.  How do I build a DLL so that teststand will reconize the inputs and outputs?
    Solved!
    Go to Solution.

    The controls and indicators are connected to the connectors.  Also, answering an earlier post, the prototype information for the inputs and outputs are not automatically displayed. I can manually define the prototypes, but then the question is how does each prototype link to its corresponding parameter (by name?). I've also tied creating just a simple VI that has just one string input and one string output.  I built the VI to a DLL and tried calling in TestStand and i get the same results.  I've inserted the resulting header file after that build.  Which, by the way, looks exactly like my other created DLL's header file.  The difference in bold(the name of the VI). Which makes me thik that my build DLL process might be off.
    #include "extcode.h"
    #pragma pack(push)
    #pragma pack(1)
    #ifdef __cplusplus
    extern "C" {
    #endif
    void __stdcall String_input_output(void);
    long __cdecl LVDLLStatus(char *errStr, int errStrLen, void *module);
    #ifdef __cplusplus
    } // extern "C"
    #endif
    #pragma pack(pop) 

  • Calling a DLL from LabVIEW causes crash

    Okay, this is an odd one. I have searched through various posts and have found several things that were close but not quite the same.
    I have a DLL. I pass to the function in the DLL two strings, each one representing an absolute path to a pair of files. I use a path control to get the paths and then convert those paths to strings. The function also has about 13 other parameters, each of which are U8's passed by reference. I have attached my VI and the DLL. I had to zip the DLL to get it a valid extension.
    The function opens the file pointed to by the first string and parses information out of it. It then tries to create some temporary files in a folder that W7 considers to be a safe temporary folder. The problem is that when I run this VI, LabVIEW crashes...hard. I get the message that LV needs to close. However, before it crashes, it successfully opens the file, parses the info out of it and creates one new file in the temp folder. So, the issue seems to happen after the function mostly finishes with everything it needs to do.
    One interesting note: I replaced the outputs of the path2string conversions with string constants pointing to the exact same files. Now LV doesn't crash. Instead I get an unhandled exception error in the DLL.
    Next interesting note: This same procedure called from another application written in C (on another system) works fine.
    Finally, I do have one advantage that most others don't: the developer of the DLL is a coworker of mine. So I have access to the source code.
    My coworker feels that the function is failing "between the lines" of code. He thinks it is some type of stack overrun but can't place it.
    Any thoughts?
    Thanks,
    Joe
    Attachments:
    dll_LoadConstantsFile.vi ‏15 KB
    gui_confread_dll.zip ‏40 KB

    Rolf, if I understood you correctly, here is the portion of the header file that declares the function:
    #define
    DLL_EXPORT __declspec(dllexport)
    BOOL WINAPI DLLMain(HINSTANCE hinstDLL,DWORD,LPVOID);
    extern
    "C" DLL_EXPORT void__cdecl LoadConstantsFile(char*filename,
    char*patch,
    uInt8 *load_status,
    uInt8 *device_type,
    uInt8 *multi_bom_available,
    uInt8 *hires_gain_available,
    uInt8 *dcdc_bom_option,
    uInt8 *bat_rail_type,
    uInt8 *num_mb_genconf,
    uInt8 *num_ring_presets,
    uInt8 *num_dcfeed_presets,
    uInt8 *num_impedance_presets,
    uInt8 *num_fsk_presets,
    uInt8 *num_tone_presets,
    uInt8 *num_pcm_presets);
    Here is a description of the function:
    Constants File Reader
    This is the main function that parses the constants files, collects information, and creates temporary script files. Run this FIRST.
    void LoadConstantsFile(char *filename,
    char *patch,
    uInt8 *load_status,
    uInt8 *device_type,
    uInt8 *multi_bom_available,
    uInt8 *hires_gain_available,
    uInt8 *dcdc_bom_option,
    uInt8 *bat_rail_type,
    uInt8 *num_mb_genconf,
    uInt8 *num_ring_presets,
    uInt8 *num_dcfeed_presets,
    uInt8 *num_impedance_presets,
    uInt8 *num_fsk_presets,
    uInt8 *num_tone_presets,
    uInt8 *num_pcm_presets);
    Inputs
    filename
    Full path and filename of constants file to be read
    patch
    Full path and filename of patch file to be loaded
    I/O
    load_status
    Updated with 0 if load successful, non-zero if unsuccessful (see codes table)
    device_type
    Updated with value representing device supported by the configuration file (see codes table)
    multi_bom_available
    Updated with 1 if configuration file supports the multi-bom format, 0 otherwise
    hires_gain_available
    Updated with 1 if configuration file supports the hires gain format, 0 otherwise
    dcdc_bom_option
    Updated with DCDC BOM Option of
    default General Configuration detected (see codes table)
    bat_rail_type
    Updated with Battery Rail Type of
    default General Configuration detected (see codes table)
    num_mb_genconf
    Number of general configuration presets detected (if multi-bom is supported)
    The items marked as "inputs" are meant to have something passed in as a value. The parameters marked as I/O are meant to have a pointer to them passed so the function can modify the values (passed as reference).
    The function simply opens the file at "filename" and parses out the info to update the other U8 parameters. The file pointed to by "patch" is simply opened to verify it exists and then closed.

  • How to pass a parameter of type __int64 to a DLL from LabVIEW?

    I have a DLL function built in C that has a parameter of type __int64. Is it possible for me to represent a control of type equivalent to __int64 in LabVIEW?

    kelsie,
    I would agree with the other answers, but I have a bit more information as well. LabVIEW's EXT data type is in an IEEE format for an 80-bit floating point number (1 sign, 15 exponent, 64 mantissa, see Application Note 154). This should then represent an 64-bit integer with no issues (theoretically). However, I have only ever been able to get it to represent integers up to 1000000000000000000.000000 visually (1*10^18). I have a VI that reproduces this and I am trying to get it fixed. Now, the numerical value in memory is correct, but LabVIEW cannot visualize it to you at each integer value from 10^18 to 2^64. (Try placin
    g an EXT control on the front panel and typing in 1000000000000000000.000000. Then type in 1000000000000000001.000000. Notice that it does not display that value. However, run the attached LabVIEW VI and notice that the numerical values are not identical because they are not equal.) Another thing to note is that the increment/decrement buttons quit working after 9007199254741000.00.
    This all came about because customers wanted to get 64-bit integers from GPIB instruments. So what I did what to take the string and make the 64-bit integer into 2 32-bit integers. I then put them back together into an EXT data type to represent the large number. This is when I ran into the issue of the very large numbers.
    So, I agree that inputting two 32-bit integers would be the best method. Then use the "Scale by Power of 2" function to multiply the high part by 2^32 and add it to the low part. Again, this works for numbers up to 10^18.
    I hope this helps.
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask
    Attachments:
    EXT_Test2.vi ‏25 KB

  • How to create a dll from vi in Labview 7.0 ?

    Hello,
    I want to create a dll from a vi in Labview 7.0.
    I've found the url: http://zone.ni.com/devzone/conceptd.nsf/webmain/003A3E6A5E9CCCEC8625691F0072B2C5
    explaining how to create DLLs from LabVIEW in Labview 6.0i but this method is not available in my Labview 7.0.
    How is it possible to create a dll from a vi or from vi's (stored in llb-files) ?
    With thanks,
             best regards,
                  Geert

    You can only create DLLs and Standalone Applications if you have LabVIEW professional or higher.
    If you only have LabVIEW Base of Full, you need to purchase the Application builder seperately. 
    (Check under "Deployment tools" in the LabVIEW comparison matrix. What level do you have?)
    Message Edited by altenbach on 10-18-2005 08:45 AM
    LabVIEW Champion . Do more with less code and in less time .

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

  • Creating a DLL in LabVIEW containing a function using pointer to pointer

    Hi!
    I´m facing the problem to create a DLL from LabVIEW containing the following C-function:
    functionF(structS** arrayA) ,
    where:
    structS is a struct of various data-types (e.g. int)
    arrayA is an C-array of structS
    How can this be done? Any ideas?
    Thank you in advance for your support

    This cannot be done in LabVIEW. LV doesn't have the data type "Pointer" as C has.
    The only workaround I can think of is to use an array of strings in LV and in the interface define the parameter as "by reference". In LV you have to typecast the wire with the string to a cluster withthe layout of structS.
    As far as I know an array of strings is represented as an array of pointer to strings. This is because strings are variable in length and therefore LV uses this method storing the pointers to the strings in the array and not the elements as usual.
    You have to read the document about memory and data types of LabVIEW. In elder versions this was in the LabVIEW Bookshelf but I haven't found it in short in the newer version.
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

Maybe you are looking for