LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop a sub VI from main VI

Solved!
Go to solution

hi,

I am also new in Labview.

But looking at your screenshots I found that

1-your SubVI has an Event structure without any while loop. (Should be avoided Event should be inside While loop).

2- Event structure doesn't have timeout value. (Place a while loop and connect a yimeout value).

I think this should solve your problem.

Labview user
0 Kudos
Message 11 of 41
(1,454 Views)

One more thing, In your main VI you have several while loops whose closing condition is false. How are you closing your main VI?

Labview user
0 Kudos
Message 12 of 41
(1,454 Views)

Yes, this was my first attempt.

Now I have a while loop for the event structures, but I don't need the timeout. If the subVI stopped for a timeout my program wouldn't have sense!

And the main VI in only a change in multiple connections-server.vi example.

I think that my problem is that I have a control reference and not a variable reference (so it works with a button but no with a variable).
I read examples posted here but there are too much difficult for me, because I'm a beginner Smiley Sad
I don't know how to put these informations on my program...

0 Kudos
Message 13 of 41
(1,448 Views)

I would suggest add a timeout value let's say 100 and see the result.

Labview user
0 Kudos
Message 14 of 41
(1,443 Views)

@Aojha wrote:

I would suggest add a timeout value let's say 100 and see the result.


While I admire your wanting to jump in and help people you really should take some time to learn LabVIEW first before giving advice. You are just starting out yourself and the advice you have given doesn't really address any of the users issues and are basically just reiterating general comments picked up from the forums. A timeout is not required on an event structure unless you require some processing to occur on a regular basis. Adding one just because will not solve any of the issues the OP is encountering. If you are suggesting the timeout be used to check for the stop condition then this is not a very good approach. You turn an event driven system into a polling system which means your task is never idle. Polling loops are generally not recommended over an event driven system.

 

 What I would recommend for the OP to look at would be to use user events to stop any subVIs that contain event structures. If a subVI does not have an event structure the recommended methods of stopping the loop with the subVI would either be using a queue or a notifier. A more basic approach would be to use a functional global.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 15 of 41
(1,427 Views)

In your main VI, use a "Value.Signalling" instead of a "Value" property node.

 

THe difference is the signaling version will fire an event while the "Value" only version will not fire an event.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 16 of 41
(1,423 Views)

Actually It was just my suggestion (not copied from any forum). And I did not suggest closing vi through polling event. While programming I have struck many a time due to event timeout. So I asked to see if OP got any progress with this or not. It was just a hit and try suggestion.

Labview user
0 Kudos
Message 17 of 41
(1,406 Views)

The problem is that I can't change value.signalling to read!!!

Uff... I think I will surrender Smiley Sad

0 Kudos
Message 18 of 41
(1,398 Views)

I don't know wether I should post this or not, you might be knowing it.

Just trying to help.

Labview user
0 Kudos
Message 19 of 41
(1,396 Views)

I try to apply this suggest but the value doesn't change.

Download All
0 Kudos
Message 20 of 41
(1,392 Views)