Thank you very much for this video, it helped me out a great deal, well done Sir.
@dmitryponyatov2158 Жыл бұрын
Do you know some reason not having multiple inputs in function blocks (with multiple dispatch) and inputs that remembers the last message? In case I'm writing some error computation function block (closed loop control), it will be great to have two inputs visually, and logically available for direct reading in a function code.
@dmitryponyatov2158 Жыл бұрын
I know about _context._ tricks, but it looks like assembly programming
@stevecope Жыл бұрын
There is no real need for multiple inputs as you can filter input by a message property usually topic. To remember use a context or flow variable. stevesnoderedguide.com/node-red-variables Rgds Steve
@Zhaymoor2 жыл бұрын
Thank you so much.
@mbunds5 жыл бұрын
To have your messages in the "Message Array" example display the payloads "test message0", "test message1", and "test message2", instead of "test message0", "test message01", and "test message012": var m_out=[]; //array for message objects var message; //variable to contain the message payload for concatenation of "i" for (i=0;i
@mrsamsupersam3 жыл бұрын
Hi, I installed a radar tide gauge and the output is a number eg 103. 103 is the distance from the sensor to the waterline. I want to know the waterlevel. 103 is corresponding a water level of 20cm. How can I convert every message with the formula below? value*(-1)+123 Thanks for the help!
@stevecope3 жыл бұрын
Use a function node with msg.payload=(msg.payload *-1) +123
@sdc79183 жыл бұрын
@@stevecope this is working fine. Thanks a lot!
@TheUnofficialMaker2 жыл бұрын
Nicely done, how would I return only the topic from email? (get the subject line) Thanks.
@stevecope2 жыл бұрын
If the subject is the message topic then you just extract it using var subject=msg.topic
@quaternion-pi6 жыл бұрын
Love your videos. At 7:46 I noticed you did not declare i as a var in the 'for' loop, and did not end the var newmsg statement with a ';'. I know the latter is optional in javascript, but sometimes its absence can cause side effects. Since I am learning javascript it;s nice to see how experienced programmers code. Your website is a great learning tool for me. Thanks.
@stevecope6 жыл бұрын
Tks for the comment. I'll try to make sure I check the code syntax . At the moment II am back and forth between Python and JavaScript.which is why I keep forgetting.
@cpyandy6 жыл бұрын
I'd like to do something slightly similar to the fourth example "topic splitter" but i can't figure how to make it work. Is it possible for a function node to output a single payload of "1" when the payload of both input node both equal to "1", else output a "0" payload. Pretty much just an AND logic gate with function node.
@stevecope6 жыл бұрын
Yes but you will need to remember the input values and you only get one input at one time. I did a video her How to Store Data In Node Red Variables kzbin.info/www/bejne/oX_JgWSsrJd8o8k If you use the ask steve page on the website I'll help you with the flow rgds steve
@chozairitu69756 жыл бұрын
in former node-red for loop is a mess, is this function has multiple output gonna change that ?
@FisVii776 жыл бұрын
Steve have you ever tried the custom node from the pallette installer for python, I was wondering if you could do a video or two on using those, python function nodes, I played with them a little but seems either I am coding wrong, or the nodes have bugs. would you consider doing a thourough video on them python is a much simpler and intuitive programming language itleast for me :)
@stevecope6 жыл бұрын
Do you mean the python3 function node? I installed this node a little while ago to run some python scripts but never got around to using it.
@FisVii776 жыл бұрын
Yes steve haven't seen anyone post any videos on this python3 function or its capabilities yet, I think that would be a great video to add to your collection considering many new programmers use python and do not know the syntax of javascript I know I fall into this category myself as well. Great vids/content keep em up.
@SA-oj3bo3 жыл бұрын
Why return [m_out] and not return m_out ?
@stevecope3 жыл бұрын
It is because we are returning a message array and so x messages will be sent and not a single message.