Send a "true"-boolean flank out of an JS Node


#1

Hey there,

I’m trying to send some sort of a boolean “flank” out of an JavaScript node at specific points. The signal should be similar to those which are send when pressing a button on the “tab” output. Is there a way to implement it?
I tried it the way as shown in the picture. (The 500 ms are just for testing, i tried different values). Alsthough the console log shows the output the way I want to, the real output value just sticks on “false”.

trigger

Many thanks in advance
Andi


#2

You can use the “signal” output type together with this.sendSignalOnOutput("outputName"):

outputs: {
   myOutput: "signal"
},
run: function(inputs,outputs) {
   if(something) {
      this.sendSignalOnOutput("myOutput");
   }
}

Regarding your sample code it almost works, there just one piece missing:

...
outputs.save = false;
this.flagOutputDirty("save"); ///this is needed when you change an output in a callback asynchronously
...

But the signal solution is easier :slight_smile:


#3

Oh, many thanks!! Its working :smile:
That was easy. I wasn’t aware of the “signal” output type.

I just created an endless loop by using it which almost froze noodl on every start but by now i got rid of it :smiley:

Thanks again