no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | node-red [25.01.2018 05:57] (current) – created Pascal Suter | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== node-RED ====== | ||
+ | [[https:// | ||
+ | |||
+ | ===== Tricks ===== | ||
+ | ==== Set/Receive global Variable ==== | ||
+ | a global variable can be accessed in all flows. also it can " | ||
+ | |||
+ | we need a setter and a getter function for our global variable, so create two new function nodes with the following code: | ||
+ | |||
+ | setter (acts as an output node): <code javascript> | ||
+ | global.set(" | ||
+ | </ | ||
+ | |||
+ | getter (an inject node could be used in front of this node to check the value every second) | ||
+ | <code javascript> | ||
+ | msg.payload = global.get(" | ||
+ | return msg; | ||
+ | </ | ||