LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I obtain a vi reference in a dll

I want the DLL to run a main loop and allow the calling program to call vis to control it. I'm having trouble loading the vi server reference once compiled.

0 Kudos
Message 1 of 10
(3,841 Views)

The Open Vi Reference does not work when compiled.

0 Kudos
Message 2 of 10
(3,837 Views)

Looks like I got it to work.

0 Kudos
Message 3 of 10
(3,832 Views)

Steve,

others might find it helpful if you shared the solution you found here.

Kind regards

0 Kudos
Message 4 of 10
(3,810 Views)

I had to use a text string instead of file path. The problem I have now is that the DLL is only running single thread and the GUI is not accepting user input. Is there a way to enable this?

0 Kudos
Message 5 of 10
(3,800 Views)

Please provide more information. What language is the calling program written in? Is it the LabVIEW GUI that isn't accepting input? What do you mean by "not accepting input" - the GUI appears, but you can't click anything in it? Or something else? Have you tried enabling remote debugging, then connecting to the running VI from the development environment? I'm pretty sure this works for VIs inside DLLs, although I haven't tested it.

0 Kudos
Message 6 of 10
(3,792 Views)

The dll is a labview compiled dll. Once I exit the launching call, the GUI appears but does not accept mouse clicks on any of the buttons.

0 Kudos
Message 7 of 10
(3,758 Views)
Is there any continuously-running loop in your DLL so that the UI can respond to user interaction? If not, then of course it won't respond. In order to have a loop in the DLL run in parallel with your other code, the calling code needs to spawn a separate thread, then launch the DLL loop in it.
0 Kudos
Message 8 of 10
(3,749 Views)

It is a standard event based queue driven state machine. I opened it this way but opted not to wait for the vi to complete and did not close the reference.

 

https://decibel.ni.com/content/docs/DOC-3413

 

It turns out that the GUI will lock up independently of whether it is compiled into a DLL so I don't know what else could be the cause.

 

0 Kudos
Message 9 of 10
(3,742 Views)

If I understand correctly, you're calling a DLL built in LabVIEW, from LabVIEW? Why? If you do the same thing but without building the called VI into a DLL, it still "locks up" the same way? Can you create a simplified example the demonstrates the same problematic behavior?

0 Kudos
Message 10 of 10
(3,724 Views)