DLLs in labview

I need help with a dll running in labview 8.2

I have no experience in C, but I can probably understand the basics if they explained.

I have a 3rd party dll and a PDF explaining the different functions.  But when I insert the library call feature, I don't see all of the features listed in the PDF document.  Is there something that I am missing?

Thanks for the help,

Branson

This isn't a standard Windows DLL, it is an ActiveX object.  Actually, this makes your life easier.  Take open connectivity-> palette of ActiveX Automation.  Create a constant for the Refnum Automation entry, right click and choose Select the ActiveX class-> Browse.  Find your DLL.  You can then use ActiveX property and invoke nodes to call functions in the library.

Tags: NI Software

Similar Questions

  • Load a complex DLLs in Labview

    Hi guys:

    I need to load a dll into labview, the prototype is:

    running long (const char a [],
    const double b,
    const int c,
    double d [5] [23],)
    Double e [4],
    );

    I put the prototype in labview is:

    Uint64_t function (const CStr has,

    const double b,

    const int32_t c,

    Array2DDouble * d,.

    Double * e);

    but the function does not work, I suppose that it maybe some concern to the parameter d, the attached file is the config box,.

    Someone tell me where is the problem?

    Thank you

    Good news. I have fix

  • Call a C-built DLLS in LabVIEW

    Hello!

    I try to get knowledge on how to call DLLs in Labview.

    I found a very good example on this site:

    http://zone.NI.com/DevZone/CDA/EPD/p/ID/1513

    I downloaded and extracted the call_c_dll_in_lvnew.zipfile.

    When you try to open the sample file GenSortRandC.vi in the folder LabVIEW_code_and_DLL

    I get the following error message.

    "The procedure entry point not found RebootRTSystem in the library cvirte.dll dynamics."

    I searched on the Internet and some forums but so far without success.

    Could you please let me know if you have the same problem the example whith?

    I have the following configuration:

    -Labview 8.5.1 FDS (default installation)

    -Windows XP sp3

    Best regards

    Mattias

    Sweden

    Mattias salvation,

    I have no problem with this example. I can't run without error.

    It's maybe because I installed the CVI Run Time engine.

    Mike

  • Python, call DLLs in LabVIEW: Fatal internal error when accessing output String Cluster

    Hello

    We have compiled a DLL in LabVIEW (TestError.dll) and tried to call it from Python.

    TestError.dll includes 2 functions:

    1 testErreur: cluster 1 entry string, 1 channel indicator

    2 TestError2: 1 channel input, 1 bunch of output string

    What we try to do in Python is actually something like this:

    1 provide values to controls in the functions of the DLL.

    2. call the DLL.

    3 get the values of the indicators.

    What we have seen are:

    1 read/write operations on normal data types (string, digital) indicators/controls are OK

    2. write operation on the Cluster string entry is OK

    3. read operation on the Cluster output string is not OK. The following error is still prompted for:

    «Unrecoverable internal error: 'MemoryManager.cpp', line 437.» LabVIEW version 8.6... »

    Also joined the TestError.prj and python code.

    Grateful if someone can help to explain why we get this error and how to overcome?

    Thank you

    howmean

    What we have seen are:

    1 read/write operations on normal data types (string, digital) indicators/controls are OK

    2. write operation on the Cluster string entry is OK

    3. read operation on the Cluster output string is not OK. The following error is still prompted for:

    «Unrecoverable internal error: 'MemoryManager.cpp', line 437.» LabVIEW version 8.6... »

    Also joined the TestError.prj and python code.

    It is very logical that it does not, and the bad news is, it cannot really be implemented reliable of a process not LabVIEW.

    LabVIEW channels (and tables) are very specific species. They are then called handles, which are pointers to a pointer to a block of memory. If you have a control or indicator on its own, the Prototype configuration allows you to configure this setting as a C. LabVIEW data pointer, when creating the DLL, create heels C for each exported function and place the code to do the translation between the past C pointer to and necessary LabVIEW data handle. For strings and arrays within the cluster, there is no configuration option and the DLL is expected to pass a structure with data handles native LabVIEW in there.

    You may say that creating handles data in your calling process enough to trick LabVIEW. For the input variables that actually CAN sometimes work (but is a delicate and dangerous generally to handle this). There is no way to make it work for output variables. LabVIEW will try to resize handle to fill data in that he wants to make. This resizing is done using internal memory manager of LabVIEW. This will work only if it had been allocated by EXACTLY the same instance of the memory manager. Otherwise, it refers to a different memory segment and catastophally fail. The only way to make this work perhaps, with luck, taking your heart and prayer to the gods, is to lvrt.dll to allocate a handle that you must pass to the DLL. Still find the good lvrt.dll, which will execute your DLL LabVIEW is a major challenge.

  • Problem of memory, then I import a DLL on LabView 2010

    Hello

    I have a lot of problems with importing a file .dll on labview.

    The blocks of import to the third of fourth function and sometimes a textbox appear (as you can see in attachment).

    I tried with the import node, but it does not work (so maybe it's that I don't know how to use it really).

    I don't really know how to import the entire library, and I am really stuck.

    There is also the header and the dll as an attachment.

    Thanks for your interest.

    I didn't say it's impossible, but it is very likely well above your head. You probably have two options:

    (1) to abandon this material and get a part that has a good support for LabVIEW.

    (2) hire someone with a very good understanding about LabVIEW C interfacing and allow them to create a VI library and interface DLL for you.

    Good luck

  • DLL crashes LabView 2013 Pro, but good to EXE

    Hello

    I started having a problem older "degenerate." I had a previous post about a dll which plays a role of interface between a program running under Windows and LabView. The details are here:

    http://forums.NI.com/T5/LabVIEW/installed-program-no-Comm-with-driver/m-p/2659765/highlight/true#M79...

    Note that this isn't a double post, I just mentioned my recent problem there, when he was not that common.

    (http://forums.ni.com/t5/LabVIEW/installed-program-no-comm-with-driver/m-p/2662503/highlight/true#M79...

    Today - unknown reason - after a win system restart I can not run my development environment LabView code. When I run the main VI, it blocks all of the LabView environment during the first call of dll. This problem we had before also, but the 2nd of the 3rd test he ran OK. Today, I tried like 30 times, too many system restart. The native software spectroscope works very well too.

    Strange, if I run the exe to build, everything works fine. The problem appears only when I run LabVIEW. There is no error code, only a window appeared the first time, as I can send the error report to NOR. I can dig into some logs tomorrow at the lab, I just need to know where I can get.

    It seems that someone has also experienced similar behavior with external dll call:

    http://forums.NI.com/T5/LabVIEW/problem-DLL-crashes-LabVIEW/m-p/2562667/highlight/true#M773565

    "In the application resulting (Exe), it seems to work very well."

    What is the difference between when the dll is built in the exe file, and when it is executed from the LabView dev environment?

    Thanks for any idea and help!

    (if nothing helps, I just re - build the exe after changes to the program, but it slows down some coding)

    The last time, we have no comments from the company that created this dll, I'll try to contact again...)

    Hello

    you said that you have read the discussion in the following link:

    http://forums.NI.com/T5/LabVIEW/problem-DLL-crashes-LabVIEW/m-p/2562667/highlight/true#M773565

    Are you facing exactly the same problem?

    If Yes, then there is not much we can do. LV is an access contradication with your included DLL unless you have access to its source. You do not experience these problems with the exe since that only works on the run-time engine while the LV environment executes the code in a different way (why LV reserve this special memory on which your DLL is also trying to access.

  • Return the execution of DLLS in Labview data table

    Hi all

    I have a DLL C++ which should run continuously collect new data of some hardware.

    I can call the DLL without any problem of Labview, but I wish I had access to some digital table data in the DLL in Labview (the appellant or an another VI) during its execution.

    Working in this direction, I've already got the event validation works, i.e. trigger messages to the DLLS running in VI of the caller using PostLVUserEvent().  This would solve my problem (maybe bad) if I need only a scalar or string of each event (which works fine).

    Then I tried passing a few paintings of small integers via the event (properly by changing the input type to create the user in LV event), but it did not work (empty tables or falls down... oops!).  Perhaps events are not the way to send large paintings (say 10 ^ 4-10 ^ 5 integers) anyway...

    Can anyone suggest a way to do this?  There are functions to manipulate the values in a control of LV/indicator of the DLL running?

    Thanks a lot for any assistance, MT


  • DLL Interop.LabVIEW

    Where can I get a copy of the DLL Interop.LabVIEW for use with c#, or do I have to write my own?


  • Effective way to make and receive pointers with C/C++ DLLs in LabVIEW

    What is the best way to pass a handle using the dll programmed in Labwindows/CVI between call node of the Labview library?

    I read a very useful on post

    https://decibel.NI.com/content/docs/doc-9080/version/5 on and the reception of pointers with dll C in Labview.

    However, my request is for the Labview interface with a camera.  In the camera API, it defines

    #define void * CameraHandle

    And then a CamHandle variable should be used by a lot of other functions.

    In CVI, if not used as DLLs in Labview, I would

    Sub OpenCamera()

    {CameraHandle ;} CamHandle

    Sub SetParameter (CameraHandle CamHandle)

    {

    }

    void CloseCamera (CameraHandle CamHandle)

    {

    }

    If CamHandle is a type void *, how can I make it since one node/function in Labview when I use the Setup to call a library function?  In the post I read, it say how to get the value of the arrow tip using a pointer to the value, and then dereferencing pointer.  However, what I need, is to pass the pointer itself.

    Thank you very much!

    Best,

    Charles


  • DLL of LabVIEW with arrays of strings in c ++

    I'm looking to use labview to retrieve a list of gas to a txt file and then transfer this list to gas in a C++ program.

    I thought it would be easier to just list the gas transfer a string array of the DLLs in labview to my C++ program.  However, I am not able to output the list of gas using tables; I am only able to output the pointer, not the chain that makes reference to the needle.  Of course, I have a syntactic problem with my method of output.

    I have no problem out of the list of gas via a simple string.  However, the approach of single string requires multiple calls to the relevant dll.

    My code is based on the labview dll for C++ routines example titled call of Labview DLL in Visual C++ this Passes table manages in reference (http://zone.ni.com/devzone/cda/epd/p/id/1518).

    I am sure that what I'm trying to make is simple enough for an experienced programmer to Labview.  However, my labview, C/C++ and experience is limited.

    Thank you in advance for your help.

    My labview and C code is found in the attached zip file.  However, the basic C code and output resulting are:

    // Call DLL.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "Array_Multiply.h" #include  #include  #include  #include  #include  using namespace std; int main(int argc, char* argv[]) { TD1Hdl handle_var3; long temp; char stringout[25]; temp=25; handle_var3 = (TD1**)DSNewHandle(sizeof(TD1)); // initialize sizes (*handle_var3)->dimSize = 1; // // Gasstring is a function that outputs a Labview array of strings. // However, I can't make this work. All I am doing is outputting // memory addresses. // Gasstring(&handle_var3); cout << "\n gasstring " << *handle_var3; cout << "\n gasstring " << handle_var3; cout << "\n gasstring " << (*handle_var3)->String[0]; //cout << "\n gasstring " << (*handle_var4)->Numeric[0]); // // Gasstring3 is just a single string. There are no issues outputting // this string. // Gasstring3(stringout,temp); cout << "\n gasstring3 " << stringout; cout << " \n enter in number "; cin >> temp ; return 0; }
    

    The output of my source code is:

    I think I understood something :-)

    cost < "\n="" gasstring ="" "=""> < lstrbuf(*(*handle_var3)-=""> String [0]);

    There are some macros useful for LStrHandles in "extcode.h", LStrBuf is one of them.

    It seems that there are no problems with memory management, you did it right.

  • String of DLLS in LabView in two strange characters

    Hello. I pass a string of DLLS in Labview and the result is correct, but there are two characters strange everytime "Gn".

    If the character that I spend is 'a', then the result is «a LARP»

    My DLL code is:

    void massiv_int(char *lv_ptr);

    _declspec (dllexport) void f_massiv (char hello []);

    _declspec (dllexport) void f_massiv (char hello []) {}

    char lv_str [10];
    char * lv_ptr;
    lv_ptr = & lv_str [0];

    massiv_int (lv_ptr);
    * Hello = lv_str [1];

    }

    void massiv_int(char *lv_ptr) {}

    char lv_local [10] = "abcdefg";
    memcpy (lv_ptr, lv_local, 10);
    }

    Could you tell me, what could be wrong?

    Thanks in advance.

    Try this:

    void massiv_int(char *lv_ptr);
    void massiv_int_NextLine(char *lv_ptr);

    LVSTR_API void f_massiv (char hello []) {}

    char lv_str [10];
    char * lv_ptr;
    lv_ptr = & lv_str [0];

    massiv_int (Hello);

    massiv_int (lv_ptr);
    * Hello = lv_str [1];
    }

    void massiv_int(char *lv_ptr) {}

    do lv_local as long as necessary (no extra characters)
    Char [] lv_local = "abcdefg";

    copies all of the characters in lv_local to lv_ptr
    strcpy (lv_ptr, lv_local);

    Add the following line
    massiv_int_NextLine (lv_ptr + strlen (lv_ptr));
    }

    void massiv_int_NextLine(char *lv_ptr) {}

    do lv_local as long as necessary (no extra characters, including LF)
    Char [] lv_local = "\nqwerty";

    copies all of the characters in lv_local to lv_ptr
    strcpy (lv_ptr, lv_local);

    }

    But make sure that the external string buffer allocated by LV is long enough to contain all the characters!

  • Named Instance/Application DLL and LabVIEW FIFO

    Hi all

    I'm working on a logging of sensor application in LabVIEW 8.5.

    Each driver (written in LabVIEW) sensor has its own loop and a named FIFO correspondent the latest read values written in. One of the pilots use VISA for RS - 232 and another DLL call to a library that is interface with a USB - I2C converter.

    The main recorder reads all the of the FIFO, concatenates the data in chronological order they are sampled from the FIFO and writes in a combined log file.

    The third recorder that I add now must be written in C the nature of the sensor with it's interface. Each new data set that comes in will be written to the file. I would like to send a message in the C program to the main recorder that includes the name and the position of all writes data; This information will be concatenated in the main newspaper for purposes of time synchronization.

    My intuition first easy synchronization is to write a VI (compiled into a DLL by using the LabVIEW application builder and called from C) who will use a FIFO named to pass a string to the C recorder for the main recorder. But I don't know how the appointed FIFOs are shared between instances of the application.

    In other words, if I have a reference to FIFO named 'test' in a VI compiled and called as a DLL and a FIFO named "test" in reference to the Application Instance main (or specific application instance to the project running on the same Windows computer), point to the same structure? Alternatively, they are specific to each instance? If they are specific to each instance, what do you suggest me as a method to be less hassle to get data between instances of the application?

    Thanks in advance!

    Bradley Hughes

    My intuition first easy synchronization is to write a VI (compiled into a DLL by using the LabVIEW application builder and called from C) who will use a FIFO named to pass a string to the C recorder for the main recorder. But I don't know how the appointed FIFOs are shared between instances of the application.

    In other words, if I have a reference to FIFO named 'test' in a VI compiled and called as a DLL and a FIFO named "test" in reference to the Application Instance main (or specific application instance to the project running on the same Windows computer), point to the same structure? Alternatively, they are specific to each instance? If they are specific to each instance, what do you suggest me as a method to be less hassle to get data between instances of the application?

    Thanks in advance!

    Bradley Hughes

    Queues, semaphores etc. are not shared between all instances of the application (although they were in LabVIEW 8.0, but it really was a bug). But just because you call a DLL that uses a DLL of LabVIEW with a queue does not necessarily mean that you work in two different application instances. If however you intende to write an independent C program that runs in a separate way of the process you can certainly not connect to a queue of LabVIEW in this way. The LabVIEW DLL will be loaded in the runtime LabVIEW according to but part of your C program process.

    Even if it would make you a C DLL that you call your LabVIEW application and calls said LabVIEW DLL to communicate through the queue, you can be problem. This will not work unless the DLL of LabVIEW and the LabVIEW application that calls your DLL is written in the same version of LabVIEW. In this case, the DLL is loaded into the LabVIEW development system already running or in the case of a DBMS built in the running system. Once your main application LabVIEW and the LabVIEW DLL are not the same version, the DLL will be launched out of process in the enforcement system according to itself, that it really run in its own process.

    Rolf Kalbermatter

  • Efficiency call DLLS in Labview

    Hello

    I'm working on a labview program for the treatment of the data in real time.  Thus, code running efficiency will be critical.  I wonder how about the cost of calling DLLs.  Similarly, what the call cost of the subprogrammes.

    To implement the same function, the call of a Subvi will be faster than calling a DLL?

    If I can develop all screws Sub in the main program and delete all the calls, which will be much faster?

    Can someone give me any clue or guideline?

    Thank you.

    CRXX wrote: [...]

    I'm working on a labview program for the treatment of the data in real time. [...]

    What is the OS you are using?

    Since you ask in general, I answer in general:

    This question cannot be ansered. This is a case-by-case-thing and must be assessed individually.

    Most of the effect will be the memory management: which allocates the amount of memory? When it's done?

    Memory of ESP. allocation mess up determinism, if a DLL can perform worse than pure code LV (given a BONE of RT LV). But it might be preferable for some algorithms encapsulated... no one can say in general.

    Perhaps the most important question is:

    How many times is that the code (DLL vs Sub - VI) called and how short is its runtime? If the load of execution: calling code relationship is very low (-online 1:1), it is best to "solve" the subcode. SubVI Inling is a valid way in pure BT (from 2010).

    If the code is called rarely, this whole discussion is somehow obsolete as the overload of calls will be negligible, even if it would be quite high...

    And no, C is not faster as LV by definition. It also depends on the task and how you implement it...

    hope this helps,

    Norbert

  • Implement pickits.dll in LabVIEW

    Hello

    I have problems with the pickits.dll chips. I want to implement the dll file in Labview and communicate with a material called Analyzer series of LIN of microchip.

    When I run my Labview VI, it cannot communicate with the device.

    It comes to my composition in Labview that does not work.

    This composition is created on an OS WIN7/64 bit and a system 32-bit/WIN XP. The two does not work.

    The Analyzer is run with the chip Network Analyzer(64bit) demo application.

    I downloaded the LIN Serial Analyzer Update v2.05 (64-bit) of the homepage of the electronic chip and with this application, it works.

    The pickitS.dll works inside LabView correct. When I run the Prototype of the "Get_PickitS_DLL_Version" function, it returns the correct Version of the DLL.

    Is my composition in LabView, right?

    Any that work with the Analyzer series of LINEN or similar devices of microchip?

    concerning

    Hello

    I solved the problem. For initialization of the FLAX series Analyzer, you have to take the ' base' constructor and the 'Initialize_MyDevice' method with the parameters USBIndex = 0 and ProductID = 0xA04. With this basic adjustment, you can initialize the device. Then you must set the baudrate of 19200 for Bus LIN.

    Feel free to ask me if you have problems with your device.

  • Adapter USB to GPIO TI EVM. Dll driver Labview for

    I'm looking for a way to send commands through Texas Instrument USB-to-GPIO using Labview. TI supports only the .dll file. No .h and .c files. So, when I set up "Call library function node" then. DLL is not enough. All nodes are closed.


  • Create DLLS in labview and call it from another application

    I have an application built using Labview. I wanted to create a DLL out of it. At the request

    two string entries start and stop buttons and two indicators of the State.

    1 how to itegrate start and stop buttons to a function prototype?

    2. what Labview created dll requires the labview runtime engine if it must be called from other applications?

    Can help with that.

    Hi Yuvish,

    (1) they must be entered Boolean to your VI. But, it is a good idea to make a stop at the beginning of your VI contribution? (THINK THE STREAM!)

    (2) Yes, LV - RTE is required...

Maybe you are looking for