LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MultiThreading: To stop the program

Hello,

 

I have a dll which has following functions: "MainFunction" ,"Cancel" etc,. When the function "MainFunction" is executed it get's stuck and doesn't come out. In this case the documentation of dll says to run the "Cancel" function in separate thread to cancel the operation. I tried running two while loops in parallel but this didn't work. Would any one help how to do this and are there any examples to describing the multi-threading.

0 Kudos
Message 1 of 9
(2,762 Views)

By default, dlls called with the "call lirbary function node" run in the UI thread, meaning they both will run in the same thread. Make sure that your CLFN setup specifies to "run in any thread" (the node will change color from orange to tan).

 

Just a guess...

0 Kudos
Message 2 of 9
(2,738 Views)
Right click on the dll and in the properties check that multithreading is allowed. One clue, if the dll is orange then it is single threaded, if it is yellow it is multithreaded.

Mcduff
0 Kudos
Message 3 of 9
(2,735 Views)

Thankyou. I have selected the thread property as "Run in any thread". My idea is to run in two while loops parallelly and if I call the "Cancel" function it should terminate the program. I don't know whether I am proceeding in the right way or not. Would you please suggest how to acheive this?

0 Kudos
Message 4 of 9
(2,720 Views)

That seems reasonable.

0 Kudos
Message 5 of 9
(2,709 Views)

Please use the NI Example Finder integrated in LabView and search for multithreading.
Please let me know, if you need more help.

 

Greetings

0 Kudos
Message 6 of 9
(2,658 Views)

@Lisl wrote:

Please use the NI Example Finder integrated in LabView and search for multithreading.


Which example did you have in mind? I could not find a multiuthreading sample dealing with a CLFN.

0 Kudos
Message 7 of 9
(2,620 Views)

@Lisl Sorry I couldn't find a single example which explains about the Multithreading especiallly for the dll's. WOuld be great if you you provide one such example.

0 Kudos
Message 8 of 9
(2,599 Views)

Hi,

I am sorry for this misunderstanding, there is no multiuthreading sample dealing with a CLFN.

I thougt you are searching for the basics of multithreading.

Have you alredy found a solution by now?

 

Greetings.

0 Kudos
Message 9 of 9
(2,544 Views)