Boolean message injection

hello all !

im using a switch to send a boolean message to a function, but i want the switch to keep sending the same message unless i change the state of the switch, is it possible?

How often will the msg be sent?
You could
Led have a inject node set to run evert X minutes and it would go to a switch that would check if a flow variable was true - if so the flow continues, if not the msg is dropped.

The switch would set the flow variable true or false and then connect to the switch for further processing

1 Like

Have a look at node-red-contrib-msg-resend.

However, can you explain why you want to do that, there may be better ways of solving the problem.

1 Like

i want to order MY PLC outputs while my flow on node red is running, the problem is each output has a condition for example : if (temperature >27) { DO1 = true ;}
DO1 is the output that will order the air conditionner.
but i want to order the air conditionner even when the temperature less than 27.
the state of the air conditionner should be contolled by me and the node red flow at the same time.

so change your function so that it is:

"if the temperature is greater than or I choose to have it on"

1 Like

exactly thank you

Could you please share with me ur fonction I have the same problem and because I'm new to the nodered I didn't get how to manage the fonction and creat it
I have a temperature sensor so I want to control an air conditioner using a fonction to send the on or off to a topic

Hi. Please create a new thread. This post is 3y old.

In your new post, show us what you are doing and what you are trying to achieve.