07-30-2009 03:55 PM
Hi All!
How I can run vi from DLL without waiting? I tried way via open reference->invoke node but unsuccessfully... The vi opened but not running.
Help, please.
Kind regards Oleg.
07-30-2009 05:24 PM
I'm not sure: is the DLL written in LabVIEW?
In any case, if you OPEN VI REFERENCE then you get a VI reference to an open VI (unless an error occurs).
To run the VI, feed that reference to an INVOKE METHOD function and choose the RUN VI method from the list.
Or you can CALL BY REFERENCE, that's an older way, I don't know the exact name of the function.
But just OPENING it is not enough, unless the VI is set to RUN ON OPEN (VI properties).
Blog for (mostly LabVIEW) programmers: Tips And Tricks
07-31-2009 02:42 AM
Yes, I do! The DLL written on LabVIEW, of course.
Your idea does not works. I tried several variants to run VI from DLL via InvokeMethod. The main strange is VI status. It "Running" after open panel always, but VI not start really. I got error "illegal state of vi", if I try unconditionally invoke "run" method.
Oleg.
07-31-2009 03:46 AM
Hi Oleg.,
please explain where you vi is located and what you try to do. What have you done so far? Can you show your code?
Mike
07-31-2009 08:35 AM
Hi MikeS81,
Mainly, I need manual control apperance of vi with UI (placed in DLL) via external vi and I need run VI with flag "Waint until done"=False.
I attached simply project with tests. You can look sources of VI test[1234].vi and my short comments inside.
07-31-2009 08:46 AM
Hi OlegUA,
why do you read the vi refnum from the dll. Normally you would write the dll with function which control the view. One function to show the window, another one to hide it, one to write values and so on. To show you vi, you can create a function (also part of the dll) which dynamically calls the view with the "wait until done" flag set to false. Store the reference to your view in a buffer (inside of the dll) to use this refnum to close/hide the window.
If you write it like i explained, then you can also use your dll with other programming languages not only LabVIEW.
Mike
07-31-2009 09:17 AM
No, Mike,
I tried it. Please, look for run_panel_test.vi inside DLL and uncomment the code with algorithm like you proposed. The panel appeared but not running 😞
Oleg.
07-31-2009 10:13 AM
07-31-2009 12:41 PM
Hi OlegUA,
see the attached example.
Mike
07-31-2009 02:47 PM
MikeS81 wrote:Hi OlegUA,
see the attached example.
Mike
Wow! It's works!
Mike, thank you very much. But, what I did wrong? I found only one difference: open vi reference by full path vs relative....
Oleg