SubVI Creates Cycles Error Message

Updated Oct 10, 2019

Reported In

Software

  • LabVIEW

Issue Details

I am attempting to create a SubVI on my block diagram by selecting a portion of my code and going to Edit»Create SubVI, but am receiving the following error: The SubVI resulting from the selection creates cycles when dropped on the caller vi's diagram.  Do you wish to just create a new VI from this selection?  What does this error mean and how can I avoid it?


 

Solution

This error message is generated when the SubVI that would be created would have an input node that would be dependent on one of its own output nodes.  Because of LabVIEW's execution order this would create a permanent hang in the code, the SubVI would never be entered because it would indefinitely be waiting for input from itself.

In the following example code, if you select the Rate/Min VI and the Bundle VI and attempt to create a SubVI out of them you will receive the above cycling error.  This is because the SubVI that would be produced would have an output node from the Rate/Min VI going into the Calc VI and an input node from the Calc VI to the Bundle VI.  Because the input node would be dependent on the Calc VI which is in turn dependent on the output node a cycle would be created.



If instead you select the Rate/Min VI, the Bundle VI, and the Calc VI the issue is resolved because the SubVI created would no longer be dependent on its own output.