Call dll function on Windows CE6.0 Device

I am trying to call a dll on a windows CE6.0 device, which is the KEBA KeTop T20techno.
In the "call library function" I added a selfmade WIN32 stub dll and in the build specifications I added the original Windows CE .lib file.
When I try to build an execution I always get the following build error:
THUMB is a missing VI or C file
ARM is a missing VI or C file
Can anyone give me a hand on this issue?

Hi Oimel,
Are you sure that the function name and function prototype for both libraries is the same?
Thanks as kudos only

Similar Messages

  • Call DLL function from JAVA

    HI!
    What's the best way (and simple) to call DLL function from JAVA.
    DLL function (developed in C) has two input parameters (string) and return an integer.
    Could you help with an example?
    Thanks a lot.

    Do a google search for 'JNI tutorial' and it will turn up hundreds of examples.

  • Calling DLL function using LabVIEW 7.1?

    Here's the scinario:
    I have LabVIEW 7.1 and i'm trying to call a DLL function using 'CALL LIBRARY FUNCTION NODE'.
    I have used this in the past with no problem. But right now, when I use this node and link it to the
    library and function name, i get 'ERROR loading Dllname.dll' message.
    NOTE that the DLL is generated using VStudio2003 or VStudio.NET. Could this be a problem??
    Also, i noticed that there are some JUNK characters before & after the function name that show
    up in function prototype:
    long ?EcpvsSign@@YAHHPBEH0HPAE1@Z(long Signer, CStr NonRMsg, long NonRMsgLen,
    CStr RMsg, long RMsgLen, CStr SigR, CStr SigS);

    tbd wrote:
    Hi rkpat,
          You might check-out this thread on building WIN32 DLLs - expecially the bit re: "mangles names" under the paragraph titled "C Language Source File".  My recollection is that 'extern "C"' directive in the header file for the DLL solved the name-mangling problem, but it's been a few years!
    Cheers!
    Message Edited by tbd on 03-01-2007 11:19 PM
    tbd is right. You have to first disable name mangling as it creates all kind of troubles. Other issues might be that your Visual Studio 2003 or .Net edition links in dynamic runtime libraries that are not standard available on every Windows PC so that you need to redistribute the according runtime library installer together with your app for the DLL to be even loadable.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • LabVIEW crashes after VI (calls DLL to post Windows Msg) exits

    I built a DLL in Visual C++ and I use LabVIEW 7.1 to call it (using the Call Library function).
    When I run the LabVIEW VI without the 'post windows message' functionality in the DLL, it works fine and exits LabVIEW without a problem. If the DLL posts a message, and the code from the link below is used to catch the meassage, the VI appears to have executed and exit correctly, allowing other VIs to be run, etc, but when the VI is closed, LabVIEW stops responding. If it is the only VI open, then it closes leaving the LabVIEW window minimized (and unresponsive) in the Taskbar. Both DLLs successfully detached from LV before the VI stops running.
    http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3E7AC56A4E034080020E74861&p_node=DZ52071&p_submitted=N&p_rank=&p_answer=&p_source=External

    Hi,
    can you post your code here so we can try to reproduce it?
    It sounds as if the handles aren't being released in the right order. i.e. LabVIEW will hold onto a DLL until the vi using it goes out of memory.
    I think from your description you have a DLL which posts a message, and then you're using the example code which was written for LabVIEW 5.0 to read that windows message?
    What message are you sending?
    When you say the DLL has detached, is that process detach or thread detach?
    What version of LabVIEW are you using?
    What operating system?
    What version of Visual C++?
    Thanks
    Sacha Emery
    National Instruments (UK)
    // it takes almost no time to rate an answer

  • Error 1097 after calling dll function which allocates memory inside

    Hello!
    When a call one my functions in my dll from LabView, i get an error 1097. My function takes a few arguments and then allocates some memory for measurement.
    It's not returning any pointers to that memory area, it is just allocates that memory for itself. I don't know what could be the problem, probably i am missing something.
    Could you help please?
    Best regards,
    Tamas
    Solved!
    Go to Solution.

    Are you sure that the allocate function is the problem?
    Error 1097 simply means something inside the external code wrote into memory locations that it was not meant to write. That is usually because of output buffer parameters that are not allocated (large enough) in LabVIEW when passed to the external code fucntion, so the function assuming it received a buffer of a certain size happily writes into that buffer but overwriting other information it should not have.
    But that is by far not the only possibility to cause this error. A simple bug in the external code can cause the same problem when a pointer goes astray or such. The fact that you used that library elsewhere already without seeing any problem is unfortunately no guarantee that the function is not buggy. The LabVIEW exeception handling around the Call Library Node has gotten rather picky and can detect violations that do not have to cause visible problems at all. But the violations it detects are real violations so just silencing them is not a good idea, as they could cause all kinds of problems including overwriting vital data structures in your program that either cause a crash later on or simply wrong results in other parts of your program. Especially the last one is a total bummer to debug.
    Without seeing much more of your code it is basically impossible to point out where the problem could lie. The particular Allocate function doesn't look like there is much that could be done wrong, but I would assume that you call several other functions too somewhere, which could cause the problem. If you can absolutely positively say that you never ever call any library function with a to short (or unallocated) buffer parameter, then you will have to take it up with the manufacturer of your lib, as it would seem very likely that there is some problem in there.
    Also you pass a handle to the library function but your Allocate function does not have this as a parameter! Where does this handle come from? Are you sure you have allocated and prepared it properly before calling this function? A handle is quite often a pointer, although usually a so called opaque pointer meaning the user of the library does not and should not know anything about the structure this pointer points to. It is only known internal to the library.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Allocate memory and call dll function which writes to the pointer

    Hi!
    I have a DLL wich has a function like the following example, wich i need to call from labview. In C I need to allocate some memory for the data and of course the struct. I add the pointer and the lengh of the data to the stuct and call the function with the struct. The function itself inserts some values to the stuct and to allocated memory. Has someone a working solution how this can be done with Labview?
    typedef struct Thestruct
     UINT16 val1;
     UINT8 val2;
     UINT8 val3;
     UINT16 dataLength;
     UINT8 *data;
    } T_Thestruct;
    MY_API Status MY_API_CALL udaReceive(Handle handle, T_Thestruct *args);
    I tried in labview (see picture), but I only got values inside the struct as well as the error 1097, the reserved memory inclues the same values as before.
    Solved!
    Go to Solution.
    Attachments:
    CallDll.PNG ‏21 KB

    Tobias_BSH wrote:
    OK, I found the soluton to my own Problem. The alignment on the struct must be corrected in Labview. There must be a 2Bytes dummy value between dataLength and the pointer.
    And please not that your solution only works in LabVIEW 32 bit. In LabVIEW 64 Bit your DLL has to be 64 bit compiled as well in order to be loadable and the pointer then is a 64 bit integer and is usually aligned to 64 bit addresses too. In this particular case since the pointer is already aligned to a multiple of 64 bit (when the additional 2 alignment bytes are added) you won't have to modify the alignment for the 64 bit case, but you have to define a different cluster with the 64 bit integer for the pointer anyhow.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Reading a line from a third party software using call dll function.

    Hi,
    I am using a third party software in Lab VIEW.
    I am having trouble using one of the functions defined in the dll.
    I have the VI attached here, As u can see in the VI I am not sure how to use the function
    LCOM_MasterGetLine in the fourth sequence.....
    This has three parameters and they are
    (int ID,char*Buffer,int Length)
    What basically happens with this function is this...
    /* ROUTINE LCOM_MasterGetLine
    It Reads line of maximally Length characters from Slave ID into Buffer and the parameters are
    * ARGUMENT(S) ID ... Slaves ID
    * Buffer ... Where do you want chars (at least Length+1 in size)
    *Length ... How many at most (should be less than LCOM_MAXLEN)
    Can
    any one help me how to define the input parameters for this function, for example in the fourth part of the Vi attached here.
    What I understand from the function is that, the third party software when it sends a line, that line is stored in the input parameter...buffer ...that is defined to the dll.
    Can any one help me how to then read what line has been sent from the third party software.
    I am including the dll file and also the header file here.
    Thanks a lot,
    Ajit
    Attachments:
    New_Folder.zip ‏30 KB

    One problems with your solution:
    LCOM_MasterGetLine(int ID,char*Buffer,int Length)
    You should allocate a buffer large enough in LabVIEW and pass it to the Call Library Node. The dll function needs som space to actually scribble in whatever it wants to do.
    Check out the attachement this should more or less be what you will need.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions
    Attachments:
    ex.vi ‏45 KB

  • Call DLL function with pointer to simple struct

    Hello,
    I try to call a function using CLFN. My problem is the parameters of the function I try to access.
    Here is the function and his parameter:
    typedef struct {
    int major;
    int minor;
    int revision;
    int build;
    } VersionNumberType;
    int Comm_BTE_softVersion( VersionNumberType *pVersion)
    BYTE byBuffer[2048] ;
    if( !Comm_BTE_readYMem( byBuffer,COMM_BTE_TX14_SOFTVERSIONADDR,
    COMM_BTE_TX14_SOFTVERSIONSIZE))
    return FALSE ;
    //. process the answer
    pVersion->major = (int) (byBuffer[0] & 0xFF) ;
    pVersion->minor = (int) (byBuffer[1] & 0xFF) ;
    pVersion->revision = (int)( byBuffer[2] & 0xFF) ;
    pVersion->build = (int) ((int) ( byBuffer[4] << 8) ) | ((int) ( byBuffer[5] ));
    return TRUE ;
    } //. end Comm_BTE
     In attached file there is the Comm BTE soft Version.vi that try to access this function. The code crashes when the function is called and labVIEW is closed.
    I probably don't pass the data parameters correctly to the CLFN.
    Thanks for help.
    Regards. NewCLAD.
    Solved!
    Go to Solution.
    Attachments:
    Comm BTE soft Version.vi ‏13 KB

    Everything is configured correctly EXCEPT the numeric representation of the values in the cluster. They must match int, which is most likely 32 bits on your platform. In your VI, they are U8.

  • Is it possible to call dll-functions with records/types as arguments?

    or must I use the fixed preselection of types

    LabVIEW must call DLLs with data types it is compatible. Therefore, you must use the types available through LabVIEW.
    I have two pieces of advice on this matter:
    First, contact NI and get their advice on how to call your data type. They may be able to offer a very quick solution.
    Second, if you cannot call these data types, and you have a compiler, I would suggest "wrapping" the DLL inside another, and 'translate' the data type from something LabVIEW can handle, to the type needed by your DLL in this 'wrapper' DLL.

  • "HOW to use Labview call Dll compiled by VC++"

    "hello,I use VC++ compile a DLL,and i want to call DLL Function in LABVIEW program.But there is a dll function
    when i call it in labview.There is error.The prototype of Dll Function that make error is "USHORT DLLFUN __stdcall IBWRT(unsigned short dev_address,const char *pstrWrite)",The second paramenter is a char pointer,
    and the paramenter pass a command which content is
    "MEASURE:CURRENTC? 1A,0.001MA".
    When i use VC++ to call this function,i program followed:
    CString m_wrt;
    int ReturnW;
    m_wrt="MEASURE:CURRENTC? 1A,0.001MA";
    char buffer[40];
    strcpy(buffer,m_wrt);
    ReturnW=IBWRT(4,buffer);
    and this call is correct.
    But when i use labview to call this function.ther
    e is
    error.So, who can help me,to tell me how to call this
    function.Thanks."

    Are you asking about porting code or calling C++ code in LabVIEW?  As far as porting code, there's no easy way to move code back and forth between LabVIEW and C++.  However, if you are trying to call C++ code in LabVIEW, you can compile it as a DLL and call it in LabVIEW using the Call Library Function node.
    Chad B. » National Instruments » ni.com

  • Calling Dlls from LabVIEW

    LabVIEW Gurus:
    I am working with some software engineers who have no experience in LabVIEW. Unfortunately I have little experience in C/C++ to make sense of their inquiry.  
    Basically we are dealing with “Data Marshalling”. I will call a DLL and issue a command (string) and get back a 2-D array and an integer. So far so good.
    The C/C++ programmer requested that I provide them with a pointer/memory address in which they will store data, so I can read it once the dll returns the array and integer. I browsed through the example online http://decibel.ni.com/content/docs/DOC-1690 and thought that if I wanted to read from the dll, the process is a simple as calling the appropriate function and configure the parameter (no pointers needed).
    So, is there a specific way that they need to write the C/C++ code to be used in LabVIEW? Or what else to I have to take into consideration?
    Thank you,
    Santiago 

    That example is pretty simplistic as it only deals with integers. In this case no pointers are required since everything is returned by value. When you're dealing with arrays, however, you need to deal with pointers. If you open the Example Finder (Help -> Find Examples) and search for "dll" you will see the "Call DLL" example. That contains many examples of how to call DLL functions with a wide variety of datatypes. I strongly suggest looking at that example. There is also a chapter in the LabVIEW Help on calling DLLs (Fundamentals -> Calling Code Written in Text-Based Progamming Language).
    You have 2 things to consider:
    You're dealing with arrays - this means you typically need to pre-allocate the memory in LabVIEW, and it sounds like that's what the DLL expects you to do. This amounts to using the Initialize Array function to create your 2D array of the appropriate size and datatype.
    You may be dealing with a C++ DLL. LabVIEW can only interface to C DLLs. This doesn't mean that you can't create a DLL in C++, but it does mean that the C++ programmers need to add an extern "C" modifier to the function calls, otherwise you get name mangling, and LabVIEW won't be able to call the DLL. The DLL programmers should know what that means.

  • How to use dll function

    I have written a program which calls dll function from a dll in eclipse platform.But I am getting Unsatisfied Linker Error.How can I solve this problem?Can anyone help me out?

    Have a look at JNA:
    https://jna.dev.java.net/

  • Calling DLL using LabVIEW 7.1

    so, i have this DLL which might be compiled using Visual Studio 2003 or Visual Studio 2005.NET.
    question is: Can i call DLL functions using LabVIEW 7.1? has anyone tried it and has any issues loading the DLL?
    i think i have everything right, as far as the configuration of 'Call Library Function Node' is concerned, but i get the
    'error loading DLL - application has failed to start because application config is incorrect'.
    can you please verify if .NET is not causing me issues? i think DLL assembly should be the same wheather it's VStudio6
    or .NET, but can anyone confirm that's not the issue? Thanks...

    Yes.
    If you dll is generated by C/C++, using Call Library Function node.
    If it is generated by .net, using constructor node.
    http://forums.ni.com/ni/board/message?board.id=170&message.id=206959#M206959

  • Calling a Function node in a DLL to give force-feedback effect to a joystick (using DirectInput)

    Hello,
    I have been working for a couple of weeks on writing a DLL in Visual C++ Studio. My intention is to write an exported function in the DLL to initialize a Logitech Force3Dpro joystick, setup a force feedback effect and run it using DirectInput. I would like to control this force feedback effect (in particular, the intensity of the feedback) from Labview by calling the function in the DLL.
    I followed the FFConst example in Microsoft SDK DirectInput Samples for making an .exe file to setup and run force feedback effects. I have been able to build the DLL successfully with an exported function that can be accessed from Labview by "Call a function node". I tested the function by running simple functions such as addition and multiplication of integers, andconfirmed the fact that the DLL was built correctly. I have also included the DirectInput code for initializing and running the force feedback effect. I am able to compile and build the DLL with no problems.
    The Problem:
    The only problem that I have at this point is with setting SetCooperativeLevel for the DirectInput8 joystick device. I have to provide a top-level window handle to SetCooperativeLevel so that I can give the function exclusive access to the joystick. Since I am not making a window and am building a DLL, I am not sure what handle I am supposed to provide it so that the joystick can respond. I am not sure if passing a handle to the Labview window would work because it is accessing the DLL's function? I tried passing LabView window handle to the function and read the X-axisposition off the joystick, but it read some junk (huge long integer) - which lead me to believe that the problem is something to do with initializing the joystick.
    For all practical purposes, I am a complete novice at DirectInput
    programming and working with Visual C++. Although, I have programmed in
    C++previously. I am sorry for the long message, but I wanted to give a bit of background so that my aim is clear.
    Any help, advice or direction with this problem be very much appreciated. Thank you for your time!
    Cheers!
    Abhishek

    Hi,
    This gave me the nudge in the right direction I needed, after a bit of basic frameset research I've got the desired functionality.
    Huge thanks!

  • Can LabVIEW call a function from a .sys file or is LabVIEW limited to dll access?

    My vendor has sent me a .sys file with functions accessing their hardware.  Can i call these function from labview directly or do I have to wrapper the .sys with a dll?

    Well a sys file is a kernel device driver. LabVIEW does not have any direct way of accessing such a driver. The way kernel drivers are accessed is usually through a DLL which makes calls to WinAPI functions such as CreateFile(), ReadFile(), WriteFile(), CloseHandle() and DeviceIORequest(). Since these WinAPI calls are basically just DLL calls too, you could theoretically use the Call Library Node to call them and access the kernel device driver in such a way.
    However for any kernel device driver with more than one or two device driver calls, it will certainly be easier in terms of development, debugging and maintenance of the code, to write actually a dedicated DLL in C/C++ for this device driver and access that DLL from LabVIEW, especially if you consider the LabVIEW datatype limitations when designing the DLL interface (Basically this same DLL can then be called from any other Windows development environment, be it Visual Basic (similar datatype limitation as LabVIEW), Delphi, (Visual) C, LabVIEW or also various scripting environments like Python and Lua.
    Some of the necessary WindAPI calls are rather involved and pose quite a bit of trouble to get the parameter data right in LabVIEw.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

Maybe you are looking for