LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

not executed

Solved!
Go to solution

I made a PID controller and added a sub vi of a fuzzy controller. The idea is to add the outputs of fuzzy and PID controller. But when I run the vi it does not execute. Her is the vi attached . can some one help.

0 Kudos
Message 1 of 11
(4,380 Views)

Hi Pargat,

 

which error do you get, when your VI is "not executed"?

Or does it run, but cannot iterate? (Which is quite a difference to "not executing"…)

Did you try to debug?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 11
(4,373 Views)

@Pargat wrote:

But when I run the vi it does not execute.


What exactly does that mean???

 

We are missing a subVI (fuzzycont.vi), so we cannot test your code. Make sure to attach all (or simplify so it runs without it while still showing the problem).

0 Kudos
Message 3 of 11
(4,346 Views)

@Pargat wrote:

I made a PID controller and added a sub vi of a fuzzy controller. The idea is to add the outputs of fuzzy and PID controller. But when I run the vi it does not execute. Her is the vi attached . can some one help.



here is the sub vi .

0 Kudos
Message 4 of 11
(4,306 Views)

The .fs file is not uploading

 

0 Kudos
Message 5 of 11
(4,305 Views)

Hi Pargat,

 

"THINK DATAFLOW!" is all you need to obey!

 

Your subVI will run until you press that stop button. Your main VI will only iterate when the subVI has been finished - basic DATAFLOW!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 11
(4,286 Views)

Thanks for the reply first. Well my main vi is working and sub is not and when i press stop button there is no change. The output of the main vi reaches its upper limit but sub vi is not executed. How can they work simulataneously. Kindly help.

0 Kudos
Message 7 of 11
(4,267 Views)
Solution
Accepted by topic author Pargat

Hi Pargat,

 

Well my main vi is working and sub is not and when i press stop button there is no change.

I don't believe  your main VI "is working" while the subVI is blocking DATAFLOW…

 

How can they work simulataneously.

When you want to run things in parallel you need to program them running parallel - THINK DATAFLOW!

As long as you use this subVI in your mainVI loop the subVI will block the mainVI…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 11
(4,254 Views)
Solution
Accepted by topic author Pargat

@GerdW wrote:

"THINK DATAFLOW!" is all you need to obey!

 Your subVI will run until you press that stop button. Your main VI will only iterate when the subVI has been finished - basic DATAFLOW!


Dear Pargat,

 

What GerdW means here is that in LabVIEW (and I imagine any other programming environment you'd care to name) a loop can't go to the next iteration until after it finishes with the current iteration.

 

When you place a loop in your Main VI, which calls a SubVI who also contains a loop, the Main VI will call the SubVI once per loop iteration - every time the loop runs, it starts the SubVI. It can't go to the next iteration until the SubVI finishes!

 

When your SubVI contains a loop, it's often indicative that you want the thing in the SubVI to run over and over again - but remember that the SubVI is being called over and over again! If the SubVI contains its own loop, it has to keep running until its own loop finishes, before it can say to the Main VI - "Hey, I'm done, you can go to the next iteration now".

 

In many cases, the SubVI should be written to just run the code once - it will run the code again in the next iteration of the Main VI's loop. This is often the intended use for mistakenly looping subVIs - really, they shouldn't be looping, because the Main VI is doing that.


GCentral
0 Kudos
Message 9 of 11
(4,243 Views)

Thank you so much for sharing your view and helping me solve the problem.

0 Kudos
Message 10 of 11
(4,236 Views)

Thank u sir ,for helping me to figure out the problem

0 Kudos
Message 11 of 11
(377 Views)