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

Similar Messages

  • Can I automate the creation of a cluster in LabView using the data structure created in an autogenerated .CSV, C header, or XML file?

    Can I automate the creation of a cluster in LabView using the data structure created in an auto generated .CSV, C header, or XML file?  I'm trying to take the data structure defined in one or more of those files listed and have LabView automatically create a cluster with identical structure and data types.  (Ideally, I would like to do this with a C header file only.)  Basically, I'm trying to avoid having to create the cluster by hand, as the number of cluster elements could be very large. I've looked into EasyXML and contacted the rep for the add-on.  Unfortunately, this capability has not been created yet.  Has anyone done something like this before? Thanks in advance for the help.  
    Message Edited by PhilipJoeP on 04-29-2009 04:54 PM
    Solved!
    Go to Solution.

    smercurio_fc wrote:
    Is this something you're trying to do at runtime? Clusters are fixed data structures so you can't change them programmatically. Or, are you just trying to create some typedef cluster controls so that you can use them for coding? What would your clusters basically look like? Perhaps another way of holding the information like an array of variants?
    You can try LabVIEW scripting, though be aware that this is not supported by NI. 
     Wow!  Thanks for the quick response!  We would use this cluster as a fixed data structure.  No need to change the structure during runtime.  The cluster would be a cluster of clusters with multiple levels.  There would be not pattern as to how deep these levels would go, or how many elements would be in each.   Here is the application.  I would like to be able to autocode a Simulink model file into a DLL.  The model DLL would accept a Simulink bus object of a certain data structure (bus of buses), pick out which elements of the bus is needed for the model calculation, and then pass the bus object.  I then will take the DLL file and use the DLL VI block to pass a cluster into the DLL block (with identical structure as the bus in Simulink).  To save time, I would like to auto generate the C header file using Simulink to define the bus structure and then have LabView read that header file and create the cluster automatically.   Right now I can do everything but the auto creation of the cluster.  I can manually build the cluster to match the Simulink model bus structure and it runs fine.  But this is only for an example model with a small structure.  Need to make the cluster creation automated so it can handle large structures with minimal brute force. Thanks!  

  • Use a wrapper to build a C++ Dll that calls a C++ .lib and Use the Dll is LabView

    Hi All,
    I need to access some functions in a C++ .lib within LabView, but has no source code for the library.  Can I build a Dll in Visual C++ that calls this library, then have LabView calls the Dll? If so, how different is building this Dll compared to building a Dll from a .cpp file?  I am new to C++, could some one suggest how to use the .lib in Visual C++ 6.0 studio to build the Dll?
    Thanks for your help.
    Bryan

    BryanL wrote:
    Hi Rolf, thanks for the info. I will try to build a vi to call that function. For a more immediate need, I can use a downloaded vi that calls SetActiveWindow function, then use its output windowshandle to find the window name with a lvwuser32.dll function. The problem is this find window name function vi requires a windows reference input, which does not take the window handle output from the SetActiveWindow vi. How do i convert the window handle into a reference number? Thanks again.
    Don't try to write a VI to call that function. That function requires a callback function pointer, something that is more or less impossible (well you can get it done but it is not worth the trouble) to create in LabVIEW. You will need an external DLL that does the enumeration and returns an array of strings to LabVIEW.
    The lvwuser32.dll also just uses window handles. Look inside those VIs and you should see that those window references are typecasted into uint32 and then passed to the Call Library Node if I remember correctly. You definitely should be able to typecast the (probably uint32) you get from your other function into the window reference that that VI takes. The window reference of the lvutil library is just a nice trick to make it refnum like so that you can not inadvertly wire something else to it (and confuse/crash Windows).
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to use the DLLs which created from c++ in Java?

    And How to use the DLLs which created from JNI in C++?

    Huh?
    Are you asking how to do JNI - you should read the tutorial.
    Are you asking how to load it - then use System.loadLibrary()
    Are you asking what to do with the output from javah - put it in a C file and write some code, compile it into a dll.

  • How to use the dll  created by c++ but not write a jni wrapper around

    how to use the dll created by c++ but not write a jni wrapper around through a java program. now I can't access that dll like this directly from java.

    Your question is unclear. (You haven't said what dll you are talking about.)
    But:
    If you are talking about an existing dll, then the only alternative to writing a wrapper is to use one of the wrapper generators floating around. Do a search on JACE.
    If you are talking about a dll you are writing, then run jah and get the interface to match java right away; then you won't have to write a wrapper.

  • Programmatically choosing the dll and function within the dll

    LabVIEW 2013
    I have a top-level UI application, basically a test executive, from which I want to execute external VIs, the tests, that are identified at run-time.  I think that means compiling my test VIs into DLLs and then accessing the test VIs from the DLLs.  The problem I have is that I do not know how to specify the VI to the Call Library Function at run-time.
    Also, since all of this is LabVIEW code, is there an easier way than using the DLLs?  Maybe an llb or packed library?  And how would I use these?

    hartzde wrote:
    [..] The vi will need to be in some compiled form.
    Default VIs include the compiled code.
    Maybe you should also take a look into TestStand.
    That being said, "Plug In" is (as already stated several times) the keyword you have to look for using Example finder, ni.com and even google.com (referring lavag.org and similar sites).
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • How can we share and transfer data at Labview using the internet

    How can we share and transfer data at Labview using the internet
    Dr. Eugene Berman, Moran Kamilyan and Ravit Bar

    [email protected] wrote:
    How can we share and transfer data at Labview using the internet
    Check these links:
    Basic TCP/IP Communication in LabVIEW
    Data Sockets
    Integrating the Internet into Your Measurement System

  • Could I use two regular computer to achieve realtime communicat​ion using the Ethercat and Labview Real Time Module?

    Could I use two regular computers (one acts master , another one acts as slave using the Ethercat Internet Card) to achieve realtime communication using the Ethercat and Labview Real Time Module? if it could, what hardware should I purchase from the NI ?
    Thank you!

    Hi Xiaolin,
    NI doesn't offer Windows based Ethercat master or slave software. Only LabVIEW RT can run the Ethercat driver. 
    However, you could use a LabVIEW RT target as an Ethercat master and use the Ethercat Internet Card with a slave PC (note: I think this will work from the Beckhoff description of the card you are describing. The card should integrate like any other non-NI slave. However I haven't tested the setup and don't advise saying it will work until you have tried). 
    You can use any NI RT target with two ethernet ports as the Ethercat master. This could be a cRIO, PXI or RT Desktop. 
    Jesse Dennis
    Design Engineer
    Erdos Miller

  • How to distribute the serial core only with my exe and DLL applicatio​n using the Labview applicatio​n builder 8.21. I'm not interested having MAX and other components installed on the customer PC and in the program menu

    Since Labview ver 8.0 and later, I am not very happy with the new way the project installer is managing the additional drivers such as Serial.
    With LV 7.11 the serial components was included in the cab file and was installed on the target computer in a specific directory. The size of the distribution was pretty small and well suited for compact distribution.
    My LV application use only the serial object and with LV 8.21, if I include the serial 3.2 component, I get an enormus file including max, visa ... and a lot of fucky component I do not need.
    To distribute my application, I just need, the runtime engine and the serial driver as it was with the version 7.XX
    Looking for clever advises from you gentlemen!

    Thanks Dennis for you input
    My problem is in fact very simple. 3 years ago, I developped a software suite for X ray generator; My company is selling such generator all over the world and our control panel software and DLL (for OEM integrator) is based on Labview professionnal development plateform.
    To drive our generator, we just need to transfer ascii data using the strandard RS232 port still present on most of equipments used in the industrial area.
    Until LV version 7.11, there was no problem to include serial component in my distribution with a very reasonable size and transparency for the end user.
    with LV 8.xx (preparing a new release), I'm very disapointed to see, my distribution is increased of about for 10 Mo to 180 Mo just because I increase the serial component.
    May I mix a previous version of the serial component with LV 8.21?
    Should I change my source to Visa instruction only and merge visa runtime only to my distribution?
    is there any simple serial example based on visa and distributed with th application builder?
    I will appreciate your help in order to optimize my distribution
    Pascal 

  • NI 5660 Driver DLL Errors when using Teststand 2010 and LabVIEW Run-Time Engine 2010

    This problem seems similar to the post "Resource not found error in executable on developmen​t machine." but I didn't want to repost under that thread because I only happened upon it by chance and none of my searches brought me there... so I made a more descriptive Subject.
    I am working on a system that uses a PXI Chassis with a NI 5600 Downconverter and a NI 5620 high speed digitizer, among other PXI Cards. 
    I inherited working code written in LabVIEW 2010, running with the LabVIEW Run-Time Engine 2010.  The code was using a custom executive and my task was to rewrite the test using TestStand 2010.  I reused the majority of the old code.  The old code used NI-5660 to control the 5600 and 5620.  When I run my sequence using the LV Development System and TestStand, it runs without any issues.  When I change the adapter over to LabVIEW Run-Time Engine 2010, all of my NI5660 VIs become broken due to DLL issues.  It warns that the nipxi5600u​.dll was not initialized correctly.  Many of the errors are associated with the NI Tuner and NI Scope. After this LabVIEW will crash randomly, and the seqeunce will not work in TestStand even when back with the LV Development Adapter.  The only way to recover after this is to restart the computer - TestStand automatically reverts back to the development system, the VIs are no longer broken and the sequence works again. 
    I have all of my VIs associated with a project. After reading a little bit about DLLs and TestStand, I found all of the DLLs in the dependencies section of my project and added them to my TestStand workspace.  I also used Dependency Walker to track down the problems with the nipxi5600u​.dll, the 2 DLL files that it said were not found already existed in the same folder as the original DLL (C:\Windows\System32).  I have also performed a Mass Compile to make sure everything was running in LV 2010.  If I skip the steps involving the 5660, my entire sequence runs fine. 
    The previous code was running with the LabVIEW Run-Time Engine without any issues.  Is there just a step I am missing?  Has anyone seen anything like this before?  I can send screenshots of errors to provide more detail if necessary. 

    I have tried some more things and still can't get it to work.  I have added the VIs mentioned in the Notes On Creating Modulation Executables KB both to the TestStand workspace and the LabVIEW project holding all of my VIs.  This did not change the results. 
    When I try to run my sequence, The first error I get is shown in Error 1445.bmp.  This happens when I try to use the NI 5660 initialize.vi.  If I click ignore, the next error I see is shown in Error -20551.bmp.  When I try to open the VI to look at it, I get the 2 DLL errors shown in Error loading nipxi5600u.bmp and Error loading nidaq32.bmp.  When I close TestStand, I get the error LabVIEW Fatal Error.bmp. 
    Attachments:
    Error1445.JPG ‏164 KB
    Error -20551.JPG ‏174 KB
    Error loading nipxi5600u.JPG ‏9 KB

  • How do you pass an array of characters using the DLL functions

    I have exported C code into my DLL and I want to know how to pass an array of characters using LabVIEW.

    Mont;
    If you want to pass a string from LabVIEW to your dll, and you do NOT change size of the string, you can use a C String pointer (CStr), which is equivalent to (unsigned) char *.
    If you do modify size of the string, pass string as a LabVIEW structure (LStrHandle).
    The example "Passing a Variety of Data Types from DLL to LabVIEW" is an excellent starting point. Also make sure you check the manual "Using External Code in LabVIEW".
    Regards;
    Enrique
    www.vartortech.com

  • How do I pass an array of structs to a C function using the dll flexible prototype adapter?

    What I want to do is pass into a C dll function a variably sized Array of structs of type TPS_Data. My Code compiles but when I run it in TestStand, I get an error -17001; Program Error. "Cannot allocate 0 size buffer Error in parameter 2, 'OpenFrdData'."
    I've allocated the Array of structs, and all of the information is there before I call my function, so is it my prototype? Or am I asking too much of the DLL Flexible Prototype Adapter to pass an Array of Structs?
    I can pass in a single struct of type TPS_Data and that works, but not an array.
    Here's the relevent code:
    typedef struct TPS_DATA
    char Report_Number[256];
    char System_Name[256];
    char Open_Date[256];
    char UUT_Part_Number[256];
    char UUT_Serial_Number[256];
    char UUT_Name[256];
    char Open_Employee_Name[256];
    char Open_Employee_Number[256];
    char Close_Employee_Name[256];
    char Close_Employee_Number[256];
    char Close_Date[256];
    } TPS_Data;
    typedef struct TPS_DATA_ARRAY
    TPS_Data DataRecord;
    } TPS_DataArray;
    long __declspec(dllexport) __stdcall OpenDialog (CAObjHandle Context, TPS_DataArray *TpsData[], const char *psFaultStr, char *sComments, const int nCount);

    OK,
    I can pass the data to the DLL function, using the following types:
    typedef struct StringArrayType
    char string[10][256];
    } StringArray;
    typedef struct MultiStringArrayType
    StringArray Record[10];
    } MultiStringArray;
    void __declspec(dllexport) __stdcall ATP_TestStructPassing(StringArray Strings)
    return;
    void __declspec(dllexport) __stdcall ATP_TestMultiStructPassing(MultiStringArray *Strings)
    return;
    But when the MultiStruct function Exits, TestStand reports an Error:
    -17501 "Unexpected Operating System Error" Source: 'TSAPI'
    There doesn't seem to be a way around this, and once the error occurs, I have to force quit TestStand. I've included the sequence file, and the dll code can be compiled from the fun
    ctions shown above.
    Any thoughts on how to get around this error would be greatly appreciated.
    Attachments:
    StructArrayPassing.seq ‏16 KB

  • How to use the DLL in crystal report (Additional applications)

    Hi,
    i have created a win32 dll, and now i want to use that dll in my crystal report how can i do so?, what i tried is i went to to Addntional functions catagory in formula workshop, and there i can see some dlls listed, similary i put my dll in the same path like "C:\Program Files\Common Files\Crystal Decisions\1.0\Bin" and other folder too. but i am not able to see that dll in "Addtional functions". can you plesase tell how can i achive this.
    Regards,
    Prabhakar J.

    Please re-post if this is still an issue to the .NET Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly

  • To add the JNI dll to the jar file and use the dll inside the jar file

    Hi to everybody,
    I am new to java.
    I want to add the JNI dll to the jar file and use it in the java class.
    How can I achieve it.
    Please help me.
    Thanks in advance.
    Regards,
    M.Sivadhas.

    can't be done because none of the known operating systems support reading binary libraries from .jar files ... you can add the binary to the jar but then you have to extract it...
    besides, mixing platform specific and platfrom independent components is not a very good idea, i'd keep the dll out of the jar to begin with

  • How to measure voltage changes using a NI-9219 with strain gauges and use the data in labview

    I am updating an old LabView/Data Acquisition system that uses strain gauges to measure two forces (normal and axial) as well as two moments (Pitch and Roll). I am having trouble reading the voltage changes over my strain gauges using my NI-9219 as well as filtering the data with both a lowpass and smoothing filter. The program attached has the project and should have all the sub-vi's used in the program. This program was written on LabView version 8.5 and is being updated to a 2013 version of LabView. Also, the hardware previously used was a combination of a NI SCB-68 and NI USB-6251. If anyone could help me it would be greatly appreciated! 
    Attachments:
    New SSWT.zip ‏751 KB

    Hi Coffeyfj, 
    Did you ever had this set up working? The first thing that I would do as I mentioned in the previous comment would be to use one of the LabVIEW examples. I recommended to you using the (strain - Continuous Input.vi). If you can read any voltage changes with the example vi, then we will know the problem we are having is in your code. If you cannot read any voltage changes using the example I mentioned, we can start trouble shooting the hardware connections. Are you connecting the excitation voltage? If yes, Are you making the right connections. Please refer to page 19 of the following document (half and full bridge modes)
    NI 9219 Operating Instructions and Specifications - February 2009
    http://digital.ni.com/manuals.nsf/websearch/4197ED4BD126E0B486257546005851CA
    Regards,
    William Fernandez
    Applications Engineer 
    National Instruments 

Maybe you are looking for

  • Need to reboot every power on

    Hi, (for system info see sig) This system is working fine except for an annoying problem. Every time I power it on, it freezes at the initial BIOS screen that shows the hard drives, etc. (I have the graphical booting screen turned off.) CTRL-ALT-DEL

  • Dmp file created using data pump

    Hi All, I have created dmp file using oracle datapump utility and identified that even after dropping dmp file physically from hard disk. I saw there is no storage release. Is there any specefic way to get spaces free from disk? Best Regards, Abida

  • Https with login page

    Hi, How can I make the default APEX login page secure (https)? The other pages will remain http. Is this possible? or I need to make the whole application https. I think, in future APEX releases, it will benefit if there are options for declarative c

  • FCP Export to Dropbox gives "cannot open in QT Player Document"

    What can I do to convert my FCP Export for it to be other than Quick Time Player Document format?  I tried Streamclip QT, Streamclip mpeg 4, same message from Dropbox: cannot open files in the QT Player format".  This is an emergency.  I'd appreciate

  • Full screen  - in screen sharing

    Hi everyone, I have a 2011 macbook air with lion os and 2011 21.5" imac also lion os, i was trying to share my macbook screen through sceen sharing so i can see it on my 21.5" imac. The problem is when i switch to full screen mode in screen sharing o