Dll in lv7

Use the CALL LIBRARY FUNCTION to access a function in a DLL
Attachments:
DLLQuestion.txt ‏1 KB

There is one of two ways.
First write or modify the function to be more "LabVIEW friendly" LabVIEW can pass you a pointer to a c string and the function can fill in the body(be careful to allocate space in the labview string before calling) but it can not move memory for you. For a pointer to a pointer or a returned pointer, either your routine must do the moving or if the memory pointed to is static, you can call a windows DLL function to move the memory into labview space. It may be most straight forward if you write a "helper" routine (first option)
Stu McFarlane
Viewpoint Systems, Inc.

Similar Messages

  • Error in calling LV7.1 dll from VS2003

    Hi everyone,
                       I developed a dll in LV7.1. I am trying to call this dll from VS2003. When a function that is in the dll is called, it throws an exception (Unhandled exception at 0x7a04f1e9 in numtest.exe: User breakpoint).
    Some help will be appreciated.

    WS Binding: exception durign SOAP invocation: java.util.NoSuchElementException
    Looks like the error is in the data sent to or expected from the service in your composite. Check that audit logs and composite flow to make sure your soap message when using soapui matches what you are working with in soa suite.

  • Create file in dll (LV version conflict)

    Hey all,
    I want to do a very simple thing in a VI, which is build in a dll. The VI should create a file.
    It works if I compile the dll in LV7.1, and then call the dll in LV7.1. If I call it from LV8.6, a fatal error is generated, and LV dies. If I compile the dll in LV8.6, the same happens if I call the function in LV7.1.
    Where is the failure? The atttached screenshot is the VI in LV8.6.

    Hi Raphi,
    yes, it's right. As an example I attach a screenshot of the error, when I call the 8.6 dll in 7.1. It's in German, but MemoryManager.ccp Line 437 should be undersotood :-)

  • Make current values default in dll

    Hello,
    I build a dll in LV7.1. There is a function (.VI), where I have to open a reference of another VI, modify its default values on somel controls, then somehow save and close the reference.
    This means, that if I use another function of my dll, which function needs those modified values, the new values are used. Is there any way to do it?
    I tried to use the invoke node "Set Control Value" on a static VI reference of the VI.  The changes are made on the controls, but the lifetime of my changes ends, if the dll is unloaded. Then I have to do the changes again.
    I know, that a dll cannot be saved through a function of it, with new values. But what is the solution? Globals in the dll?
    regards
    Mitulatbati

    Well, the idea would be to read/write the file only once.... So you would create an FGV/AE to read the settings at the call of the first function of the dll, keep the values until the last call will use the FGV/AE to write the settings back to file.
    This change could possibly require a certain "setup" and "shutdown" routine in your dll which must be called from outside when using the dll. And it for certain creates issues if the dll is used without proper usage of those functions.
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Dynamic user data in execution context

    Hi,
    I need to call to an USB-driver-DLL via LV7 in parallel running excutions (modified parallel process model with several test sockets).
    I get a DevHdl after opening the driver from every instance (execution).
    Is there an elegant solution to keep this handle in the context of every execution? I dislike the idea of keeping an array of handles in a station global and access it with the test socket index or to maintain a chain of parameters 'handle' throughout all the sequence files involved in that calls.
    Any ideas?
    Greetings from Germany!
    Uwe

    Uwe -
    When I here someone saying they want to create dynamic variables associated with an execution in TestStand, I believe they are talking about using subproperties under Execution.RunTimeVariables. I cannot think of any better way to do it within TestStand.
    As to why your VI calls appear to crash quietly when using this DLL and TestStand, I have no ideas. The first path to debug this would be to attach a debugger like MSVC to the process that goes away to see what might be going on. Minimally you should be able to catch the exception that is causing it to crash, see what type of exception it is, and to see the minimal stack trace to see where the crash is occurring. Sometimes this type of information can lead you to the next level of de
    bugging. If you have source for the DLL, then you can possibly see more details if the crash occurs inside the DLL source code.
    Scott Richardson
    Scott Richardson
    National Instruments

  • How to transfer data between a multi-thread dll build with LV7 and MS C++, using envent programing method.

    It is easy to transfer data between a simple input/output dll build with LV and an external code like C++, but when data are available inside a loop running in the dll(in fact thread running in LV); How can I read them or receive an handle pointer to the calling C++ application when new data are ready.

    If you're using LabVIEW 7, you can use the PostLVUserEvent function to fire an event for an event structure in LV. Refer to the Using External Code in LV manual.
    Or you could use datasocket for this. The datasocket activex dll is nids.dll. You could have the class wizard generate wrappers for you or if you have Measurement Studio, you could use the custom wrappers it provides to communicate between the VI and dll.
    I hope this helps
    Bilal Durrani
    NI
    Bilal Durrani
    NI

  • How to make an apllication in LV7 which using a DLL ?

    My vi application call a DLL, it runs ok offline, I want to make it running
    on a CVS, so how can I include the DLL when making the appliaction.
    thanks.

    My interest is in building a stand-alone application or an exe file. The DLL
    was generated using Visual C++. It works alright off-line. I just want to
    build an exe with the DLL included so I can run it on the CVS or any other
    platform. Do I need to copy the DLL to the CVS? What if the platform does
    not have sufficient storage media?
    "jdigiova" wrote in message
    news:[email protected]..
    > What DLL are you calling? Is this DLL something that you wrote? What
    > programming environment did you make the DLL? Are you getting an
    > error when you download a VI with this DLL? What is happening?
    >
    > In general, a DLL will work in RT if that DLL does not make any
    > unsupported Windows API calls. If you have
    CVI you can develop a DLL
    > using the build option to make it compatible for RT. This will inform
    > you if you are making any unsupported calls.
    >
    > Joe D.
    > National Instruments

  • Dlls working fine in LabVIEW 6.1 dont do so in LabVIEW 7.0

    We are using the following dlls from Microstar Labs for one of our
    Microstar DSP boards :
    a. DAPIO32.dll : DAPcell client I/O library
    b. Diostub.dll
    We use these in the main Vi called DAPControl.vi
    We currently run this VI in LV 6.1 - its working fine for the last several months. When we open this VI in LV 7.0 the VI loads (i.e. there is no problem reported by LV as far any subvi/dll is concerned), but during run time it gives an error. Specifically the Function DAPLinePut does not work - when trying to input offset values & set display.

    Hello MKris,
    Thank you for your question regarding executing a VI written in LabVIEW 6.1on LabVIEW 7. You mentioned that the VI executes correctly in LV6.1 but gives an error when executed in LV7. I am not familiar with the functions of Microstar you are using and I might be more equipped to help solve your problem with some more information about the problem that you are having. Could you possibly provide a screen shot of the error or some sample code that demonstrates the problem in the simplest way possible?
    Shea C.
    Applications Engineering

  • How to call a VB dll with boolean parameter in labview

    hi ,
         I havea problem with labview calling dll.
         I need to call a customer's dll(VB) , but I find labview have no  boolean type parameter, so how can I do it ?
         I have used labview 7.1 and only have dll without source code.
    sonic
    Sonic
    Diffrent Strokes for Different Folks

    hi   semercurio :
        I have bulid a dll by lv 7.1 with boolean and  then call lt  from LV7.1,but i have some issue of it .
        I also use U8 and I16 type and all pop up a errer message,you can see it from accathed.
        do you have any suggestion about it ?
    Sonic
    Diffrent Strokes for Different Folks
    Attachments:
    15.JPG ‏17 KB
    SharedLib.h ‏1 KB

  • How to register a dll written in LV?

    Hi LV'ers,
    I have written a simple dll in labview and I am trying to register it using regsvr32.  I get the following error message:
    "Test was loaded, but the  DllRegisterServer entrypoint was not found.
    Test does not apppear to be a .DLL or .OCX file"
    (Test is the name of the dll I created).
    Is it possible to create labview dll's that can be registered in this way?
    I have attached my example code (LV7) ....
    Thanks,
    mr_e_cat
    Attachments:
    dll test.zip ‏23 KB

    Why are your trying to run regsvr32? You normally use this to register OLE or ActiveX controls and a LabVIEW dll is neither.

  • Interfacing LabVIEW to the GetFileTime function in kernel32.dll

    I am attempting to get the creation date/time of a file. The GetFileTime function inside kernel32.dll seems like a good choice. It requires a handle to the file, so I open the file, typecast the refnum to a U32 and pass the U32 to the Call Library function node. The outputs I expect are pointers to strings, so I use the C string pointer.
    I am at a loss of why this doesn't work. I have my crude VI (LV7.0) attached.
    Attachments:
    Get_File_Times.zip ‏13 KB

    Hi,
    If you use GetFileTime, the handle has to be opened with:
    HFILE OpenFile(
    LPCSTR lpFileName, // file name
    LPOFSTRUCT lpReOpenBuff, // file information
    UINT uStyle // action and attributes
    LV's file handle is not compatible!
    Also, this function is tricky. lpCreationTime is not a pointer to a string,
    but a pointer to a FILETIME structure. You should provide it with pointers
    to clusters with two U32's in it. You can do this by making a cluster with
    two integers in it, and wire it (three times) to the dll. The dll has to be
    configured as "adapt to type".
    You should convert the FILETIME structures to SYSTEMTIME's with:
    BOOL FileTimeToSystemTime(
    CONST FILETIME *lpFileTime, // file time to convert
    LPSYSTEMTIME lpSystemTime
    // receives system time
    Regards,
    Wiebe.
    "Mark Borodkin" wrote in message
    news:[email protected]..
    > I am attempting to get the creation date/time of a file. The
    > GetFileTime function inside kernel32.dll seems like a good choice. It
    > requires a handle to the file, so I open the file, typecast the refnum
    > to a U32 and pass the U32 to the Call Library function node. The
    > outputs I expect are pointers to strings, so I use the C string
    > pointer.
    >
    > I am at a loss of why this doesn't work. I have my crude VI (LV7.0)
    > attached.

  • Array output of a Labview dll

    Hi all,
    I haven´t found the solution in the posts of this forum, if somebody has, please inform me.
    I want to output an array from a dll compiled in LV7.1. It doesn´t work. I have tried all the combinations of Array Data Pointer & Array Handle Pointer, and the two calling conventions, and it doesn´t work. My output array (Y) is always the unchanged input array. Any idea?

    Whithout having your DLL it's difficult to say why your code is not working. There are different ways to pass array data, please also have a look at the examples that are contained in LabVIEW.
    You can also find a pretty good tutorial here 

  • LabVIEW crashes when calling a dll

    I am trying to call a dll through my LabVIEW program. The dll implements a routine to access an ftp server. When the server is found, everything works as expected. However, if there is a delay in finding the server, LabVIEW throws an error � �An exception occured within the external code called by the Call Library Node�. The detailed error message is attached here.
    The dll function times out after 25 seconds if the server is not found (it returns a signed integer). This error message pops up after roughly 20 seconds.
    The dll was created in VC++ 6.0. It uses standard MFC calls.
    Any information about why this could be happening will be appreciated.
    Thanks.
    Attachments:
    LabVIEW_error.jpg ‏14 KB

    Hi,
    If you call a dll, everything should be just right, or it will crash (if you
    use LV7, you're lucky, most of the times LV stays alive, and only gives a
    message).
    The first thing that should be checked is the calling convention. This
    should probably be "stdcall (API)". This changes the way the parameters and
    return address are pushed to the stack.
    The second point are the parameters. Pointers should be set to pointers,
    LONG to i32 etc. The return parameter can always be set to i32, or to
    nothing.
    My best guess is (since the dll crashes after a while), there should be a
    pointer to a buffer (most likely a cluster, but could be a reference). The
    connection succeeds, and the dll copies the information to the pointer. If
    the pointer is not valid (the memory does
    not belong to LabVIEW), an
    exception is raised.
    Perhaps you can give a function prototype? The prototype is the way to
    start.
    Regards,
    Wiebe.
    "gopinath" wrote in message
    news:[email protected]..
    I am trying to call a dll through my LabVIEW program. The dll
    implements a routine to access an ftp server. When the server is
    found, everything works as expected. However, if there is a delay in
    finding the server, LabVIEW throws an error - "An exception occured
    within the external code called by the Call Library Node". The
    detailed error message is attached here.
    The dll function times out after 25 seconds if the server is not found
    (it returns a signed integer). This error message pops up after
    roughly 20 seconds.
    The dll was created in VC++ 6.0. It uses standard MFC calls.
    Any information about why this could be happening will be appreciated.
    Thanks.

  • Pass error cluster from labview dll to teststand

    Hello,
    I just want to pass an error cluster from a dll compiled in LV7.1 to TestStand 3.1. I never receive the contents of the LV error cluster in TS. I compiled my function with standard calling convention option, this should work. In my VI I generate only an error and pass to error output.
    LV Settings:
     TS settings:
    regards
    MB

    MB,
    please follow the info in this KB:
    http://digital.ni.com/public.nsf/allkb/22BF02003B4588808625717F003ECD67?OpenDocument
    Please note that using "By Value" will never return any values to TestStand!
    You cannot use the default error-container in TestStand to receive data from the LV error cluster if you compile the VI into a LV DLL.
    So either you choose to follow the KB or you split up the error cluster in your LV VIs to return error.occurred (boolean), error.code (numeric i32) and error.msg (LV String) .
    hope this helps,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Why is my deployed application not executing functions from an external .dll?

    My application executes python scripts via function calls made to the python C/API, python24.dll.  It works fine in the development environment, but my deployed application does not seem to find the .dll since the the application crashes at what seems to be the first attempt to access the python shared library.
    I believe I've included all the necessary support files.  LV automatically included python24.dll into the installer.  And I've tried to make all the paths to script files and other support files point to where the app.exe is located...some debugging windows have shown the paths to be correct in the deployed app.  The call library function nodes are configured to find the python .dll in the win\system32 folder.
    I feel like I'm missing some step in the build process since it works in the development environment, but perhaps there is some other trick using CLFN's that I don't understand.
    I using LV7.
    Thanks.

    Hello CraigerB,
    It seems like you are doing everything the right way. Click on the following link for a related discussion forum post.
    Here is what you can try:
    1. Place the dll in the C:\WINDOWS\system32 on your development machine.
    2. Make sure your Call Library Function Node VI is pointing to C:\WINDOWS\system32\python24.dll
    3. Build your executable
    4. LabVIEW will not make a copy of your python24.dll because it will treat it differently
    5. Manually copy the python24.dll to the target PC's C:\WINDOWS\system32\
    6. Make sure you have all supporting files for your python24.dll to insure the dll itself is working.
    7. If you are using relative paths to call your dll, switch to hard paths, or take a look at this KB for relevent information.
    Hope this helps!
    Kalin T.
    National Instruments

Maybe you are looking for

  • Editable field in ALV GRID/LIST

    Hi All, I developed an alv program in which 10 rows is there. In alv grid/list first column is check box. I want 1,5 and 10th row is editable for first column (check box) while rest is not editable. Can you please give solution for same. Please tell

  • How do you downgrade to a previous version of firefox?

    How do you down grade to a previous version of Firefox on an Android Phone? Current versions of Firefox no longer work with our WIFI network. Starting sometime around version 33 or 34 we started noticing that while using WIFI, Firefox would freeze ev

  • About vertical format (iBooks Author)

    Hello people! This is my first entry, but not the first time I check for your support. This is because I can't figure something out, so you might help me a little. This is my problem: some creative son of his/her mother decided to propose vertical co

  • How to change data in an inbound delivery

    Hi, I want to change the following data in an Inbound delivery: Challan No (LIKP-LIFEX, LIKP-VERUR) Date (LIKP-LFDAT, LIKP-ERDAT) Quantity (LFIMG) I have gone through the thread how to change delivery date (LFDAT) in a inbound delivery But still, it

  • MOVED: Problem with GX700 with nvidia gt9600m 1gb pls help

    This topic has been moved to MSI Notebooks & Netbooks. https://forum-en.msi.com/index.php?topic=173753.0