LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop a vi hosted in a .Net assembly from a .Net C# application

Solved!
Go to solution

I used Labview to build a .Net assemlby that contains a VI. I can start the VI operation from my C# .Net application but I can't stop it.

For example, I start broadcasting a signal from a data file. The data file is 20min long. What should I do to stop the broadcasting manually before the VI operation has ended?

0 Kudos
Message 1 of 6
(2,978 Views)

WIth such little information, I would be guessing.  Is broadcasing stopping all other things from continuing?  How about broadcastng smaller discreate sections of the data, and in between, check to see if an abort is requested.

 

 

A

0 Kudos
Message 2 of 6
(2,967 Views)

Thank you for your answer, I understand the solution you suggest.

 

Broadcasing does stop all other things from continuing.

 

What I want to do is to run a Labview project that runs a long procedure from .Net application. I do not want to split the source action into small short actions.

 

The best solution for me is to run the Labview from one thread in the .Net application and to stop it from another thread (run the long procedure asynchronicly).

 

I can start the long procedure in another thread - that way my application does not get stuck, but I can't stop it before the procedure is complete (can I use events with lab view assembly?).

 

Thanks again!

0 Kudos
Message 3 of 6
(2,963 Views)

Well, if you perhaps can expose an interface on the LV side that is a stop which would then set a variable somewhere that is checked before scanning descreate portions the data stream you can effectively have the same thing without breaking the stream up externally.

 

 

A

0 Kudos
Message 4 of 6
(2,958 Views)

That would be great!

 

How do I expose such an interface from the LV?

At the moment all I can do is to expose one function per VI file - that function shold start or stop the VI according to the paramaters I pass from my .Net application.

When I call this function (with or without parameters) from one thread to start, I can't call it again from the same thread or from another thread. The VI wouldn't respond until it completes the procedure.

0 Kudos
Message 5 of 6
(2,954 Views)
Solution
Accepted by topic author SharpInstincts

Right so create another VI.  Have it write to a global variable that the other VI that you are trying to stop will read.

 

 

A

0 Kudos
Message 6 of 6
(2,948 Views)