02-18-2009 10:18 AM
Hi,
I am trying to create a sub-vi from a top-level vi, but I get the following error message: "The SubVI resulting from the selection creates cycles when dropped on the caller vi's diagram.".
The Help explains that a sub-vi should not have its output affecting signals coming back to its input. I can understand that this could create a closed-loop system IF the affected subvi input influences the SAME output. In my case, the subvi output goes to the caller diagram, comes back to another input of the subvi, then influences a DIFFERENT output of the subvi, which eventually leaves the caller diagram. There are no closed loops. Actually, the diagrams runs correctly when it is flat (no sub-vi). So why is LabView complaining? Is there a way to disable this check?
I tried to sever the subvi in two sections with a sequence, to further seperate the "supposed" loops, but it is still complaining.
Thanks,
Benoit
02-18-2009 10:23 AM
Hi Benoit,
Have you gone through the following article:
SubVI Creates Cycles Error Message
If so, be sure to post your code; it's always easy to help out when we can visualize the code.
02-18-2009 10:24 AM
Hello Benoit,
that's dataflow 🙂
What should happen first: let the subvi wait for any inputs or start the subvi to produce some output? That's why LabView is complaining about cycles...
Can you show the code? Does the code run before inclusion/creation of the subvi?
02-18-2009 11:22 AM
Thanks for the replies.
Yes, the code runs correctly when the top-level VI is flat (i.e., when the content of what I want to put in a sub-vi is still at the top-level). As soon as I try to make it a sub-vi, I get the error message. This is what I find stange: why does pushing it to a sub-vi make a difference?
Here are the two VIs in attachement. "test2.vi" is the top level. "error intercepter2.vi" is the sub-vi.
Thanks,
Benoit
02-18-2009 12:15 PM
02-18-2009 12:50 PM
I did not know the rule about having all the inputs ready before a sub-vi can run. So data cannot flow back and forth from the sub-vi to the top-level... The sub-vi has to run once.
Ok. Now I understand why it fails. My current solution is to move parts of the sub-vi to the top-level. It is not as clean as having everything in the sub-vi, but it works...
Thanks!
Benoit