C++ Call to DLL made in LabVIEW Fails the second time it is called

I have an application where a C++ executive calls a LabVIEW DLL (a LabVIEW application built into a DLL).
The executive calls and operates the DLL fine the first time (NT, the applications task manager shows LabVIEW runtime runs, then stops when the DLL is done. However, when the executive calls the DLL a second time, it hangs, and the runtime engine never shows up in the applications task manager as running.
However, this only occurs when something like IMAQ, DAQ, or another custom DLL call is occurring. We tried it with a simple DLL that only uses a call to the sound VIs, and it seems to run fine, although as the program called is very short, and the task manager slow, we never see the runtime engin
e in the task manager. We are going to put a popup dialog in to ensure that the DLL is being called reliably, but we believe it is.
We are unable to answer why when we call something that uses IMAQ, that the DLL doesn't run right the second time. We are unsure of the reasons, but believe it to be related to thread creation and destruction in the executive.
If anyone out there has any insight into this, we would be happy to see it.
We will be putting in a formal request for support from NI, but wanted to poll the audience as well, as we know from first hand experience that LabVIEW users often times have more experience with this sort of thing than developers.
Thanks a bunch

> Thanks for the information Greg. There is no documentation on this
> issue, except for the email that we got from NI Support. This is
> quite a new realm for us and NI alike. We would like to know what
> your experiences have been on this subject. If you have a bit of
> information, perhaps we should suggest a topic. As I said, this is a
> new frontier for LabVIEW, and there are a lot of things that NI
> doesn't know, and I'm sure a few of the programmers out there have
> figured out.
>
I often answer emails from home, but I work for NI on the LV development
team. So anything I know about, NI knows about. The info I was
describing about the DLL execution system is not well documented since
we were hoping that it would work we
ll with the way Windows Apps are
typically written. I suspect that we will need to write a Tech Note
to cover the nitty gritty. This sort of info gets lost in manuals,
and it is subject to change as we learn how people are expecting to
use it.
Anyway, my post was to explain why your use of it didn't work.
In general, we believe that LV DLLs are thread savvy, reentrant
VIs can be called from multiple threads simultaneously, execution can
continue in the background after the DLL call has returned, and the UI
is live provided the calling app processes messages in that thread.
If you have other issues or questions, just ask.
Greg McKaskle

Similar Messages

  • Error 1172, an error running a VI in the second time call of the DLL

    Hello All,
    I am a beginner in labVIEW.
    I have to write a test program in labVIEW which uses a DLL created by other programmer.
    I called the DLL from my labVIEW to control DIOs, a serial port, communicate with a slave device, perfrom a flashing task.
    While testing the program, I found that the program is OK if I use it just once, however, if I want to run it coninuously using a Do-While Loop, it failed with
    Error 1172.
    As far as I could understand, it seems that the DLL creates a log file in C:\ while it was called for the first time, and the process does not stop taking control of this log file even after the DLL is closed.
    Then when the DLL is called for the second time, it looks for the same log file to write new info but as it was taken control by the previous process, there comes an error.
    Please find the attached files.
    Hope there would be somebody who is able to help me to point out my mistakes in my vi or suggest me a solution for it.
    Thanks and Best Regards
    Aung
    (As the system does not accept the DLL attachment, I changed the extension to .pdf for the DLL File)
    Solved!
    Go to Solution.
    Attachments:
    I Basic Flasher.vi ‏60 KB
    Failure.xls ‏86 KB

    -message deleted -
    Message Edited by Ray.R on 11-17-2009 08:01 PM

  • TS3367 My partner has the Iphone 5 and I am using a MacBook with version 1.0.2. When using the face time app to call him he says that cam freezes and he is unable to hear me. Any ideas of the problem and and ideas for resolving the issue?

    My partner has the Iphone 5 and I am using a MacBook with version 1.0.2. When using the face time app to call him he says that cam freezes and he is unable to hear me. Any ideas of the problem and and ideas for resolving the issue?

    Had the same problem, the only fault and the reason why it happend is a bad wifi connection!
    Could ofc be something else, but thats my two cents!

  • Firefox gets slower with every upgrade & now crashes every time I open a PDF, made worse when opening the next time, by reopening the PDF & crashing again

    Firefox gets slower with every upgrade & now crashes every time I open a PDF, made worse when opening the next time, by reopening the PDF & crashing again

    If you have submitted crash reports then please post the IDs of one or more crash reports that have this format:
    *bp-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    You can find the IDs of the submitted crash reports on the <i>about:crashes</i> page.
    *You can open the <b>about:crashes</b> page via the location bar, like you open a website.
    See:
    *http://kb.mozillazine.org/Mozilla_Crash_Reporter
    *https://support.mozilla.org/kb/Mozilla+Crash+Reporter

  • When making a phone call on my iphone I can hear the person that i am calling but they can not hear me

    when making a phone call on my iphone,I can hear the person that I am calling but they can not hear my voice

    My first new iphone4 was received and installed complete.
    Nothing to hear when i was calling, only when I used loudspeaker.
    complete reset and reprogrammed Iphone, same result.
    Called Apple support and received a new Iphone4 next day.
    Updated and programmed.
    It works.
    2 weeks ago My son's iphone4, same problem, could only call with loudspeaker??
    Anyone an Idea.

  • My new iphone 5s doesn't have any volume when I call someone. I can see from the screen that it's calling the person, but I can't hear anything. I also can bearly hear the person when they answer my call.

    My new iphone 5s doesn't have any volume when I call someone. I can see from the screen that it is calling them, but I cannot hear anything. Also when they answer my call, I cannot hear them.

    Turn the volume up... in call volume and sounds (ring, notifications, etc) are seperate volume controls.

  • Why are not all photos taken with an iphone available on the icloud, even that i made some fotos at the same time. Some of them are afterwards available on fotostream others not

    Hi,
    why are not all photos taken with an iphone available on the icloud, even that i made some fotos at the same time?
    Some of these photos are afterwards available on fotostream others not.
    Thx
    Markus

    If they are in photos view then they are in an event unless you have a corrupted library
    How are you"merging" the photos?
    most common issue is either bad sort (view menu ==> sort events) or bad camera dates
    select one and show event to see the event
    LN

  • Can apple fix my ipad2 twice  for free this is the second time my ipad2 screen broke, now dont calle me careless  brother begs and cries and it's frustrating, all he wants is thomas and friends so i end up getting forced to give it to him, i didnt know.

    can apple fix my ipad2 twice  for free this is the second time my ipad2 screen broke, now dont calle me careless my 3 yr old  brother begs and cries and it's frustrating, all he wants is thomas and friends so i end up getting forced to give it to him,  i  didnt know my brother was still playing with the ipad , and i was watching tv, so my dad comes up it was lying in the floor next to my bro, u couldnt believe how i cried that time because second time...... my mom was very very dissapointed , and so am i , so will apple be able to fix my 1pad 2 wifi only16 gb for free again, i barely have enough money to repair, because my mom brought another one. im really sad  bc it took alot of sacrifice from my parents to buy me this ipad, i dont think i deserved that : ( plz help , or give me any other options.

    If you mean your iPad got stepped on and the screen physically broke, I think it extremely unlikely that Apple will replace it again for free. They weren't obligated to do so the first time, as apparently they did, and almost certainly not going to do so twice.
    Sorry, but I think you'll just have to live without your iPad until such time as you can save up enough money to pay for repairs. There are independent iPad repair services that may be able to replace the screen for less than Apple's replacement charge, though I can't say with certainty. Do a web search for "ipad repair".
    Regards.

  • How can i hide phone apps so that if kids take my mobile the couldnt be able to make calls. At the same time when someone call me I could be able to attend call. is there any control to lock phone's apps or hide it.

    how can i hide phone apps so that if kids take my mobile the couldnt be able to make calls. At the same time when someone call me I could be able to attend call. is there any control to lock phone's apps or hide it.

    Hi there
    Apple doesnt give this feauture and there are certain apps in app store under utilities which provide password facility under this app and u can store photos videos and orther stuff and lock so
    Kids will be not able to access this single app ortherwise there is no such feature of locking apps feature given by apple
    <Edited By Host>

  • Input parameter setting when calling a DLL(Built from LabVIEW and a kind of VISA communication driver) in Teststand.

    In labVIEW7.1 I wrote a COM port communications driver by using "VISA Write/Read". I put a string as the input of "VISA Write" and made it the input of the whole vi. Then I converted the vi into a DLL, which is called in Teststand3.1 by specifying DLL adapter. In "Edit C/C++ DLL Call" dialog, I pass a message of "60 6A 94 80 86 81" as the input parameter. My problem is I tried three kinds of methods to pass the message, see attached 1.jpg,2.jpg and 3.jpg. and found the first one sometimes doesn't work, the second work fine and the last doesn't work all time. I don't know why the first one and last one don't work well.
    Thanks!
    Jacky
    Attachments:
    31.jpg ‏38 KB
    11.jpg ‏36 KB
    21.jpg ‏49 KB

    Hi Srinivas,
    Just another note, I noticed that the Math Interface Toolkit version (MIT) 1.0 is not compatible with LabVIEW 7.1. You’ll need version 1.0.1. of the MIT toolkit in order for it to work with LabVIEW 7.1.
    The LabVIEW 7.0 lvanlys.dll is also attached. I had to rename it with a .txt extension, so you’ll want to delete the extension.
    Kileen
    Attachments:
    lvanlys.dll.txt ‏516 KB

  • Error in Calling a dll built in labview from Matlab standalone

    hello,
    The problem I encountered is in the use of the math interface toolkit. I
    created a dll which performs data fitting using a labview vi which i converted into a dll using the
    math interface toolkit.
    This dll is then called from a standalone matlab program. It works fine in the computer where I
    create the matlab standalone program and labview dll. Howerver when i export to another
    computer the matlab part runs fine but an error is reported when it tries to
    call the labview created dll.
    "One or more output arguments not assigned during call Parfit.dll"
    The files related to this problem in the math interface toolkit (the labview vi, the corresponding dll and the matlab .m and .fig files and the standalone exe are in the attachment and named MathITproblem.zip
    The matlab run time engine(for matlab 7) and labview runtime engine(ver 7.1) must be installed for this matlab file to run. the run time engines are downloadable from the web.
    Does any one know the source of this error or encountered it before?
    thanks
    Attachments:
    MathITproblem.zip ‏1263 KB

    Hi Srinivas,
    Just another note, I noticed that the Math Interface Toolkit version (MIT) 1.0 is not compatible with LabVIEW 7.1. You’ll need version 1.0.1. of the MIT toolkit in order for it to work with LabVIEW 7.1.
    The LabVIEW 7.0 lvanlys.dll is also attached. I had to rename it with a .txt extension, so you’ll want to delete the extension.
    Kileen
    Attachments:
    lvanlys.dll.txt ‏516 KB

  • Calling a dll made with LV6i

    HI,
    I use C++ builder and I want to call a dll which was made with LV6.
    When I try to run the programm i get this error message:
    Access violation at adress 30193AC6 in module 'LVRT.DLL'. Read of address
    FFFFFFFF.
    someone knows about it?

    I'm using MS VC++ 6 and I have some similar problem with LV build DLLs using the example from the Developer zone.
    The problem does no longer occure after I have updated to LV 6.0.2.
    Maybe this will solve your problem too.
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • Calling a DLL with a & (ampersand) in the declaration

    Hi,
    I'm trying to call an external DLL and having issues calling an important function.  The 'FindDevices' call has the following declaration:
    long FindDevices(long &DeviceCount);
    I've never come across calling an external function with an ampersand (indicating that a reference, rather than a pointer, shall be passed) before.  Is this possible with LabView?
    I've tried many permutations of the DLL configuration, but it usually crashes the entire development environment.  Here is a link to the DLL and *.h file if you'd like to give it a shot.  It's a 64-bit DLL, and I've been developing this on 64-bit Labview and Windows 7 x64.  It also requires the configuration file 'ZStepperSettings.xml' to be in the same directory as the DLL.
    Thanks for your time.
    Attachments:
    ZStepper_SDK.h ‏6 KB

    For scalars the C++ reference syntax should be equal to a standard C pointer. For other datatypes that is certainly not guaranteed. Since long is a scalar I would guess the problem to be elsewhere. Are you sure the calling convention is correct?
    Also the effect that it only causes the 1097 error sometimes, as well as crashing only sometimes is not so strange. There is no supervisor that can 100% surely detect if there is some memory violation during a call to an external function. Eventhough the parameter configuration is wrong or the DLL does something bad, this doesn't always result in a behaviour that LabVIEW could detect or would always cause a crash. It depends on the actual memory layout of your process at the moment this function is called if the error will be causing one of these problems. But be assured that if there is an error in how the function is configured or a bug in the function about how it access the memory especially for writing operation, something bad is done to the memory that will sooner or later cause very serious problems to your application.
    EDIT: It seems that while C++references for scalar types are usually implemented as pointers by the compiler, there is nothing in the C++ standard that mandates this nor defines in any way how they should be implemented. So basically C++ references are not a safe datatype to use if you want to allow a function to be callable by anything else than code compiled with the same C++ compiler. Basically anything C++ specific is not safe at all in that sense. And anything standard C conformant mostly only by convention and not by specific requirements set forth in the C standard.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • DLL Call doesn't work the second time

    The first time I open the VI, it runs properly. Why doesn't doit the next time I open it.
    Attachments:
    PGS67Open.llb ‏72 KB

    Dobi,
    Please post the dll. I cannot run your code without it.
    Also, the problem may be that you cannot call this twice, without first 'closing' the device. You may be trying to use resources that are already in use. This would be the same as opening a daq session that is already in use.
    Try that, and if you can't get it working still, post the code or some more information.
    Good luck

  • Calling jvm from c++ code fails the secnd time

    Hi all,
    i have a dll which calls java code thru jni.
    for the first time i am able to successfully call the jvm.
    when i execute 2nd time jvm crashes
    though i destroy the jvm for the first time.
    looks like it doesnot load all native method.
    below i have listed the verbose of jvm loading secnd time.
    please advice me if i need to use any technique in loading the jvm.
    thanks in advance
    [Dynamic-linking native method java.lang.Float.intBitsToFloat ... JNI]
    [Dynamic-linking native method java.lang.Double.longBitsToDouble ... JNI]
    [Dynamic-linking native method java.lang.Float.floatToIntBits ... JNI]
    [Dynamic-linking native method java.lang.Double.doubleToLongBits ... JNI]
    [Dynamic-linking native method java.lang.Object.registerNatives ... JNI]
    [Registering JNI native method java.lang.Object.hashCode]
    [Registering JNI native method java.lang.Object.wait]
    [Registering JNI native method java.lang.Object.notify]
    [Registering JNI native method java.lang.Object.notifyAll]
    [Registering JNI native method java.lang.Object.clone]
    [Dynamic-linking native method java.lang.Throwable.fillInStackTrace ... JNI]
    # HotSpot Virtual Machine Error, Internal Error
    # Please report this error at
    # http://java.sun.com/cgi-bin/bugreport.cgi
    # Error ID: 455843455054494F4E530E43505000DE
    # Problematic Thread: prio=139238232 tid=0x84c9b58 nid=0x0 runnable
    #

    Hallo,
    if I understand your problem correctly, you are creating the JVM, doing something, calling DestroyJavaVM() and then creating the JVM once more. You cannot do that! See: http://java.sun.com/j2se/1.3/docs/guide/jni/jni-12.html#DestroyJavaVM . The solution is just to create the JVM once, when you first need it. You can then reuse it as offen as you want.

Maybe you are looking for