Problems using "Appellant library function Node" statements with a DLL compiled by LabWindowsCVI

I'm calling a simple C routine to a VI by using the node call library feature.  The example of ANSIdouble.vi, found inside the example called DLL.VI given in the help files does not work.

But when I replace it with the same program (the source code is given in the DLL.VI call) compiled by LabWindowsCVI, it does not work.  In fact, it blocks Labview.

I use LV 8.2.1.

In addition, LabWindowsCVI does not compile the example as written code. I had to change the Sub _declspec (dllexport) in front of the function declaration cancel DLLEXPORT DLLSTDCALL and #incude the file "C:\Program NIUninstaller Instruments\CVI81\include\cvidef.h".  The compiler produces errors if not.

The DLL.VI program to call is:

#include "extcode.h".

_declspec (dllexport) void ANSIdouble (double entry, double * output);
_declspec (dllexport) void ANSIdouble (double entry, double * output)
{
* output = entry * entry;
}

The program compiled by LabWindowCVI is:

#include "C:\Program NIUninstaller Instruments\LabVIEW 8.2\cintools\extcode.h".
#include "C:\Program NIUninstaller Instruments\CVI81\include\cvidef.h".
#include "TestC.h".

DLLEXPORT DLLSTDCALL ANSIdouble(double input, double *output) Sub
{
* output = entry * entry;
}

where TestC.h is the statement:

Sub DLLEXPORT DLLSTDCALL ANSIdouble(double input, double *output);

The program has been compiled in a DLL that can be debugged with box of determination of objectives, copied as an attachment.

Thanks to all those who can help you.

TJ

Solved with a call to Al on the help line.

The correct procedure can be found by searching for "creating DLL" on the Web site of NOR.

Using the page found by searching for "creating"DLL"helping within the CVI, is TOTALLY FAKE!  At least with my worm 8.1.1.

Tom J

Tags: NI Software

Similar Questions

  • When I use the library function node call in real time, is loaded only once for all or load the DLL whenever it is called?

    When I use the library function node call in real time, is loaded only once for all or load the DLL every time when it is called?

    I have a critical application in real time, in which I use a piece of DLL function developed in C++.  It is ok?  Make sure any senior developer?

    Thank you in advance.

    The user interface thread is the thread that is used to update the user interface. It's slow. And it's supposed to be that way because humans are slow.

    The call library function node can be configured as this thread to use in the configuration for it dialog box. Please visit the LabVIEW documentation on how to do this.

  • Failure of the assertion when using Labview ActiveX functions to communicate with the dll

    Hello

    I'm looking for suggestions and tips about the following error that I get when I use .NET Labview functions to communicate with the dll written in .NET environment. I just need a starting pointer on where can I search for the origin of this error. I am a newbie in. NET.

    I am also attaching the .vi I use, if this is of any help. All suggestions are welcome!  Thank you.

    The origin of the error found after studying the examples provided by the OR .NET. The callback function had to be moved out of the loop, which solved the problem.

  • Despite indicating to the path, still have manually pointing DLL every time LV works using the library function node call

    I use the node of the library function call in LV 8.6. I checked the path to specify the box diagram and made directly in the DLL file that I use. Whenever I have started with Labview, I have to go to the diagram and physically find the DLL in one of my calls to make it work properly. Once I have do this everything seems to work as expected. Anyone else see this issue? Any suggestion would be appreciated.

    Thank you

    Steckman wrote:

    I use the node of the library function call in LV 8.6. I checked the path to specify the box diagram and made directly in the DLL file that I use. Whenever I have started with Labview, I have to go to the diagram and physically find the DLL in one of my calls to make it work properly. Once I have do this everything seems to work as expected. Anyone else see this issue? Any suggestion would be appreciated.

    Thank you

    Probably that DLL does not depend on other DLLs that reside in the same directory you point to in the configuration node dialog box call library. What is happening is this:

    Without going into this directory:

    LabVIEW applications Windows to load the DLL, Windows detects that it needs to load other DLLs and can not find in its standard search sites:

    (1) already loaded into memory

    (2) in the application directory (where the exe that began the current process resides in the LabVIEW IDE would be where is LabVIEW.exe)

    (3) in the system directory

    (4) in the Windows directory

    (5) any directory in the PATH environment variable contains

    (6) in the directory 'active '.

    Because Windows cannot find a person to load DLL he abandoned the main DLL loading and returns an error to LabVIEW.

    Now, you go to the configuration dialog box and point to the DLL. The dialog box browse file in LabVIEW uses the standard OS dialog box and this dialog box has the behavior obnoxious always update the "current" directory in the directory where a file got selected in. LabVIEW sees now that the path has "changed" and asks again to load the DLL. Yet once, Windows detects that it needs to load other DLLs too for this DLL but this time going over the search order, it will actually hit the DLL in the same directory and that's all fine.

    It is certainly NOT a problem of LabVIEW. LabVIEW does not and should not really need to know that a DLL needs other DLL loaded and more importantly should never try to think he can do better than Windows, it probably could, but is simply not his task of dependency DLL loading.

    It is your responsibility as a programmer and user of this DLL to know its dependencie, and if you did not write the DLL, to hit the original on his head programmer, if it has not documented these dependencies and make sure that these dependencies are actually properly resolved for Windows placing them in one of the places mentioned above

    ((2) is generally the best location for applications applications because it will not pollute the Windows directory or the user of the application system and 5) is the best for the development machine as you can add a directory to your PATH environment variable where you put the dll you need to develop a specific application.

    Rolf Kalbermatter

  • call library function node to paste files

    Hello, I use the call library function node to paste the text to and from the Clipboard and works well.  Now, I'm trying to figure out how to paste a file from the windows file Explorer.  So if I highlights a file in the Windows File Explorer and press Ctrl-C, how can I use the library function node spit a file path?  It would be even better if I could highlight a bunch of files and then paste a table of paths, but that can wait.  Also, I use a Listbox MC, so I can't use drag-and - event trigger move a control path of the file.

    Also, I use WinXP and LV 7.1.

    Thank you

    Pat

    UPDATE

    I had little time to play with it and really out of curiosity on my part that I have whipped up a simple example to drag and drop from the Explorer in LabVIEW. I wrote the code in 7.1, but I have 7.1 on a virtual machine, and the DragQueryFiles did not work. I don't know if it was due to the fact that I was running on a virtual machine. I did, however, run the code in 8.2 and it works correctly. 8.2, I was able to drag a bunch of files in front of the VI, and the string table fills with file names. I am especially to see if it might work for you. You will need to get the Windows Message Queue library. Simply place the library in the same folder where you unzip the attached file.

  • help with call library function node

    I have problem with node function call library that I try to use velleman k8061 dll file to get this working labview

    all I'm trying to get the same problem

    but I chose one to explain it

    SetDigitalChannel
    Syntax
    PROCEDURE SetDigitalChannel (CardAddress: Longint;) Channel: Longint);
    Parameters
    CardAddress: The address of the previously opened card.
    Channel: Value between 1 and 8, which corresponds to the output channel to be resolved.
    Description
    The selected digital output channel is activated.
    Example of
    BEGIN
    SetDigitalChannel (0, 1);

    now, when I try to call the function of library in k8061.dll node and set up 2 a card address and one for the channel

    address of card type: type numeric & statistics: signed 32 bit intger

    channel type: numeric type & data: signed 32 bit intger

    function prototype

    void setdigitalchannel (int32_t, intg32_t channel address);

    I also configure error call library function node checking up

    now that I run it, I get error 1517 produced and tell me this mismatch between the calling conventions?

    problem solved

    thanx

  • Loading of the DLL string using the Code Library function node

    I experience now with the element of Code Library function node... what I wanted to do are, for example, I have compiled a. DLL file... which has a function that returns the pointer to string... function looks like:

    / * This function returns a pointer to the character string * /.

    char * pchar (int n)

    {

    char * str [] = {"error", "String1" and "Word2", "3"};

    Return ((n! = 1) & (n! = 2) & (n! = 3))? Str [0]: str [n];

    }

    but when I load into LabView DLL, a part of the chain on the screens to Panel frontal trash... any ideas why?

    p.s. when I do even with integer values... say my job is like int x = 5; Return x; and then I load in LabView to the digital indicator... it works great!

    So any ideas?

    thanx

    Cyrax says:

    I experience now with the element of Code Library function node... what I wanted to do are, for example, I have compiled a. DLL file... which has a function that returns the pointer to string... function looks like:

    / * This function returns a pointer to the character string * /.

    char * pchar (int n)

    {

    char * str [] = {"error", "String1" and "Word2", "3"};

    Return ((n! = 1) & (n! = 2) & (n! = 3))? Str [0]: str [n];

    }

    but when I load into LabView DLL, a part of the chain on the screens to Panel frontal trash... any ideas why?

    p.s. when I do even with integer values... say my job is like int x = 5; Return x; and then I load in LabView to the digital indicator... it works great!

    So any ideas?

    thanx

    You cannot return a pointer to the data stored on the stack. At the time when the function returns, the stack is reset to the State before the call to the function and in a multithreaded as LabVIEW environment probably long reused for other things when LabVIEW gets around to actually copy the returned pointer data.

    Since it is a read-only variable, you could create a permanent memory for string storage by declaring your variable static. This will create a memory area allocated globally for the string data (and also cause a compile error when you try to write in this area somewhere in your code, which is a good thing).

  • Disable the use of structure in a lead time library function node increases

    I found that if I use a stureture disable to disable one of the outputs of a library function node call, the run time will be greatly increased. Can someone explain this?

    You can read this thread and benchmarking, I did there.

    Turn off debugging and check if the loss of performance you MENTION (but not quantified) is still there.

  • VI Analyzer: the wire under the test object fails with call library function nodes

    Hello

    If I have a knot of function call with an ErrorIn and an ErrorOut library, the VI thread Test Analyzer "Thread under object" always fails with two hits in a library function node call.

    Double click to the salient facts occurrence lines error related to the call... node.

    The test fails, if the error lines are not connected.

    Thank you!

    H

    Sorry, created the CAR number is #208992.

    Kind regards

    Michael

  • Call library function node

    When using a call library function node, and the program came out, I get an error "has encountered a problem and needs to close" having to do with ntdll.  It does not stop the program from running properly, but it's annoying.  Any ideas?

    You should NOT specify the full path to a DLL system in the configuration dial the node of the library. This mess something in the newer versions of Windows. Instead just enter the name of the DLL only. It is sort of a bug in LabVIEW not automatically detect the system paths and shorten the path accordingly in itself, but this is how things have been for a long time and you just need to be a little careful.

    Also the return value must be really set up to be an integer of size of pointer, since a HANDFUL is really a pointer under Windows and that the first parameter is also better configured as such. The way you did works very well for LabVIEW 32 Bit but will misbehave in LabVIEW 64 Bit.

  • What is the right way to specify the location of the shared library in an a .lvlib function call library function node?

    I'll have a bit of a problem with how to specify the location of library shared in a call library function node it is a VI that is part of a library of LV. Here's a little background which may help.

    I do a lot of measures using spectrometers photo from several manufacturers.  Someone in my company developed a C DLL library, which provides a simple API for all the different spectrometers. To facilitate this DLL to use in LabVIEW, I wrote a .lvlib that wraps all the functions.  When I want to use the API, I simply include the .lvlib file in my project that allows me to drag and drop the wrapper s VI on my block diagram. When I created the .lvlib of VI, I specified the path in the call library node. /. * so it will always look in the local application to the DLL directory when I run.

    The problem is, when I load demand, LabVIEW you asks for the location of the DLL even if it's just there in the local directory! I tried to put copies of the DLL in the directory with the .lvlib, but he still refuses to find the DLL loading.  What I am doing wrong?

    You should in this simple case enter the full path to the DLL by navigating to it. If the DLL is on the same volume/drive that the VI containing the call library node LabVIEW will be internally store the relative path from the VI to the DLL (but still show the absolute path). If you move the DLL and screw together (so the relative location of the DLL to the VI remains the same) LabVIEW will always find the DLL.

    I don't think that the lvlib would add nothing to that.

  • Crash when moving from a structure in a call library function node

    I am trying to use a type of Fortran (which I think is similar to a struct) in a LabVIEW call library function node.  I read a few remedies to this topic, but I'm not quite sure if I need to add the name of the parameter list of the node structure.  Now, when I run my VI it closed just LabVIEW entirely with no message.  I've attached the VI that I use and code source fortran, which compiles in my .dll.

    Any help is appreciated.

    Do you know if Fortran passes parameters by value or by reference?  I never used it.  A very quick search on the internet gives to think that the parameters must be passed by reference.  If this is the case, then you must pass the entire cluster as the parameter single, similar to Fortran statement.  You must also change the order of cluster to match the order in the Fortran statement.  Try the attached VI.

  • call library function node-need help

    Hi all

    I have a flow meter that I need to interface in LabVIEW. Flow meter provided a dll and the function prototype document,

    I have not used intensively the function node of the library call, in the document of function prototype that I have named function-

    "extern int GetConnexionStatus(CONNEXION_STATUS*);" How to write the node of the library of the call to this function?

    Thank you

    Hi all

    I used the import from the shared library Assistant after getting the ".h" from the Director of dll file and was able to complete the task needed to communicate to the device.

  • Can I use the library of creative cloud with Illustrator CS5

    Can I use the library of creative cloud with Illustrator CS5

    Hi Ilys Ravel,

    No, CC libraries function is available in version CC 20141 sur-quartiers.

    Sanjay...

  • Return an array of strings of call library function node

    Hello

    I'm having a few problems getting the following work.

    I have a camera from a manufacturer that came with its own .dll and header files. I'm calling the LabVIEW .dll file (2011). In total, there are about 50 functions, and there is a rest that I can't go to work (probably because I understand enough about the topic to interface with an external code).

    The description of .dll is delivered with the following text:

    #define length

    #define MAX_CONFIGURATIONS

    Prototype: int ConfigListGet (char (& sConfigurations) [MAX_CONFIGURATIONS] [length]);

    and the header file with:

    extern "C" __declspec (dllexport) int RepRateConfigurationListGet (char (& sConfigurations) [MAX_CONFIGURATIONS] [length]);

    The function should return an array of strings to the list of configurations.

    The problem I have is that I can not understand how to return the array of strings for the node of the library function call to LabVIEW. I looked a little on the web and the examples in LabVIEW and I can't find anything specific to return an array of strings in this way, so if anyone can point me in the right direction I would really appreciate it.

    Also, if I click with the right button on the node library function call and click on "File Create.c", I would be able to create the prototype of function even that above? I tried this but no luck. Was the closest I came:

    int32_t RepRateConfigurationListGet (char sConfigurations [], uint8_t MAX_CONFIGURATIONS, uint8_t MAX_LEN);

    Thank you very much in advance for any help!

    D

    Hello!

    I tried once using an array of U8, converting it to a string and then split into an array.

    Here is my old piece of code (the split part can be cleaner ;=))

    Kind regards

    Marco

Maybe you are looking for

  • Cannot find com.apple.iMovieApp.plist - iMovie keep crashing

    Hi, I have demonstrated having problems with edit video in iMovie. I already edited 2 videos, but now it has stopped working and whenever I try to move some clip in the place where I can modify it, it closes, and this is what is written: ....... Thre

  • New hard drive. Do I need windows disk?

    I have a HP Pavilion dv7 laptop and recently the hard drive has failed... It was running windows 7 home basic 64-bit and did not come with recovery disks. im going to buy a new hard drive to replace soon and I was wondering what discs do I have to ge

  • Presario CQ61 Max Memory

    I bought a Presario CQ61 a couple of years ago and I wanted to replace its sticks of 2 x 2 GB with something a little bigger. Now, I read online that the maximum memory it supports is 4 GB, but I do not understand if it is a single stick, or the maxi

  • damaged or missing file

    my dvd and cd rom don't work any more it says that the file is damaged or missing im running windows xp and I can not install my anti virus what can I please help thanks randy

  • Windows 7 complete retail can be installed in 32-bit or 64-bit? you have that choice?

    I don't speak of the OEM/system integrators edition that comes with a computer, I don't know the retail edition that you buy at the store. If you're not sure, do not respond. My guess is there is not a choice and there is no such thing as a 32-bit ed