call library

Greetings and happy new year to all!

I'm working on a program where (among other things) that I want to read a resource shared memory. Through a few scripts that run between my machine and another on the same network, a segment specified memory on my machine is fed data in real time, and I want to access these data to manipulate. Once I have access, I think I have to throw in a buffer before I can start to work with him, but that is me...

For now, I found the "call library function node" that I think that I can use to access the .dll file that has the features I need to read and interpret the data passed to me. Where I could use some guidance is what to do with it? I have to say somehow LV 'name' associated with the shared memory, Yes? And somehow, I need to say LV what is data... or this would be through the functions in my .dll? [I think that the answer is the dll - and Yes, I know that you all may not really know without seeing the code; I ask you again in a general sense.]

With the help of this function node looks like a simple method. Anyone know of a better method to access the shared memory?

Thank you!

________________________________________________________________________________

* Always to search through other threads; If this has been answered elsewhere, please let me know!

* It's all about LV 7.1.1...

IceMan30 wrote:

Greetings and happy new year to all!

I'm working on a program where (among other things) that I want to read a resource shared memory. Through a few scripts that run between my machine and another on the same network, a segment specified memory on my machine is fed data in real time, and I want to access these data to manipulate. Once I have access, I think I have to throw in a buffer before I can start to work with him, but that is me...

For now, I found the "call library function node" that I think that I can use to access the .dll file that has the features I need to read and interpret the data passed to me. Where I could use some guidance is what to do with it? I have to say somehow LV 'name' associated with the shared memory, Yes? And somehow, I need to say LV what is data... or this would be through the functions in my .dll? [I think that the answer is the dll - and Yes, I know that you all may not really know without seeing the code; I ask you again in a general sense.]

With the help of this function node looks like a simple method. Anyone know of a better method to access the shared memory?

Thank you!

________________________________________________________________________________

* Always to search through other threads; If this has been answered elsewhere, please let me know!

* It's all about LV 7.1.1...

Your thoughts are all correct! The answer is in the DLL, and we cannot help you at all without having more details on the DLL.

Tags: NI Software

Similar Questions

  • How to implement a callback to the help function call library function node in LabView?

    I try to call a fuction from a SDK.dll library by using the node call library feature. The SDK has been provided to

    me and I don't have the source code, just the .dll and .h files.

    The SdkSetPropertyEventHandler function has a function of recall as one of its parameters. How to apply the

    callback using the NSI node? I'm a good programmer LabView but this is my first time using the library to call

    Function node. I read all the info I can find on the web site of NOR and the discussion Forum, but can not understand

    This one out. I'm using LabView 8.6.

    The deacribes SDK.h function as:

    Function: SdkSetPropertyEventHandler

    (SdkSetPropertyEventHandler) SdkError SDKAPI
    SdkCameraRef inCameraRef,
    SdkPropertyEvent inEvnet,
    SdkPropertyEventHandler inPropertyEventHandler,
    SdkVoid * context);

    //
    Description:
    Registers a callback function to receive the status
    change the notification events for the States of property on a camera.
    //
    Parameters:
    In: inCameraRef - designate the object camera.
    inEvent - designated one or all the events will be completed.
    inPropertyEventHandler - designate the pointer to the callback
    function to receive the camera property-related events.
    inContext - designated application information must be passed
    way to the callback function. All the data necessary to
    your application can be passed.
    Output: no
    //
    Returns: A sdk errors.
    -----------------------------------------------------------------------------*/

    A separate header called SDKTypes.h file contains the following data:

    typedef SdkUInt32 SdkPropertyEvent;
    typedef SdkUInt32 SdkPropertyID;
    typedef void SdkVoid;

    typedef struct __SdkObject * SdkBaseRef;
    typedef SdkBaseRef SdkCameraRef;

    /*-----------------------------------------------------------------------------
    SdkPropertyEventHandler
    -----------------------------------------------------------------------------*/
    typedef SdkError (SDKCALLBACK * SdkPropertyEventHandler))
    SdkPropertyEvent inEvent,
    SdkPropertyID inPropertyID,
    SdkUInt32 inParam,
    SdkVoid * context);

    Thanks for your help.
    Alejandro

    Andrew_E wrote:

    Hi Rolfk,

    You are absolutely right. This article describes what you were talking about? I'm just trying to get as much information as possible on this thread if the solution is easier to find for the future. Thank you.

    Yes, but I find the idea of using .net to call a LabVIEW VI as callback function C a bit as using a roll of Steam ironing your pants. Why do it? Well the steamroller has extra security guards that make it less likely that you'll break your pants in the process, but it's not elegant IMHO.

    Write a C DLL that translates between a C callback and a user event LabVIEW using the PostLVUserEvent() of the interface of the kernel to run LabVIEW function seems so eleganter for me. Yes, it's a bit of programming in C, but good!

    Rolf Kalbermatter

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

  • An array of LStrHandles to the breast to call library node grave Functio Resizeing down Subvi.

    Hello

    I try to resize a table of LStrHandles in a shared library. Here the code C - attached a picture of the appellant Subvi:

    / * Call library source file * /.

    #include
    #include "extcode.h".

    / * Typedefs * /.

    typedef struct {}
    long dimSize;
    LStrHandle elt [1];
    } TD1;
    typedef TD1 * TD1Hdl;

    long strArray (TD1Hdl arg1);
    long strArray (TD1Hdl arg1)
    {
    long err = 0, count = 2;

    ERR = DSSetHandleSize (arg1 (UHandle), count + (long) sizeof * sizeof (LStrHandle));
    {if (Err)}
    printf ("ERROR: 'DSSetHandleSize()': %ld\n", err);
    return err;
    };

    (* arg1)-> dimSize = (* arg1)-> dimSize;

    return noErr;

    }

    I know there is a lot of discussion, I read some and also tried the source code provided but somehow LabVIEW crashes. I don't know if it's valuable, but when I change the next line it don't crash:

    (* arg1)-> dimSize = (* arg1)-> dimSize;

    Thanks for any help,

    Johannes

    OS: RedHat

    LV: 8.2 teacher

    To be honest I'm not entirely sure why that would break but good process is much more complicated than what you have done. The crash probably can't function of C, but the return of the function such as LabVIEW tries to display data. DSSetHandleSize() doesn't boot the zone allocations in addition it of probably garbage that LabVIEW then tries to interpret as string handles and therefore crashes.

    You should also use NumericArrayResize() where possible because it supports various complications that can be difficult to deal with cross-platform programs. NumericArrayResize() use internal DSSetHSzClr() which initializes additional memory to 0. That would avoid the accident since LabVIEW interprets handles NULL as the default value for the data type, which would here be a string empty.

    #include "extcode.h".

    #if IsOpSystem64Bit

    uPtr uQ #define

    #else

    uPtr uL #define

    #endif

    typedef struct {}

    dimSize of Int32;

    LStrHandle Elm [1];

    } TDStrArr, * TDStrArrHdl;

    MgErr MyArrayFunc (TDStrArrHdl stop)

    {

    Int32 count = 4;

    LStrHandle p;

    MgErr err = noErr;

    / * Table could be non-empty, so have all of the items there are larger than we need * /.

    for (i = (* arr)-> dimSize - 1; i > = count; i--)

    {

    p = (* arr)-> Elm [i];

    If (p)

    DSDisposeHandle (p)

    }

    (* arr)-> dimSize = i + 1;

    / * resize the table handle to get enough space * /.

    ERR = NumericArrayResize (uPtr, 1, (UHandle *) & arr, count);

    If (err)

    return err;

    / * Fill in the data as desired * /.

    for (i = 0;! err & I)< count;="">

    {

    p = (* arr)-> Elm [i];

    #if! complicated

    ERR = NumericArrayResize (uB, 1, (UHandle *) & p, 1);)

    #else

    If (p)

    {

    ERR = DSSetHSzClr (p, sizeof (int32));

    }

    on the other

    {

    p = DSNewHClr (sizeof (int32));

    If (p)

    (* arr)-> Elm [i] = p;

    on the other

    ERR = mFullErr;

    }

    #endif

    If (! err)

    ERR = LStrPrintf (p, "% ld", i);

    }

    (* arr)-> dimSize = i;

    return err;

    }

    Rolf Kalbermatter

  • Can we call library user directly labview vi in teststand?

    Hello

    I'm calling one of the libraries of the labview teststand user directly. I get errors when running (Catpure.png attachment).

    If I create labview file and use this library vi in labview with same entries that then use this labview in teststand, and teststand is happy (capture2.png, capture3.png).

    I would like to know if I can call library user directly labview vis in teststand or should have create my own vi call this lib from there? Can someone let me know?

    Kind regards

    Hema

    Hi Hema,

    In general, screw calling for a Bachelor's degree in LAW (LabVIEW library) TestStand works very well. I have attached a sequence that makes calls to a VI in a Bachelor's degree in LAW and a VI out of one. This works as expected.

    The error you get is probably the result of another problem. Please add more details about the error, the versions TestStand and LabVIEW, you use and if you have set the LabVIEW LabVIEW RunTimeEngine adapter or LabVIEW Development System.

    PS: The image you attached shows the setting for the call of VI step and it seems to be loading fine (no provider indicating a loading error error). If the step throws an error only when executed, then attach a snapshot of the error dialog box that is displayed or the report that has the details of the error.

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

  • 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

  • Call library function node, large table DLL by the way

    Hello

    I interfaced with success in most of the functions in a DLL, but it's trouble...

    Statement of header file:
    CORRTABLE * pDestCorrectionTable;

    Fundamental data type:
    struct {}
    long [65 * 65];
    long [65 * 65];
    long [65 * 65];
    }*;

    Call library Functio prototype node:
    long unsigned MC_get_corrtable (unsigned short int wSourceIndex, void * pDestCorrectionTable);

    The wrapper is generated automatically from the tools | Import | Shared library creates a cluster of 3 x 65 long. Shouldn't this created a 3 x 65 x 65 cluster? (but 256 is the maximum cluster size). That and tried all methods cause the node of the function of the library call crashing.
    What is the workaround?
    Thank you

    Al


  • How to use the node function call library for a function in the dll with the data SUB type

    Hi all

    I would ask for your kind help

    I am facing a problem with the call library node.

    I have a C++ (stdcall) function, which has Sub as data type

    XXXX error code (hwnd, lid, getValue, * Sub data1, * Sub data2)

    data1 and data2 types are constantly changing based on the value of 'getValue '.

    Mainly I can use the call library node several times and adapt each node according to the types of data data1, data2 and extract the values and use in the code. Here is no question. Real question is:

    My question:

    How can I use a node of library time call and make a case according to the 'getvalue', who will control the data1, data2 data type. Here I really seeking solutions.

    My tests:

    I used varaints as entry to the libray call node of the data1, data2 and selected parameters in the call libraby node as "Adapt to type. Here labview just crashed.

    I appreciate your suggestions to feedbackand.

    Thank you

    Karine

    You must allocate enough space for data1 and data2, and then pass a pointer to this space. An easy way to do this is the function to initialize table. Set the U8 type and size for the number of bytes required. Pass this array to the function as a pointer of table data.

    After the function call returns, you need to extract the data in the table. You can do it manually, but a simple approach is to use the array of bytes to a string. Then, in a housing structure, use Unflatten chain to convert the string to the correct data type. This method also converts the "endianness" which will be probably necessary; Be sure to only set all entries for unflatten correctly.

  • Why the DLL function performed by call library node fails when the Vi is reopened?

    Development system

    OS: Windows XP

    LabVIEW: version 10.0

    DLL: Custom

    Compiler: Visual C++ 6.0

    Function prototype: __declspec (dllexport) const char * test (void)

    We have developed a DLL to use.  Compile the DLL itself.  The DLL includes a function test.  The test function validates the functional capabilities of the DLL.  I followed the examples online, and I used the tool to import shared library in LabVIEW.  The screw created use the call library node.

    When I create a VI by calling the function in the DLL test customized by using the call library node the VI runs the test DLL function flawlessly.  I close the VI.  When I re - open the VI and run it, I get an error code of the DLL.  However, if I go on the schema and define the path of the DLL in the library call Configuration node once again the VI then runs the test DLL function perfectly again.

    I have set the path of the DLL in the library call Configuration node everytime I open the VI.  The examples that I downloaded from the community don't require this.  What could be the missing DLL?  What Miss me?

    I solved the problem.

    I had create the DLL by using the following steps for VC 6.0:

    1. new project

    2. Select the Appwizard (DLL) MFC

    3. Select the regular DLLS using the MFC shared DLLS

    4 Yes for source file comments

    5 finishing

    The DLL must be on the VI search path.  The easiest way was to have the DLL in the same directory as the VI.

  • call library function node - function not found

    When you create a DLL, I get a error Labview "node"LabviewReceiverDLL.dll:readDataJ1939Data "function not found." call library function Everything looks good to me and cela used to work, even if I changed computers since then.

    This is the beginning of my C++ code just to show my name of the function. I've also attached the function of the library calls window to show my setup.

    Thanks in advance for your help.

    #include "StdAfx.h"

    #include

    / * Call library source file * /.

    extern "C" __declspec (dllexport) unsignedint readDataJ1939Data (unsignedint, unsignedint, unsignedchar, unsignedchar * canData, unsignedchar path);

    unsigned int readDataJ1939Data (ulTimeStamp, ulIdentifier, unsignedchar uiDataCount, unsigned char unsignedint unsignedint * canData, constchar path)

    {

    I've recreated the DLL and Labview library node call and now it works.

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

  • Memory from the Flushing call library function node

    I use the function call library (COLD LAKE) node to load some dll dynamically in a same vi.

    I use a loop for to send the DLL files or a table to COLD LAKE to load the different dll.

    For the first iteration, the COLD LAKE works very well, but for the second iteration and so on can not replace the output variable, and continue to repeat the result of the first iteration.

    Is there anyway to clear the memory of COLD LAKE, so that I will get the correct result for DLL 2nd and so on?

    I understand your message, you have different dll, which returns an array of LabVIEW.

    This table can be of different sizes according to the DLL you are calling.

    I think that you are having a general misunderstand about LV memory management. I think that your comments refer to the data space LV has allocated for the table, this has nothing to do with the DLL itself said!

    LV works memory about conservative. So if you allocated a data space, execution of a new of the same VI will try to reuse this dataspace. So the tables are not released if the VI will slow.

    That being said, the table itself will not reduce its size.

    The only question I have on this: you still have all the available values? If the new call returns the three values (out of 33), is the rest 30 items "the old value"?

    For ANSI C dll - it is common that the DLL also returns a scalar value "arraysize". If you got that, you can use the Array subset function to retrieve valid values.

    Norbert

  • Where the photos are normally stored on a Mac computer? In the folder images in the Finder on my Mac, I see a file called "Library.photoslibrary Photos" i.e. 28.52 GB but I also have about 160 other image files in the same folder. But in pictures,.

    Where the photos are normally stored on a Mac computer? In the folder images in the Finder on my Mac, I have a file named "Library.photoslibrary Photos" i.e. 28.52 gb and another folder called 'iPhoto Library.migratedphotolibrary' i.e. 4.95 GB, but then I have also on the 160 other photo and video files in the same folder. But in my Photos app, it says that I have 6 260 'elements '.

    The pictures that you have imported into the photo library are, by default, stored inside the package (not file) "Library.photoslibrary Photos" in your pictures folder. The 'iPhoto Library.migratedphotolibrary' package would contain photos that have been stored in your library, iPhoto at the time of the migration.

    The other files in the pictures folder are that: other files. Also, they can be in libraries if you imported and has not deleted the copies lying around in the images.

Maybe you are looking for