How to build a dll

hi everybody,
                        I have a problem  on creating a dll for my appliction in labview. Anybody give me the suggesstion for creating a dll.
Thanks.
kumar.

I have a doubt reg the configuration of the input parameters when LabVIEW builds them into a Dll.
For example,
       F to C Vi has 1 i/p and 1 o/p. I built this VI into a dll. This dll is called by another VI, where it shows 2 inputs F & C. The return type is a 8-byte double. But as of my unserstanding, it should be1 I/P only, ie, degF alone. Am I right? If not, what is the reason for the appearance of the second input degC, when it shoulld have been the output by itself ?
LabVIEW by itself builds the Dll with all the required parameters when we export he VI. So, why does it have the DegC as the second I/P parameter when the connector pane does not have it as an input?
Please explain this confusion to me.
The file with extn .zip is the FtoC Dll. Please change the extn when U use it.
Regards,
Kumar.
Attachments:
ftoc.vi ‏10 KB
FtoC.zip ‏18 KB
FC.vi ‏13 KB

Similar Messages

  • How to build a DLL that has Pascal calling conventions with application builder?

    Hi,
    I'm researching for possible solution to one of our problems.
    In one case, solution would be to build a DLL from LabView
    code. This should be simple task, but the application that
    is going to load the DLL requires that the functions in the
    library are exported using Pascal calling conventions,
    similar to the C/C++ example code below.
    DWORD APPEXPORT far APPPASCAL function(char hexr[])
    Could this be possible with LabView somehow? Or is it best just
    to write the DLL with C/C++?
    Thanks.

    Thanks Wiebe.
    I don't know whether I need pass string pointers or not. The example
    I posted was from the manual of the program that will be using the DLL
    I build with LabView. I only wanted to show with it the exported calling
    convention needed. It seems that it actually confused my question rather
    than clearing it.
    Anyway, now I know that it's possible to declare the calling convention
    when building the DLL. And it's always good to know that I might encounter
    different pointer types on the way, this may actually save me from a lot of
    debugging some day.

  • How to build a dll for labview pda, which uses the intel ipp primitives in it

    Hi all,
    For my application, I need to call a c dll from Labview PDA, and in the c function i need to use intel IPP function. When i call my dll, i get an error saying the ippfunction i use, say "ippsCopy_16s missing c or vi file". Can someone tell  me what I might be doing wrong?

    Hi Vani,
    When using a DLL in a PDA there are some special considerations you have to take. Please take a look at the following knowledgebase describing the process.
    Eli S.
    National Instruments
    Applications Engineer

  • Problem with building a dll

    Hello! I am trying to learn how to build a DLL with Labview. I have made a simple VI that concatenates 2 numbers into an array. Then a indexes that array and puts that number to an indicator. This works fine.
    But, if I instead invokes the sub-vi Mean to calculate the mean of the array nothing happens. No results at all comes out from the dll.
    WHY?
    I have seen that the sub-vi Mean is a DLL, do I have to add that in the builder?
    /tj

    Hello Thomas!
    Could you send your program for further investigations?
    cheers
    Message Edited by AshwaniS on 09-26-2005 03:23 AM
    Ashwani S.
    Applications Engineer
    National Instruments Sweden

  • How to remove the "int len" of my return string on the DLLS header when building a DLL on LabVIEW 8.5

    Hi all.
    I'm building a DLL on LabVIEW and I choose a string as an output on the terminals connectors.
    But LabVIEW creates another output, the lenght of the return string.
    This is a problem because I have other DLLs and I need them to be compatible.
    How do I remove this length from the header? What is the difference between Pascal String and C string and String Handle Pointer?
    String Handle Pointer removes the length from the header but I don't know the difference between this data types.
    Thanks in advance for the help.
    Daniel Coelho
    Portugal
    Daniel Coelho
    VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
    Controlar - Electronica Industrial e Sistemas, Lda

    Daniel Coelho wrote:
    Hi all.
    I'm building a DLL on LabVIEW and I choose a string as an output on the terminals connectors.
    But LabVIEW creates another output, the lenght of the return string.
    This is a problem because I have other DLLs and I need them to be compatible.
    How do I remove this length from the header? What is the difference between Pascal String and C string and String Handle Pointer?
    String Handle Pointer removes the length from the header but I don't know the difference between this data types.
    Thanks in advance for the help.
    Daniel Coelho
    Portugal
    C string pointer is a pointer to a memory location whose string information is terminated by a 0 byte. Pascal String Pointer is a pointer to a memory location where the first byte specifies the number of bytes to follow. This obviously allows only for strings up to 255 character length.
    LabVIEW String Handle is a pointer to a pointer to a memory location where the first 4 bytes are an int32 value indicating the number of characters to follow. You can read such a String handle in a function without many problems, but you can only create, resize and delete such a handle by using LabVIEW memory manager functions. So this makes only sense if the caller of such a DLL is LabVIEW too as another caller would have to go through several hoops and tricks in order to gain access to the correct LabVIEW kernel that could provide the memory manager functions to deal with such handles.
    Last but not least output strings whose allocated length is not passed to the funciton as additional parameter are a huge secerity risk (talk about buffer overrun errors). LabVIEW DLL Builder does not support the creation of DLLs with output string (or array parameters)  without the explicit passing of an additional parameter telling the DLL function how large the allocated size is (so that the DLL function can make sure to never write over the end of the buffer).
    The additional length parameter only disappears for String Handles because LabVIEW will simply resize them to whatever length is necessary and that is also the reason why those handles need to be allocated by the same memory manager instance that is also going to execute the DLL function.
    Resizing of memory pointers is non-standardized and in normal circumstances not suited for passed function parameters at all.
    Rolf Kalbermatter
    Message Edited by rolfk on 06-13-2008 12:28 PM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to build a shared library (dll) of a VI to be called by VC++

    hi All,
    How should I build a shared library ( dll ) using LabVIEW so that the desired output from LabVIEW can be returned to the main program that runs in VC++ ?
    I'm currently working in a project that uses the PXI 1042 & DMM, AWG, FGEN, SCOPE, RFSG, RFSA etc.
    The VC++ programmers dont want the LabVIEW front-end to be visible when called into VC++, in the sense they don't want LV to be another front-end, as the entire software is designed using VC++. It is enough if I simply pass the final values of measurement to them for display purpose.
    So, they've asked me if it is possible in LabVIEW to provide the VIs as dlls instead of exes.
    Since I've seen the feasibility of building a EXE or a DLL in LV, I've replied positively to them.
    In another of my project, I'm using dlls built in VC++ for hardware drive interaction parts in my LabVIEW project.
    Likewise, what are the methodologies that I should follow when building a Dll in LV ?
    I tried with a simple VI, wherein it returns a value of addtion of 2 elements & I passed it thro' the connector pane correctly.
    When I called the same dll in LV itself & configured it correctly by specifying the correct return type & I/O, then also it did not run properly.
    I could not understand what was going.
    So experts pls help me out by some simple examples or related links.
    Regards & Thanks,
    Partha.
    - Partha
    LabVIEW - Wires that catch bugs!

    Here you can find Application Notes and examples:
    http://zone.ni.com/devzone/devzone.nsf/webcategories/98D192CDCCDA21EE86256AB7006BECAF
    Hope this helps!

  • How to create a .DLL file from a .C file ?

    Hi everybody
    I'm looking for a method how to create a .DLL file from a .C file .That Dll file will be used to perform a board to measure voice quality accoding to the international standard named PESQ (perceptual evaluation of speech qualty) P.862.
    Can anyone help to start dealing with Dlls and give some advices to avoid errors ?
    thx
    Attachments:
    source.zip ‏37 KB

    Hi sinaps,
    You mention that you want to create a DLL from a .C file. Just to clarify, are you using C (.c file) or C++ (.cpp) to write your code?
    Also, if you are using C++, are you using Visual Studio? (The reason I ask is because this forum is geared towards Measurement Studio, which is an add on to Microsoft Visual Studio).
    That being said,
    If you are using C: National Instruments provides an ANSI C Application Development Environment called LabWindows/CVI which makes building dlls a snap. It has templates for DLLs and you can build them either as stdcall or cdecl dlls.
    Developer Zone Tutorial: Building a DLL with LabWindows/CVI 8.5 for use with LabVIEW 8.5
    If you are using Visual C++: Look at the link that Al provided earlier.
    MSDN: Walkthrough: Creating and Using a Dynamic Link Library
    If you aren't using CVI or Visual Studio, then really the best bet is to do a google search for "Create C DLL" or post or a forum for the appropriate environment that you are using.
    Thanks!
    Message Edited by Jervin_J on 03-14-2009 02:02 PM
    Jervin Justin
    NI TestStand Product Manager

  • How to call a dll with special parameters in Labview?

    Hi,
    I have a dll file (compiled in C++) and I would like to call the individual functions from this dll file.
    I do not know however, how I must correctly define the initial parameters in LabView.
    That is the function, which I would like to call:
    DWORD OpenDiagDriver ( char* port,
    LPCSTR path,
    CANObjects CANObj[],
    WORD BitTiming = 0x4167);
    CANObjects CANObj[] is a pointer to array with CAN configuration data
    typedef struct
    DWORD Ident;
    BYTE Config;
    }CANObjects;
    CANObj[0].Ident= 0x18DA0000;
    CANObj[0].Config= 0x8C;
    CANObj[1].Ident= 0x18DA0000;
    CANObj[1].Config= 0x84;
    WORD BitTiming= 0x4167;
    I made a vi, but it doesn’t work.
    Attachments:
    example.vi ‏29 KB

    Hard to say without the full C source. Are you building the DLL according to the CIN rules (see Using External Code in LabVIEW)? Mapping clusters to C code in DLLs is not a simply process and we generally recommend to create wrappers. However, since your structures are fairly straightforward, you could use the "Adapt to Type" as you are trying to do.
    I recommend checking out the mentioned manual and also the examples in \examples\dll\data passing\Call Native Code.llb and the associated C files.
    Brian Tyler
    http://detritus.blogs.com/lycangeek

  • Build a DLL in LabVIEW & Use the DLL in LabVIEW

    I am trying to build a DLL for the simple vi with LabVIEW and want to use the DLL in LabVIEW. is it impossible?
    I wrote a vi and it have 2 terminals. one is the input for numeric dbl data type and one another is the output for numeric dbl 1D array data type.
    It was built with the Application builder for LabVIEW 8.0 and DLL was created successfully.
    I want to use this DLL in new vi with LabVIEW.
    Call library function used. I wrote a new vi to use that DLL.
    In config dialog I config each parameter for dll and connected terminals. but it doesn't work
    pleas refer to the attatched file and let me know what I missed.
    Attachments:
    Array1D.zip ‏60 KB

    At first I kept scratching my head wondering why someone would want to do this. Create a DLL in LabVIEW to call it from LabVIEW. Seems redundant. But, perhaps it's an exercise or perhaps it's for testing the DLL...
    In any event, calling the DLL worked for me in 8.2. How are you configuring your Call LIbrary Function node? I have it set up as follows:
    return type: void
    iteration: Numeric, Signed 32-bit Integer, pass by value
    array1D2: array type, Signed 32-bit Integer, 1 dimension, "Array Data Pointer" format
    len: Numeric, Signed 32-bit Integer, pass by value
    Then I called the DLL like this:
    Message Edited by smercurio_fc on 03-16-2007 12:57 PM
    Attachments:
    Example_BD.png ‏2 KB

  • Can't build "hprof.dll" on Windows [JDK5.0]

    Hello everyone!
    Now,I am trying to build "hprof.dll" on windows, because I want to customize "Hprof".The "hprof" source code is included in "JDK DEMO(see %JAVA_HOME%\demo\jvmti\hprof\src)".
    I have not changed the source code at all.
    However,Building doesn't go well.
    My environment
    windows Xp sp1
    J2SE5.0 [<-JAVA_HOME=C:\Program Files\Java\jdk1.5.0_05]
    VC++6.0
    I made a simple batch file to build it referring to "sample.makefile.txt".
    I executed this batch file in "%JAVA_HOME%\demo\jvmti\hprof\src".
    ---build batch----------------------------------------
    set JDK_INC=C:\Program Files\Java\jdk1.5.0_05\include
    set CFLAGS= -Ox -Op -Zi -Gy -W0 -WX -DHPROF_LOGGING -DNDEBUG -I. -I..\..\java_crw_demo\src -I"%JDK_INC%" -I"%JDK_INC%\win32"
    del /F *.obj *.exp *.lib
    del /F hprof_md.c
    copy .\windows\hprof_md.c hprof_md.c
    cl %CFLAGS% /c *.c
    link -dll -out:MyHprof.dll *.obj wsock32.lib winmm.lib
    pause
    -----Result-------------------------------------------
    debug_malloc.c
    hprof_blocks.c
    hprof_class.c
    hprof_cpu.c
    hprof_error.c
    hprof_event.c
    hprof_frame.c
    hprof_init.c
    hprof_io.c
    hprof_ioname.c
    hprof_listener.c
    hprof_loader.c
    hprof_md.c
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock2.h(99) : error C2011: 'fd_set' : 'struct' type redefinition
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock2.h(134) : note C6311: C:\Program Files\Microsoft Visual Studio\VC98\include\winsock.h(83) :see previous definition of 'FD_SET'.
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock2.h(143) : error C2011: 'timeval' : 'struct' type redefinition
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock2.h(199) : error C2011: 'hostent' : 'struct' type redefinition
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock2.h(212) : error C2011: 'netent' : 'struct' type redefinition
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock2.h(219) : error C2011: 'servent' : 'struct' type redefinition
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock2.h(226) : error C2011: 'protoent' : 'struct' type redefinition
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock2.h(310) : error C2011: 'in_addr' : 'struct' type redefinition
    [continues]
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock2.h(2258) : error C2375: 'WSAAsyncGetProtoByNumber' : redefinition; different linkage
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock.h(810) : see declaration of 'WSAAsyncGetProtoByNumber'
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock2.h(2283) : error C2375: 'WSAAsyncGetHostByName' : redefinition; different linkage
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock.h(814) : see declaration of 'WSAAsyncGetHostByName'
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock2.h(2310) : error C2375: 'WSAAsyncGetHostByAddr' : redefinition; different linkage
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock.h(818) : see declaration of 'WSAAsyncGetHostByAddr'type redefinition
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock2.h(2333) : error C2375: 'WSACancelAsyncRequest' : redefinition; different linkage
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock.h(822) : see declaration of 'WSACancelAsyncRequest'type redefinition
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock2.h(2353) : error C2375: 'WSAAsyncSelect' : redefinition; different linkage
    C:\Program Files\Microsoft Visual Studio\VC98\include\winsock.h(824) : see declaration of 'WSAAsyncSelect'type redefinition
    hprof_monitor.c
    hprof_object.c
    hprof_reference.c
    hprof_site.c
    hprof_stack.c
    hprof_string.c
    hprof_table.c
    hprof_tag.c
    hprof_tls.c
    hprof_trace.c
    hprof_tracker.c
    hprof_util.c
    C:\Program Files\Java\jdk1.5.0_05\demo\jvmti\hprof\src>link -dll -out:MyHprof.dll *.obj wsock32.lib winmm.lib
    Microsoft (R) Incremental Linker Version 6.00.8447
    Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
    Linking...
    hprof_init.obj : error LNK2001: unresolved external symbol "_md_get_milliticks
    hprof_io.obj : error LNK2001: unresolved external symbol "_md_get_milliticks
    hprof_init.obj : error LNK2001: unresolved external symbol "_md_init
    hprof_util.obj : error LNK2001: unresolved external symbol"_md_snprintf
    [continues]
    hprof_listener.obj : error LNK2001: unresolved external symbol "_md_ntohs
    hprof_listener.obj : error LNK2001: unresolved external symbol "_md_ntohl
    hprof_listener.obj : error LNK2001: unresolved external symbol "_md_shutdown
    hprof_tls.obj : error LNK2001: unresolved external symbol "_md_get_thread_cpu_timemillis
    MyHprof.dll : fatal error LNK1120: 29 unresolved externals
    The problem is the compile error of "hprof_md.c". (VC compile Error No : C2011, C2375)
    I think that the link error in the end part is solved with this compile error.
    Because "sample.makefile.txt" is for GNU make, I tyied to build using Cygwin and GNU make.
    but the same compile error went out.
    My Knowledge is insufficient concerning C/C++ development....
    I have no idea how to deal with this error.
    Who can help me about this problem ? please give me some answers!
    Thank you for reading .
    Sorry my poor English...
    Masahiro Kouda

    Do you have the specific name of the C++ compiler you are using?
    The actual name on the box and the specific version string?
    I'll look into this, sorry I didn't see this earlier.
    -kto

  • How to build a JNI App

    I couldn't find this anywhere so here you go...
    Sun you let me down on this one but overall you are very good.
    1. compile your java class, Test.java -> Test.class
    2. use javah.exe (should come with jdk) to create the h file
    --> $javah.exe Test.class
    3. This should create C/C++ header file.
    4. You need to create the *.C/*.cpp file and include the above header file
    5. build the dll
    6. In the java file, to load the library, use
    System.loadLibrary("YourDllNameNoDllExtension")
    7. make sure the dll is in \windows\system32 dir
    OR
    that its in the same directory as the java class that you are executing.

    Hallo,
    I must say that I found the information in http://java.sun.com/docs/books/tutorial/native1.1/stepbystep/index.html sufficient to get me started.
    http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html is also helpful.
    Finally, there is the JNI Reference: http://java.sun.com/docs/books/jni/html/titlepage.html
    I do not think that one can complain about lack of information from Sun in this respect. Perhaps the problem is that one needs to know not only about Java, but also about C/C++, and how the particular operating system finds DLLs etc. It can therefore be a steep learning curve getting started with JNI.

  • How to call a dll which has one VISA name as input

    Hi there,
    The Labview application builder can generate a dll file from a vi which is a simple serial comunication program using VISA name as one control.
    The problem is how to call the dll file in Labview which has a VISA name as INPUT?
    Thanks!
    George

    I would suggest modifying the LabVIEW VI so that the input is a string control instead of a visa control. The LabVIEW application will work the same and there is no need for any casting. All visa VIs can take a string as an input. Then when you recreate the dll make the input a string. Then you can easily pass a string to the dll from any API.
    -Josh

  • How to build a Oracle style Web site

    Dear All,
    (Not sure whether this question should be this sub-site or not.)
    My question is how to build a Oracle style Web site, what technology should be use.
    Example Site: [http://www.orapub.net/ebs/index.htm|http://www.orapub.net/ebs/index.htm]
    This web site style is like Oracle Enterprise Manager.
    Thanks a lot
    Pan

    You can use Oracle Webcenter or just Oracle ADF to build a Oracle Enterprise Manager kind of Website.
    See details here -
    http://st-curriculum.oracle.com/obe/jdev/obe11jdev/ps1/ria_application/developriaapplication_long.htm
    http://www.youtube.com/watch?v=iE2zTNhlvy8

  • How to build a report in web Intelligence using Store procedure under Microsoft SQL Server 2000

    Post Author: ltkin
    CA Forum: WebIntelligence Reporting
    Hi,
    How to build a report in web Intelligence using Store procedure under Microsoft SQL Server 2000 ?
    Regards,

    Hi ltkin,
    Unfortunately, it is not possible in Xir2 to create Webi reports from stored procedures.
    Webi reports can only be created from Universe. So in Business Objects XIR3 we can create a special universe that enables Web Intelligence user's to access stored procedures residing in the database. This is the only way that Web Intelligence user's can access stored procedures.
    Please let me know if the above information helps.
    Regards,
    Pavan

  • I have just started to use Muse for our design agency and learning how to build ourselves a new site, I have manged to create a basic lightbox which contains sliding images, what I need to do now is have a pop up window which goes into detail about the pr

    I have just started to use Muse for our design agency and learning how to build ourselves a new site, I have managed to create a basic lightbox which contains sliding images, what I need to do now is have a pop up window which goes into detail about the projects, what I would like is a piece of text  or icon that when you roll over it and then click a separate window pops up with additional information in, once finished reading the info you can then click to close the box, any advice on how to do this?

    The best way to do what you're asking is with the Composition widget. Start with the Tooltip preset, which, by default shows the info on rollover. You can change the option to show on click, which is what you're after. You can also add the close button or have the info disappear on rollout.
    David

Maybe you are looking for

  • Deadline, Business Hours vs. Maintenance Windows

    I read the blog about Business Hours vs. Maintenance Windows, but I still have two questions http://blogs.technet.com/b/server-cloud/archive/2012/03/28/business-hours-vs-maintenance-windows-with-system-center-2012-configuration-manager.aspx Event 1:

  • Weather widgets for Nokia E6

    anyone know of a good weather widget for the Nokia E6?  I tried the accuweather one and I cant get it to show up in the widgets catalog.  Anyone have a working weather widget on their Nokia E6? what are you using? Solved! Go to Solution.

  • What is wrong with my tiny jdbc program? Help!!!

    Hi, Would anyone diagnose the problem of my simple jdbc program? The situation is : a) local machine oracle thin driver connection; "lsnrctl" is running. b) I can query the statement "select id from gameUser" from SQLPLUS logged in as "scott", with d

  • Running Hardware Test or Running Mac OS X from DVD with an older iMac

    I have a 4 year old iMac which is running Snow Leopard 10.6.2 and using a wired aluminum keyboard along with a Magic Mouse. I recently had some files corrupted so that when I booted up, the dock would not load and could not run any programs. It appea

  • Force shutting down

    A couple times so far, my computer has simply run out of ram and completely froze. I open up force quit and quit a few programs but then it gets a pinwheel of death. I wait for like 5 mins and then I hold the power button for a few seconds so it forc