Trekker Other Jul 2, 2021, 3:15 PM Jul 2, 2021, 11:50 PM

How can 1 single light or relay be controlled through multiple switches/buttons across multiple functions blocks? Is there an example on this? 

Many thanks 

Answers 2

Luboš Urban Jul 2, 2021, 3:15 PM

You can combine all input signals using the logic function OR and connect its output to the light_on/loght_off or light_toggle input of the fb_iLight function block. Moreover this function block and similar are equipped with web_toggle input that can be joined with a virtual button in the web page or app.

Textual language ST:

PROGRAM prgMain

  VAR
     Room1 : fb_iLight;
  END_VAR

    Room1(lightToggle :=  toggleLight1 or webLight1, out =>  light1);

END_PROGRAM

or the same in the graphical language:

Two buttons for one light

Trekker Jul 2, 2021, 11:50 PM

Thank you for your quick reply. Your answer looks understandable, however I am looking for the following scenario (as an example):

In a Livingroom function block

Light1button(input)------->click(button action)----->livingroom light toggle(fb_ILight)------>living room light on/off (output).

Let’s assume I am expanding the system / wanting to use another switch to turn the living room light on by a long press(this is still in the living room function block).

Light9button(input)------->press(button action)----->livingroom light toggle(fb_ILight)------>living room light on/off (output).

I am trying to achieve the above without using the OR function to keep the diagrams neat in case the program becomes complex with multiple light switches etc.. 

Also, what if I would like to turn the light on from a different function block eg.: Hall function block?

Many thanks

Your answer

You have to be signed-in for asking a question. Continue after sign-in.