LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How I can run vi from DLL without waiting?

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. 

0 Kudos
Message 1 of 11
(3,232 Views)

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

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 11
(3,221 Views)

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. 

0 Kudos
Message 3 of 11
(3,202 Views)

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

0 Kudos
Message 4 of 11
(3,191 Views)

Hi ,

 

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.

0 Kudos
Message 5 of 11
(3,182 Views)

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

Message 6 of 11
(3,180 Views)

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. 

0 Kudos
Message 7 of 11
(3,173 Views)
http://vlaurie.com/computers2/Articles/rundll32.htm will help you out. It worked for me 


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 8 of 11
(3,161 Views)

Hi OlegUA,

see the attached example.

 

Mike

Message 9 of 11
(3,149 Views)

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....  Smiley Surprised

 

Oleg 

0 Kudos
Message 10 of 11
(3,140 Views)