Dynamic plugin - while loop crashes

Why does using a while loop to wait for an input ‘trigger’ crash vvvv?

Ie -


FOutput0 = “message one”;

while(boolInput01 ^ true)
FOutput0 = “message two”;

I need to move through states based on user input, displaying output strings accordingly

well you wrote an endless loop. there’s no such thing as an input ‘trigger’ in vvvv. such a thing would exist if the execution model of vvvv would be push based -> sources push values down to the sinks.
but as it happens vvvv’s execution model is pull based -> sinks pull values down from the sources.

the sinks pull the data every frame -> your method gets called every frame (if there’s no switch in between) -> simply look at your inputs, do some computation and write the results to the outputs, or the data won’t get back to the sinks and the ‘pulling’ sinks will simply wait forever ;)

Hi Elias.

Ok, so the whole method has to finish executing every frame?

How do I make a plugin where the output depends on a previous execution, such as a counter?

Store the result of the previous execution in a class local variable. Or just read the (previous) output you need before you overwrite it with the current frame’s value.

Thanks guys