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


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.

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

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

  • 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

  • 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

  • [HELP] Call library function node...

    I have a DLL that has a function as follows:

    int GetMessageNameNumber (char * messageName [], const int MessageNumber);

     

    The function is used thus:

    char * MessageName = NULL;
    int MessageNumber = 0;
    ...

    error = HL1553API_GetMessageNumberName (& MessageName, MessageNumber);

    MessageName will contain the name of the message as a string.

    I saw the Devils own job trying to wrap this in a Labview module.  I have a knot of library function to call the above function, but I'm not sure what to set the parameter "MessageName" also!  I tried array of integers 8 signed bits, adapted to the Type of pointer to data in the table and then passed in an array of strings.  Whatever I do translates into LabView crash.  I know HL1553API_GetMessageNumberName works, because if I call it directly in TestStand it works fine.  I need LabView well!

    Any ideas?

    C a pointer to a string or an array of strings are completely ambiguous.

    char * something = char * something [].

    You can't tell the two apart from the syntax, but only from the documentation or an example of how the function is called. A C compiler treats the equal in terms of access (but a C++ compiler will do a syntactic differentiation when code syntax checking, with the possible result compile warnings when you are prompted to use a sufficiently high level of warning).

    The example shows that it is not a string array gets allocated by the caller and passed to the function, but a string pointer that is passed by reference. So the function will allocate a pointer and return it (a very atypical C practice at least for strings). This automatically raises the question when and how this pointer will be released? The documentation for this function should document the call from Manager memory allows to allocate this pointer and also point to the function to call to release. Ideally the library (DLL) provides an exported function for this purpose.

    Assume that everything I spoke so far is clear and available you need to cheat a bit LabVIEW. You need to configer a pointer size whole that is passed by reference. Now this whole in the diagram IS actually your channel. If you only need to pass this pointer to other library functions call that you're already doing. Otherwise if you need access to the contents of this string from the diagram LabVIEW, you will need to copy the information from this string to a real string of LabVIEW pointer.

    One way to do that is to use the export of the MoveBlock() C function that LabVIEW exports itself. I have explained this several times here on this forum and the MoveBlock research will no doubt find out these positions.

    Another slightly better way is to use the LStrPrintf() function which also exports of LabVIEW. To do this, you configure a library function call as follows:

    Library name: LabVIEW

    Function name: LStrPrintf

    Calling Convention: C

    Thread: both are possible, but the function is thread safe, so just use environment

    return parameter: int32 (there is a possible LabVIEW Manager error code)

    1st parameter: handle string of LabVIEW, passed by value

    parameter 2: C string pointer

    3rd parameter: integer pointer size, passed by valu

    Wire an empty string in the first parameter constant.

    Wire a constant containing the text '%s' without the quotes on the 2nd.

    The pointer to your thread on the 3rd string

    The function will return 0 as a return value and the content of the string on the side of the exit of the 1st parameter or a zero value indicating that a mistake to return back.

  • 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

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

  • Connection of several call library function node

    First of all, I apologize if some of these issues are pretty basic. For my work, I have been teaching myself LabVIEW (using one of the books) for the last two months, in addition to a course of semesters of C++ software development. I have flowed through a few examples from the book and have searched these forums + google search, but I found the contradictory and confusing information on how to manage the C string data.

    I have attached a photo of the block diagram, the real VI and a manual describing the .dll file I'll call you. My real application is more complicated than what I've built here (I installed a trial version free at home, since I can't bring my lab computers files due to their having no do not have access to the internet...) There install everything for us, but it's a side story!), but deals with execution other than that, as I have the VI wrapped around an imposing event that runs based on which side a user presses the button, messages pop up additional user, etc..

    In the end, I'll implement a program which allows a user presses a single button that sends a bunch of instructions to an instrument, where requested orders have been compiled by the society of the instrument in a couple of .dll files. The instrument itself be held the certain function specifications, so there is not much need to worry to get somewhere, out string parameters to be stored, and there is no reception data of the instrument: it simply distributes liquid charges based on what parameters I pass to it. Given the same internet connection problems, I have to wait a few weeks for my IT team installed a decompiler of .dll file on the computer that has installed LabVIEW so that I hope that I can directly import the header file in the Import Wizard. I worked out of their manual without even being able to look in the .dll file (which may be more documentation), and they do not have the more detailed documentation on their data types (even if maybe these data types are public knowledge, and I'm just missing something). I went ahead and copied + pasted some of their function prototypes + example code pages 16 and 17 of the provided pdf (it looks like to me a C calling convention):

    'Functions of the DLL to talk to the PiezoElectronics.

    Public Function declare bfx_piezo_OpenPort Lib "bfx_piezocontrol.dll" (ByVal portname As String) As Integer

    Public Function declare bfx_piezo_ClosePort Lib "bfx_piezocontrol.dll" () As Integer

    Public Function declare bfx_piezo_ConfigurePiezo Lib "bfx_piezocontrol.dll" (ByVal ability As Double, ByVal VoltagePerStroke As Double) As Integer

    Public Function declare bfx_piezo_SetupPiezo Lib "bfx_piezocontrol.dll" (ByVal StrokeLength As Double, ByVal DownStrokeVelocity As Double, ByVal HoldTime As Integer, ByVal UpStrokeVelocity As Double, ByRef LoadTime As Double, ByRef LoadCurrent As Double, ByRef UnloadTime As Double, ByRef UnloadCurrent As Double) As Integer

    ' Search for electronics

    RC = bfx_autodetect_SearchPiezo (False, PiezoElectronicsPort, PiezoElectronicsDev)

    If rc = 0 then MsgBox("No electronics could be detected", MsgBoxStyle.Critical)"error message LogLabel.Text ="no electronics could be detected.

    On the other

    Action.Enabled = True '

    Device found-> activate the button LogLabel.Text = "Piezoelectronics" found on the Port & PiezoElectronicsPort

    RC = bfx_piezo_OpenPort (PiezoElectronicsDev) ' establish communication

    If rc = 0 Then LogLabel.Text = "open e".

    End If

    End Sub

    Private Sub Action_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Action.Click

    Dim rc As Integer ' to store the return code of the dll

    Dim LoadTime, LoadCurrent, UnloadTime, UnloadCurrent As Double ' to store the values returned by the dll

    RC = bfx_piezo_ConfigurePiezo (PiezoCapacity, PiezoVoltagePerStroke) ' Tell the dll of the distributor of physics

    If rc = 0 Then LogLabel.Text = "Configured distributor" "configure the parameters of dosage

    RC = bfx_piezo_SetupPiezo (stroke, beat down, HoldTime, ascending, UnloadTime, UnloadCurrent, LoadCurrent and LoadTime) rc += bfx_piezo_Repeat (repetitions, RepeatDelay)

    If rc = 0 Then LogLabel.Text = "Setup dosage settings."

    Only four interested features me search piezo, open port, configure piezo and piezo installation, as seen on my block diagram. My questions concern only the setup functions / openport piezo and how I built the library call nodes function, since these would also address how to set up the other two. When running VI, I get the error code is 1517, with installation function highlighted, leading me to believe that I have this feature badly adjusted upward (and Potentially openport, explained in the next paragraph).

    Function to open the port has two string parameters that are passed by reference, and configure the function takes one of the following strings as a call by value. Can I just wire them together as I did, or is it necessary to do something in the sense of adding a sub - VI GetValueAtPointer to dereference firstly, the pointer to the string and then spend the actual string on the second node?

    To specify the data types in the function library call nodes, I have all channels like C strings, double as double, return numeric values as integers signed 32 (each function returns a digital long I think that for debugging purposes), Boolean as an integer 16 bit signed (after that I forced my Boolean constant in an integer) and one of my numbers in Setup as an integer no signed, as I was told in an e-mail from the manufacturer of the instrument. Should we indicate the call launched by numbers as constants value, or not, since they are not explicitly defined as constants in the code provided? Since they have been specified not as long, I am right to assume signed 16-bit integer for the passage by the digits of the value? Is the Boolean value a 8-bit or 16-bit and signed? If the function has a numeric parameter as a value call, I guess by the wiring in a digital constant, that this value is transferred to the function?

    Again, I apoligize if these questions are too simplistic (and many of them), due to my limited experience programming and possibly scarce documentation of the company during the inspection. I look forward comments about the VI as well, if I had nothing at all just illegal/bad practice.

    Thank you for your time!

    First of all, I'm really not familiar with C/C++ dll, but I remember something the DLL must contain the standard C functions to properly accessible from LabVIEW. I don't know if this is the case here, but lets see more will enlighten this part.

    Second, whenever I have the chance to directly use the simple series commands, I go like this, and I create my own live LabVIEW. As I see in the attached pdf doc, it is possible to order the material through the series without using the DLL (on page 18). If these features meet your needs, I would really screw via VISA program, your life will be much easier...

    Edit: http://www.ni.com/tutorial/3702/en/

  • Name of the function mutilated in the call library function node

    Hello

    I am change an existing wrapper LabView project, I added a function, and even if I used the same settings of export, it is used for all other functions, the new function name appears truncated.

    The code of the DLL:

    #ifdef OS_WINDOWS
    # define exportspec extern "C" __declspec (dllexport)
    #else

    Exportspec int S7API lv_Srv_RegEvents (S7Object, LVUserEventRef Server * EventRef, PSrvEvent EventData);

    The library Call dialog box:

    Even if the function itself is empty, LabView still triggers the corruption of General memory error.

    Help, please.

    Oh me,.

    the S7API definition is lying __stdcall

    now, it works fine...

Maybe you are looking for