LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Main VI doesn't stop using channels

I am tinkering on a application structure using channel messages to communicate with worker sub VI's. Right now I face the issue that my Main VI doesn't close even all loops are stopped. I think the reason for this is the remaining SubVI with the green arrow. Any suggestions on that? I was wondering if one has to kill channels, abut I couldn't find a hint on that.

main.PNG

vi idle.PNG

 

0 Kudos
Message 1 of 8
(803 Views)

Yes, the green arrow says it's still running. Use the Channel to send an Exit command that all VI's should adhere to.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 8
(789 Views)

I think this is what I am actually already doing. 

  • First screenshot: Main VI after Shutdown.
  • Second sceenshot: The SubVI with the green arrow

It looks to me the SubVI should be stopped since there is a True on the Stop. So what am I missing here?

0 Kudos
Message 3 of 8
(777 Views)

"my Main VI doesn't close even all loops are stopped"

Then where has it stopped? Somewhere in that sub-VI. Open it and use the lamp.

 

My guess is that a channel reader is waiting and you have no stop message or stop condition, and that that loop has not actually stopped. 

 

Which type of channel reader do you use? some have stop conditions or "last element" that you can use to stop the loop in that VI.

 

Post the code to get better help.

 

 

Certified LabVIEW Architect
Message 4 of 8
(771 Views)

@Quiztus2 wrote:

I think this is what I am actually already doing. 

  • First screenshot: Main VI after Shutdown.
  • Second sceenshot: The SubVI with the green arrow

It looks to me the SubVI should be stopped since there is a True on the Stop. So what am I missing here?


How did the event structure stop? Did it stop?

0 Kudos
Message 5 of 8
(766 Views)

@Quiztus2 wrote:

I think this is what I am actually already doing. 

  • First screenshot: Main VI after Shutdown.
  • Second sceenshot: The SubVI with the green arrow

It looks to me the SubVI should be stopped since there is a True on the Stop. So what am I missing here?


Didn't see this post when I posted.

 

It has not stopped in the loop, it passed out but there is another VI there with a channel input. What is that doing? probably waiting:

thols_0-1698052735717.png

Hard to see in the pic.

Certified LabVIEW Architect
0 Kudos
Message 6 of 8
(759 Views)

After adding a stopped loop around the Sub VI's Event structure the application closed. Somehow LabVIEW choked on that one.

 

So I don't have to close the channels in order to close the application at all.

0 Kudos
Message 7 of 8
(726 Views)

I use Channel Wires (mainly Messenger, Stream, and the occasional Tag Channels) all the time, often with a half-dozen or so semi-independent parallel loops.  Every Loop has a means to stop it, sometimes two independent methods (the Event Loop typically has two, one being a Tag channel in an "occasional" (100 ms) TimeOut case that, when True, stops the While Loop).  The main State Machine, of course, has an Exit State, where it can make sure the other Loops have their exit conditions set (or you can send the "Exit" commands via the appropriate Channel Wire as the State Machine exits).

 

I try to designed these routines so that you can easily "see" the multiple parallel loops (some are only 32 x 32 pixels on the Block Diagram, with Channels coming in and out on the center two top connectors, with conventional Input and Output Channels (or Wires) coming on the left/right edge connectors in the standard 4-2-2-4 pattern).  Everything fits on a Laptop screen ...

 

Bob Schor

0 Kudos
Message 8 of 8
(674 Views)