• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Special Light control

    Mervis
    3
    5
    812
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      Tin Androić last edited by

      Hello,
      i want control my light with switch on wall and with lux sensor, but i want in every time turn light off with switch, so if LightSW_1 is ON -> Light ist ON and/or Light_sensor go ON -> light ist stil ON. After i want switch OFF, LightSW_1 -> Light go OFF, OR switch OFF Light_sensor -> Light also go OFF,
      Have Mervis some special fbd for this, or how can i create it ?

      alt text

      Martin Kudláček 1 Reply Last reply Reply Quote 0
      • Martin Kudláček
        Martin Kudláček administrators @Tin Androić last edited by

        Hello @tin-androić,

        there is no special FB for this, but you can construct them from the existing ones. First, you need to decompose the problem to several layers.

        1. Detecting changes
          To detect the change, you need to look for "edges" of the square signal. The Mervis has triggers for rising edge (changing from 0 to 1) and falling edge (changing from 1 to 0) producing a rising edge on the output on given occassions on the input.

        2. Combine the changes
          From your example you need to react to rising and falling edge of either on of the inputs. So if rising edge occurs on LightSW_1 OR Light_sensor. You can use logical block "OR".

        3. Setting and resetting the light
          You want to set the Light to ON when the combined rising edge occurs and reset the Light to OFF when the combined falling edge occurs. This is job for flip-flop FB called Flip Flop (BD52). You would use inputs IN and IND

        Best regards,
        Martin

        1 Reply Last reply Reply Quote 0
        • T
          Tin Androić last edited by

          Thanks Martin, for fast answer. Now i heave problem, for exemple: Switch ist True then Light_sensor i put True and again False, and now when i want turn on Lamp with switch, i need push switch button two times, (first time go to false then second time to true and Lamp go ON ). Thats ok for sensor but not for switch button.

          alt text

          1 Reply Last reply Reply Quote 0
          • P
            PP last edited by

            Hello Tin,
            You want to control the lights from two places, but you use the switch instead of the button.
            Light sensor is unable to change the switch position to off.

            PP

            1 Reply Last reply Reply Quote 0
            • P
              PP last edited by

              If you use push button via the digital input, then use own control mechanism (pulse counter) with reset from ligth sensor falling edge.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post